小编use*_*276的帖子

用python计算灰度图像中遮罩的面积(以像素为单位)

下面的硬币图是具有不同蒙版(以不同颜色显示)的灰度图像。有没有办法用python计算灰度图像中每个硬币的这些掩码的面积(以像素为单位)。

在此处输入图片说明

硬币面具的标签

{"classes": [{"title": "coin1", "shape": "polygon", "color": "#BE5C3C", "geometry_config": {}}, {"title": "coin2", "shape": "polygon", "color": "#961D82", "geometry_config": {}}, {"title": "coin3", "shape": "polygon", "color": "#C1BB5C", "geometry_config": {}}, {"title": "coin4", "shape": "polygon", "color": "#D0021B", "geometry_config": {}}, {"title": "coin5", "shape": "polygon", "color": "#417505", "geometry_config": {}}], "tags": []}
Run Code Online (Sandbox Code Playgroud)

硬币掩码的注释

{"tags": [], "description": "", "objects": [{"description": "", "bitmap": null, "tags": [], "classTitle": "coin1", "points": {"exterior": [[59.0, 85.0], [65.0, 70.0], [76.0, 63.0], [89.0, 61.0], [105.0, 63.0], [116.0, 78.0], [118.0, 98.0], [103.0, 117.0], [80.0, 118.0], [61.0, …
Run Code Online (Sandbox Code Playgroud)

python image mask image-processing

4
推荐指数
1
解决办法
4166
查看次数

标签 统计

image ×1

image-processing ×1

mask ×1

python ×1