Recognize some objects and delete other objects from image

조회 수: 3 (최근 30일)
Samia Sanjari
Samia Sanjari 2016년 2월 10일
댓글: Samia Sanjari 2016년 2월 12일
How can i isolate my green '+' selected objects from the other objects.I only want to plot the green objects and want to delete others object from my image.I need an idea to do that.

답변 (2개)

Samia Sanjari
Samia Sanjari 2016년 2월 11일
Hello Image analyst Do you have any idea how can i do that?I already selected my objects and marked them by green '+'.I only want to show these green selected objects in my image.
Thanks in advance

Image Analyst
Image Analyst 2016년 2월 11일
Basically you need to find everything except squares. You can do that by adapting my attached shape recognition demo.
  댓글 수: 3
Image Analyst
Image Analyst 2016년 2월 12일
First find the green where the red and blue channel are low and the green value is high.
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
greenCrosses = greenChannel > t1 & redChannel < t2 & blueChannel < t3;
Next find white where all channels are high.
whiteBackground = greenChannel > t1 & redChannel > t1 & blueChannel > t1;
Then use imclearborder() to get rid of the surround.
shapesOnly = imclearborder(whiteBackground);
Then use imreconstruct with the white image and the green image to get only those shapes with green on them.
See if you can finish the code.
Samia Sanjari
Samia Sanjari 2016년 2월 12일
Thank you.I will let you know .

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by