Super Resolution is used to increase the resolution of low resolution image for better visualization purpose or for recognition purpose.
In this week post, we will again share a upcoming new feature for IPCV v1.2, –> Image Super Resolution. In general, the are numbers of algorithms for super resolution, which works on either single image of frames of images.
In this implementation, we will use the code posted quite some time ago : Usage of sparse matrix (SparseMat) 2: Super resolution (1).
Different with the original implementation, which generate the simulated low resolutions and used it in the same code for generating super resolution image, we modified the code with a more practical approach by using the LR images directly fed into Scilab function.
Reading Sequence of Images
Our inputs to the function are frames of images, and in order to make the code clean, we use Scilab list to store the images. Say our images are labelled with sequence number such as “input000.png”, “input001.png” …”input015.png”, there are 2 ways to import all the 16 images:
Method 1 : Manually Read Image 1-by-1
S = list(); S(1) = imread('input000.png'); S(2) = imread('input001.png'); ... S(16) = imread('input015.png');
Please take note that the ‘…’ in the code above means you have to enter the S(3), S(4)… etc.
Method 2 : Using For Loop
// Reading sequences of images S = list(); for cnt = 1:16 fn = "input" + msprintf("%.3d",cnt-1) + ".png"; S(cnt) = imread(fn); end
Let’s visualize all 16 low-resolution (LR) images:
for cnt = 1:16 subplot(4,4,cnt); imshow(S(cnt)); title(string(cnt)); end
Now, let’s feed the images in Scilab list into the function:
Sr = imsuperres(S,4,180);
after 180 iteration, the result would be returned in variable Sr, which has 4 times resolution compare to the input images.
Let’s compare the result with the normal resize output:
S2 = imresize(S(1),4); subplot(121); imshow(S2); title('Normal Resize'); subplot(122); imshow(Sr); title('Super Resolution');
(1) Source : http://opencv.jp/opencv2-x-samples/usage_of_sparsemat_2_superresolution
An implementation of Super resolution with Bilateral Total Variation – Implementation of a paper by Farsiu, S.,Robinson, D., Elad, M., Milanfar, P.”Fast and robust multiframe super resolution,” IEEETrans.ImageProcessing 13 (2004)1327-1344.