[英]How to create segmentation map for image in python
I have an image of a room and pixel coordinates from which I can generate lines.我有一个房间和像素坐标的图像,我可以从中生成线条。 These lines separate the room into wall, floor and ceiling segments.
这些线条将房间分成墙壁、地板和天花板部分。 I would like to create a segmentation map for this layout like in 1 .
我想为这个布局创建一个分割图,就像在1 中一样。 How can I do this in python?
我怎么能在python中做到这一点?
Separate comment for visibility.单独评论以提高可见性。 Credit to @ZarakiKenpachi.
归功于@ZarakiKenpachi。 I used cv2.fillPoly from open cv to generate polygons for each segment and combine them into one numpy array.
我使用 open cv 中的 cv2.fillPoly 为每个线段生成多边形并将它们组合成一个 numpy 数组。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.