How to filter an RGB image and transform into an BW one.
1 view (last 30 days)
Show older comments
Shizuka
on 1 Mar 2013
Commented: poongothai rajan
on 23 Jun 2014
I have been trying to do that:
http://prntscr.com/umv66 -> http://goo.gl/Bgmv2 (You can ignore the red lines, I just added them to illustrate the final objective)
So, what I've done in the first case was: I transformed rgb -> hsv and picked up the s channel (a.k.a saturation). Then I used Otsu (called graythresh in matlab) to binarize and transform into a black and white picture. Everything worked perfectly.
Now, in the second case this doesn't work so well:
As you can see, the Otsu filter becomes useless in this case. Is there any workaround or other way I should be taking? Thanks in advance!
2 Comments
Accepted Answer
Image Analyst
on 1 Mar 2013
Edited: Walter Roberson
on 1 Mar 2013
I think you need to try some noise removal first. You can try a median filter first because it's easy. If that doesn't work, try a bilateral filter or a mean shift filter. After that you should be able to threshold it reasonably well in the Saturation channel. If you look at the image's 3D color gamut you'll see that it is like a slab but it's not radial along a constant hue - it's tilted in the Hue-Saturation plane, so to do the best job of segmentation you'll need to do principal components analysis and find the axis and then threshold in the PC2 or PC3 component. You could do the PCA in either RGB color space or HSV colorspace. However, if you look at it in LAB color space, it's pretty much has a constant "b" value with varying "a" value. So use makecform to convert to lab colorspace and threshold the "a" channel, after noise reduction of course. That would be my recommendation after inspecting the gamut with this.
6 Comments
poongothai rajan
on 23 Jun 2014
i just want to combine the above features and then have to use PCA for dimension reduction..if anyone know the idea can u please tell
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!