[Insight-developers] Video and OpenCV issues

Bill Lorensen bill.lorensen at gmail.com
Thu Nov 3 16:48:10 EDT 2011


Some progress...

I built OpenCV with OPENCV_BUILD_3RDPARTY_LIBS:BOOL=ON and now I only get
one failure:

 3 - OpenCVVideoIOTest (Failed)
3: Test command:
/home/lorensen/ProjectsGIT/ITKGerrit-linux/bin/ITKVideoBridgeOpenCVTestDriver
"itkOpenCVVideoIOTest"
"/home/lorensen/ProjectsGIT/ITKGerrit-linux/ExternalData/Modules/Video/BridgeOpenCV/test/Input/inde-circulation_short.avi"
"foo.txt"
"/home/lorensen/ProjectsGIT/ITKGerrit-linux/Testing/Temporary/OpenCVVideoIOTest_Out.avi"
"/home/lorensen/ProjectsGIT/ITKGerrit-linux/Testing/Temporary/OpenCVVideoIOTest_CameraOut.mha"
"320" "240" "1396" "14.985"
3: Test timeout computed to be: 9.99988e+06
3: OpenCVVideoIO::CanReadFile...
3: OpenCVVideoIO::ReadImageInformation...
3: [swscaler @ 0x95299a0]No accelerated colorspace conversion found from
yuv420p to bgr24.
3: [swscaler @ 0x954cb60]No accelerated colorspace conversion found from
yuv420p to bgr24.
3: WARNING: In
/home/lorensen/ProjectsGIT/ITKGerrit/Modules/Video/BridgeOpenCV/src/itkOpenCVVideoIO.cxx,
line 313
3: OpenCVVideoIO (0x9474088): OpenCV can only seek to I-Frames. I-Frame
spacing for this video is 19. Last I-Frame is 19
3:
3: FrameTotal mismatch: (expected) 1396 != (got) 30
3: OpenCVVideoIO::Read...
3: Comparing all 30 frames
3: [swscaler @ 0x9583f70]No accelerated colorspace conversion found from
yuv420p to bgr24.
3: [swscaler @ 0x9612a80]No accelerated colorspace conversion found from
yuv420p to bgr24.
3: [swscaler @ 0x9636f90]No accelerated colorspace conversion found from
yuv420p to bgr24.
3: [swscaler @ 0x965b4a0]No accelerated colorspace conversion found from
yuv420p to bgr24.
3: [swscaler @ 0x965e030]No accelerated colorspace conversion found from
yuv420p to bgr24.
3: [swscaler @ 0x96610b0]No accelerated colorspace conversion found from
yuv420p to bgr24.
3: OpenCVVideoIO::SetNextFrameToRead
3:     Last message repeated 54 times
3: [swscaler @ 0x94deab0]No accelerated colorspace conversion found from
yuv420p to bgr24.
3: OpenCVVIdeoIO::SetWriterParameters...
3: OpenCVVideoIO::CanWriteFile...
3: WARNING: In
/home/lorensen/ProjectsGIT/ITKGerrit/Modules/Video/BridgeOpenCV/src/itkOpenCVVideoIO.cxx,
line 496
3: OpenCVVideoIO (0x9474088): Unrecognized file extension asdfasdfasdf
3:
3: OpenCVVIdeoIO::Write...
3:     Last message repeated 1 times
3: [swscaler @ 0x9529f70]No accelerated colorspace conversion found from
yuv420p to bgr24.
3: [swscaler @ 0x954d130]No accelerated colorspace conversion found from
yuv420p to bgr24.
3: WARNING: In
/home/lorensen/ProjectsGIT/ITKGerrit/Modules/Video/BridgeOpenCV/src/itkOpenCVVideoIO.cxx,
line 313
3: OpenCVVideoIO (0x9489970): OpenCV can only seek to I-Frames. I-Frame
spacing for this video is 19. Last I-Frame is 19
3:
3: [swscaler @ 0x9527fc0]No accelerated colorspace conversion found from
yuv420p to bgr24.
3: Output #0, avi, to
'/home/lorensen/ProjectsGIT/ITKGerrit-linux/Testing/Temporary/OpenCVVideoIOTest_Out.avi':
3:     Stream #0.0: Video: msmpeg4v2, yuv420p, 320x240, q=2-31, 4915 kb/s,
90k tbn, 14.98 tbc
3: [msmpeg4v2 @ 0x9561590]removing common factors from framerate
3: [swscaler @ 0x96cf030]No accelerated colorspace conversion found from
yuv420p to bgr24.
3: [swscaler @ 0x96f9090]No accelerated colorspace conversion found from
yuv420p to bgr24.
3: [swscaler @ 0x9720070]No accelerated colorspace conversion found from
yuv420p to bgr24.
3: ITK test driver caught an ITK exception:
3:
3: itk::ExceptionObject (0x9489208)
3: Location: "virtual void itk::OpenCVVideoIO::Read(void*)"
3: File:
/home/lorensen/ProjectsGIT/ITKGerrit/Modules/Video/BridgeOpenCV/src/itkOpenCVVideoIO.cxx
3: Line: 403
3: Description: itk::ERROR: OpenCVVideoIO(0x9489970): Error reading frame
28. May be out of bounds
3:
1/1 Test #3: OpenCVVideoIOTest ................***Failed    0.98 sec

