cvInitFont, cvPutText, cvRectangle

Hi everyone, I'm new in OpenCV, after go through some of the program, I having problem here...I have some confusion after search the following program from Internet and eBook, can anyone help to help me with the following, thanks^^

============================================================================

From Program
cvInitFont (&dfont, CV_FONT_HERSHEY_SIMPLEX , hscale, vscale, italicscale, thickness, CV_AA);

From Internet
cvInitFont(&font,CV_FONT_HERSHEY_SIMPLEX|CV_FONT_ITALIC, hScale,vScale,0,lineWidth);

From eBook
1
2
3
4
5
6
7
8
9
void cvInitFont(
CvFont* font,
int font_face,
double hscale,
double vscale,
double shear = 0,
int thickness = 1,
int line_type = 8
);


1. Is this CvFont* font from eBook means pointer of the name?
2. Why is this italicscale from Program is different with shear = 0 from eBook For the way they wrote? Or they are actually same?
3. What is this means CV_AA? Or can I just put line_type = 8 instead of CV_AA?
4. Why the code from internet don't put CV_AA but put only until lineWidth?

============================================================================

From Program
cvPutText(img2, text, cvPoint(p1.x, p2.y + 15),&dfont,CV_RGB(100,100,100));

From Internet
cvPutText (img,"My comment",cvPoint(200,400), &font, cvScalar(255,255,0));

From eBook
void cvPutText(
CvArr* img,
const char* text,
CvPoint origin,
const CvFont* font,
CvScalar color
);

1. Is that "My Comment" same as "text" in Program?
2. cvPoint(p1.x, p2.y + 15) same as cvPoint(200,400) for the way there wrote?
3. CV_RGB and cvScalar are the same?

============================================================================

From Program
cvRectangle( img2, p1, p2, CV_RGB( 100, 100, 100 ), 1, 8, 0 );

From Internet
// draw a box with red lines of width 1 between (100,100) and (200,200)
cvRectangle(img, cvPoint(100,100), cvPoint(200,200), cvScalar(255,0,0), 1);

From eBook
cvRectangle(
myImg,
cvPoint(5,10),
cvPoint(20,30),
cvScalar(255,255,255)
);

1. cvPoint(100,100) is inside the code from Internet but why the code from Program use p1, p2, and so on?

============================================================================

Thanks for anyone that helps^^
Last edited on
1. Is this CvFont* font from eBook means pointer of the name?
2. Why is this italicscale from Program is different with shear = 0 from eBook For the way they wrote? Or they are actually same?
3. What is this means CV_AA? Or can I just put line_type = 8 instead of CV_AA?
4. Why the code from internet don't put CV_AA but put only until lineWidth?


number 1 & 2, it's just function's parameters

number 3 & 4, because they use different variable names...

btw, i actually don't know about openCV. but it's just an ordinary syntax in C++. that means you haven't learn the basics of C++.

http://cplusplus.com/doc/tutorial

CMIIW
Topic archived. No new replies allowed.