My solution is working with CPU as my OpenCV is not a GPU build.
It super-slow about 15 seconds per frame. Most likely you can speed this up with working in OpenCV/EmguCV GPU build.
Initially I thought it was not working because of the long delay in SuperRes call, but I compiled and ran the OpenCV sample in VC++ it was also slow.
If you want to do this real-time it will be a issue.
Here is the final solution that worked for me using EmguCV 3.1.0
You might need other class for file I/O etc:
using Emgu.CV;
using Emgu.CV.CvEnum;
using Emgu.CV.Structure;
using Emgu.Util;
using Emgu.CV.UI;
using Emgu.CV.Superres;
using Emgu.CV.Cuda;
public void SuperResolutionTest()
{
Mat frame = new Mat();
Mat result = new Mat();
FrameSource _frameSource = new FrameSource("video.avi", false);
_frameSource.NextFrame(frame);
for (int i = 0; i < 5; i++)
{
frame.Save(@"c:\Dev\superres\inputFrame" + i.ToString("00") + ".png");
SuperResolution _superResolution = new SuperResolution(Emgu.CV.Superres.SuperResolution.OpticalFlowType.Btvl, _frameSource);
_superResolution.NextFrame(result);
result.Save(@"c:\Dev\superres\outputFrame"+i.ToString("00")+".png");
}
}
This program will use an video file stream read 5 frames and generate 5 super resolution images using default EmguCV/superres parameters. With the VC++/OpenCV sample version of the code you can control most of the parameters for super resolution.
Simple but it works!