I am trying to process a picture. There is an RGB leaf photograph and I want to exract the leaf's itself only.
The procedure I follow is
As you see the shadow on the bottom right corner sticks to the BW image. Is there a method to select the leaf only.
I = imread(files{404});
hcsc = vision.ColorSpaceConverter;
hcsc.Conversion = 'RGB to intensity';
Ig = step(hcsc, I);
medFilt= vision.MedianFilter([f f]);
Ig = step(medFilt, Ig);
at = vision.Autothresholder;
Ibw = step(at, Ig);
Instead of converting to grayscale image, I convert it to HSV and take its V part. It results better now.
I = imread(files{404});
I = rgb2hsv(I);
Ig = I(:,:,3);
medFilt= vision.MedianFilter([f f]);
Ig = step(medFilt, Ig);
at = vision.Autothresholder;
Ibw = step(at, Ig);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With