A basic question on point classes and ellipses
I am attempting to teach myself some basic opencv concepts (c++ and Windows) by studying code examples. My goal is to develop a webcam based eye tracking app. I have found some good example code that I might be able to build upon, but I am first trying to learn what each part of the program does. However, I often have trouble finding a tutorial or explanation for something that seems very specific and basic.
Right now I am studying the cascade classifier tutorial:
http://docs.opencv.org/3.1.0/db/d28/t...
I am confused about a couple of lines of code, which I believe has something to do with drawing an ellipse:
Point center( faces[i].x + faces[i].width/2, faces[i].y + faces[i].height/2 );
ellipse( frame, center, Size( faces[i].width/2, faces[i].height/2), 0, 0, 360, Scalar( 255, 0, 255 ), 4, 8, 0 );
I understand somewhat what the second line is about, but I can't make sense of the first. It has similarities to the code for the ellipse, but I believe it is a point class object. I read about the point class in the opencv documentation, but the code examples appeared quite different from the way in which it was used in the cascade classifier program. What exactly is being added?
Finally, is this the best place to ask some of these basic questions? I have many more, although I usually try to find answers myself first. But sometimes I can't seem to find exactly what I'm looking for.
faces[i].x + faces[i].width/2
and a y value offaces[i].y + faces[i].height/2
. Don't be confused by having expressions rather than raw numbers, it is like initializing as for examplePoint center (34, 60)
. The second line draws an ellipse calling theellipse()
functionExtra: use the "10101" button to format code lines here in the forum
Thanks, that makes things slightly more understandable, but now I have a few follow-up questions.
First, I am confused about the usage of the square brackets, which I understand has something to do with arrays. However this doesn't really look like an array to me. Secondly, is the period after the square brackets a dot operator, or is that something else?
Finally, does the i have something to do with the i found in the previous line:
Well... your problem is not with OpenCV but with very very basic knowledge of C++ and Object oriented programming. You don't even seem to know what a for-loop is, so I strongly reccomend you to start reading one of the beginners C++ books available on the internet