CV.cpp
Go to the documentation of this file.
1 // Copyright (c) 2010, 2013 by Wayne C. Gramlich. All rights reserved.
2 
3 #include <assert.h>
4 #include <opencv/cv.h>
5 #include <opencv/highgui.h>
6 #include <string.h>
7 
8 #include "CV.hpp"
9 #include "File.hpp"
10 #include "String.hpp"
11 
12 static CvSlice whole_sequence; // CV_WHOLE_SEQ (see below)
14 
16 {
17  whole_sequence = CV_WHOLE_SEQ;
18 }
19 
20 // Depth constants:
21 int CV__depth_1u = IPL_DEPTH_1U;
22 int CV__depth_8u = IPL_DEPTH_8U;
23 int CV__depth_16u = IPL_DEPTH_16U;
24 int CV__depth_8s = IPL_DEPTH_8S;
25 int CV__depth_16s = IPL_DEPTH_16S;
26 int CV__depth_32s = IPL_DEPTH_32S;
27 int CV__depth_32f = IPL_DEPTH_32F;
28 int CV__depth_64f = IPL_DEPTH_64F;
29 
30 int CV__load_image_any_color = CV_LOAD_IMAGE_ANYCOLOR;
31 int CV__load_image_any_depth = CV_LOAD_IMAGE_ANYDEPTH;
32 int CV__load_image_color = CV_LOAD_IMAGE_COLOR;
33 int CV__load_image_gray_scale = CV_LOAD_IMAGE_GRAYSCALE;
34 int CV__load_image_unchanged = CV_LOAD_IMAGE_UNCHANGED;
35 int CV__window_auto_size = CV_WINDOW_AUTOSIZE;
36 
37 // Color space conversion codes:
38 int CV__bgr_to_bgra = CV_BGR2BGRA;
39 int CV__rgb_to_rgba = CV_RGB2RGBA;
40 int CV__bgra_to_bgr = CV_BGRA2BGR;
41 int CV__rgba_to_rgb = CV_RGBA2RGB;
42 int CV__bgr_to_rgba = CV_BGR2RGBA;
43 int CV__rgb_to_bgra = CV_RGB2BGRA;
44 int CV__rgba_to_bgr = CV_RGBA2BGR;
45 int CV__bgra_to_rgb = CV_BGRA2RGB;
46 int CV__bgr_to_rgb = CV_BGR2RGB;
47 int CV__rgb_to_bgr = CV_RGB2BGR;
48 int CV__brga_to_rgba = CV_BGRA2RGBA;
49 int CV__rgba_to_brga = CV_RGBA2BGRA;
50 int CV__bgr_to_gray = CV_BGR2GRAY;
51 int CV__rgb_to_gray = CV_RGB2GRAY;
52 int CV__gray_to_brg = CV_GRAY2BGR;
53 int CV__gray_to_rgb = CV_GRAY2RGB;
54 int CV__gray_to_bgra = CV_GRAY2BGRA;
55 int CV__gray_to_rgba = CV_GRAY2RGBA;
56 int CV__brga_to_gray = CV_BGRA2GRAY;
57 int CV__rgba_to_gray = CV_RGBA2GRAY;
58 int CV__bgr_to_bgr565 = CV_BGR2BGR565;
59 int CV__rgb_to_bgr565 = CV_RGB2BGR565;
60 int CV__bgr565_to_bgr = CV_BGR5652BGR;
61 int CV__bg4565_to_rgb = CV_BGR5652RGB;
62 int CV__bgra_to_bgr565 = CV_BGRA2BGR565;
63 int CV__rgba_to_bgr565 = CV_RGBA2BGR565;
64 int CV__bgr565_to_bgra = CV_BGR5652BGRA;
65 int CV__bgr565_to_rgba = CV_BGR5652RGBA;
66 int CV__gray_to_bgr565 = CV_GRAY2BGR565;
67 int CV__bgr565_to_gray = CV_BGR5652GRAY;
68 int CV__bgr_to_bgr555 = CV_BGR2BGR555;
69 int CV__rgb_to_bgr555 = CV_RGB2BGR555;
70 int CV__bgr555_to_bgr = CV_BGR5552BGR;
71 int CV__bgr555_to_rgb = CV_BGR5552RGB;
72 int CV__bgra_to_bgr555 = CV_BGRA2BGR555;
73 int CV__rgba_to_bgr555 = CV_RGBA2BGR555;
74 int CV__bgr555_to_bgra = CV_BGR5552BGRA;
75 int CV__bgr555_to_rgba = CV_BGR5552RGBA;
76 int CV__gray_to_bgr555 = CV_GRAY2BGR555;
77 int CV__bgr555_to_gray = CV_BGR5552GRAY;
78 int CV__bgr_to_xyz = CV_BGR2XYZ;
79 int CV__rgb_to_xyz = CV_RGB2XYZ;
80 int CV__xyz_to_bgr = CV_XYZ2BGR;
81 int CV__xyz_to_rgb = CV_XYZ2RGB;
82 int CV__bgr_to_ycrcb = CV_BGR2YCrCb;
83 int CV__rgb_to_ycrcb = CV_RGB2YCrCb;
84 int CV__ycrcb_to_bgr = CV_YCrCb2BGR;
85 int CV__ycrcb_to_rgb = CV_YCrCb2RGB;
86 int CV__bgr_to_hsv = CV_BGR2HSV;
87 int CV__rgb_to_hsv = CV_RGB2HSV;
88 int CV__bgr_to_lab = CV_BGR2Lab;
89 int CV__rgb_to_lab = CV_RGB2Lab;
90 int CV__bayerbg_to_bgr = CV_BayerBG2BGR;
91 int CV__bayergb_to_bgr = CV_BayerGB2BGR;
92 int CV__bayerrg_to_bgr = CV_BayerRG2BGR;
93 int CV__bayergr_to_bgr = CV_BayerGR2BGR;
94 int CV__bayerbg_to_rgb = CV_BayerBG2RGB;
95 int CV__bayergb_to_rgb = CV_BayerGB2RGB;
96 int CV__bayerrg_to_rgb = CV_BayerRG2RGB;
97 int CV__bayergr_to_rgb = CV_BayerGR2RGB;
98 int CV__bgr_to_luv = CV_BGR2Luv;
99 int CV__rgb_to_luv = CV_RGB2Luv;
100 int CV__bgr_to_hls = CV_BGR2HLS;
101 int CV__rgb_to_hls = CV_RGB2HLS;
102 int CV__hsv_to_bgr = CV_HSV2BGR;
103 int CV__hsv_to_rgb = CV_HSV2RGB;
104 int CV__lab_to_bgr = CV_Lab2BGR;
105 int CV__lab_to_rgb = CV_Lab2RGB;
106 int CV__luv_to_bgr = CV_Luv2BGR;
107 int CV__luv_to_rgb = CV_Luv2RGB;
108 int CV__hls_to_bgr = CV_HLS2BGR;
109 int CV__hls_to_rgb = CV_HLS2RGB;
110 
111 int CV__adaptive_thresh_mean_c = CV_ADAPTIVE_THRESH_MEAN_C;
112 int CV__adaptive_thresh_gaussian_c = CV_ADAPTIVE_THRESH_GAUSSIAN_C;
113 int CV__thresh_binary = CV_THRESH_BINARY;
114 int CV__thresh_binary_inv = CV_THRESH_BINARY_INV;
115 
116 // Types for Matrices and images:
117 int CV__u8 = CV_8U;
118 int CV__s8 = CV_8S;
119 int CV__u16 = CV_16U;
120 int CV__s16 = CV_16S;
121 int CV__s32 = CV_32S;
122 int CV__f32 = CV_32F;
123 int CV__f64 = CV_64F;
124 int CV__user_type = CV_USRTYPE1;
125 
126 int CV__u8c1 = CV_8UC1;
127 int CV__u8c2 = CV_8UC2;
128 int CV__u8c3 = CV_8UC3;
129 int CV__u8c4 = CV_8UC4;
130 
131 int CV__s8c1 = CV_8SC1;
132 int CV__s8c2 = CV_8SC2;
133 int CV__s8c3 = CV_8SC3;
134 int CV__s8c4 = CV_8SC4;
135 
136 int CV__u16c1 = CV_16UC1;
137 int CV__u16c2 = CV_16UC2;
138 int CV__u16c3 = CV_16UC3;
139 int CV__u16c4 = CV_16UC4;
140 
141 int CV__s16c1 = CV_16SC1;
142 int CV__s16c2 = CV_16SC2;
143 int CV__s16c3 = CV_16SC3;
144 int CV__s16c4 = CV_16SC4;
145 
146 int CV__s32c1 = CV_32SC1;
147 int CV__s32c2 = CV_32SC2;
148 int CV__s32c3 = CV_32SC3;
149 int CV__s32c4 = CV_32SC4;
150 
151 int CV__f32c1 = CV_32FC1;
152 int CV__f32c2 = CV_32FC2;
153 int CV__f32c3 = CV_32FC3;
154 int CV__f32c4 = CV_32FC4;
155 
156 int CV__f64c1 = CV_64FC1;
157 int CV__f64c2 = CV_64FC2;
158 int CV__f64c3 = CV_64FC3;
159 int CV__f64c4 = CV_64FC4;
160 
161 int CV__auto_step = CV_AUTO_STEP;
162 
163 int CV__blur_no_scale = CV_BLUR_NO_SCALE;
164 int CV__blur = CV_BLUR;
165 int CV__gaussian = CV_GAUSSIAN;
166 int CV__median = CV_MEDIAN;
167 int CV__bilateral = CV_BILATERAL;
168 
169 // *CV* routines:
170 
172  CV_Point2D32F_Vector corners, int count, bool pattern_was_found) {
173  cvDrawChessboardCorners(image,
174  *pattern_size, corners, count, pattern_was_found);
175 }
176 
178  return cvCloneImage(image);
179 }
180 
181 //void
182 //CV__calibrate_camera2(
183 // CV_Matrix object_points,
184 // CV_Matrix image_points,
185 // CV_Matrix point_counts,
186 // CV_Size image_size,
187 // CV_Matrix camera_matrix,
188 // CV_Matrix distortion_coefficients,
189 // CV_Matrix rotation_vectors,
190 // CV_Matrix translation_vectors,
191 // int flags)
192 //{
193 // cvCalibrateCamera2(object_points, image_points, point_counts,
194 // *image_size, camera_matrix, distortion_coefficients, rotation_vectors,
195 // translation_vectors, flags);
196 //}
197 
199  CV_Point2D32F_Vector corners, int flags) {
200  int corner_count;
201  int result;
202 
203  result = cvFindChessboardCorners(image,
204  *pattern_size, corners, &corner_count, flags);
205  if (result != 0) {
206  result = corner_count;
207  }
208  return result;
209 }
210 
212  CV_Matrix object_points,
213  CV_Matrix image_points,
214  CV_Matrix camera,
215  CV_Matrix distortion_coefficients,
216  CV_Matrix rotation_vector,
217  CV_Matrix translation_vector,
218  int use_extrinsic_guess)
219 {
220  cvFindExtrinsicCameraParams2(object_points, image_points, camera,
221  distortion_coefficients, rotation_vector, translation_vector,
222  use_extrinsic_guess);
223 }
224 
225 int CV__fourcc(char character1, char character2,
226  char character3, char character4) {
227  return CV_FOURCC(character1, character2, character3, character4);
228 }
229 
230 int CV__gemm_a_t = CV_GEMM_A_T;
231 int CV__gemm_b_t = CV_GEMM_B_T;
232 int CV__gemm_c_t = CV_GEMM_C_T;
233 
234 void CV__gemm(CV_Matrix a, CV_Matrix b, double alpha, CV_Matrix c, double beta,
235  CV_Matrix d,int transpose_a_b_c) {
236  return cvGEMM(a, b, alpha, c, beta, d, transpose_a_b_c);
237 }
238 
239 
240 double CV__get_real_2d(CV_Matrix matrix, int row, int column) {
241  return cvGetReal2D(matrix, row, column);
242 }
243 
244 void CV__init_undistort_map(CV_Matrix camera_matrix,
245  CV_Matrix distortion_coefficients, CV_Matrix mapx, CV_Matrix mapy) {
246  cvInitUndistortMap(camera_matrix, distortion_coefficients, mapx, mapy);
247 }
248 
249 //CV_Matrix
250 //CV__load(
251 // String file_name,
252 // CV_Memory_Storage storage,
253 // String name,
254 // String real_name)
255 //{
256 // char *simple_file_name;
257 // char *simple_name;
258 // const char *simple_real_name;
259 //
260 // simple_name = (char *)0;
261 // simple_real_name = (const char *)0;
262 // return cvLoad(file_name, storage, simple_name, &simple_real_name);
263 //}
264 
266  cvReleaseImage(&image);
267 }
268 
269 int CV__inter_linear = CV_INTER_LINEAR;
270 int CV__warp_fill_outliers = CV_WARP_FILL_OUTLIERS;
271 
273  CV_Matrix rotation_vector, CV_Matrix rotation_matrix, CV_Matrix jacobian) {
274  cvRodrigues2(rotation_vector, rotation_matrix, jacobian);
275 }
276 
277 void CV__set_identity(CV_Matrix matrix, CV_Scalar scalar) {
278  cvSetIdentity(matrix, *scalar);
279 }
280 
282  CV_Matrix matrix, int row, int column, double value) {
283  cvSetReal2D(matrix, row, column, value);
284 }
285 
286 void CV__set_zero(CV_Matrix matrix) {
287  cvSetZero(matrix);
288 }
289 
290 int CV__round(double value) {
291  return cvRound(value);
292 }
293 
294 // Read the calibration file and generate the undistortion maps
295 // in:
296 // calibrate_file_name - camera calibration file
297 // w h - width and height of images to undistort
298 // out:
299 // mapx, mapy, - undistortion maps
300 
301 int CV__undistortion_setup(String_Const calibrate_file_name,
302  int width, int height, CV_Image *mapx, CV_Image *mapy) {
303  double fcx, fcy, ccx, ccy;
304  double kc[4];
305 
306  // Open *calibrate_file_name*:
307  File file = File__open(calibrate_file_name, "r");
308  if (file == (File)0) {
309  File__format(stderr, "Could not open \"%s\"\n", calibrate_file_name);
310  return -1;
311  }
312 
313  // Scan in the calibration values:
314  // format is fc - focal length, cc, principal point, kc distortion vector
315  int x = fscanf(file, "fc %lf %lf cc %lf %lf kc %lf %lf %lf %lf",
316  &fcx, &fcy, &ccx, &ccy, &kc[0], &kc[1], &kc[2], &kc[3]);
317  if (x != 8) {
318  File__format(stderr, "Expected 8 parameters got %d\n", x);
319  return -1;
320  }
321  File__close(file);
322 
323  // Create *intrisic* matrix:
324  double intrinsic_vector[9] = {
325  fcx, 0, ccx,
326  0, fcy, ccy,
327  0, 0, 1
328  };
329  CvMat intrinsic = cvMat(3, 3, CV_64FC1, intrinsic_vector);
330  //printf("intrinsic matrix\n");
331  //dumpMat(&intrinsic);
332 
333  // Create *distortion* matrix*:
334  CvMat distortion = cvMat(1, 4, CV_64FC1, kc);
335  //printf("distortion matrix\n");
336  //dumpMat(&distortion);
337 
338  *mapx = cvCreateImage(cvSize(width, height), IPL_DEPTH_32F, 1);
339  *mapy = cvCreateImage(cvSize(width, height), IPL_DEPTH_32F, 1);
340  cvInitUndistortMap(&intrinsic, &distortion, *mapx, *mapy);
341 
342  return 0;
343 }
344 
345 // *CV_Image* routines:
346 
348  CV_Image destination_image, double maximum_value, int adaptive_method,
349  int threshold_type, int block_size, double parameter1) {
350  cvAdaptiveThreshold(source_image, destination_image, maximum_value,
351  adaptive_method, threshold_type, block_size, parameter1);
352 }
353 
355  CV_Image image, int x, int y, CV_Scalar color) {
356  // Draw a small cross at the indicated point.
357  uchar red = cvRound(color->val[0]);
358  uchar green = cvRound(color->val[1]);
359  uchar blue = cvRound(color->val[2]);
360  uchar *data = (uchar *)image->imageData;
361  int width_step = image->widthStep;
362 
363  // Sanity check the values.
364  if (x < 2 || y < 2 || x >= (image->width - 2) || y >= (image->height - 2)) {
365  return;
366  }
367 
368  // Draw away:
369  for (int i = -2; i <= 2; i++) {
370  for (int j = -2; j <= 2; j++) {
371  uchar *pixel = &(data + width_step * (y + j))[(x + i) * 3];
372  pixel[0] = red; pixel[1] = green; pixel[2] = blue;
373  }
374  }
375 }
376 
377 CV_Image CV_Image__create(CV_Size size, unsigned int depth, unsigned int channels) {
378  return cvCreateImage(*size, depth, channels);
379 }
380 
382  return image->nChannels;
383 }
384 
386  CV_Image source_image, CV_Image destination_image, int conversion_code) {
387  cvCvtColor(source_image, destination_image, conversion_code);
388 }
389 
391  CV_Image source_image, CV_Image destination_image, CV_Image mask) {
392  cvCopy(source_image, destination_image, mask);
393 }
394 
396  CV_Image image, int x, int y, CV_Scalar color) {
397  // Draw a small cross at the indicated point.
398  uchar *pixel;
399  uchar *pixel_lt;
400  uchar *pixel_rt;
401  uchar *pixel_up;
402  uchar *pixel_dn;
403  uchar red = cvRound(color->val[0]);
404  uchar green = cvRound(color->val[1]);
405  uchar blue = cvRound(color->val[2]);
406  uchar *data = (uchar *)image->imageData;
407  int width_step = image->widthStep;
408 
409  // Sanity check the values.
410  if (x < 1 || y < 1 || x >= (image->width - 1) || y >= (image->height - 1)) {
411  return;
412  }
413 
414  // Get the pixels to be colored.
415  pixel = &((data + width_step * y))[x * 3];
416  pixel_lt = &((data + width_step * y))[(x - 1) * 3];
417  pixel_rt = &((data + width_step * y))[(x + 1) * 3];
418  pixel_up = &((data + width_step * (y - 1)))[x * 3];
419  pixel_dn = &((data + width_step * (y + 1)))[x * 3];
420 
421  // Draw the cross.
422  pixel[0] = red; pixel[1] = green; pixel[2] = blue;
423  pixel_lt[0] = red; pixel_lt[1] = green; pixel_lt[2] = blue;
424  pixel_rt[0] = red; pixel_rt[1] = green; pixel_rt[2] = blue;
425  pixel_up[0] = red; pixel_up[1] = green; pixel_up[2] = blue;
426  pixel_dn[0] = red; pixel_dn[1] = green; pixel_dn[2] = blue;
427 }
428 
430  CV_Scalar external_color, CV_Scalar hole_color, int maximal_level,
431  int thickness, int line_type, CV_Point offset) {
432  cvDrawContours(image, contour, *external_color,
433  *hole_color, maximal_level, thickness, line_type, *offset);
434 }
435 
436 // {mode} constants:
437 int CV__retr_external = CV_RETR_EXTERNAL;
438 int CV__retr_list = CV_RETR_LIST;
439 int CV__retr_ccomp = CV_RETR_CCOMP;
440 int CV__retr_tree = CV_RETR_TREE;
441 
442 // {method} constants:
443 int CV__chain_code = CV_CHAIN_CODE;
444 int CV__chain_approx_none = CV_CHAIN_APPROX_NONE;
445 int CV__chain_approx_simple = CV_CHAIN_APPROX_SIMPLE;
446 int CV__chain_approx_tc89_l1 = CV_CHAIN_APPROX_TC89_L1;
447 int CV__chain_approx_tc89_kcos = CV_CHAIN_APPROX_TC89_KCOS;
448 int CV__chain_link_runs = CV_LINK_RUNS;
449 
450 int CV__calib_cb_adaptive_thresh = CV_CALIB_CB_ADAPTIVE_THRESH;
451 int CV__calib_cb_normalize_image = CV_CALIB_CB_NORMALIZE_IMAGE;
452 int CV__calib_cb_filter_quads = CV_CALIB_CB_FILTER_QUADS;
453 
455  int header_size, int mode, int method, CV_Point point) {
456  int result;
457  CV_Sequence contours;
458 
459  contours = (CV_Sequence)0;
460  result = cvFindContours(image,
461  storage, &contours, sizeof(CvContour), mode, method, *point);
462  return contours;
463 }
464 
465 unsigned int CV_Image__depth_get(CV_Image image) {
466  return image->depth;
467 }
468 
469 unsigned int CV_Image__fetch3(
470  CV_Image image, unsigned int x, unsigned int y, unsigned int channel) {
471  unsigned char *pointer = cvPtr2D(image, y, x, (int *)0);
472  return pointer[channel];
473 }
474 
475 int CV_Image__gray_fetch(CV_Image image, int x, int y) {
476  int result = -1;
477  if (0 <= x && x < image->width && 0 <= y && y < image->height) {
478  result =
479  (int)(((uchar *)image->imageData + image->widthStep * y))[x];
480  }
481  return result;
482 }
483 
485  int count, CV_Size window, CV_Size zero_zone, CV_Term_Criteria criteria) {
486  cvFindCornerSubPix(image, corners, count, *window, *zero_zone, *criteria);
487 }
488 
489 void CV_Image__flip(CV_Image from_image, CV_Image to_image, int flip_code) {
490  cvFlip(from_image, to_image, flip_code);
491 }
492 
494  CV_Size size, unsigned int depth, unsigned int channels) {
495  return cvCreateImageHeader(*size, depth, channels);
496 }
497 
499  return image->height;
500 }
501 
508 
510  unsigned int size = String__size(file_name);
511  assert (String__equal(file_name + size - 4, ".pnm"));
512  CV_Image image = cvLoadImage(file_name, CV_LOAD_IMAGE_UNCHANGED);
513  if (image == (CV_Image)0) {
514  File__format(stderr, "Unable to open file '%s'\n", file_name);
515  assert(0);
516  }
517  return image;
518 }
519 
526 
527 void CV_Image__pnm_write(CV_Image image, String_Const file_name) {
528  unsigned int size = String__size(file_name);
529  assert (String__equal(file_name + size - 4, ".pnm"));
530  cvSaveImage(file_name, image, (int *)0);
531 }
532 
533 void CV_Image__remap(CV_Image source_image, CV_Image destination_image,
534  CV_Image map_x, CV_Image map_y, int flags, CV_Scalar fill_value) {
535  cvRemap(source_image,
536  destination_image, map_x, map_y, flags, *fill_value);
537 }
538 
539 void CV_Image__smooth(CV_Image source_image, CV_Image destination_image,
540  int smooth_type, int parameter1, int parameter2,
541  double parameter3, double parameter4) {
542  cvSmooth(source_image, destination_image, smooth_type, parameter1,
543  parameter2, parameter3, parameter4);
544 }
545 
547  CV_Image image, unsigned int x, unsigned int y, unsigned int channel, unsigned int value) {
548  unsigned char *pointer = cvPtr2D(image, y, x, (int *)0);
549  pointer[channel] = (unsigned char)value;
550 }
551 
562 
564  // Open *tga_in_file*:
565  File tga_in_file = File__open(tga_file_name, "rb");
566  if (tga_in_file == (File)0) {
567  File__format(stderr,
568  "Unable to open '%s' for reading\n", tga_file_name);
569  assert (0);
570  }
571 
572  // Read .tga header from *tga_in_file*:
573  File__byte_read(tga_in_file); // identsize
574  File__byte_read(tga_in_file); // colourmaptype
575  unsigned int image_type =
576  File__byte_read(tga_in_file); // imagetype (3=>raw b&w)
577  File__little_endian_short_read(tga_in_file); // colourmapstart
578  File__little_endian_short_read(tga_in_file); // colourmaplength
579  File__byte_read(tga_in_file); // colourmapbits
580  File__little_endian_short_read(tga_in_file); // xstart
581  File__little_endian_short_read(tga_in_file); // ystart
582  unsigned int width =
583  File__little_endian_short_read(tga_in_file); // width
584  unsigned int height =
585  File__little_endian_short_read(tga_in_file); // height
586  unsigned int bpp = File__byte_read(tga_in_file); // bits per pixel
587  File__byte_read(tga_in_file); // descriptor
588 
589  // Compare {image_type}, {bpp}, {width} and {height} with {image}.
590  if (image != (CV_Image)0 && (unsigned int)image->width == width &&
591  (unsigned int)image->height == height && (unsigned int)image->depth == 8) {
592  // {width}, {height}, and {depth} match {image}:
593  unsigned int channels = (unsigned int)image->nChannels;
594  if (image_type == 3 && channels == 1 && bpp == 8) {
595  // We have a gray mode .tga match; do nothing:
596  } else if (image_type == 2 && channels == 3 && bpp == 24) {
597  // We have a color mode .tga file; do nothing:
598  } else {
599  // No match:
600  CV__release_image(image);
601  image = (CV_Image)0;
602  }
603  } else {
604  CV__release_image(image);
605  image = (CV_Image)0;
606  }
607  // If {image} is not equal to {null@CV_Image} we can reuse {image}:
608 
609  // Figure out whether .tga file is gray scale or color:
610  bool gray_mode = (bool)0;
611  if (image_type == 3 && bpp == 8) {
612  gray_mode = (bool)1;
613  } else if (image_type == 2 && bpp == 24) {
614  // Color mode:
615  gray_mode = (bool)0;
616  } else {
617  // Something else:
618  File__format(stderr, "'%s' has image type=%d and bpp=%d\n",
619  tga_file_name, image_type, bpp);
620  assert (0);
621  }
622 
623  // Allocate a new {image} if we need to:
624  if (image == (CV_Image)0) {
625  CV_Size size = CV_Size__create((int)width, (int)height);
626  if (gray_mode) {
627  image = CV_Image__create(size, 8, 1);
628  } else {
629  image = CV_Image__create(size, 8, 3);
630  }
631  }
632 
633  // Read the .tga data into {image}:
634  for (unsigned int row = 0; row < height; row++) {
635  unsigned int j = height - row - 1;
636  for (unsigned int column = 0; column < width; column++) {
637  unsigned int i = column;
638  if (gray_mode) {
639  unsigned int gray = fgetc(tga_in_file);
640  CV_Image__store3(image, column, row, 0, gray);
641  } else {
642  //unsigned int red = File__byte_read(tga_in_file);
643  //unsigned int green = File__byte_read(tga_in_file);
644  //unsigned int blue = File__byte_read(tga_in_file);
645  unsigned int red = fgetc(tga_in_file);
646  unsigned int green = fgetc(tga_in_file);
647  unsigned int blue = fgetc(tga_in_file);
648  unsigned char *pointer = cvPtr2D(image, row, column, (int *)0);
649  pointer[0] = red;
650  pointer[1] = green;
651  pointer[2] = blue;
652  //CV_Image__store3(image, i, j, 0, red);
653  //CV_Image__store3(image, i, j, 1, green);
654  //CV_Image__store3(image, i, j, 2, blue);
655  }
656  }
657  }
658 
659  // Close {tga_in_file}:
660  File__close(tga_in_file);
661 
662  return image;
663 }
664 
671 
672 void CV_Image__tga_write(CV_Image image, String_Const file_name) {
673  unsigned int channels = (unsigned int)image->nChannels;
674  unsigned int depth = (unsigned int)image->depth;
675  unsigned int height = (unsigned int)image->height;
676  unsigned int width = (unsigned int)image->width;
677  assert (depth == 8);
678 
679  unsigned int bpp = 0;
680  unsigned int image_type = 0; // 2=>color; 3=>b&w:
681  bool gray_mode = (bool)0;
682  if (channels == 1) {
683  // Gray scale:
684  bpp = 8;
685  gray_mode = (bool)1;
686  image_type = 3;
687  } else if (channels == 3) {
688  // Color:
689  bpp = 24;
690  gray_mode = (bool)0;
691  image_type = 2;
692  } else {
693  assert (0);
694  }
695 
696  // Open {file_name} file for writing:
697  File tga_out_file = File__open(file_name, "wb");
698  if (tga_out_file == (File)0) {
699  File__format(stderr, "Could not open '%s for writing.\n", file_name);
700  assert (0);
701  }
702 
703  // Write .tga header:
704  File__byte_write(tga_out_file, 0); // identsize
705  File__byte_write(tga_out_file, 0); // colourmaptype
706  File__byte_write(tga_out_file, image_type); // type (3=b&w)
707  File__little_endian_short_write(tga_out_file, 0); // colormapstart
708  File__little_endian_short_write(tga_out_file, 0); // colourmaplen
709  File__byte_write(tga_out_file, 0); // colourmapbits
710  File__little_endian_short_write(tga_out_file, 0); // xstart
711  File__little_endian_short_write(tga_out_file, 0); // ystart
712  File__little_endian_short_write(tga_out_file, width); // width
713  File__little_endian_short_write(tga_out_file, height); //height
714  File__byte_write(tga_out_file, bpp); // bits/pixel
715  File__byte_write(tga_out_file, 0); // descriptor
716 
717  // Write out the .tga file data:
718  for (unsigned int row = 0; row < height; row++) {
719  unsigned int j = height - row - 1;
720  for (unsigned int column = 0; column < width; column++) {
721  unsigned int i = column;
722  if (gray_mode) {
723  unsigned int gray = CV_Image__fetch3(image, i, j, 0);
724  File__byte_write(tga_out_file, gray);
725  } else {
726  unsigned int index = height - row - 1;
727  unsigned int red = CV_Image__fetch3(image, i, j, 0);
728  unsigned int green = CV_Image__fetch3(image, i, j, 1);
729  unsigned int blue = CV_Image__fetch3(image, i, j, 2);
730  File__byte_write(tga_out_file, red);
731  File__byte_write(tga_out_file, green);
732  File__byte_write(tga_out_file, blue);
733  }
734  }
735  }
736 
737  // Close the .tga file:
738  File__close(tga_out_file);
739 }
740 
742  return (unsigned int)image->width;
743 }
744 
745 // *CV_Matrix* routines:
746 
748  return matrix->cols;
749 }
750 
752  return matrix->rows;
753 }
754 
755 void CV_Matrix__save(CV_Matrix matrix, const char * file_name) {
756  CvAttrList attributes;
757 
758  attributes = cvAttrList((const char **)0, (CvAttrList *)0);
759  cvSave(file_name,
760  matrix, (const char *)0, (const char *)0, attributes);
761 }
762 
763 // *CV_Memory_Storage* routines:
764 
766  cvClearMemStorage(storage);
767 }
768 
770  return cvCreateMemStorage(block_size);
771 }
772 
773 // *CV_Point* routines:
774 
775 CV_Point CV_Point__create(int x, int y) {
776  unsigned int malloc_bytes = sizeof *((CV_Point)0);
777  // (void)printf("CV_Point__create: malloc_bytes=%d\n", malloc_bytes);
778  CV_Point point = (CV_Point) malloc(sizeof *((CV_Point *)0) );
779 
780  point->x = x;
781  point->y = y;
782  return point;
783 }
784 
786  return point->x;
787 }
788 
789 void CV_Point__x_set(CV_Point point, int x) {
790  point->x = x;
791 }
792 
794  return point->y;
795 }
796 
797 void CV_Point__y_set(CV_Point point, int y) {
798  point->y = y;
799 }
800 
801 // *CV_Point2D32F* routines:
802 
804  unsigned int malloc_bytes = sizeof *((CV_Point2D32F)0);
805  // (void)printf("CV_Point2D32F__create: malloc_bytes=%d\n",
806  // malloc_bytes);
807  CV_Point2D32F point = (CV_Point2D32F)malloc(malloc_bytes);
808 
809  point->x = x;
810  point->y = y;
811  return point;
812 }
813 
815  return point->x;
816 }
817 
818 void CV_Point2D32F__x_set(CV_Point2D32F point, double x) {
819  point->x = x;
820 }
821 
823  return point->y;
824 }
825 
826 void CV_Point2D32F__y_set(CV_Point2D32F point, double y) {
827  point->y = y;
828 }
829 
831  int x = CV_Point__x_get(point);
832  int y = CV_Point__y_get(point);
833  (void)CV_Point2D32F__x_set(point2d32f, (double)x);
834  (void)CV_Point2D32F__y_set(point2d32f, (double)y);
835 }
836 
837 // *CV_Point2D32F_Vector* routines:
838 
840  unsigned int malloc_bytes = size * sizeof *((CV_Point2D32F)0);
841  // (void)printf("CV_Point2D32F_Vector__create: size=%d malloc_bytes=%d\n",
842  // size, malloc_bytes);
843  CV_Point2D32F vector = (CV_Point2D32F)malloc(malloc_bytes);
844  unsigned int index;
845 
846  for (index = 0; index < size; index++) {
847  vector[index].x = 0.0;
848  vector[index].y = 0.0;
849  }
850  return vector;
851 }
852 
854  CV_Point2D32F_Vector vector, unsigned int index) {
855  return &vector[index];
856 }
857 
858 // CV_Scalar *routines*:
859 
861  double value0, double value1, double value2, double value3) {
862  CV_Scalar scalar = Memory__new(CV_Scalar, "CV_Scalar__create");
863  scalar->val[0] = value0;
864  scalar->val[1] = value1;
865  scalar->val[2] = value2;
866  scalar->val[3] = value3;
867  return scalar;
868 }
869 
870 void CV_Scalar__free(CV_Scalar cv_scalar) {
871  Memory__free((Memory)cv_scalar);
872 }
873 
874 // This routine will return a {CV_Scalar} that encodes {red}, {green},
875 // and {blue} as a color.
876 
877 CV_Scalar CV_Scalar__rgb(double red, double green, double blue) {
878  return CV_Scalar__create(blue, green, red, 0.0);
879 }
880 
881 // *CV_Sequence* routines:
882 
883 int CV__poly_approx_dp = CV_POLY_APPROX_DP;
884 
886  int header_size, CV_Memory_Storage storage, int method,
887  int parameter1, double parameter2) {
888  //(void)printf("sizeof=%d method=%d param1=%d\n",
889  // sizeof(CvContour), method, parameter1);
890  return cvApproxPoly(contour,
891  sizeof(CvContour), storage, method, parameter1, parameter2);
892 }
893 
895  CV_Sequence contour, CV_Slice slice, int is_closed) {
896  return cvArcLength(contour, *slice, is_closed);
897 }
898 
900  return (bool)(cvCheckContourConvexity(contour) ? 1 : 0);
901 }
902 
904  CV_Sequence contour, CV_Slice slice, int oriented) {
905  return cvContourArea(contour, *slice, oriented);
906 }
907 
909  return sequence->h_next;
910 }
911 
913  return (CV_Point)cvGetSeqElem(sequence, index);
914 }
915 
917  return sequence->total;
918 }
919 
920 // *CV_Size* routines:
921 
922 CV_Size CV_Size__create(int width, int height) {
923  CV_Size size = Memory__new(CV_Size, "CV_Size__create");
924  size->width = (int)width;
925  size->height = (int)height;
926  return size;
927 }
928 
929 extern void CV_Size__free(CV_Size cv_size) {
930  Memory__free((Memory)cv_size);
931 }
932 
933 // *CV_Slice* routines:
934 CV_Slice CV_Slice__create(int start_index, int end_index) {
935  unsigned int malloc_bytes = sizeof *((CV_Slice)0);
936  // (void)printf("CV_Slice__create: malloc_bytes=%d\n", malloc_bytes);
937  CV_Slice slice = (CV_Slice)malloc(malloc_bytes);
938 
939  slice->start_index = start_index;
940  slice->end_index = end_index;
941  return slice;
942 }
943 
944 // *CV_Term* rouitines:
945 int CV__term_criteria_iterations = CV_TERMCRIT_ITER;
946 int CV__term_criteria_eps = CV_TERMCRIT_EPS;
947 
949  int type, int maximum_iterations, double epsilon) {
950  unsigned int malloc_bytes = sizeof *((CV_Term_Criteria)0);
951  // (void)printf("CV_Term_Criteria__create: malloc_bytes=%d\n",
952  // malloc_bytes);
953  CV_Term_Criteria term_criteria = (CV_Term_Criteria)malloc(malloc_bytes);
954 
955  term_criteria->type = type;
956  term_criteria->max_iter = maximum_iterations;
957  term_criteria->epsilon = epsilon;
958  return term_criteria;
959 }
960 
void CV_Point2D32F__x_set(CV_Point2D32F point, double x)
Definition: CV.cpp:818
void CV__init_undistort_map(CV_Matrix camera_matrix, CV_Matrix distortion_coefficients, CV_Matrix mapx, CV_Matrix mapy)
Definition: CV.cpp:244
int CV__bilateral
Definition: CV.cpp:167
CvScalar * CV_Scalar
Definition: CV.hpp:24
void File__byte_write(File file, unsigned int byte)
Write byte ot file.
Definition: File.cpp:29
CvTermCriteria * CV_Term_Criteria
Definition: CV.hpp:28
int CV__fourcc(char character1, char character2, char character3, char character4)
Definition: CV.cpp:225
int CV__depth_32s
Definition: CV.cpp:26
int CV__luv_to_rgb
Definition: CV.cpp:107
int CV__f32
Definition: CV.cpp:122
int CV__bayergr_to_rgb
Definition: CV.cpp:97
int CV__gaussian
Definition: CV.cpp:165
int CV__rgb_to_gray
Definition: CV.cpp:51
CV_Memory_Storage CV_Memory_Storage__create(int block_size)
Definition: CV.cpp:769
int CV__auto_step
Definition: CV.cpp:161
int CV__bgr_to_luv
Definition: CV.cpp:98
int CV__chain_code
Definition: CV.cpp:443
int CV_Matrix__rows_get(CV_Matrix matrix)
Definition: CV.cpp:751
int CV__f32c2
Definition: CV.cpp:152
CV_Image CV_Image__tga_read(CV_Image image, String_Const tga_file_name)
Read in a .tga file.
Definition: CV.cpp:563
int CV__rgba_to_brga
Definition: CV.cpp:49
int CV__u8c4
Definition: CV.cpp:129
CV_Image CV__clone_image(CV_Image image)
Definition: CV.cpp:177
int CV__rgba_to_bgr
Definition: CV.cpp:44
int CV__f64
Definition: CV.cpp:123
void CV_Image__copy(CV_Image source_image, CV_Image destination_image, CV_Image mask)
Definition: CV.cpp:390
int CV__f64c2
Definition: CV.cpp:157
int CV__f64c1
Definition: CV.cpp:156
int CV__f64c4
Definition: CV.cpp:159
int CV_Sequence__total_get(CV_Sequence sequence)
Definition: CV.cpp:916
void Memory__free(Memory memory)
Releases the storage associated with memory.
Definition: Memory.cpp:60
int CV__f64c3
Definition: CV.cpp:158
int CV__depth_1u
Definition: CV.cpp:21
int CV__rgb_to_ycrcb
Definition: CV.cpp:83
int CV__s32
Definition: CV.cpp:121
unsigned int CV_Image__depth_get(CV_Image image)
Definition: CV.cpp:465
int CV__bgr_to_bgr565
Definition: CV.cpp:58
int CV__bgra_to_rgb
Definition: CV.cpp:45
int CV__median
Definition: CV.cpp:166
int CV__rgb_to_hsv
Definition: CV.cpp:87
void File__close(File file)
Closes file.
Definition: File.cpp:50
int CV__gemm_c_t
Definition: CV.cpp:232
void CV_Memory_Storage__clear(CV_Memory_Storage storage)
Definition: CV.cpp:765
int CV__bayerbg_to_bgr
Definition: CV.cpp:90
int CV__thresh_binary_inv
Definition: CV.cpp:114
CvSize * CV_Size
Definition: CV.hpp:26
int CV__u8
Definition: CV.cpp:117
double CV_Point2D32F__y_get(CV_Point2D32F point)
Definition: CV.cpp:822
void CV__gemm(CV_Matrix a, CV_Matrix b, double alpha, CV_Matrix c, double beta, CV_Matrix d, int transpose_a_b_c)
Definition: CV.cpp:234
void CV_Image__smooth(CV_Image source_image, CV_Image destination_image, int smooth_type, int parameter1, int parameter2, double parameter3, double parameter4)
Definition: CV.cpp:539
int CV__load_image_unchanged
Definition: CV.cpp:34
int CV__rgb_to_rgba
Definition: CV.cpp:39
void CV__set_zero(CV_Matrix matrix)
Definition: CV.cpp:286
unsigned int File__little_endian_short_read(File file)
Read a little endian short (16-bits) from file.
Definition: File.cpp:215
CV_Point2D32F CV_Point2D32F__create(double x, double y)
Definition: CV.cpp:803
int CV__s16c4
Definition: CV.cpp:144
int CV__bgr_to_hsv
Definition: CV.cpp:86
int CV__load_image_any_depth
Definition: CV.cpp:31
int CV__gemm_b_t
Definition: CV.cpp:231
int CV_Point__y_get(CV_Point point)
Definition: CV.cpp:793
void CV_Matrix__save(CV_Matrix matrix, const char *file_name)
Definition: CV.cpp:755
int CV__adaptive_thresh_mean_c
Definition: CV.cpp:111
int CV__s8c3
Definition: CV.cpp:133
int CV__depth_16u
Definition: CV.cpp:23
int CV__gray_to_bgr555
Definition: CV.cpp:76
int CV__depth_8u
Definition: CV.cpp:22
int CV_Point__x_get(CV_Point point)
Definition: CV.cpp:785
void CV_Point2D32F__point_set(CV_Point2D32F point2d32f, CV_Point point)
Definition: CV.cpp:830
int CV__s32c4
Definition: CV.cpp:149
void CV__set_identity(CV_Matrix matrix, CV_Scalar scalar)
Definition: CV.cpp:277
CvPoint2D32f * CV_Point2D32F
Definition: CV.hpp:22
int CV__lab_to_rgb
Definition: CV.cpp:105
FILE * File
FILE is a file I/O object.
Definition: File.hpp:12
CV_Sequence CV_Sequence__approximate_polygon(CV_Sequence contour, int header_size, CV_Memory_Storage storage, int method, int parameter1, double parameter2)
Definition: CV.cpp:885
int CV__bayerrg_to_bgr
Definition: CV.cpp:92
int CV__u8c3
Definition: CV.cpp:128
int CV__bgra_to_bgr555
Definition: CV.cpp:72
int CV__u16c2
Definition: CV.cpp:137
int CV__bgr565_to_bgra
Definition: CV.cpp:64
int CV__bgr_to_rgb
Definition: CV.cpp:46
int CV__depth_8s
Definition: CV.cpp:24
void CV_Image__find_corner_sub_pix(CV_Image image, CV_Point2D32F_Vector corners, int count, CV_Size window, CV_Size zero_zone, CV_Term_Criteria criteria)
Definition: CV.cpp:484
int CV__poly_approx_dp
Definition: CV.cpp:883
void CV_Image__tga_write(CV_Image image, String_Const file_name)
Write image out to file_name in .tga format.
Definition: CV.cpp:672
CV_Sequence CV_Image__find_contours(CV_Image image, CV_Memory_Storage storage, int header_size, int mode, int method, CV_Point point)
Definition: CV.cpp:454
int CV__chain_approx_tc89_kcos
Definition: CV.cpp:447
CV_Term_Criteria CV_Term_Criteria__create(int type, int maximum_iterations, double epsilon)
Definition: CV.cpp:948
int CV__bgr555_to_bgra
Definition: CV.cpp:74
int CV__s8c1
Definition: CV.cpp:131
CV_Image CV_Image__pnm_read(String_Const file_name)
Reads in a CV_Image in from the .pnm file named file_name.
Definition: CV.cpp:509
int CV__hsv_to_rgb
Definition: CV.cpp:103
int CV__ycrcb_to_rgb
Definition: CV.cpp:85
void CV_Slice__Initialize(void)
Definition: CV.cpp:15
int CV__xyz_to_bgr
Definition: CV.cpp:80
void CV_Scalar__free(CV_Scalar cv_scalar)
Definition: CV.cpp:870
int CV__f32c3
Definition: CV.cpp:153
int CV__luv_to_bgr
Definition: CV.cpp:106
int CV__load_image_gray_scale
Definition: CV.cpp:33
int CV__retr_tree
Definition: CV.cpp:440
CvPoint2D32f * CV_Point2D32F_Vector
Definition: CV.hpp:23
int CV__s8c2
Definition: CV.cpp:132
int CV__term_criteria_iterations
Definition: CV.cpp:945
int CV_Image__width_get(CV_Image image)
Definition: CV.cpp:741
int CV__brga_to_rgba
Definition: CV.cpp:48
int CV__calib_cb_adaptive_thresh
Definition: CV.cpp:450
int CV__bgr555_to_gray
Definition: CV.cpp:77
int CV__hls_to_bgr
Definition: CV.cpp:108
int CV__bgr_to_lab
Definition: CV.cpp:88
int CV__gray_to_brg
Definition: CV.cpp:52
CvMemStorage * CV_Memory_Storage
Definition: CV.hpp:20
int CV__s32c1
Definition: CV.cpp:146
int CV__f32c1
Definition: CV.cpp:151
int CV__gray_to_rgb
Definition: CV.cpp:53
IplImage * CV_Image
Definition: CV.hpp:18
#define Memory__new(Type, from)
Allocate a Type object from the heap.
Definition: Memory.hpp:23
int CV__rgba_to_rgb
Definition: CV.cpp:41
void File__little_endian_short_write(File file, unsigned int xshort)
Write 16-bit xshort to file in little endian format.
Definition: File.cpp:231
void File__format(File file, String_Const format,...)
will write format out to file with all patterns that start with "%" replaced by formatted versions of...
Definition: File.cpp:107
CV_Image CV_Image__create(CV_Size size, unsigned int depth, unsigned int channels)
Definition: CV.cpp:377
int CV__retr_ccomp
Definition: CV.cpp:439
int CV__thresh_binary
Definition: CV.cpp:113
int CV__load_image_color
Definition: CV.cpp:32
int CV__lab_to_bgr
Definition: CV.cpp:104
int CV__ycrcb_to_bgr
Definition: CV.cpp:84
int CV__xyz_to_rgb
Definition: CV.cpp:81
CV_Point2D32F CV_Point2D32F_Vector__fetch1(CV_Point2D32F_Vector vector, unsigned int index)
Definition: CV.cpp:853
unsigned int File__byte_read(File file)
Read a byte from file.
Definition: File.cpp:17
int CV__rgb_to_bgr
Definition: CV.cpp:47
int CV__rgba_to_bgr555
Definition: CV.cpp:73
CV_Point CV_Sequence__point_fetch1(CV_Sequence sequence, unsigned int index)
Definition: CV.cpp:912
void CV_Image__blob_draw(CV_Image image, int x, int y, CV_Scalar color)
Definition: CV.cpp:354
CV_Slice CV_Slice__create(int start_index, int end_index)
Definition: CV.cpp:934
CV_Scalar CV_Scalar__rgb(double red, double green, double blue)
Definition: CV.cpp:877
int CV__s8
Definition: CV.cpp:118
void CV_Image__adaptive_threshold(CV_Image source_image, CV_Image destination_image, double maximum_value, int adaptive_method, int threshold_type, int block_size, double parameter1)
Definition: CV.cpp:347
int CV__u16c3
Definition: CV.cpp:138
double CV__get_real_2d(CV_Matrix matrix, int row, int column)
Definition: CV.cpp:240
int CV__bayerbg_to_rgb
Definition: CV.cpp:94
int CV__bayergb_to_rgb
Definition: CV.cpp:95
int CV__bgr555_to_rgba
Definition: CV.cpp:75
int CV__bgr_to_hls
Definition: CV.cpp:100
void CV_Image__remap(CV_Image source_image, CV_Image destination_image, CV_Image map_x, CV_Image map_y, int flags, CV_Scalar fill_value)
Definition: CV.cpp:533
int CV_Image__gray_fetch(CV_Image image, int x, int y)
Definition: CV.cpp:475
int CV_Image__height_get(CV_Image image)
Definition: CV.cpp:498
int CV__s16c2
Definition: CV.cpp:142
void CV_Image__convert_color(CV_Image source_image, CV_Image destination_image, int conversion_code)
Definition: CV.cpp:385
int CV__bgr565_to_rgba
Definition: CV.cpp:65
int CV__rgb_to_bgra
Definition: CV.cpp:43
bool CV_Sequence__check_contour_convexity(CV_Sequence contour)
Definition: CV.cpp:899
int CV_Matrix__columns_get(CV_Matrix matrix)
Definition: CV.cpp:747
int CV__gray_to_rgba
Definition: CV.cpp:55
int CV__s16
Definition: CV.cpp:120
int CV__bgr_to_ycrcb
Definition: CV.cpp:82
int CV__bgr_to_rgba
Definition: CV.cpp:42
int CV__chain_link_runs
Definition: CV.cpp:448
void CV__find_extrinsic_camera_params2(CV_Matrix object_points, CV_Matrix image_points, CV_Matrix camera, CV_Matrix distortion_coefficients, CV_Matrix rotation_vector, CV_Matrix translation_vector, int use_extrinsic_guess)
Definition: CV.cpp:211
int CV__rgb_to_hls
Definition: CV.cpp:101
int CV__blur_no_scale
Definition: CV.cpp:163
int CV__bayergr_to_bgr
Definition: CV.cpp:93
int CV__bgra_to_bgr
Definition: CV.cpp:40
int CV__round(double value)
Definition: CV.cpp:290
int CV__inter_linear
Definition: CV.cpp:269
int CV__term_criteria_eps
Definition: CV.cpp:946
int CV__blur
Definition: CV.cpp:164
int CV__warp_fill_outliers
Definition: CV.cpp:270
CV_Point CV_Point__create(int x, int y)
Definition: CV.cpp:775
int CV__rgb_to_lab
Definition: CV.cpp:89
int CV__s8c4
Definition: CV.cpp:134
int CV__u16c1
Definition: CV.cpp:136
int CV__gray_to_bgra
Definition: CV.cpp:54
int CV__chain_approx_none
Definition: CV.cpp:444
int CV__gemm_a_t
Definition: CV.cpp:230
int CV__u16
Definition: CV.cpp:119
int CV__u8c2
Definition: CV.cpp:127
int CV__load_image_any_color
Definition: CV.cpp:30
void * Memory
Memory is a pointer to memory.
Definition: Memory.hpp:27
int CV__hsv_to_bgr
Definition: CV.cpp:102
int CV__gray_to_bgr565
Definition: CV.cpp:66
CvMat * CV_Matrix
Definition: CV.hpp:19
CV_Slice CV__whole_seq
Definition: CV.cpp:13
int CV__s32c3
Definition: CV.cpp:148
int CV__retr_external
Definition: CV.cpp:437
int CV__rgb_to_luv
Definition: CV.cpp:99
int CV__u8c1
Definition: CV.cpp:126
int CV__bgr_to_bgr555
Definition: CV.cpp:68
int CV__calib_cb_normalize_image
Definition: CV.cpp:451
CV_Sequence CV_Sequence__next_get(CV_Sequence sequence)
Definition: CV.cpp:908
int CV__chain_approx_simple
Definition: CV.cpp:445
CvPoint * CV_Point
Definition: CV.hpp:21
int CV__depth_64f
Definition: CV.cpp:28
void CV_Image__store3(CV_Image image, unsigned int x, unsigned int y, unsigned int channel, unsigned int value)
Definition: CV.cpp:546
int CV__rgb_to_bgr565
Definition: CV.cpp:59
int CV__u16c4
Definition: CV.cpp:139
File File__open(String_Const file_name, String_Const flags)
will open file_name using flags to specify read/write options.
Definition: File.cpp:243
void CV__draw_chessboard_corners(CV_Image image, CV_Size pattern_size, CV_Point2D32F_Vector corners, int count, bool pattern_was_found)
Definition: CV.cpp:171
int CV__rgb_to_xyz
Definition: CV.cpp:79
int CV__bgr_to_bgra
Definition: CV.cpp:38
int CV__rgba_to_bgr565
Definition: CV.cpp:63
void CV_Point2D32F__y_set(CV_Point2D32F point, double y)
Definition: CV.cpp:826
int CV__adaptive_thresh_gaussian_c
Definition: CV.cpp:112
int CV__bayerrg_to_rgb
Definition: CV.cpp:96
int CV__f32c4
Definition: CV.cpp:154
CvSeq * CV_Sequence
Definition: CV.hpp:25
CV_Point2D32F_Vector CV_Point2D32F_Vector__create(unsigned int size)
Definition: CV.cpp:839
int CV__find_chessboard_corners(CV_Image image, CV_Size pattern_size, CV_Point2D32F_Vector corners, int flags)
Definition: CV.cpp:198
int CV__rgb_to_bgr555
Definition: CV.cpp:69
double CV_Sequence__arc_length(CV_Sequence contour, CV_Slice slice, int is_closed)
Definition: CV.cpp:894
CV_Size CV_Size__create(int width, int height)
Definition: CV.cpp:922
int CV__chain_approx_tc89_l1
Definition: CV.cpp:446
void CV_Size__free(CV_Size cv_size)
Definition: CV.cpp:929
int CV__bgr565_to_bgr
Definition: CV.cpp:60
const char * String_Const
Definition: String.hpp:9
double CV_Sequence__contour_area(CV_Sequence contour, CV_Slice slice, int oriented)
Definition: CV.cpp:903
int CV__depth_32f
Definition: CV.cpp:27
int CV__window_auto_size
Definition: CV.cpp:35
int CV__bg4565_to_rgb
Definition: CV.cpp:61
int CV__brga_to_gray
Definition: CV.cpp:56
int CV__bgr555_to_rgb
Definition: CV.cpp:71
void CV_Image__cross_draw(CV_Image image, int x, int y, CV_Scalar color)
Definition: CV.cpp:395
unsigned int CV_Image__fetch3(CV_Image image, unsigned int x, unsigned int y, unsigned int channel)
Definition: CV.cpp:469
int CV__hls_to_rgb
Definition: CV.cpp:109
int CV__bgr_to_gray
Definition: CV.cpp:50
int CV__s16c3
Definition: CV.cpp:143
int CV__calib_cb_filter_quads
Definition: CV.cpp:452
CV_Image CV_Image__header_create(CV_Size size, unsigned int depth, unsigned int channels)
Definition: CV.cpp:493
int CV__retr_list
Definition: CV.cpp:438
int CV__rgba_to_gray
Definition: CV.cpp:57
CV_Scalar CV_Scalar__create(double value0, double value1, double value2, double value3)
Definition: CV.cpp:860
void CV_Image__pnm_write(CV_Image image, String_Const file_name)
Writes image out to .pnm file named file_name.
Definition: CV.cpp:527
int CV__user_type
Definition: CV.cpp:124
void CV__rodrigues2(CV_Matrix rotation_vector, CV_Matrix rotation_matrix, CV_Matrix jacobian)
Definition: CV.cpp:272
void CV_Image__draw_contours(CV_Image image, CV_Sequence contour, CV_Scalar external_color, CV_Scalar hole_color, int maximal_level, int thickness, int line_type, CV_Point offset)
Definition: CV.cpp:429
double CV_Point2D32F__x_get(CV_Point2D32F point)
Definition: CV.cpp:814
int CV__bgr_to_xyz
Definition: CV.cpp:78
unsigned int String__size(String_Const string)
Returns the size of string.
Definition: String.cpp:75
int CV__bayergb_to_bgr
Definition: CV.cpp:91
int CV__undistortion_setup(String_Const calibrate_file_name, int width, int height, CV_Image *mapx, CV_Image *mapy)
Definition: CV.cpp:301
CvSlice * CV_Slice
Definition: CV.hpp:27
void CV_Point__y_set(CV_Point point, int y)
Definition: CV.cpp:797
bool String__equal(String_Const string1, String_Const string2)
Returns true if string1 equals string2.
Definition: String.cpp:31
static CvSlice whole_sequence
Definition: CV.cpp:12
int CV__s16c1
Definition: CV.cpp:141
void CV__set_real_2d(CV_Matrix matrix, int row, int column, double value)
Definition: CV.cpp:281
int CV__depth_16s
Definition: CV.cpp:25
int CV__bgra_to_bgr565
Definition: CV.cpp:62
int CV__bgr565_to_gray
Definition: CV.cpp:67
void CV_Point__x_set(CV_Point point, int x)
Definition: CV.cpp:789
int CV__s32c2
Definition: CV.cpp:147
int CV__bgr555_to_bgr
Definition: CV.cpp:70
int CV_Image__channels_get(CV_Image image)
Definition: CV.cpp:381
void CV__release_image(CV_Image image)
Definition: CV.cpp:265
void CV_Image__flip(CV_Image from_image, CV_Image to_image, int flip_code)
Definition: CV.cpp:489


fiducial_lib
Author(s): Wayne Gramlich
autogenerated on Thu Dec 28 2017 04:06:53