Segment Coordinates of split screen
1 view (last 30 days)
Show older comments
Steven Moran
on 27 Dec 2017
Commented: Walter Roberson
on 29 Dec 2017
I split screen into segments for my classifier. I don't just want to classify each segment, I want the pixel coordinates of each segment as well. How do I do this?
thanks
0 Comments
Accepted Answer
Walter Roberson
on 27 Dec 2017
Are the segments all the same size? If so then you should be able to easily convert segment index to screen coordinates.
coordinates_of_start = (index - 1) * width_in_this_direction + 1;
coordinates_of_end = index * width_in_this_direction;
2 Comments
Walter Roberson
on 29 Dec 2017
index is the number of the segment in a particular direction. So the 3rd segment down, 4th over, would call for index numbers 3 for vertical direction and 4 for horizontal direction.
More Answers (1)
Image Analyst
on 28 Dec 2017
Edited: Image Analyst
on 28 Dec 2017
What do you mean by segmentation for your classifier? Is it like you want to segment the standard peppers.png demo image into purple region(s), red regions, green regions, and yellow regions, and you want the pixel coordinates of each segment (each class)? And you want to split up the screen to show masks for each segmentation (class)? If so, you can segment the image using whatever method you want, such as classify() function or the Color Thresholder app, then take the mask for each color class and use find() or regionprops() to get the (x,y) coordinates for each class.
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!