Hi, I have read few other questions about Super Resolution and Video on this forum. But I did not find any tip about real time processing with super resolution. I wanted to test with a webcam but it seems that the algorithms, at least the BTV SuperResolution algorithm, need too many resources to be achieved real time and are supposed to have smal input size.
- Is there a new alternative for real time processing?
- I tried the approach below but did not succeed. Did I make a programming mistake?
Code:
Mat newRawImage;
Ptr<SuperResolution> superRes;
Ptr<DenseOpticalFlowExt> of;
Ptr<FrameSource> frameSource;
And I call the following part in an infinite loop of a thread and use newRawImage:
if (of.empty())
{
of = createOptFlow_DualTVL1_OCL();
}
if (!of.empty())
{
superRes = createSuperResolution_BTVL1_OCL();
superRes->set("opticalFlow", ext->of);
superRes->set("scale", 4);
superRes->set("iterations", 4);
superRes->set("temporalAreaRadius", 4);
if (frameSource.empty())
{
frameSource = createFrameSource_Camera(deviceId);
superRes->setInput(frameSource);
}
cv::ocl::oclMat result_;
superRes->nextFrame(result_);
ocl::finish();
if (!result_.empty())
{
result_.download(newRawImage);
}
}