How could get the texture of a flower in a plant with stdfilt() function in MATLAB?

Hello,
How stdfilt() should be used to get the texture of a part of an image?
For example the attached images.

10 commentaires

Hello Sir, So shouldn't I asked this question?
It is a related question that could probably have been merged with the other question; but it could also potentially stand alone.
However, any time you ask a question about image processing, it helps to include sample images. Your previous question that I linked to had samples of some of the images you need to process in connection with this newer question, so people can have a look there to get an idea of what your images look like.
Thank you for your comment. But as my previous question was closed because it was unclear so I thought it might be better to ask my question this way. Sure I will add related images now.
You asked the exact same question minutes apart but attached pictures to the newer one. I closed the older copy that did not have images and left the newer copy that did have images.
Thank you so much. First I forgot to attach my images and then I wanted to edit my question by adding some images. I must have done a mistake.
In order to take advantage of texture, you need every similar image that needs to match to be on the same scale, unless you can find some way to match textures at different scales.
Your two sample images here are taken at fairly different scales: different enough that a simple foreground vs background coverage fraction would be enough to distinguish between the two cases if all of images of the same flower are at the same range.
Thank you, Sir. Actually, they are the same size, I cropped them just to be able to upload it here. I need to do flower detection and I have two kinds of plants for now; Sorghum and Yufeng. Could you please guide me more that what could be the best approach to this problem?
Remove the background. Do a detection for bright yellow: if you find it then it must be Yufeng. Otherwise detect green, and find the mean brightness: the Yufeng is notably darker.

Connectez-vous pour commenter.

 Réponse acceptée

I'd use imsplit() to get the individual color channels and then call stdfilt() on each color channel individually.

3 commentaires

Thank you Image Analyst,But Could you please explain more about stdfilt() and how the results of this function are interpreted?
Regions that vary a lot in gray level (complicated parts with lots of leaf edges) will have high values. Regions that are smooth will have low stddev values. Just try it and see:
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
windowWidth = 15; % Whatever...
sdRed = stdfilt(recChannel, ones(windowWidth));
imshow(sdRed, []);
% Same for green and blue.
Thank you so much for your guidance.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by