Halcon - 获取世界坐标中的区域面积。

问题描述 投票:0回答:1

我有以下代码。

image_points_to_world_plane (CamParam, Pose, intersection_points_row, intersection_points_col, 'mm', X1, Y1)
distance_pp (X1[2], Y1[2], X1[3], Y1[3], Measure1)

这段代码是以毫米为单位来计算的

现在代码如下图所示,我需要Regions1的面积,单位是mm²。相反,我得到的是以像素为单位。

access_channel(Image, ImageMono, 1)

threshold(ImageMono, Region, 0, 100)
fill_up(Region, RegionFillUp)

reduce_domain(ImageMono, RegionFillUp, ImageReduced)

threshold (ImageReduced, Regions1, 230, 255)
connection (Regions1, Connection)
select_shape(Connection, Labels, 'area', 'and', 2000, 99999)
area_center(Labels, AreaLabels, RowLabels, ColumnLabels)

AreaLabels 但我找不到类似 region_to_world_plane 的东西......怎么做呢?

coordinates region halcon
1个回答
1
投票

试着看一下操作符 "image_to_world_plane"。它将转换图像,使像素大小以公制单位(或任何你喜欢的单位)为单位。它还会扭曲图像,使它看起来就像图片是直接从头顶拍摄的。然后,你在这个转换后的图像上执行的任何面积计算都将以你指定的单位(毫米、米等)进行。

© www.soinside.com 2019 - 2024. All rights reserved.