Gregjksmith / Single-Image-Example-Based-Super-Resolution

Single image example-based super resolution. Improves the spatial and temporal resolution of an image using a direct mapping of LR HR patch pairs. C++, openCV.
MIT License
33 stars 8 forks source link

Hello, I am interested in your code for Single-Image-Example-Based-Super-Resolution. I have a Question. #2

Open star4s opened 6 years ago

star4s commented 6 years ago

Hello, I am interested in your code for Single-Image-Example-Based-Super-Resolution. I have a Question.

After I do build the code by using the Example, I have no error message. But after I run the program I have some error message on the console,

OpenCV Error: Assertion failed (dims <= 2 && data && (unsigned)i0 < (unsigned)size.p[0] && (unsigned)(i1DataType<_Tp>::channels) < (unsigned)(size.p[1]channels()) && ((((sizeof(size_t)<<28)|0x8442211) >> ((DataType<_Tp>::depth) & ((1 << 3) - 1))*4) & 15) == elemSize1()) in cv::Mat::at, file c:\opencv\build\include\opencv2\core\mat.hpp, line 538

So, I tried debugging in the code. While debugging, in void gs::makeFreqResp(int filterSize, float p, float q, float s, cv::Mat& H, cv::Mat& G, cv::Mat& h, cv::Mat& g) I had some error in /create the low pass magnitude response/ part. in the for loop, in the else if (kTrans[i] == 1.0), after taking d = (1.0 + cos(wScaled[i]))*sqrt(2.0 - cos(wScaled[i])) / 2, H.at(0, i) = d had some thing wrong. I have no idead why H.at(0, i) = d has some thing wrong. Can you help me for the problem? Thank you for your attention

Gregjksmith commented 6 years ago
  1. when loading the image, can you verify that the image matrix is not empty?
  2. What build configs are you using? I find openCV works when using release configs but not debug configs.

Greg.