Super Resolution in Opencv
Super Resolution in Opencv
Super Resolution in Opencv
https://www.pyimagesearch.com/2020/11/09/opencv-super-resolution-with-deep-learning/
https://towardsdatascience.com/deep-learning-based-super-resolution-with-opencv-4fd736678066
https://docs.opencv.org/4.5.2/dc/d69/tutorial_dnn_superres_benchmark.html
https://docs.opencv.org/4.5.2/d8/df8/tutorial_table_of_content_dnn_superres.html
great algorithms. Since one of the latest mergers, OpenCV contains an easy-to-use
interface for implementing Super Resolution (SR) based on deep learning methods.
The interface contains pre-trained models that can be used for inference very easily
and efficiently. In this post, I will explain what it can do and show step-by-step how to
NOTE: You don’t need any knowledge about SR to use this code. I am running this on
an Ubuntu 16.04 machine, but it works for any other distributions (it also works on
Windows).
Steps
careful with the version: 4.2.0 for C++, 4.3.0 adds Python wrap, 4.4.0
adds GPU inference. You can follow the instructions from the opencv
because that is where the SR interface code resides. You can choose to install all the
contrib modules or just the necessary SR one. The interface or module we will use is
called dnn_superres (dnn stands for Deep Neural Network; superres for Super
Resolution).
We need to download the pre-trained models separately, because the OpenCV code-
base does not contain them. The reason is some of the models are quite big. So if they
were in the standard code-base, people who might not need them still would have to
download them. There are several models to choose from (see section Models in this
article). All of them are implementations of popular SR papers. For now, let’s choose a
small model. You can download it here. This pre-trained model can increase the
resolution of an image by 2. For more models and their explanations, see section