cvCvtColor with COLOR_BGR2YUV_I420

280 views
Skip to first unread message

Scott Montgomerie

unread,
Jan 20, 2015, 1:19:01 AM1/20/15
to jav...@googlegroups.com
Anyone know what parameters cvCvtColor  with COLOR_BGR2YUV_I420 is expecting? 

                 opencv_core.IplImage convertedImageFrame = opencv_core.IplImage.create(imageFrame.width(), imageFrame.height(), opencv_core.IPL_DEPTH_8U, 1);
                 cvCvtColor(imageFrame.clone(), convertedImageFrame.clone(), opencv_imgproc.COLOR_BGR2YUV_I420);

No matter what I try I get this error:

OpenCV Error: Assertion failed (dst.data == dst0.data) in cvCvtColor, file /Users/saudet/projects/bytedeco/javacpp-presets/opencv/cppbuild/macosx-x86_64/opencv-2.4.10/modules/imgproc/src/color.cpp, line 4424
java.lang.RuntimeException: /Users/saudet/projects/bytedeco/javacpp-presets/opencv/cppbuild/macosx-x86_64/opencv-2.4.10/modules/imgproc/src/color.cpp:4424: error: (-215) dst.data == dst0.data in function cvCvtColor

Many thanks,
Scott

Samuel Audet

unread,
Jan 25, 2015, 12:51:21 AM1/25/15
to jav...@googlegroups.com
On 01/20/2015 03:19 PM, Scott Montgomerie wrote:
> Anyone know what parameters cvCvtColor with COLOR_BGR2YUV_I420 is expecting?

Let's check the code, here for example:
https://github.com/Itseez/opencv/blob/03fc3d1ceb867cbd6882e2a2809a196582d0efc1/modules/imgproc/src/color.cpp#L8435

So it looks like it wants 3 or 4 destination channels, with a height 2/3
of the input image.

Samuel

Reply all
Reply to author
Forward
0 new messages