OpenCV453
imgproc_c.h
1/*M///////////////////////////////////////////////////////////////////////////////////////
2//
3// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
4//
5// By downloading, copying, installing or using the software you agree to this license.
6// If you do not agree to this license, do not download, install,
7// copy or use the software.
8//
9//
10// License Agreement
11// For Open Source Computer Vision Library
12//
13// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
14// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
15// Third party copyrights are property of their respective owners.
16//
17// Redistribution and use in source and binary forms, with or without modification,
18// are permitted provided that the following conditions are met:
19//
20// * Redistribution's of source code must retain the above copyright notice,
21// this list of conditions and the following disclaimer.
22//
23// * Redistribution's in binary form must reproduce the above copyright notice,
24// this list of conditions and the following disclaimer in the documentation
25// and/or other materials provided with the distribution.
26//
27// * The name of the copyright holders may not be used to endorse or promote products
28// derived from this software without specific prior written permission.
29//
30// This software is provided by the copyright holders and contributors "as is" and
31// any express or implied warranties, including, but not limited to, the implied
32// warranties of merchantability and fitness for a particular purpose are disclaimed.
33// In no event shall the Intel Corporation or contributors be liable for any direct,
34// indirect, incidental, special, exemplary, or consequential damages
35// (including, but not limited to, procurement of substitute goods or services;
36// loss of use, data, or profits; or business interruption) however caused
37// and on any theory of liability, whether in contract, strict liability,
38// or tort (including negligence or otherwise) arising in any way out of
39// the use of this software, even if advised of the possibility of such damage.
40//
41//M*/
42
43#ifndef OPENCV_IMGPROC_IMGPROC_C_H
44#define OPENCV_IMGPROC_IMGPROC_C_H
45
46#include "opencv2/imgproc/types_c.h"
47
48#ifdef __cplusplus
49extern "C" {
50#endif
51
56/*********************** Background statistics accumulation *****************************/
57
61CVAPI(void) cvAcc( const CvArr* image, CvArr* sum,
62 const CvArr* mask CV_DEFAULT(NULL) );
63
67CVAPI(void) cvSquareAcc( const CvArr* image, CvArr* sqsum,
68 const CvArr* mask CV_DEFAULT(NULL) );
69
73CVAPI(void) cvMultiplyAcc( const CvArr* image1, const CvArr* image2, CvArr* acc,
74 const CvArr* mask CV_DEFAULT(NULL) );
75
79CVAPI(void) cvRunningAvg( const CvArr* image, CvArr* acc, double alpha,
80 const CvArr* mask CV_DEFAULT(NULL) );
81
82/****************************************************************************************\
83* Image Processing *
84\****************************************************************************************/
85
88CVAPI(void) cvCopyMakeBorder( const CvArr* src, CvArr* dst, CvPoint offset,
89 int bordertype, CvScalar value CV_DEFAULT(cvScalarAll(0)));
90
111CVAPI(void) cvSmooth( const CvArr* src, CvArr* dst,
112 int smoothtype CV_DEFAULT(CV_GAUSSIAN),
113 int size1 CV_DEFAULT(3),
114 int size2 CV_DEFAULT(0),
115 double sigma1 CV_DEFAULT(0),
116 double sigma2 CV_DEFAULT(0));
117
131CVAPI(void) cvFilter2D( const CvArr* src, CvArr* dst, const CvMat* kernel,
132 CvPoint anchor CV_DEFAULT(cvPoint(-1,-1)));
133
137CVAPI(void) cvIntegral( const CvArr* image, CvArr* sum,
138 CvArr* sqsum CV_DEFAULT(NULL),
139 CvArr* tilted_sum CV_DEFAULT(NULL));
140
147CVAPI(void) cvPyrDown( const CvArr* src, CvArr* dst,
148 int filter CV_DEFAULT(CV_GAUSSIAN_5x5) );
149
156CVAPI(void) cvPyrUp( const CvArr* src, CvArr* dst,
157 int filter CV_DEFAULT(CV_GAUSSIAN_5x5) );
158
162CVAPI(CvMat**) cvCreatePyramid( const CvArr* img, int extra_layers, double rate,
163 const CvSize* layer_sizes CV_DEFAULT(0),
164 CvArr* bufarr CV_DEFAULT(0),
165 int calc CV_DEFAULT(1),
166 int filter CV_DEFAULT(CV_GAUSSIAN_5x5) );
167
169CVAPI(void) cvReleasePyramid( CvMat*** pyramid, int extra_layers );
170
171
175CVAPI(void) cvPyrMeanShiftFiltering( const CvArr* src, CvArr* dst,
176 double sp, double sr, int max_level CV_DEFAULT(1),
177 CvTermCriteria termcrit CV_DEFAULT(cvTermCriteria(CV_TERMCRIT_ITER+CV_TERMCRIT_EPS,5,1)));
178
182CVAPI(void) cvWatershed( const CvArr* image, CvArr* markers );
183
190CVAPI(void) cvSobel( const CvArr* src, CvArr* dst,
191 int xorder, int yorder,
192 int aperture_size CV_DEFAULT(3));
193
197CVAPI(void) cvLaplace( const CvArr* src, CvArr* dst,
198 int aperture_size CV_DEFAULT(3) );
199
203CVAPI(void) cvCvtColor( const CvArr* src, CvArr* dst, int code );
204
205
209CVAPI(void) cvResize( const CvArr* src, CvArr* dst,
210 int interpolation CV_DEFAULT( CV_INTER_LINEAR ));
211
217CVAPI(void) cvWarpAffine( const CvArr* src, CvArr* dst, const CvMat* map_matrix,
218 int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS),
219 CvScalar fillval CV_DEFAULT(cvScalarAll(0)) );
220
224CVAPI(CvMat*) cvGetAffineTransform( const CvPoint2D32f * src,
225 const CvPoint2D32f * dst,
226 CvMat * map_matrix );
227
231CVAPI(CvMat*) cv2DRotationMatrix( CvPoint2D32f center, double angle,
232 double scale, CvMat* map_matrix );
233
237CVAPI(void) cvWarpPerspective( const CvArr* src, CvArr* dst, const CvMat* map_matrix,
238 int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS),
239 CvScalar fillval CV_DEFAULT(cvScalarAll(0)) );
240
244CVAPI(CvMat*) cvGetPerspectiveTransform( const CvPoint2D32f* src,
245 const CvPoint2D32f* dst,
246 CvMat* map_matrix );
247
251CVAPI(void) cvRemap( const CvArr* src, CvArr* dst,
252 const CvArr* mapx, const CvArr* mapy,
253 int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS),
254 CvScalar fillval CV_DEFAULT(cvScalarAll(0)) );
255
259CVAPI(void) cvConvertMaps( const CvArr* mapx, const CvArr* mapy,
260 CvArr* mapxy, CvArr* mapalpha );
261
265CVAPI(void) cvLogPolar( const CvArr* src, CvArr* dst,
266 CvPoint2D32f center, double M,
267 int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS));
268
272CVAPI(void) cvLinearPolar( const CvArr* src, CvArr* dst,
273 CvPoint2D32f center, double maxRadius,
274 int flags CV_DEFAULT(CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS));
275
291 CVAPI(IplConvKernel*) cvCreateStructuringElementEx(
292 int cols, int rows, int anchor_x, int anchor_y,
293 int shape, int* values CV_DEFAULT(NULL) );
294
298CVAPI(void) cvReleaseStructuringElement( IplConvKernel** element );
299
304CVAPI(void) cvErode( const CvArr* src, CvArr* dst,
305 IplConvKernel* element CV_DEFAULT(NULL),
306 int iterations CV_DEFAULT(1) );
307
313CVAPI(void) cvDilate( const CvArr* src, CvArr* dst,
314 IplConvKernel* element CV_DEFAULT(NULL),
315 int iterations CV_DEFAULT(1) );
316
320CVAPI(void) cvMorphologyEx( const CvArr* src, CvArr* dst,
321 CvArr* temp, IplConvKernel* element,
322 int operation, int iterations CV_DEFAULT(1) );
323
327CVAPI(void) cvMoments( const CvArr* arr, CvMoments* moments, int binary CV_DEFAULT(0));
328
330CVAPI(double) cvGetSpatialMoment( CvMoments* moments, int x_order, int y_order );
332CVAPI(double) cvGetCentralMoment( CvMoments* moments, int x_order, int y_order );
334CVAPI(double) cvGetNormalizedCentralMoment( CvMoments* moments,
335 int x_order, int y_order );
336
340CVAPI(void) cvGetHuMoments( CvMoments* moments, CvHuMoments* hu_moments );
341
342/*********************************** data sampling **************************************/
343
349CVAPI(int) cvSampleLine( const CvArr* image, CvPoint pt1, CvPoint pt2, void* buffer,
350 int connectivity CV_DEFAULT(8));
351
358CVAPI(void) cvGetRectSubPix( const CvArr* src, CvArr* dst, CvPoint2D32f center );
359
360
368CVAPI(void) cvGetQuadrangleSubPix( const CvArr* src, CvArr* dst,
369 const CvMat* map_matrix );
370
375CVAPI(void) cvMatchTemplate( const CvArr* image, const CvArr* templ,
376 CvArr* result, int method );
377
382CVAPI(float) cvCalcEMD2( const CvArr* signature1,
383 const CvArr* signature2,
384 int distance_type,
385 CvDistanceFunction distance_func CV_DEFAULT(NULL),
386 const CvArr* cost_matrix CV_DEFAULT(NULL),
387 CvArr* flow CV_DEFAULT(NULL),
388 float* lower_bound CV_DEFAULT(NULL),
389 void* userdata CV_DEFAULT(NULL));
390
391/****************************************************************************************\
392* Contours retrieving *
393\****************************************************************************************/
394
399CVAPI(int) cvFindContours( CvArr* image, CvMemStorage* storage, CvSeq** first_contour,
400 int header_size CV_DEFAULT(sizeof(CvContour)),
401 int mode CV_DEFAULT(CV_RETR_LIST),
402 int method CV_DEFAULT(CV_CHAIN_APPROX_SIMPLE),
403 CvPoint offset CV_DEFAULT(cvPoint(0,0)));
404
413CVAPI(CvContourScanner) cvStartFindContours( CvArr* image, CvMemStorage* storage,
414 int header_size CV_DEFAULT(sizeof(CvContour)),
415 int mode CV_DEFAULT(CV_RETR_LIST),
416 int method CV_DEFAULT(CV_CHAIN_APPROX_SIMPLE),
417 CvPoint offset CV_DEFAULT(cvPoint(0,0)));
418
422CVAPI(CvSeq*) cvFindNextContour( CvContourScanner scanner );
423
424
430CVAPI(void) cvSubstituteContour( CvContourScanner scanner, CvSeq* new_contour );
431
432
436CVAPI(CvSeq*) cvEndFindContours( CvContourScanner* scanner );
437
455CVAPI(CvSeq*) cvApproxChains( CvSeq* src_seq, CvMemStorage* storage,
456 int method CV_DEFAULT(CV_CHAIN_APPROX_SIMPLE),
457 double parameter CV_DEFAULT(0),
458 int minimal_perimeter CV_DEFAULT(0),
459 int recursive CV_DEFAULT(0));
460
467CVAPI(void) cvStartReadChainPoints( CvChain* chain, CvChainPtReader* reader );
468
472CVAPI(CvPoint) cvReadChainPoint( CvChainPtReader* reader );
473
474
475/****************************************************************************************\
476* Contour Processing and Shape Analysis *
477\****************************************************************************************/
478
483CVAPI(CvSeq*) cvApproxPoly( const void* src_seq,
484 int header_size, CvMemStorage* storage,
485 int method, double eps,
486 int recursive CV_DEFAULT(0));
487
491CVAPI(double) cvArcLength( const void* curve,
492 CvSlice slice CV_DEFAULT(CV_WHOLE_SEQ),
493 int is_closed CV_DEFAULT(-1));
494
497CV_INLINE double cvContourPerimeter( const void* contour )
498{
499 return cvArcLength( contour, CV_WHOLE_SEQ, 1 );
500}
501
502
507CVAPI(CvRect) cvBoundingRect( CvArr* points, int update CV_DEFAULT(0) );
508
512CVAPI(double) cvContourArea( const CvArr* contour,
513 CvSlice slice CV_DEFAULT(CV_WHOLE_SEQ),
514 int oriented CV_DEFAULT(0));
515
519CVAPI(CvBox2D) cvMinAreaRect2( const CvArr* points,
520 CvMemStorage* storage CV_DEFAULT(NULL));
521
525CVAPI(int) cvMinEnclosingCircle( const CvArr* points,
526 CvPoint2D32f* center, float* radius );
527
531CVAPI(double) cvMatchShapes( const void* object1, const void* object2,
532 int method, double parameter CV_DEFAULT(0));
533
537CVAPI(CvSeq*) cvConvexHull2( const CvArr* input,
538 void* hull_storage CV_DEFAULT(NULL),
539 int orientation CV_DEFAULT(CV_CLOCKWISE),
540 int return_points CV_DEFAULT(0));
541
545CVAPI(int) cvCheckContourConvexity( const CvArr* contour );
546
547
551CVAPI(CvSeq*) cvConvexityDefects( const CvArr* contour, const CvArr* convexhull,
552 CvMemStorage* storage CV_DEFAULT(NULL));
553
557CVAPI(CvBox2D) cvFitEllipse2( const CvArr* points );
558
560CVAPI(CvRect) cvMaxRect( const CvRect* rect1, const CvRect* rect2 );
561
563CVAPI(void) cvBoxPoints( CvBox2D box, CvPoint2D32f pt[4] );
564
568CVAPI(CvSeq*) cvPointSeqFromMat( int seq_kind, const CvArr* mat,
569 CvContour* contour_header,
570 CvSeqBlock* block );
571
579CVAPI(double) cvPointPolygonTest( const CvArr* contour,
580 CvPoint2D32f pt, int measure_dist );
581
582/****************************************************************************************\
583* Histogram functions *
584\****************************************************************************************/
585
613CVAPI(CvHistogram*) cvCreateHist( int dims, int* sizes, int type,
614 float** ranges CV_DEFAULT(NULL),
615 int uniform CV_DEFAULT(1));
616
628CVAPI(void) cvSetHistBinRanges( CvHistogram* hist, float** ranges,
629 int uniform CV_DEFAULT(1));
630
644CVAPI(CvHistogram*) cvMakeHistHeaderForArray(
645 int dims, int* sizes, CvHistogram* hist,
646 float* data, float** ranges CV_DEFAULT(NULL),
647 int uniform CV_DEFAULT(1));
648
656CVAPI(void) cvReleaseHist( CvHistogram** hist );
657
665CVAPI(void) cvClearHist( CvHistogram* hist );
666
680CVAPI(void) cvGetMinMaxHistValue( const CvHistogram* hist,
681 float* min_value, float* max_value,
682 int* min_idx CV_DEFAULT(NULL),
683 int* max_idx CV_DEFAULT(NULL));
684
685
694CVAPI(void) cvNormalizeHist( CvHistogram* hist, double factor );
695
696
704CVAPI(void) cvThreshHist( CvHistogram* hist, double threshold );
705
706
708CVAPI(double) cvCompareHist( const CvHistogram* hist1,
709 const CvHistogram* hist2,
710 int method);
711
722CVAPI(void) cvCopyHist( const CvHistogram* src, CvHistogram** dst );
723
724
727CVAPI(void) cvCalcBayesianProb( CvHistogram** src, int number,
728 CvHistogram** dst);
729
733CVAPI(void) cvCalcArrHist( CvArr** arr, CvHistogram* hist,
734 int accumulate CV_DEFAULT(0),
735 const CvArr* mask CV_DEFAULT(NULL) );
736
738CV_INLINE void cvCalcHist( IplImage** image, CvHistogram* hist,
739 int accumulate CV_DEFAULT(0),
740 const CvArr* mask CV_DEFAULT(NULL) )
741{
742 cvCalcArrHist( (CvArr**)image, hist, accumulate, mask );
743}
744
748CVAPI(void) cvCalcArrBackProject( CvArr** image, CvArr* dst,
749 const CvHistogram* hist );
750
751#define cvCalcBackProject(image, dst, hist) cvCalcArrBackProject((CvArr**)image, dst, hist)
752
753
773CVAPI(void) cvCalcArrBackProjectPatch( CvArr** image, CvArr* dst, CvSize range,
774 CvHistogram* hist, int method,
775 double factor );
776
777#define cvCalcBackProjectPatch( image, dst, range, hist, method, factor ) \
778 cvCalcArrBackProjectPatch( (CvArr**)image, dst, range, hist, method, factor )
779
780
792CVAPI(void) cvCalcProbDensity( const CvHistogram* hist1, const CvHistogram* hist2,
793 CvHistogram* dst_hist, double scale CV_DEFAULT(255) );
794
798CVAPI(void) cvEqualizeHist( const CvArr* src, CvArr* dst );
799
800
804CVAPI(void) cvDistTransform( const CvArr* src, CvArr* dst,
805 int distance_type CV_DEFAULT(CV_DIST_L2),
806 int mask_size CV_DEFAULT(3),
807 const float* mask CV_DEFAULT(NULL),
808 CvArr* labels CV_DEFAULT(NULL),
809 int labelType CV_DEFAULT(CV_DIST_LABEL_CCOMP));
810
811
817CVAPI(double) cvThreshold( const CvArr* src, CvArr* dst,
818 double threshold, double max_value,
819 int threshold_type );
820
829CVAPI(void) cvAdaptiveThreshold( const CvArr* src, CvArr* dst, double max_value,
830 int adaptive_method CV_DEFAULT(CV_ADAPTIVE_THRESH_MEAN_C),
831 int threshold_type CV_DEFAULT(CV_THRESH_BINARY),
832 int block_size CV_DEFAULT(3),
833 double param1 CV_DEFAULT(5));
834
838CVAPI(void) cvFloodFill( CvArr* image, CvPoint seed_point,
839 CvScalar new_val, CvScalar lo_diff CV_DEFAULT(cvScalarAll(0)),
840 CvScalar up_diff CV_DEFAULT(cvScalarAll(0)),
841 CvConnectedComp* comp CV_DEFAULT(NULL),
842 int flags CV_DEFAULT(4),
843 CvArr* mask CV_DEFAULT(NULL));
844
845/****************************************************************************************\
846* Feature detection *
847\****************************************************************************************/
848
852CVAPI(void) cvCanny( const CvArr* image, CvArr* edges, double threshold1,
853 double threshold2, int aperture_size CV_DEFAULT(3) );
854
861CVAPI(void) cvPreCornerDetect( const CvArr* image, CvArr* corners,
862 int aperture_size CV_DEFAULT(3) );
863
868CVAPI(void) cvCornerEigenValsAndVecs( const CvArr* image, CvArr* eigenvv,
869 int block_size, int aperture_size CV_DEFAULT(3) );
870
875CVAPI(void) cvCornerMinEigenVal( const CvArr* image, CvArr* eigenval,
876 int block_size, int aperture_size CV_DEFAULT(3) );
877
883CVAPI(void) cvCornerHarris( const CvArr* image, CvArr* harris_response,
884 int block_size, int aperture_size CV_DEFAULT(3),
885 double k CV_DEFAULT(0.04) );
886
890CVAPI(void) cvFindCornerSubPix( const CvArr* image, CvPoint2D32f* corners,
891 int count, CvSize win, CvSize zero_zone,
892 CvTermCriteria criteria );
893
898CVAPI(void) cvGoodFeaturesToTrack( const CvArr* image, CvArr* eig_image,
899 CvArr* temp_image, CvPoint2D32f* corners,
900 int* corner_count, double quality_level,
901 double min_distance,
902 const CvArr* mask CV_DEFAULT(NULL),
903 int block_size CV_DEFAULT(3),
904 int use_harris CV_DEFAULT(0),
905 double k CV_DEFAULT(0.04) );
906
917CVAPI(CvSeq*) cvHoughLines2( CvArr* image, void* line_storage, int method,
918 double rho, double theta, int threshold,
919 double param1 CV_DEFAULT(0), double param2 CV_DEFAULT(0),
920 double min_theta CV_DEFAULT(0), double max_theta CV_DEFAULT(CV_PI));
921
925CVAPI(CvSeq*) cvHoughCircles( CvArr* image, void* circle_storage,
926 int method, double dp, double min_dist,
927 double param1 CV_DEFAULT(100),
928 double param2 CV_DEFAULT(100),
929 int min_radius CV_DEFAULT(0),
930 int max_radius CV_DEFAULT(0));
931
935CVAPI(void) cvFitLine( const CvArr* points, int dist_type, double param,
936 double reps, double aeps, float* line );
937
938/****************************************************************************************\
939* Drawing *
940\****************************************************************************************/
941
942/****************************************************************************************\
943* Drawing functions work with images/matrices of arbitrary type. *
944* For color images the channel order is BGR[A] *
945* Antialiasing is supported only for 8-bit image now. *
946* All the functions include parameter color that means rgb value (that may be *
947* constructed with CV_RGB macro) for color images and brightness *
948* for grayscale images. *
949* If a drawn figure is partially or completely outside of the image, it is clipped.*
950\****************************************************************************************/
951
952#define CV_FILLED -1
953
954#define CV_AA 16
955
959CVAPI(void) cvLine( CvArr* img, CvPoint pt1, CvPoint pt2,
960 CvScalar color, int thickness CV_DEFAULT(1),
961 int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0) );
962
968CVAPI(void) cvRectangle( CvArr* img, CvPoint pt1, CvPoint pt2,
969 CvScalar color, int thickness CV_DEFAULT(1),
970 int line_type CV_DEFAULT(8),
971 int shift CV_DEFAULT(0));
972
976CVAPI(void) cvRectangleR( CvArr* img, CvRect r,
977 CvScalar color, int thickness CV_DEFAULT(1),
978 int line_type CV_DEFAULT(8),
979 int shift CV_DEFAULT(0));
980
981
987CVAPI(void) cvCircle( CvArr* img, CvPoint center, int radius,
988 CvScalar color, int thickness CV_DEFAULT(1),
989 int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0));
990
997CVAPI(void) cvEllipse( CvArr* img, CvPoint center, CvSize axes,
998 double angle, double start_angle, double end_angle,
999 CvScalar color, int thickness CV_DEFAULT(1),
1000 int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0));
1001
1002CV_INLINE void cvEllipseBox( CvArr* img, CvBox2D box, CvScalar color,
1003 int thickness CV_DEFAULT(1),
1004 int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0) )
1005{
1006 CvSize axes = cvSize(
1007 cvRound(box.size.width*0.5),
1008 cvRound(box.size.height*0.5)
1009 );
1010
1011 cvEllipse( img, cvPointFrom32f( box.center ), axes, box.angle,
1012 0, 360, color, thickness, line_type, shift );
1013}
1014
1018CVAPI(void) cvFillConvexPoly( CvArr* img, const CvPoint* pts, int npts, CvScalar color,
1019 int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0));
1020
1024CVAPI(void) cvFillPoly( CvArr* img, CvPoint** pts, const int* npts,
1025 int contours, CvScalar color,
1026 int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0) );
1027
1031CVAPI(void) cvPolyLine( CvArr* img, CvPoint** pts, const int* npts, int contours,
1032 int is_closed, CvScalar color, int thickness CV_DEFAULT(1),
1033 int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0) );
1034
1035#define cvDrawRect cvRectangle
1036#define cvDrawLine cvLine
1037#define cvDrawCircle cvCircle
1038#define cvDrawEllipse cvEllipse
1039#define cvDrawPolyLine cvPolyLine
1040
1047CVAPI(int) cvClipLine( CvSize img_size, CvPoint* pt1, CvPoint* pt2 );
1048
1055CVAPI(int) cvInitLineIterator( const CvArr* image, CvPoint pt1, CvPoint pt2,
1056 CvLineIterator* line_iterator,
1057 int connectivity CV_DEFAULT(8),
1058 int left_to_right CV_DEFAULT(0));
1059
1060#define CV_NEXT_LINE_POINT( line_iterator ) \
1061{ \
1062 int _line_iterator_mask = (line_iterator).err < 0 ? -1 : 0; \
1063 (line_iterator).err += (line_iterator).minus_delta + \
1064 ((line_iterator).plus_delta & _line_iterator_mask); \
1065 (line_iterator).ptr += (line_iterator).minus_step + \
1066 ((line_iterator).plus_step & _line_iterator_mask); \
1067}
1068
1069
1070#define CV_FONT_HERSHEY_SIMPLEX 0
1071#define CV_FONT_HERSHEY_PLAIN 1
1072#define CV_FONT_HERSHEY_DUPLEX 2
1073#define CV_FONT_HERSHEY_COMPLEX 3
1074#define CV_FONT_HERSHEY_TRIPLEX 4
1075#define CV_FONT_HERSHEY_COMPLEX_SMALL 5
1076#define CV_FONT_HERSHEY_SCRIPT_SIMPLEX 6
1077#define CV_FONT_HERSHEY_SCRIPT_COMPLEX 7
1078
1079#define CV_FONT_ITALIC 16
1080
1081#define CV_FONT_VECTOR0 CV_FONT_HERSHEY_SIMPLEX
1082
1083
1085typedef struct CvFont
1086{
1087 const char* nameFont; //Qt:nameFont
1088 CvScalar color; //Qt:ColorFont -> cvScalar(blue_component, green_component, red_component[, alpha_component])
1089 int font_face; //Qt: bool italic /** =CV_FONT_* */
1090 const int* ascii;
1091 const int* greek;
1092 const int* cyrillic;
1093 float hscale, vscale;
1094 float shear;
1096 float dx;
1098}
1100
1118CVAPI(void) cvInitFont( CvFont* font, int font_face,
1119 double hscale, double vscale,
1120 double shear CV_DEFAULT(0),
1121 int thickness CV_DEFAULT(1),
1122 int line_type CV_DEFAULT(8));
1123
1124CV_INLINE CvFont cvFont( double scale, int thickness CV_DEFAULT(1) )
1125{
1126 CvFont font;
1127 cvInitFont( &font, CV_FONT_HERSHEY_PLAIN, scale, scale, 0, thickness, CV_AA );
1128 return font;
1129}
1130
1135CVAPI(void) cvPutText( CvArr* img, const char* text, CvPoint org,
1136 const CvFont* font, CvScalar color );
1137
1141CVAPI(void) cvGetTextSize( const char* text_string, const CvFont* font,
1142 CvSize* text_size, int* baseline );
1143
1149CVAPI(CvScalar) cvColorToScalar( double packed_color, int arrtype );
1150
1159CVAPI(int) cvEllipse2Poly( CvPoint center, CvSize axes,
1160 int angle, int arc_start, int arc_end, CvPoint * pts, int delta );
1161
1165CVAPI(void) cvDrawContours( CvArr *img, CvSeq* contour,
1166 CvScalar external_color, CvScalar hole_color,
1167 int max_level, int thickness CV_DEFAULT(1),
1168 int line_type CV_DEFAULT(8),
1169 CvPoint offset CV_DEFAULT(cvPoint(0,0)));
1170
1173#ifdef __cplusplus
1174}
1175#endif
1176
1177#endif
CV_INLINE CvPoint cvPoint(int x, int y)
Definition: core/types_c.h:979
CV_INLINE CvPoint cvPointFrom32f(CvPoint2D32f point)
Definition: core/types_c.h:1051
void CvArr
This is the "metatype" used only as a function parameter.
Definition: core/types_c.h:139
CV_INLINE CvSize cvSize(int width, int height)
Definition: core/types_c.h:1202
CV_INLINE int cvRound(double value)
Rounds floating-point number to the nearest integer
Definition: fast_math.hpp:200
CV_EXPORTS_W void filter(InputArray image, InputArray kernel, OutputArray output)
Image filtering
CV_INLINE double cvContourPerimeter(const void *contour)
Definition: imgproc_c.h:497
struct CvFont CvFont
CVAPI(void) cvAcc(const CvArr *image
Adds image to accumulator
CV_INLINE void cvCalcHist(IplImage **image, CvHistogram *hist, int accumulate CV_DEFAULT(0), const CvArr *mask CV_DEFAULT(NULL))
Definition: imgproc_c.h:738
@ CV_DIST_L2
Definition: imgproc/types_c.h:592
@ CV_THRESH_BINARY
Definition: imgproc/types_c.h:604
@ CV_GAUSSIAN
Definition: imgproc/types_c.h:78
CV_EXPORTS_W void accumulate(InputArray src, InputOutputArray dst, InputArray mask=noArray())
Adds an image to the accumulator image.
Definition: core/types_c.h:393
Definition: core/types_c.h:328
Definition: core/types_c.h:1278
float angle
Definition: core/types_c.h:1281
CvPoint2D32f center
Definition: core/types_c.h:1279
CvSize2D32f size
Definition: core/types_c.h:1280
Definition: core/types_c.h:1690
Definition: imgproc/types_c.h:512
Definition: imgproc/types_c.h:58
Definition: core/types_c.h:1703
Definition: imgproc_c.h:1086
float shear
slope coefficient: 0 - normal, >0 - italic
Definition: imgproc_c.h:1094
int thickness
Qt: weight /‍** letters thickness *‍/
Definition: imgproc_c.h:1095
int line_type
Qt: PointSize
Definition: imgproc_c.h:1097
float dx
horizontal interval between letters
Definition: imgproc_c.h:1096
const int * ascii
font data and metrics
Definition: imgproc_c.h:1090
Definition: core/types_c.h:818
Definition: imgproc/types_c.h:465
Definition: core/types_c.h:1317
Definition: core/types_c.h:469
Definition: core/types_c.h:1498
Definition: imgproc/types_c.h:408
Definition: core/types_c.h:993
Definition: core/types_c.h:951
Definition: core/types_c.h:848
Definition: core/types_c.h:1383
Definition: core/types_c.h:1524
Definition: core/types_c.h:1574
Definition: core/types_c.h:1174
Definition: core/types_c.h:1337
Definition: core/types_c.h:918