How to fing COG?
조회 수: 6 (최근 30일)
이전 댓글 표시
Hi,
How to find the center of gravity of image along the x direction of the line?
Thanks in advance
댓글 수: 0
채택된 답변
Image Analyst
2012년 5월 23일
It's just the usual formula, the sum(x .* intensity) / sum(intensity). It's like the intensity cancels out and you're left with the weighted x value.
댓글 수: 2
Image Analyst
2012년 5월 24일
oneRowIntensity = image2D(theRowYouWant, :);
x = 1:size(image2D, 1);
Then use the formula I gave you, and save it using save() or imwrite() or into a variable. Put that into a loop if you want to do it for all the rows that you want to do it over.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!