Clear Filters
Clear Filters

Image Reconstruction using Radial Basis Function?

16 views (last 30 days)
I am working on a project, Reconstruction of damaged Images using Radial Basis Function, and I don’t have any prior experience in image processing. I have didvided the process in these steps:
1. Introducing the Gaussian noise to a standard test image
2. Identify the destructed pixels. (zero value pixels)
3. Define a 5x5 window around that pixel.
4. Using the values of 5x5 neighboring pixels, form a system of linear equations and use LU factorization to find the value and write that value in the place of destructed pixel.
I have done first two steps, now I can’t figure out how to define 5x5 window around that pixel and then replace the value.
Kindly guide me here. Any algorithm, even barely related to this problem (just to give me an idea), would be appreciated. Thank you.

Answers (1)

Sindar on 29 Dec 2020
Some ideas for figuring out patches:
% load an example (color) image
corn_rgb = imread('corn.tif',2);
% get pixel rows, pixel columns, color channels (3)
imsize = size(corn_rgb);
% display image
% set up a new image to manipulate
corn_rgb2 = corn_rgb;
% "Identify" the destructed pixels
idx_bad = [500 13506];
% define extent of patch. Yours is 2 (pixel + 2 in each direction = 5x5), but 20 is more visible
patch_n = 20;
for ind=idx_bad
% find row and column from linear index
[row,col] = ind2sub(imsize(1:2),ind);
% compute patch rows and cols
patch_rows = row + [-patch_n:patch_n];
patch_cols = col + [-patch_n:patch_n];
% make sure you don't go off the edges
patch_rows(patch_rows<1 | patch_rows>imsize(1)) = [];
patch_cols(patch_cols<1 | patch_rows>imsize(2)) = [];
% Do something. Here, I make the patches white
corn_rgb2(patch_rows,patch_cols,:) = 255;

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!