OpenCV function essay

1. RNG class: It
     is a class that generates random numbers. It can compress a 64-bit i integer, and also get random numbers of scalar and array. The current version also supports uniformly distributed random numbers and Gaussian distributed random numbers.
         Its member functions are:
                            1. next can take out the next random number rng.next
                            2. uniform returns a random number in a specified range rng.uniform
                            3. gaussian returns a Gaussian random number rng.gaussian
                            4. fill fills the matrix rng with random numbers. fill

2. The copyTo member function:
     There are two forms of image.copyTo () in OpenCV, as shown below:
               A.copyTo (B) paste the content of A into B;
               image, copyTo (A, B) put B After overlapping with image, the point in image corresponding to the point with pixel value 0 in B becomes transparent, leaving other points in A.

3. static_cast <double> (A):
        Force the type of A to double.

4. The ptr
     Mat class provides the ptr function. The function is to get the first address of any line of the image. For example:
    uchar * data = outputImage.ptr <uchar> (i) The meaning of this statement is to get the first address of line i. Give data.

5. image.at <uchar> (i, j) takes out the points of row i and column j in the grayscale image;
    image.at <Vec3b> (i, j) [k] takes the kth channel of row i and column j in the color image The color points, uchar and Vec3b are all types of image pixel values;

6. nameWindow (name, window type)
   WINDOW_AUTOSIZE The window size automatically adapts to the size of the picture and cannot be changed manually. (0)
  WINDOW_NORMAL users can change the size of this window (1)
  WINDOW_OPENGL window will support OpenGL when it is created

7. Mat M ( 2 , 2 , CV_8UC3, cv :: Scalar :: all ( 1 ));
     two 2 represents the rows and columns of the created matrix, the third parameter is the data type in the matrix, and the last one is to assign a value to the matrix 1. CV_8UC3 (8bit 3 channels)  

8. Example of a function to get a point (point):
      Point a = Point ( 0 , 0 );
      Point b = Point (src.cols, src.rows);
9.  cvCircle (CvArr * img, CvPoint center, int radius, CvScalar color, int thickness = 1, int lineType = 8, int shift = 0)
                 
img is the source image pointer
                 center is the center coordinates of the circle drawn
                 radius is the radius of the circle
                 color is the color of the set circle, the rule is based on B (blue) G ( Green) R (red)
                 thickness If it is a positive number, it indicates the thickness of the lines that make up the circle. Otherwise, it indicates whether the circle is filled with
                 line_type. The default is the
                 number of decimal points for the 8 shift circle center point and radius value

10. 

 

 

 

 

 

 

Published 18 original articles · won praise 1 · views 2676

Guess you like

Origin blog.csdn.net/taochengwu123/article/details/84952834