find foreground pixels in each segments in grid
2 views (last 30 days)
Show older comments
i want to find the foreground pixels in each segments in grid after finding the foreground pixel i want to find center of mass in each segments and i want to add nodes based on center of mass.
0 Comments
Answers (1)
Image Analyst
on 22 Feb 2017
Like we've told you in some of your prior posts, extract each tile/block. Then use find() to get the rows and columns, then take the mean of those numbers to get the centroid.
[y, x] = find(yourImage(row1:row2, col1:col2));
centroidX = mean(x);
centroidY = mean(y);
See Also
Categories
Find more on Convert Image Type in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!