Find local minima in x,y array. Need for careful elimination of Johnston noise in images.
Show older comments
I am trying to eliminate noise in images similar to the following so I may use them for VERY sensitive and precise pixel analysis later:

Note that the real image is 15MB at a much higher resolution.
My current image processing algorithm:
• reading all the images into a cell array
• converting each image into 3264x4928x3 doubles
• summing their components into a 3264x4928x1 double (this is because I only care about RGB not saturation or whatever like in im2gray) ~~~ 'im3{count}=im2{count}(:,:,1)+im2{count}(:,:,2)+im2{count}(:,:,1)'
• adding each image in quadrature into a single 3264x4928x1 double
From here I want to eliminate JUST the Johnston Noise (red haze) in the image, but leave the noise from the dead pixels so I can eliminate them by comparing two images and subtracting the similarities to make a third. The dead pixel noise tends to be only blue, green, or red, but NOT all three so their intensity using my algorithm will be around 1/3 of the maximum.
I then took my 3264x4928 matrix and uniformly scaled it so the highest intensity pixel was at intensity level 1000, and then rounded using ceil(x).
I then used a loop to scan through and count the number of pixels at each intensity value. I expected two roughly bell curve shapes. One for the Johnston noise and the other for the dead pixel noise, which is what I found:

The x-axis is the rounded intensity level of each pixel The y-axis is a count of the pixels in the image closest to each intensity level.
Exactly as expected. a peak at the low end for the Johnston noise and another peak at about 1/3 max intensity.
I am wondering if I should:
a) Scan the slopes of the linear fits of the 50 points on each side of each point between 200 and 450 and find the point where the left slope is negative, the right slope is positive AND the slope change is the greatest.
b) Use some function (which I don't know about) to do it for me (whose precision and accuracy I worry about).
I'm not sure which would give me better results so I'm hesitant at this point. Then from here I can go back to the original image, eliminate everything under the threshold that I just found, and compare two images to find the dead pixels.
Does anybody have any suggestions on finding this minimum where I should cut everything before it off? Or should I have an entire different approach to this whole problem in general.
Accepted Answer
More Answers (1)
Image Analyst
on 3 Apr 2014
0 votes
If you want to "Find local minima in x,y array" then use imregionalmin() in the Image Processing Toolbox. It finds all regional mins, no matter how bright or dark. If you only want ones less than some value, then you can AND it with a thresholded image that gets mins in the intensity range you want.
3 Comments
Kyle Bryenton
on 4 Apr 2014
Image Analyst
on 4 Apr 2014
Get the histogram
[pixelCount, grayLevels] = imhist(grayImage, 256);
This gives you the count at every intensity, not just "various" intensities. Then find the max count(s):
[maxCount, indexOfMaxCount] = max(pixelCounts);
I'm not clear on what you want to do after that.
Kyle Bryenton
on 4 Apr 2014
Edited: Kyle Bryenton
on 4 Apr 2014
Categories
Find more on Image Quality in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



