How to fing COG?
1 回表示 (過去 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 件)
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!