smile
smile

Reputation: 169

How do i typecast cvseq to cvpoint

Hai ,

how do i typecast in opencv ,I want to type cast to cvseq to cvpoint

Upvotes: 0

Views: 2107

Answers (2)

thecoshman
thecoshman

Reputation: 8650

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.

Upvotes: 0

Andreas Brinck
Andreas Brinck

Reputation: 52519

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));

Upvotes: 4

Related Questions