find foreground pixels in each segments in grid
조회 수: 2 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Image Analyst
2017년 2월 22일
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);
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!