<div dir="ltr">Hi everyone,<br>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<br><br>typedef itk::RGBPixel<unsigned char> RGBPixelType;<br>typedef itk::Image< RGBPixelType, 2 > InputImageType;<br>
typedef itk::VideoStream<<div class="im">InputImageType> VideoStream;<br>typedef itk::VideoFileReader<VideoStream> ReaderType;<br>ReaderType::Pointer reader = ReaderType::New();<br>reader->SetFileName( name );<br>
reader->Update();<br>
VideoStream::Pointer video = reader->GetOutput();<br>VideoStream::FramePointer singleFrame = video->GetFrame(0);<br><br>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.<br>
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<br><br>itk::ObjectFactoryBase::RegisterFactory( itk::FileListVideoIOFactory::New() );<br>
<br>but also with this line of code the error is the same at the same point.<br><br>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!<br>
<br>Matteo</div></div>