All the way OpenCV scenery

Source: Internet
Author: User

first of all, this is a study of the life of the summary text, biased technology to, write to themselves, incidentally look at their own this time what to do, and how to go forward, go elsewhere.

All day long to read the book to me the greatest feeling is: Then, learn a never heard of what is a kind of experience. Most estimates are like this: I've never heard of it, I heard it, and then "AO".

The next is more suffering, to have great patience to insist. is also a goal, is--embody your principles in actions. This is my principle, like to do more to say less. Then we begin to summarize ...

First, what is OPENCV?

The first time I heard, I whispered, what the hell is this thing? Later through the practiced hand only know, plainly is a function Library. It is a C function, C + + class composition, a lot of general algorithms are processing images. in the understanding of this process, I deeply appreciate the importance of C language ... Because I'm not proficient in C writing code, it's really embarrassing.

Then it is to install this software, and then configure the OpenCV related library files, my computer to force, pass through again. Otherwise, there will be no post-text ...

Second, in VC or VS programming must be used: A few big head files.

Cv.h
Cxcore.h
Highgui.h
Cvaux.h
Ml.h

And every time you make up a thing to be in the project-Setup-Connection inside Add library file, do not feel trouble and a bit of meaning ... What a state of mind ...

Third, the general can start to get started. Then the others began to knock on the code, one by one, knocking and thinking.

First contact is how to the most basic processing of the image, generally to display a folder under the picture, definitely to call the OPENCV function to achieve, I summarize the steps are:

1, CV structure to define a pointer to the picture iplimage* SRC
2, to load cvloadimage3. Create Window Cvnamedwindow 4. Display picture in window cvshowimage5, for the picture lets you see Cvwaitkey (0) normally;6. Free Space Cvreleaseimage 7. release window Cvdestroywindow
Iv. dealing with pictures don't know they can't.

The first one isRGB color space, do the physics know, but I first know, because Junior high school physics are not pass ... This is related to the dimension and the concept of the channel, a few dimensions, a few channels, and now seems a bit chaotic ...

And the second one is HSV color space,h indicates that the color of the phase angle 0-360;s the saturation of the color, popular point, S is the "purity" of a certain color, the smaller the value, the more gray color. V indicates the brightness of the color, from 0 to 1. V is equal to 0 is black, when v=1 and s=0 mean pure white; you can contact two pictures the question of a diagonal line is still very confusing ...

Here is a note, cvgetreal2d function is not used, consider the efficiency problem, the big picture is especially not possible. You don't have to do it.

Five, began to play a bold picture, delineation of areas of interestROI, face, license plate and other areas are believed to be the most concerned about the place, of course, confined to the honest rectangular frame range, and realize the replacement, during which I also put Zeng's face to the Sun's descendants of that person's face ... is also enough, fun has wood has ...

The lunatic is still in the back,image grayscale histogram,Two-dimensionalthe range of each bin becomes a polygon: 0<x<1,0<y<1. Direct analysis of the image shows three channels similar to the image of the data structure, the following may be used to match what, anyway, without a picture.

color space conversion Ah, it is a split-HSV2BGR, it's a score--BGR2HSV, the problem is that I split up after the combination of my picture blue into a purple red, until now do not know what the problem, I still think the blue from the purple on the H is not very close, is not the computer processing error.

Six, several algorithms: the most basic idea of image processing, Yes, it is.The play is very hi, corrosion erode. Expansion dilate. Refinement algorithm. The algorithm of extracting contour with binary value.

Contour MatchingCvmatchshapes, this involves probability theory, three moments: Primitive moment, center distance, Hu moment. I think it's starting to recognize the image and it's near.

And then it really took a step, from the multiple shapes in a pictureThe match for the template. It has to be said that the use of a more rigid translation of a rectangle to match the comparison, so first understand the idea is good. The rest of the excellent algorithm behind, you can go to find the direct use.

vii. Video processing on OPENCV
 
is also the relevant function cvcreatefilecapture,
 frame = cvqueryframe (capture);
 char C = cvwaitkey (+);if (c==27) break;//esc
I also have to pay attention to these, although not yet understand why this number, know the function will be able to ...  

Then learn the video control Progress control bar The most interesting, I seem to feel very tall on , in fact, that's it. is still a function, function, functionCvsettrackbarpos , but this piece of logical thinking is very high, because there are too many variables set, specifically to study the code bar ...

There is a small experiment, many pictures into small video I feel this is not interesting, because after all, there is a professional processing software, and this is very slag ... Processing for the sake of convenience also have to name the image into order, convenient to do an array processing, think I rename those pictures is very tired ah ...

Eight, it sounds a crazy face haar classifier training

about the Haar classifier method, including the algorithm of XXX. Classifier in this is the face and non-human face classification algorithm, in machine learning field, many algorithms are the classification of things, clustering process. ML provides a number of algorithms for classification and clustering. All I can do nowshallow into shallow out, according to People's summary to comb induction. Just remember that there are positive samples, negative samples of samples Ah ah ah ah ah ah.

The rest of the study, and look forward to their own growth.

All the way OpenCV scenery

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.