[ITK Community] VideoFileReader: segmentation fault

Matt McCormick matt.mccormick at kitware.com
Fri Mar 7 02:34:55 EST 2014


Hi Matteo,

Is the reader->Update() call in a try-catch block [1]?

Thanks,
Matt

[1]
http://itk.org/ITKExamples/src/Core/Common/TryCatchException/Documentation.html


On Thu, Mar 6, 2014 at 12:06 PM, Matteo Pozza <
matteo.pozza at studenti.unipd.it> wrote:

> Hi everyone,
> I'm trying to read a video with ITK: I want to get every single frame for
> compute some features. I'm trying to use the code below
>
> typedef itk::RGBPixel<unsigned char> RGBPixelType;
> typedef itk::Image< RGBPixelType, 2 > InputImageType;
> typedef itk::VideoStream<
> InputImageType> VideoStream;
> typedef itk::VideoFileReader<VideoStream> ReaderType;
> ReaderType::Pointer reader = ReaderType::New();
> reader->SetFileName( name );
> reader->Update();
> VideoStream::Pointer video = reader->GetOutput();
> VideoStream::FramePointer singleFrame = video->GetFrame(0);
>
> but reader->Update() gives me segmentation fault runtime error. I've
> already checked that the filename passed to the reader is consistent, so
> the error is really strange.
> I've looked for some examples but I've haven't found so much, so is likely
> that my code is somewhere wrong: I've also found that before instantiating
> the reader is appropriate to put
>
> itk::ObjectFactoryBase::RegisterFactory(
> itk::FileListVideoIOFactory::New() );
>
> but also with this line of code the error is the same at the same point.
>
> I ask you to guide me to a correct use of these classes or to give me some
> advices about this problem: anyway, thank you for the attention!
>
> Matteo
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/community
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140307/4f266625/attachment-0002.html>


More information about the Community mailing list