Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

create FrameSource for super-res using createFrameSource_Empty

$
0
0
I am looking to perform SuperResolution in OpenCV using an image stack as opposed to a video file. Due to the number of images/file size I would prefer to not have an intermediate step creating a video file from the images. I created a function that calls createFrameSource_Empty and return a pointer to the main super-res code. However, I keep getting seg faults later on. Here is my function. Any help is appreciated. // Creates a frame source from an image stack Ptr createFrameSource_imageStack() { VideoCapture g_cap; Mat frame; int i = 270330; // should include leading zero int d = 1; char filename[1024]; // Generate an empty frame source structure Ptr frameSource; frameSource = createFrameSource_Empty(); // Process 20 frames while(1) { // Get frame from capture //cout << "Variable i is " << i << endl; sprintf(filename, "/Users/terry/Documents/video_product_20frame/1_1_%07d.tif",i); g_cap.open(filename); g_cap >> frame; // Check if the frame was retrieved if(!frame.data) { cerr << "Could not retrieve frame."; exit (-1); } frameSource->nextFrame(frame); // quit after the 20th frame if (d == 20) break; i+=4; d++; } return frameSource; }

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>