how can i detect triangle
17 views (last 30 days)
Show older comments
Ahmad Jadoon
on 12 Jun 2016
Commented: Ahmad Jadoon
on 13 Jun 2016
how can i detect green colour triangle from pic
2 Comments
Accepted Answer
Image Analyst
on 12 Jun 2016
You can segment out that green triangle using either color or shape - your choice. I'm attaching demos for each. Feel free to adapt as needed.
3 Comments
Image Analyst
on 13 Jun 2016
Don't use for loops and simply vectorize it. Get rid of the size() and two for loops and simply have this:
% Extract the individual red, green, and blue color channels.
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
% Get pixels that are greener than they are red or blue.
Triangle = greenChannel > redChannel & greenChannel > blueChannel;
More Answers (1)
See Also
Categories
Find more on Red in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!