Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I want to degrade the image, and then execute the restoration, such as a lena.jpg.

I tried this:

lena = ExampleData[{"TestImage", "Lena"}];
lena1 = GaussianFilter[lena, 5] 

With these get stained image lena1.jpg is stained image from lena this image use for recognition in folow step

 ImageDeconvolve[lena1, GaussianMatrix[5.10]]

only parameter 5.10 gives beter picture then lena1.jpg

Then this I have three pictures "lena.jpg"-original image, "lena1.jpg"-degraded image and Image after deconvolve - Restoration image.

Problem: 1) I do not know which settings (filters) to apply during restoration pictures and 2) Which function to use when degradation and restoration during which, as you know?

Whether we can write a concrete example of an image degradation and restoration so obtained images?

Sorry for my English... :)

share|improve this question
    
Hi, welcome to Mma.SE, please change to a nicer name for better identification. –  mm.Jang Jun 11 '13 at 15:18
    
Can you please post lena.jpg somewhere, like on imgur, and then link to the picture here? Alternatively, did you know about ExampleData[{"TestImage", "Lena"}]? –  J. M. Jun 11 '13 at 15:21
    
BTW, you should use (* and *) for comment in Mathematica. –  mm.Jang Jun 11 '13 at 15:27
    
Please could you provide complete examples (what is the "stained" image?) and valid code (rather than this odd markup)? Thanks. –  Oleksandr R. Jun 11 '13 at 18:39
2  
Does "degradation" always mean that a GaussianFilter has been applied? I wouldn't think so, but the restoration depends a lot on what type of degradation you have. –  Jens Jun 11 '13 at 23:42
show 2 more comments

2 Answers 2

If you are asking about what value you need to set in the ImageDeconvolve[lena1.jpg, GaussianMatrix[value]] command, I'm not sure it can be calculated in an analytical way. In my experience it is best to create a table (list) of deconvoluted images with different GaussianMatrix values and then visually determine the best value. You could probably automate this with contrast calculation but I'm sceptical of the results. For example:

lena = ExampleData[{"TestImage", "Lena"}];
lena1 = GaussianFilter[lena, 5];
t = Table[ImageDeconvolve[lena1, GaussianMatrix[n]], {n, 1, 10}];
contrast[image_] := Total[Table[(i - j)^2, {i, 256}, {j, 256}] * 
ImageCooccurrence[image, 256] / 255^2, 2]; (* from: ref/ImageCooccurrence *)
ListLinePlot[contrast /@ t, Mesh -> All]

Resulting plot: contrast_plot

share|improve this answer
    
I'm new to all this. There is but one example of the current knowledge tungsten Mathematica not able to fully interpret. Here's the link demonstrations.wolfram.com/ImageRestorationForDegradedImages –  zokinp Jun 16 '13 at 18:53
add comment

The deconvolution kernel should be an estimate of the point spread function degrading the image. In your case this is known to be GaussianMatrix[5] as that is what you used to blur the image.

lena = ImagePad[ExampleData[{"TestImage", "Lena"}], -100];
lena1 = GaussianFilter[lena, 5];
ImageDeconvolve[lena1, GaussianMatrix[5]]

enter image description here

To suppress the high spatial frequency artefacts it is probably better to adjust the regularization parameter than to change the kernel:

ImageDeconvolve[lena1, GaussianMatrix[5], Method -> {"DampedLS", 0.002}]

enter image description here

share|improve this answer
    
How to recognition this image? –  zokinp Jun 16 '13 at 19:08
    
imgur.com/EYP0B0z –  zokinp Jun 16 '13 at 19:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.