Removing outliers from a grey-scale image
17 views (last 30 days)
Show older comments
I have an images sequence representing depth information which I'd like to clean. There are some outliers (values with intensity below 25, for a 0-255 range) which I would like to be filled with an acceptable alternative (an average value localised to that specific area could be a good guess).
Can someone see a simple way to do this? I've tried to use a median filter (filter size of 10) substituting the undesired values with NaN, but it did worsen the situation, which improves instead by substituting them with a general average value.
-
P.S. Someone has already suggested me to use a fast wavelet reconstruction, but I would not really know where to start...
0 Comments
Answers (1)
Image Analyst
on 5 Apr 2013
It looks like all your outlier data is dark. So I'd just threshold it and then use roifill() to smear the surrounding area into the black areas.
binaryImage = grayImage < 50; % or whatever.
binaryImage = imdilate(binaryImage, true(5)); % Enlarge it somewhat.
fixedImage = roifill(grayImage, binaryImage);
Try that. You might have to play around with the dilation amount and the threshold value.
0 Comments
See Also
Categories
Find more on Kinect For Windows Sensor 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!