본문 바로가기

Computer Vision/OpenCV

OpenCV – Basic Functions




Miscellaneous Image Transformations

Converts an image from one color space to another.

void cvtColor(InputArray src, OutputArray dst, int code, int dstCn=0 )
- http://goo.gl/wJeZgt


Filter

void GaussianBlur(InputArray src, OutputArray dst, Size ksize, double sigmaX, double sigmaY=0, int borderType=BORDER_DEFAULT )
- http://goo.gl/FiOgMO



Basic Thresholding Operations

double threshold(InputArray src, OutputArray dst, double thresh, double maxval, int type)
- http://goo.gl/lmPPIu


Eroding and Dilating
- http://goo.gl/uswkhF

void erode(InputArray src, OutputArray dst, InputArray kernel, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar& borderValue=morphologyDefaultBorderValue() )

- http://goo.gl/AZ24NA

void dilate(InputArray src, OutputArray dst, InputArray kernel, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar& borderValue=morphologyDefaultBorderValue() )

- http://goo.gl/UqdyRc



Operations on Arrays

Calculates the per-element sum of two arrays or an array and a scalar.

void add(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray(), int dtype=-1)
- http://goo.gl/j7R1XK

void bitwise_not(InputArray src, OutputArray dst, InputArray mask=noArray())
- http://goo.gl/qjHoIX

void bitwise_xor(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray())
- http://goo.gl/ME3MPk

void bitwise_and(InputArray src1, InputArray src2, OutputArray dst, InputArray mask=noArray())
- http://goo.gl/bsnuf2




Draw Function

Draws a simple, thick, or filled up-right rectangle.

void rectangle(Mat& img, Point pt1, Point pt2, const Scalar& color, int thickness=1, int lineType=8, int shift=0)
void rectangle(Mat& img, Rect rec, const Scalar& color, int thickness=1, int lineType=8, int shift=0 )
- http://goo.gl/MabOF0


Draws a text string.

void putText(Mat& img, const string& text, Point org, int fontFace, double fontScale, Scalar color, int thickness=1, int lineType=8, bool bottomLeftOrigin=false )
- http://goo.gl/GlZAQM

Initializes font structure (OpenCV 1.x API).

void cvInitFont(CvFont* font, int font_face, double hscale, double vscale, double shear=0, int thickness=1, int line_type=8 )
- http://goo.gl/Pm177T




Feature Detection

Finds edges in an image using the [Canny86] algorithm.

void Canny(InputArray image, OutputArray edges, double threshold1, double threshold2, int apertureSize=3, bool L2gradient=false )
- http://goo.gl/vu8mwL


Contours

Finds contours in a binary image.

void findContours(InputOutputArray image, OutputArrayOfArrays contours, OutputArray hierarchy, int mode, int method, Point offset=Point())

void findContours(InputOutputArray image, OutputArrayOfArrays contours, int mode, int method, Point offset=Point())

- http://goo.gl/Beuq8c


Draws contours outlines or filled contours.

void drawContours(InputOutputArray image, InputArrayOfArrays contours, int contourIdx, const Scalar& color, int thickness=1, int lineType=8, InputArray hierarchy=noArray(), int maxLevel=INT_MAX, Point offset=Point() )
- http://goo.gl/tPfa4X


Structural Analysis and Shape Descriptors

Calculates all of the moments up to the third order of a polygon or rasterized shape.

Rect boundingRect(InputArray points)¶
- http://goo.gl/JycYKE


More Morphology Transformations

- http://goo.gl/cDxRwf

Performs advanced morphological transformations.

void morphologyEx(InputArray src, OutputArray dst, int op, InputArray kernel, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar& borderValue=morphologyDefaultBorderValue() )
- http://goo.gl/8YeDSb


UI

Creates a window.

void namedWindow(const string& winname, int flags=WINDOW_AUTOSIZE )¶
- http://goo.gl/bDZcL9


Displays an image in the specified window.

void imshow(const string& winname, InputArray mat)
- http://goo.gl/uxW7uQ




Extend Function

Edge Detector

bool RemoveLineWithSobel(const cv::Mat& src, cv::Mat& gray_res, cv::Mat* pLineMask = NULL, int min_line_len = 0)
- http://goo.gl/a67VUF








'Computer Vision > OpenCV' 카테고리의 다른 글

OpenCV – Blob Detect 자료  (0) 2016.08.25