How to find distorted pixel in a whole image in image restoration

2 views (last 30 days)
How to find a distorted/blurred pixel in a whole image in image restoration. Give me the code if available.
[Merged from duplicate post]
Can u give me a code to find a pixel in an image which is blurred. In my logic I have select a particular set of pixel with a neighboring pixels of 3*3 matrix i.e. A single pixel neighbored by 8 neighboring pixels. I want to find that middle pixel is blurred or not. How to find that pixel is blurred or not?

Answers (2)

Walter Roberson
Walter Roberson on 16 Jun 2013
Can u give me a code to find a pixel in an image which is blurred.
No. You would need additional information about the image to have any chance of guessing whether any particular pixel is blurred or is instead exactly the desired pixel.
Suppose I take a picture of my backyard, and there are spots that show up in the image. Are the spots blurred pixels? Maybe. Are the spots there because it was raining? Maybe. Do I want the spots to be removed (i.e., do I want the rain effect removed from the image), or do I want the spots to be kept (because what I was doing was taking a picture of the rain) ? If I was deliberately taking a picture of the rain then the blurred pixels are what should be there and should not be removed, but if the rain "got in the way" then the exact same blurred pixels should be removed. But how does the algorithm know anything about my intent when either way the starting image is exactly the same ?
You cannot program code to recognize intent, not without further input.

Image Analyst
Image Analyst on 31 May 2013
There's no way to tell unless you have the correct, undistorted image. It could be one in a million, or one in 18 million, depending on your camera. Here's an image
myImage = uint8(randi(255, [4008,2672]));
% Now distort one pixel located at row 100, column 200,
% by changing its value to 50.
myImage(100, 200) = 50;
Now, look at myImage, and without knowing what it was when it started, tell me the coordinates of the pixel I changed, and its original value. You can't.
  3 Comments
Algorithms Analyst
Algorithms Analyst on 3 Jun 2013
myImage function is...
you have created a random numbers matrix of size [4008 2672] and this matrix is multiplied by a factor 255 and then you have changes its class from double to uint8.
Image Analyst
Image Analyst on 4 Jun 2013
This creates an image of random values from 1 to 255. It really doesn't matter. The point was to drive home that point that if someone just hands you an image and asks you to identify the distorted pixel(s), you can't -- unless you know something about what their true values should be.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!