OpenCV 4.5.3(日本語機械翻訳)
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
49 extern "C" {
50 #endif
51
56 /*********************** Background statistics accumulation *****************************/
57
61 CVAPI(void) cvAcc( const CvArr* image, CvArr* sum,
62 const CvArr* mask CV_DEFAULT(NULL) );
63
67 CVAPI(void) cvSquareAcc( const CvArr* image, CvArr* sqsum,
68 const CvArr* mask CV_DEFAULT(NULL) );
69
73 CVAPI(void) cvMultiplyAcc( const CvArr* image1, const CvArr* image2, CvArr* acc,
74 const CvArr* mask CV_DEFAULT(NULL) );
75
79 CVAPI(void) cvRunningAvg( const CvArr* image, CvArr* acc, double alpha,
80 const CvArr* mask CV_DEFAULT(NULL) );
81
82 /****************************************************************************************\
83 * Image Processing *
84 \****************************************************************************************/
85
88 CVAPI(void) cvCopyMakeBorder( const CvArr* src, CvArr* dst, CvPoint offset,
89 int bordertype, CvScalar value CV_DEFAULT(cvScalarAll(0)));
90
111 CVAPI(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
131 CVAPI(void) cvFilter2D( const CvArr* src, CvArr* dst, const CvMat* kernel,
132 CvPoint anchor CV_DEFAULT(cvPoint(-1,-1)));
133
137 CVAPI(void) cvIntegral( const CvArr* image, CvArr* sum,
138 CvArr* sqsum CV_DEFAULT(NULL),
139 CvArr* tilted_sum CV_DEFAULT(NULL));
140
147 CVAPI(void) cvPyrDown( const CvArr* src, CvArr* dst,
148 int filter CV_DEFAULT(CV_GAUSSIAN_5x5) );
149
156 CVAPI(void) cvPyrUp( const CvArr* src, CvArr* dst,
157 int filter CV_DEFAULT(CV_GAUSSIAN_5x5) );
158
162 CVAPI(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
169 CVAPI(void) cvReleasePyramid( CvMat*** pyramid, int extra_layers );
170
171
175 CVAPI(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
182 CVAPI(void) cvWatershed( const CvArr* image, CvArr* markers );
183
190 CVAPI(void) cvSobel( const CvArr* src, CvArr* dst,
191 int xorder, int yorder,
192 int aperture_size CV_DEFAULT(3));
193
197 CVAPI(void) cvLaplace( const CvArr* src, CvArr* dst,
198 int aperture_size CV_DEFAULT(3) );
199
203 CVAPI(void) cvCvtColor( const CvArr* src, CvArr* dst, int code );
204
205
209 CVAPI(void) cvResize( const CvArr* src, CvArr* dst,
210 int interpolation CV_DEFAULT( CV_INTER_LINEAR ));
211
217 CVAPI(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
224 CVAPI(CvMat*) cvGetAffineTransform( const CvPoint2D32f * src,
225 const CvPoint2D32f * dst,
226 CvMat * map_matrix );
227
231 CVAPI(CvMat*) cv2DRotationMatrix( CvPoint2D32f center, double angle,
232 double scale, CvMat* map_matrix );
233
237 CVAPI(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
244 CVAPI(CvMat*) cvGetPerspectiveTransform( const CvPoint2D32f* src,
245 const CvPoint2D32f* dst,
246 CvMat* map_matrix );
247
251 CVAPI(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
259 CVAPI(void) cvConvertMaps( const CvArr* mapx, const CvArr* mapy,
260 CvArr* mapxy, CvArr* mapalpha );
261
265 CVAPI(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
272 CVAPI(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
298 CVAPI(void) cvReleaseStructuringElement( IplConvKernel** element );
299
304 CVAPI(void) cvErode( const CvArr* src, CvArr* dst,
305 IplConvKernel* element CV_DEFAULT(NULL),
306 int iterations CV_DEFAULT(1) );
307
313 CVAPI(void) cvDilate( const CvArr* src, CvArr* dst,
314 IplConvKernel* element CV_DEFAULT(NULL),
315 int iterations CV_DEFAULT(1) );
316
320 CVAPI(void) cvMorphologyEx( const CvArr* src, CvArr* dst,
321 CvArr* temp, IplConvKernel* element,
322 int operation, int iterations CV_DEFAULT(1) );
323
327 CVAPI(void) cvMoments( const CvArr* arr, CvMoments* moments, int binary CV_DEFAULT(0));
328
330 CVAPI(double) cvGetSpatialMoment( CvMoments* moments, int x_order, int y_order );
332 CVAPI(double) cvGetCentralMoment( CvMoments* moments, int x_order, int y_order );
334 CVAPI(double) cvGetNormalizedCentralMoment( CvMoments* moments,
335 int x_order, int y_order );
336
340 CVAPI(void) cvGetHuMoments( CvMoments* moments, CvHuMoments* hu_moments );
341
342 /*********************************** data sampling **************************************/
343
349 CVAPI(int) cvSampleLine( const CvArr* image, CvPoint pt1, CvPoint pt2, void* buffer,
350 int connectivity CV_DEFAULT(8));
351
358 CVAPI(void) cvGetRectSubPix( const CvArr* src, CvArr* dst, CvPoint2D32f center );
359
360
368 CVAPI(void) cvGetQuadrangleSubPix( const CvArr* src, CvArr* dst,
369 const CvMat* map_matrix );
370
375 CVAPI(void) cvMatchTemplate( const CvArr* image, const CvArr* templ,
376 CvArr* result, int method );
377
382 CVAPI(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
399 CVAPI(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
413 CVAPI(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
422 CVAPI(CvSeq*) cvFindNextContour( CvContourScanner scanner );
423
424
430 CVAPI(void) cvSubstituteContour( CvContourScanner scanner, CvSeq* new_contour );
431
432
436 CVAPI(CvSeq*) cvEndFindContours( CvContourScanner* scanner );
437
455 CVAPI(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
467 CVAPI(void) cvStartReadChainPoints( CvChain* chain, CvChainPtReader* reader );
468
472 CVAPI(CvPoint) cvReadChainPoint( CvChainPtReader* reader );
473
474
475 /****************************************************************************************\
476 * Contour Processing and Shape Analysis *
477 \****************************************************************************************/
478
483 CVAPI(CvSeq*) cvApproxPoly( const void* src_seq,
484 int header_size, CvMemStorage* storage,
485 int method, double eps,
486 int recursive CV_DEFAULT(0));
487
491 CVAPI(double) cvArcLength( const void* curve,
492 CvSlice slice CV_DEFAULT(CV_WHOLE_SEQ),
493 int is_closed CV_DEFAULT(-1));
494
497 CV_INLINE double cvContourPerimeter( const void* contour )
498{
499 return cvArcLength( contour, CV_WHOLE_SEQ, 1 );
500}
501
502
507 CVAPI(CvRect) cvBoundingRect( CvArr* points, int update CV_DEFAULT(0) );
508
512 CVAPI(double) cvContourArea( const CvArr* contour,
513 CvSlice slice CV_DEFAULT(CV_WHOLE_SEQ),
514 int oriented CV_DEFAULT(0));
515
519 CVAPI(CvBox2D) cvMinAreaRect2( const CvArr* points,
520 CvMemStorage* storage CV_DEFAULT(NULL));
521
525 CVAPI(int) cvMinEnclosingCircle( const CvArr* points,
526 CvPoint2D32f* center, float* radius );
527
531 CVAPI(double) cvMatchShapes( const void* object1, const void* object2,
532 int method, double parameter CV_DEFAULT(0));
533
537 CVAPI(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
545 CVAPI(int) cvCheckContourConvexity( const CvArr* contour );
546
547
551 CVAPI(CvSeq*) cvConvexityDefects( const CvArr* contour, const CvArr* convexhull,
552 CvMemStorage* storage CV_DEFAULT(NULL));
553
557 CVAPI(CvBox2D) cvFitEllipse2( const CvArr* points );
558
560 CVAPI(CvRect) cvMaxRect( const CvRect* rect1, const CvRect* rect2 );
561
563 CVAPI(void) cvBoxPoints( CvBox2D box, CvPoint2D32f pt[4] );
564
568 CVAPI(CvSeq*) cvPointSeqFromMat( int seq_kind, const CvArr* mat,
569 CvContour* contour_header,
570 CvSeqBlock* block );
571
579 CVAPI(double) cvPointPolygonTest( const CvArr* contour,
580 CvPoint2D32f pt, int measure_dist );
581
582 /****************************************************************************************\
583 * Histogram functions *
584 \****************************************************************************************/
585
613 CVAPI(CvHistogram*) cvCreateHist( int dims, int* sizes, int type,
614 float** ranges CV_DEFAULT(NULL),
615 int uniform CV_DEFAULT(1));
616
628 CVAPI(void) cvSetHistBinRanges( CvHistogram* hist, float** ranges,
629 int uniform CV_DEFAULT(1));
630
644 CVAPI(CvHistogram*) cvMakeHistHeaderForArray(
645 int dims, int* sizes, CvHistogram* hist,
646 float* data, float** ranges CV_DEFAULT(NULL),
647 int uniform CV_DEFAULT(1));
648
656 CVAPI(void) cvReleaseHist( CvHistogram** hist );
657
665 CVAPI(void) cvClearHist( CvHistogram* hist );
666
680 CVAPI(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
694 CVAPI(void) cvNormalizeHist( CvHistogram* hist, double factor );
695
696
704 CVAPI(void) cvThreshHist( CvHistogram* hist, double threshold );
705
706
708 CVAPI(double) cvCompareHist( const CvHistogram* hist1,
709 const CvHistogram* hist2,
710 int method);
711
722 CVAPI(void) cvCopyHist( const CvHistogram* src, CvHistogram** dst );
723
724
727 CVAPI(void) cvCalcBayesianProb( CvHistogram** src, int number,
728 CvHistogram** dst);
729
733 CVAPI(void) cvCalcArrHist( CvArr** arr, CvHistogram* hist,
734 int accumulate CV_DEFAULT(0),
735 const CvArr* mask CV_DEFAULT(NULL) );
736
738 CV_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
748 CVAPI(void) cvCalcArrBackProject( CvArr** image, CvArr* dst,
749 const CvHistogram* hist );
750
751 #define cvCalcBackProject(image, dst, hist) cvCalcArrBackProject((CvArr**)image, dst, hist)
752
753
773 CVAPI(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
792 CVAPI(void) cvCalcProbDensity( const CvHistogram* hist1, const CvHistogram* hist2,
793 CvHistogram* dst_hist, double scale CV_DEFAULT(255) );
794
798 CVAPI(void) cvEqualizeHist( const CvArr* src, CvArr* dst );
799
800
804 CVAPI(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
817 CVAPI(double) cvThreshold( const CvArr* src, CvArr* dst,
818 double threshold, double max_value,
819 int threshold_type );
820
829 CVAPI(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
838 CVAPI(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
852 CVAPI(void) cvCanny( const CvArr* image, CvArr* edges, double threshold1,
853 double threshold2, int aperture_size CV_DEFAULT(3) );
854
861 CVAPI(void) cvPreCornerDetect( const CvArr* image, CvArr* corners,
862 int aperture_size CV_DEFAULT(3) );
863
868 CVAPI(void) cvCornerEigenValsAndVecs( const CvArr* image, CvArr* eigenvv,
869 int block_size, int aperture_size CV_DEFAULT(3) );
870
875 CVAPI(void) cvCornerMinEigenVal( const CvArr* image, CvArr* eigenval,
876 int block_size, int aperture_size CV_DEFAULT(3) );
877
883 CVAPI(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
890 CVAPI(void) cvFindCornerSubPix( const CvArr* image, CvPoint2D32f* corners,
891 int count, CvSize win, CvSize zero_zone,
892 CvTermCriteria criteria );
893
898 CVAPI(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
917 CVAPI(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
925 CVAPI(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
935 CVAPI(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
959 CVAPI(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
968 CVAPI(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
976 CVAPI(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
987 CVAPI(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
997 CVAPI(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
1018 CVAPI(void) cvFillConvexPoly( CvArr* img, const CvPoint* pts, int npts, CvScalar color,
1019 int line_type CV_DEFAULT(8), int shift CV_DEFAULT(0));
1020
1024 CVAPI(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
1031 CVAPI(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
1047 CVAPI(int) cvClipLine( CvSize img_size, CvPoint* pt1, CvPoint* pt2 );
1048
1055 CVAPI(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
1085 typedef 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
1118 CVAPI(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
1135 CVAPI(void) cvPutText( CvArr* img, const char* text, CvPoint org,
1136 const CvFont* font, CvScalar color );
1137
1141 CVAPI(void) cvGetTextSize( const char* text_string, const CvFont* font,
1142 CvSize* text_size, int* baseline );
1143
1149 CVAPI(CvScalar) cvColorToScalar( double packed_color, int arrtype );
1150
1159 CVAPI(int) cvEllipse2Poly( CvPoint center, CvSize axes,
1160 int angle, int arc_start, int arc_end, CvPoint * pts, int delta );
1161
1165 CVAPI(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