Ask Your Question
0

Super resolution video format?

asked 2015-06-11 09:10:07 -0600

pursang gravatar image

Hello,

I can't find a list of possible video formats for super resolution. I've only seen people use .avi on forums. Would it work with .mp4 as well?

Where can I find documentation for this? (http://docs.opencv.org/modules/superr... doesn't quite cut it).

Thanks in advance for your reply!

edit retag flag offensive close merge delete

Comments

1
LBerger gravatar imageLBerger ( 2015-06-11 13:14:03 -0600 )edit

Indeed I know this example, but it doesn't provide any clues as to what the inputVideoName is...

pursang gravatar imagepursang ( 2015-06-16 04:47:08 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-06-17 13:43:09 -0600

LBerger gravatar image

updated 2015-06-17 13:49:13 -0600

Have you solve your problem? It's not really an answer but may be it could help you. After you can change cv::superres::createFrameSource_Camera(0) in createFrameSource_Video(name); where name is pathname to your file. I think that's video format can be any format that opencv (ffmpeg ) can read .

I start working on Superres my program is (very slow) (using samples/gpu/super_resolution.cpp). Becarefull I use twice usb device 0 (my webcam). It works on windows but I'm not sure that's good on all platform.

#include <opencv2/opencv.hpp> 
#include "opencv2/superres.hpp"

using namespace cv;
using namespace std;
using namespace cv::superres;


int main(int argc, char** argv)
{

    Ptr<cv::superres::FrameSource> f;
    f = cv::superres::createFrameSource_Camera(0);
    Ptr<cv::superres::SuperResolution >sr;

    VideoCapture vid;
    vid.open(0);

    sr = cv::superres::createSuperResolution_BTVL1();
    Ptr<DenseOpticalFlowExt> of = cv::superres::createOptFlow_Farneback();

    int scale = 2;
    sr->setOpticalFlow(of);
    sr->setScale(scale);
    sr->setTemporalAreaRadius(2);
    sr->setIterations(2);
    Mat frame;
    char c;
    Mat frameZoom;
    Mat mZoom;
    Mat v;
    f->nextFrame(frame);
    sr->setInput(f);
    do{
        //if (vid.grab())
        {
            sr->nextFrame(frame);
            imshow("Video SuperRes", frame);
            if (vid.grab())
            {
                vid >> v;
                resize(v, mZoom, Size(0, 0), scale, scale);
                imshow("Video Scale", mZoom);

            }
                imshow("Video SuperRes", frame);
            c = waitKey(20);
        }

    } while (c != 27);
    return 0;
}
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-06-11 09:10:07 -0600

Seen: 1,335 times

Last updated: Jun 17 '15