libcvd-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libcvd-members] Issues converting Rgb<byte> to byte with V4L1


From: Casey Link
Subject: [libcvd-members] Issues converting Rgb<byte> to byte with V4L1
Date: Sun, 28 Sep 2008 22:11:43 -0400

Hello,

A project I am working on implements libcvd, and I'm having some
troubles adapting it to my V4L1 camera.

First, I should note that I am using the V4L1Buffer< Rgb<byte> >
object, and I give this emphasis because in the documentation[1] it
says "<CVD::Rgb<CVD::byte> > should work to but crashes with my
current driver ?!"
That pretty much sums up the issues I am having.

Specifically, line 99  of cvd/internal/convert_pixel_types.h segfaults:
0xb7d82169 in CVD::ConvertImage<CVD::Rgb<unsigned char>, unsigned
char, CVD::Pixel::CIE<CVD::Rgb<unsigned char>, unsigned char>,
1>::convert (address@hidden, address@hidden)
  at ./cvd/internal/convert_pixel_types.h:99
99                to = scalar_convert<Scalar,typename
Pixel::Component<Rgbish>::type,double>(wr*from.red + wg*from.green +
wb*from.blue);

We've (a teammate and I) traced the problem back to
cvd_src/i686/convert_rgb_to_y.cc, and we think the issue stems from
the while() control structure not terminating correctly. I printed the
output of steps_to_align() for 'rgb' and 'gray' and here is a sample
of the output: http://www.binaryelysium.com/steps_to_align.txt
I think that either rgb or gray are being ++ed outside the allocated
memory for the program.

The code that calls all this is:
V4L1Buffer< Rgb<byte> >* pvb = (V4L1Buffer< Rgb<byte> >*) mptr;
VideoFrame<Rgb<byte> > *pVidFrame = pvb->get_frame();
convert_image(*pVidFrame, imBW);     // This one fails
convert_image(*pVidFrame, imRGB);
pvb->put_frame(pVidFrame);

What's strange is that the first time the above code is called, it
works fine, but the second time it dies on the indicated line.

I'm using the CVS version of libcvd, gcc 4.2.3, and you can see my
v4l1 device information here:
http://www.binaryelysium.com/v4l_info.txt. I just noticed in that info
output that my camera claims to support RGB24 - there's no mention of
RGB 16 - could this be related?

I'd appreciate any suggestions :) I'm almost tempted to go try  a V4L2 camera.

Regards,
Casey Link

[1] http://mi.eng.cam.ac.uk/~er258/cvd/html/classCVD_1_1V4L1Buffer.html




reply via email to

[Prev in Thread] Current Thread [Next in Thread]