Posts

Showing posts from July, 2017

Learn Load, Display In Addition To Relieve An Image

Mat imread (const string& filename, intflags=1 ) Parameters: filename   – Name of file to live on loaded. flags   –Flags specifying the color type of a loaded image: CV_LOAD_IMAGE_ANYDEPTH - render 16-bit/32-bit icon when the input has the corresponding depth, otherwise convert it to 8-bit. CV_LOAD_IMAGE_COLOR(>0) - If set, ever convert icon to the color one CV_LOAD_IMAGE_GRAYSCALE (0)- If set, ever convert icon to the grayscale one CV_LOAD_IMAGE_UNCHANGED (<0) loads the icon equally is (including the alpha channel if present) bool imwrite (const string& filename, InputArray img, const vector<int>&params=vector<int>() ) Parameters: filename   – Name of the file. image   – Image to live on saved. params   – Format-specific relieve parameters encoded equally pairs paramId_1, paramValue_1,...

Learn Threshold Operation

Image
double threshold (InputArray src, OutputArray dst, double thresh, double maxval, int type) Applies a fixed-level threshold to each array element Parameters: src – input array (single-channel, 8-bit or 32-bit floating point). dst – output array of the same size as well as type every bit src . thresh – threshold value. maxval – maximum value to role amongst the THRESH_BINARY as well as THRESH_BINARY_INV threshold ing types. type – threshold ing type THRESH_BINARY THRESH_BINARY_INV THRESH_TRUNC THRESH_TOZERO THRESH_TOZERO_INV Find an instance inwards OpenCV documentaion . Steps: Load an image Create a window to display results Create Trackbar to conduct type of Threshold Call the component "Threshold_Demo" to perform threshold operation. Functions: threshold , createTrackbar , imread , cvtColor , namedWindow , waitKey. Example: ------------ #include "opencv2/imgproc/imgproc.hpp...

Learn Erosion Or Dilation (Morphological Operations)

Image
void erode (InputArray src, OutputArray dst, InputArray kernel, Point anchor=Point(-1,-1), int iterations=1, int borderType=BORDER_CONSTANT, const Scalar& borderValue=morphologyDefaultBorderValue() ) Parameters: src – input image; the release of channels tin last arbitrary, simply the depth should last i of CV_8U , CV_16U , CV_16S , CV_32F` or ``CV_64F . dst – output picture of the same size too type every bit src . element – structuring chemical cistron used for erosion; if element=Mat() , a 3 x 3 rectangular structuring chemical cistron is used. anchor – seat of the anchor inside the element; default value (-1, -1) agency that the anchor is at the chemical cistron center. iterations – release of times erosion is applied. borderType – pixel extrapolation method (see borderInterpolate() for details). borderValue – edge value inward instance of a constant edge (see createMorphologyFilter() for detail...

Learn Opencv Representative To Convert Rgb To Greyness / Other Colouring Cloth Spaces

Image
void cvtColor (InputArray src, OutputArray dst, int code, int dstCn=0 ) Parameters: src – input image: 8-bit unsigned, 16-bit unsigned ( CV_16UC... ), or single-precision floating-point. dst – output icon of the same size in addition to depth equally src . code – color infinite conversion code (see the description below). dstCn – publish of channels inward the finish image; if the parameter is 0, the publish of the channels is derived automatically from src in addition to code . Note that the default color format inward OpenCV is oft referred to equally RGB precisely it is genuinely BGR (the bytes are reversed). The conventional ranges for R, G, in addition to B channel values are: 0 to 255 for CV_8U images 0 to 65535 for CV_16U images 0 to 1 for CV_32F images RGB GRAY ( CV_BGR2GRAY, CV_RGB2GRAY, CV_GRAY2BGR, CV_GRAY2RGB ) RGB YCrCb JPEG (or YCC) ( CV_BGR2YCrCb, CV_RGB2YCrCb, CV_YCrCb2BGR, CV_YCrCb2RGB ) RGB HSV ( CV...