Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
vikasgupta-github committed Nov 23, 2021
2 parents 943402a + 7e6ac32 commit 6536257
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
37 changes: 29 additions & 8 deletions Super-Resolution-in-OpenCV/super_res.cpp
@@ -1,10 +1,31 @@
#include <string>
#include <opencv2/opencv.hpp>
#include <opencv2/dnn_superres.hpp>

img=cv::imread("image.png")
DnnSuperResImpl sr;
string model_path = "ESPCN_x4.pb";
sr.readModel(model_path);
sr.setModel("espcn", 4); // set the model by passing the value and the upsampling ratio
Mat result; // creating blank mat for result
sr.upsample(img, result); // upscale the input image
cv::imwrite("output.png",result)
int main(){

// Read image
cv::Mat img = cv::imread("image.png");

// Make DNN Super resolution instance
cv::dnn_superres::DnnSuperResImpl sr;

// Read the model
std::string model_path = "ESPCN_x4.pb";
sr.readModel(model_path);

// Set the model by passing the value and the upsampling ratio
sr.setModel("espcn", 4);

// Creating a blank Mat for result
cv::Mat result;

// Upscale the input image
sr.upsample(img, result);

// Write the final image
cv::imwrite("output.png",result);

return 0;

}
7 changes: 4 additions & 3 deletions WeChat-QRCode-Scanner-OpenCV/README.md
Expand Up @@ -19,8 +19,9 @@ python wechatQRcodeReader.py <input_file> (Leave blank for default image)
```

## Sample Result

![](WeChat-vs-OpenCV.gif)
<p align="center">
<img src="WeChat-vs-OpenCV.gif" alt="T-Rex Bot Demo")
</p>


# AI Courses by OpenCV
Expand All @@ -31,4 +32,4 @@ Want to become an expert in AI? [AI Courses by OpenCV](https://opencv.org/course
<p align="center">
<img src="https://www.learnopencv.com/wp-content/uploads/2020/04/AI-Courses-By-OpenCV-Github.png">
</p>
</a>
</a>

0 comments on commit 6536257

Please sign in to comment.