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 个)
另请参阅
类别
在 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!