[Insight-developers] Video and OpenCV issues

Xiaoxiao Liu xiaoxiao.liu at kitware.com
Fri Nov 4 15:08:43 EDT 2011


I think I figured out the test failure in   OpenCVVideoIOTest.

I looked at the original test arguments in (
http://review.source.kitware.com/#patch,sidebyside,2717,1,Modules/VideoIO/OpenCV/test/CMakeLists.txt
)
Patrick used a different video dataset during the processing of
refactoring. So  the current video file is smaller (has less frames)  than
the original avi data, to make the testing time shorter.
But he might forget to change the input arguments about the number of frame
for comparison.

So if i just change the number of frames from 1396 to 30. The test will
pass!








On Fri, Nov 4, 2011 at 10:36 AM, Luis Ibanez <luis.ibanez at kitware.com>wrote:

> Bill,
>
> This was mostly due to our learning process on OpenCV...
>
> We probably should review the code and replace the
> use of the C interface with the more modern C++ interface.
>
>
>    Luis
>
>
> ---------------------
> 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
> >
> >
>



-- 


---------------------------------------------
*Xiaoxiao Liu*, Ph.D.
R & D Engineer
Kitware Inc <http://www.kitware.com/>.
Clifton Park, NY
Phone: (518) 881-4924  or  (518) 371-3971 x124
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20111104/440a89ea/attachment.htm>


More information about the Insight-developers mailing list