Centroid of a estimated polygon

1 次查看(过去 30 天)
Avinash Kumar
Avinash Kumar 2015-5-4
I have created a polygon using estimate geometry. I need to find the center/centroid of the polygon. I am using the below code to create the polygon.
if true
codematchedBoxPoints = boxPoints(boxPairs(:, 1), :);
matchedScenePoints = scenePoints(boxPairs(:, 2), :);
[tform, inlierBoxPoints, inlierScenePoints] = estimateGeometricTransform(matchedBoxPoints, matchedScenePoints, 'affine');
boxPolygon = [1, 1;size(boxImage, 2), 1;size(boxImage, 2), size(boxImage, 1);1, size(boxImage, 1);1, 1];
newBoxPolygon = transformPointsForward(tform, boxPolygon);
end
I need the centroid of the newBoxPolygon. Please help me how to do it.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Elementary Polygons 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by