Operation of matrices and images
(1) cvor function
Its structure
void Cvor (//two matrix corresponding element do or perform const cvarr* src1,//matrix 1const cvarr* src2,//matrix 2cvarr* dst,//result Matrix Const cvarr* mask = null//Matrix "switch") ;
Instance Code
#include <cv.h> #include
Output results
(2) Cvors function
Its structure
void Cvor (//matrix with given scalar do or op const cvarr* src1,//matrix 1CvScalar value,//given variable cvarr* dst,//result Matrix Const cvarr* mask = null//Matrix "switch");
Instance Code
#include <cv.h> #include
Output results
(3) Cvreduce function
Its structure
Cvsize cvreduce (//Finished by op specified reduction const cvarr* src,//target matrix cvarr* dst,//result Matrix int Dim = -1,//Factor Factor,//1 merge rows, 0 merged into columns. -1 into the corresponding disint op = cv_reduce_sum//Specify the law of reduction);
PS: The conversion operation in which the OP represents
| The value of OP |
Results |
| Cv_reduce_sum |
Calculates the sum of all vectors |
| Cv_reduce_avg |
Calculates the average of all vectors |
| Cv_reduce_max |
Calculates the maximum value in all vectors |
| Cv_reduce_min |
Calculates the minimum value in all vectors |
Instance Code
#include <cv.h> #include
Output results
(4) Cvrepeat function
Its structure
void Cvrepeat (//Copy Image const cvarr* src,//target matrix cvarr* dst//result matrix);
Instance Code
#include <cv.h> #include
Output Results
(5) Cvscale function
Its structure
void Cvscale (//Linear transform Conversion const cvarr* src,//input matrix cvarr* dst,//output matrix Double scale,//scale factor double shift = 0.0//scaling);
Instance Code
#include <cv.h> #include
Output results
(6) Cvset function
Its structure
void Cvset (//for pixels in an image set valuecvarr* arr,//target matrix cvscalar value,//Setting value const,cvarr* mask = null//image switch);
Instance Code
#include <cv.h> #include
Output results
(7) Cvsetzero function
Its structure
void Cvsetzero (//On the image itself is set to zero, equivalent to Cvset (0.0) cvarr* arr,//target matrix);
Instance Code
#include <cv.h> #include
Output results
To be Continued
Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.
"Learn OpenCV" considerations--matrix and image processing--cvor,cvors,cvrreduce,cvrepeat,cvscale,cvset and Cvsetzero