Hai ,
how do i typecast in opencv ,I want to type cast to cvseq to cvpoint
Hai ,
how do i typecast in opencv ,I want to type cast to cvseq to cvpoint
From what I can see here:
http://opencv.willowgarage.com/documentation/dynamic_structures.html
CvSeq
seems to be some form of data container and can not be directly cast to a CvPoint
.
This might be what you want:
char* cvGetSeqElem(const CvSeq* seq, int index)
I guess it's used like this:
CvPoint* point = reinterpret_cast<CvPoint*>(cvGetSeqElem(sequence, some_index));
You don't typecast in onpenCV as such, its a feature of C++
you do it something like this
float var_a = 9.99;
int var_b = static_cast<int>var_a;
if you had only tried to write
int var_b = var_a;
You would have got a warning that you can't implicitly (automatically) convert a float to an int, as you lose the decimal.
typecasting (putting the type you KNOW you want in brackets) tells the compiler you know what you are doing and are cool with it.