0% tests passed, 1 tests failed out of 1

Label Time Summary:
ITKVideoBridgeOpenCV    =   0.98 sec

Total Test time (real) =   1.02 sec

The following tests FAILED:
      3 - OpenCVVideoIOTest (Failed)
Errors while running CTest


Bill
On Thu, Nov 3, 2011 at 3:00 PM, Bill Lorensen <bill.lorensen at gmail.com>wrote:

> Eventually, you will see that cvCaptureFromFile is failing in  CanReadFile
>
> BTW, why is the openCV C interface being used rather than the C++interface?
>
>
> On Thu, Nov 3, 2011 at 2:48 PM, Bill Lorensen <bill.lorensen at gmail.com>wrote:
>
>> I pulled down the patch and still get these errors:
>>
>>     Start 1: OpenCVVideoCaptureTest
>> 1/4 Test #1: OpenCVVideoCaptureTest ...........***Exception: SegFault
>> 1.44 sec
>>     Start 2: OpenCVImageBridgeTest
>> 2/4 Test #2: OpenCVImageBridgeTest ............   Passed    0.95 sec
>>     Start 3: OpenCVVideoIOTest
>> 3/4 Test #3: OpenCVVideoIOTest ................***Failed    0.25 sec
>>     Start 4: OpenCVVideoIOFactoryTest
>> 4/4 Test #4: OpenCVVideoIOFactoryTest .........***Failed    0.26 sec
>>
>> The code is not checking for failure here. It shopuld throw an exception.
>> Of course this will not fix the problem.
>>
>> 247    ::InitializeVideoIO()
>> 248    {
>> 249      m_VideoIO = itk::VideoIOFactory::CreateVideoIO(
>> 250                                    itk::VideoIOFactory::ReadFileMode,
>> 251                                    m_FileName.c_str());
>> 252      m_VideoIO->SetFileName(m_FileName.c_str());
>> 253      m_VideoIO->ReadImageInformation();
>> 254
>>
>>
>> On Thu, Nov 3, 2011 at 2:15 PM, Luis Ibanez <luis.ibanez at kitware.com>wrote:
>>
>>> Bill,
>>>
>>> We made some progress with Xiaoxiao,
>>> and push a patch 4:
>>>
>>> Where the ITK_VIDEO_USE_*
>>> variables were part of the problem,
>>>
>>> http://review.source.kitware.com/#patch,sidebyside,2997,4,Modules/Video/IO/src/itkVideoIOFactory.cxx
>>>
>>> but,...
>>> still need to do further debugging.
>>>
>>> We think that we are getting closer
>>> to the final source of the problem.
>>>
>>>
>>>     Luis
>>>
>>>
>>> -----------------------------------------------
>>> On Thu, Nov 3, 2011 at 1:27 PM, Bill Lorensen <bill.lorensen at gmail.com>
>>> wrote:
>>> > I built my OpenCV with FFMPEG support. I assume you'll find the same
>>> problem
>>> > when I ran gdb.
>>> >
>>> > Quoted from my gerrit review:
>>> >
>>> > OpenCVVideoIO::CanReadFile, cvCaptureFromFile fails.VideoFileReader
>>> should
>>> > check for failure here:
>>> > m_VideoIO = itk::VideoIOFactory::CreateVideoIO(
>>> > itk::VideoIOFactory::ReadFileMode,
>>> > m_FileName.c_str());
>>> > m_VideoIO->SetFileName(m_FileName.c_str());
>>> > m_VideoIO->ReadImageInformation();
>>> >
>>> > On Thu, Nov 3, 2011 at 1:12 PM, Luis Ibanez <luis.ibanez at kitware.com>
>>> wrote:
>>> >>
>>> >> Bill,
>>> >>
>>> >> I just managed to replicate the segmentation fault in:
>>> >>
>>> >>              OpenCVVideoCaptureTest
>>> >>
>>> >>
>>> >> ... now firing up GDB...    :-)
>>> >>
>>> >>
>>> >> I would suspect that this is related to not having build
>>> >> some FFMPEG support in OpenCV, but, I will probably
>>> >> be wrong and will end up having to buy you a beer...
>>> >>
>>> >>
>>> >>     Luis
>>> >>
>>> >>
>>> >> ------------------------------------------------------------
>>> >> On Fri, Oct 28, 2011 at 11:42 AM, Bill Lorensen <
>>> bill.lorensen at gmail.com>
>>> >> wrote:
>>> >> > Luis and Pat,
>>> >> >
>>> >> > I am building openvc 2.3.1 with WITH_FFMPEG:BOOL=ON.
>>> >> >
>>> >> > This is against this gerrit topic:
>>> >> > http://review.source.kitware.com/#change,2997
>>> >> >
>>> >> > itkOpenCVVideoCaptureTest segfaults.
>>> >> >
>>> >> > Bill
>>> >> >
>>> >
>>> >
>>> >
>>> > --
>>> > Unpaid intern in BillsBasement at noware dot com
>>> >
>>> >
>>>
>>
>>
>>
>> --
>> Unpaid intern in BillsBasement at noware dot com
>>
>>
>
>
> --
> Unpaid intern in BillsBasement at noware dot com
>
>


-- 
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20111103/c719d336/attachment-0001.htm>


More information about the Insight-developers mailing list