Ask Your Question
0

How to use cvMakeSeqHeaderForArray in Javacv?

asked 2013-05-03 15:34:11 -0600

My developing environment is javacv. I have an array of CvPoint data, and I want to convert them into a CvSeq by using the function cvMakeSeqHeaderForArray. However, the result CvSeq data are different from the original CvPoint array data. The following is my codes:

             CvSeq contours = new CvSeq();
             cvMakeSeqHeaderForArray(
                    CV_SEQ_ELTYPE_POINT,
                    Loader.sizeof(CvContour.class),
                    Loader.sizeof(CvPoint.class),
                    pixels[0],
                    pixels.length,
                    contours,
                    seqBlock
            );

where pixels[] is my defined CvPoint array. Then I use the following sentence to detect the converting result: CvPoint tempPoint = new CvPoint(cvGetSeqElem(contours.position(0),indx)); When indx is an even number, temPoint returns one of elements of pixels[] but with position of about index/2. When indx is an odd number temPoint returns wrong data. What's wrong?

edit retag flag offensive close merge delete

Comments

I want to match among contours. I need not get the contours by the function cvFindContours(). I have got all contours by some other way. I want to try to use the methods given by opencv first.

murkysky gravatar imagemurkysky ( 2013-05-05 09:14:19 -0600 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2013-05-04 05:09:57 -0600

Qichao Chen gravatar image

See FQA about OpenCV wrappers.

If you have any question about JavaCV,you should go to JavaCV groups,instead here.JavaCV is independent project.

BTW,OpenCV != JavaCV.

edit flag offensive delete link more

Comments

Thanks for your reminding. But I also appreciate very much if some one provide a simple sample even using opencv. I can't find any sample about this function.

murkysky gravatar imagemurkysky ( 2013-05-04 10:42:35 -0600 )edit
1

What is your purpose?

Qichao Chen gravatar imageQichao Chen ( 2013-05-04 11:09:28 -0600 )edit

Question Tools

Stats

Asked: 2013-05-03 15:34:11 -0600

Seen: 391 times

Last updated: May 04 '13