How can I reconstruct an RBG image?

I have the following image. Is there any way to reconstruct this image without all the noise and the blurring in it (with the same color of each fringe)?
In other words, I want to make these colored fringes on a black ground.

Réponses (2)

Image Analyst
Image Analyst le 18 Sep 2019
How about this, using the attached data in answers.mat:
s = load('answers.mat')
red = repmat(s.red, [1699, 1]);
green = repmat(s.green, [1699, 1]);
blue = repmat(s.blue, [1699, 1]);
rgbImage = uint8(cat(3, red, green, blue));
imshow(rgbImage);
axis('on', 'image');
0000 Screenshot.png

4 commentaires

Muhamed Sewidan
Muhamed Sewidan le 18 Sep 2019
Thank you for your answer, I think you have done a great job.
but there is one key component missing in the image, as you can see there is a shift for each fringe, the following image can describe the fringes and their shifts.
I had an idea that the Matlab can analyze each fringe colour and then redraw them again in their original path that includes the shits. Is it possible?
Thank you in advance.dr= 1.15.jpg
Muhamed Sewidan
Muhamed Sewidan le 19 Sep 2019
Excuse me but could you please tell how did you generate the answers file with the red, green and blue values?
Image Analyst
Image Analyst le 19 Sep 2019
I took the average profile over a section of "good" rows in original image, then replicated it for the entire height of the image.
I assume the glitches were noise that you said you did not want, so I ignored them.
If you just want simple noise reduction, maybe you should try something like medfilt2() to do a median filter.
Muhamed Sewidan
Muhamed Sewidan le 19 Sep 2019
How can I take the average profile (exuse me as I'm a beginner)? could you please tell me how to do it?
Acutally the shift in every fringe is the cornerstone of my image, therefore I want to neglect all the features of the image excpet every fringe and its shift. In other words, in my work i took images that have some problems such as noise, blurring and some unwanted objects (scratches on the slide of the specimen or dust particles). I had an idea that I can reconstruct the damaged image to create new one with the main features of the original image and without these problems.

Connectez-vous pour commenter.

James Heselden
James Heselden le 6 Nov 2019
I have tried to find you a solution which will work with any image you want, however I am only able to test this system on the single image you have provided. The following script has given me the attached output image. I hope this will help you with your project.
%Read in the image you want
I = imread('image.png');
%Extract and binarize the relevant colour channels
redChannel=imbinarize(I(:,:,1), 0.8);
greenChannel=imbinarize(I(:,:,2), 0.4);
%Filter the image
filtered = medfilt2(redChannel+greenChannel);
%Convert to binary mask
mask=imbinarize(filtered,0.3);
%Apply the mask to the colour channels
Ir = I(:,:,1); Ir(~mask)=0;
Ig = I(:,:,2); Ig(~mask)=0;
Ib = I(:,:,3); Ib(~mask)=0;
%Compile the output image
I_coloured(:,:,1) = Ir;
I_coloured(:,:,2) = Ig;
I_coloured(:,:,3) = Ib;
imagesc(I_coloured)
I_coloured.png

Catégories

Produits

Version

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by