find foreground pixels in each segments in grid
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.
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);
1 Comment
Raghu Rao
on 22 Feb 2017
Categories
Find more on Modify Image Colors 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!