how to select the parts/objects in an image

39 次查看(过去 30 天)
I want to select the specific parts of an image, like I have a plant image and in that iamge I need to to select/highlight/ the flowers and other parts, how to do that plz guide, what is the best way to do that?

回答(2 个)

Sarvesh Kale
Sarvesh Kale 2023-3-7
If you are trying to segment an image then you can do the following
img=imread('peppers.png');
imageSegmenter(img)
An Image segmentation App will open which will allow you to highlight the specific patches in image. Follow the steps
  1. open App using the imageSegmenter(img)
  2. Select Draw ROIs
  3. Select freehand drawing and highlight the parts you want in image
  4. Exit ROI
  5. Click on export
More information on image segmentation can be found in the following documentation
If you want to crop a part of image and further use the image patch for image processing then take a look at imcrop function
I hope this helps your query, please accept the answer if it does
Thank you
  4 个评论
Aiman Zara
Aiman Zara 2023-3-10
unfortunately that didnot work for me, is their anyother way? I am attaching refernce pic to get you an idea to help me more.
Sarvesh Kale
Sarvesh Kale 2023-3-10
I have ran out of ideas, do not want to keep you waiting !

请先登录,再进行评论。


Image Analyst
Image Analyst 2023-3-10
It's a generic, general purpose demo of how to threshold an image to find blobs, and then measure things about the blobs, and extract certain blobs based on their areas or diameters.
You can also try my other demos in there on color segmentation, or you can try the Color Thresholder on the Apps tab of the tool ribbon.
  2 个评论
Aiman Zara
Aiman Zara 2023-3-10
编辑:Aiman Zara 2023-3-10
@Image Analyst when I run that code it says: Error using nargon. As I am a beginner, dont know much coding, the code you shared is quite large for me to handle. Can u please specify the code for detecting specific objects in an image and then counting those specified objects? Sample pictures are attached from which I need to detect objects/part in an image and after detecting i need to count them too.
Image Analyst
Image Analyst 2023-3-10
In a nutshell, here are the essentials of image processing:
mask = grayImage > someThreshold;
props = regionprops('table', mask);
If you want more details, then that's what my tutorial does in well-commented, excruciating detail.

请先登录,再进行评论。

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by