# Revision history [back]

### Super-Resolution can't process first frame

Hey,

I am hoping to try out the SuperResolution feature included in OpenCV however i am having a bit of trouble with it. I believe it is the same issue as this question, i just have a few extra questions i'd like answered. I am testing it on the Megamind.avi video located in ..\opencv\samples\cpp\tutorial_code\HighGUI\video-input-psnr-ssim\video It is 720x528, 11seconds long and has a frame rate of 23frames/second.

Basically the issue i am having is when i call nextFrame() the memory usage shoots up 2GB and the CPU usage is at 100%, i have had it running for over an hour now and it is still processing as i type. For an 11second video this seems unreasonable?

Now my questions:

• Is the code i have posted correct? any tipes for improving performance?
• If the answer to the question i linked to is correct, Is the initialization time static, linear or does it increase exponentially. If it is not static i would find it pretty hard to stomach.
• Would real time processing be possible with GPUs?(I have tesla cards at work that i can use)
• If this is the expected result then is this function only really designed for 10-20 frames or something?

My Code:

    Ptr<SuperResolution> superRes;
superRes = createSuperResolution_BTVL1();
Ptr<FrameSource> frameSource;
frameSource = createFrameSource_Video("D:\\Megamind.avi");
Mat frame;
frameSource->nextFrame(frame);
superRes->setInput(frameSource);
for (int i = 0;; ++i)
{
Mat result;
//Calling nextFrame() is what is causing me the issue
superRes->nextFrame(result);
imshow("Super Resolution", result);
if (result.empty())
{
break;
}
waitKey(500);
}


Really appreciate any input you can give.

### Super-Resolution can't process first frame

Hey,

I am hoping to try out the SuperResolution feature included in OpenCV however i am having a bit of trouble with it. I believe it is the same issue as this question, i just have a few extra questions i'd like answered. I am testing it on the Megamind.avi video located in ..\opencv\samples\cpp\tutorial_code\HighGUI\video-input-psnr-ssim\video It is 720x528, 11seconds long and has a frame rate of 23frames/second.

Basically the issue i am having is when i call nextFrame() the memory usage shoots up 2GB and the CPU usage is at 100%, i have had it running for over an hour now and it is still processing as i type. For an 11second video this seems unreasonable?

Now my questions:

• Is the code i have posted correct? any tipes tips for improving performance?
• If the answer to the question i linked to is correct, Is the initialization time static, linear or does it increase exponentially. If it is not static i would find it pretty hard to stomach.
• Would real time processing be possible with GPUs?(I have tesla cards at work that i can use)
• If this is the expected result then is this function only really designed for 10-20 frames or something?

My Code:

    Ptr<SuperResolution> superRes;
superRes = createSuperResolution_BTVL1();
Ptr<FrameSource> frameSource;
frameSource = createFrameSource_Video("D:\\Megamind.avi");
Mat frame;
frameSource->nextFrame(frame);
superRes->setInput(frameSource);
for (int i = 0;; ++i)
{
Mat result;
//Calling nextFrame() is what is causing me the issue
superRes->nextFrame(result);
imshow("Super Resolution", result);
if (result.empty())
{
break;
}
waitKey(500);
}


Really appreciate any input you can give.