logo

各位大神,我想问一下如何将图像标记的白色矩形框的坐标值提取出来?

2019-06-28 11:42
4
peter
if 90<statistics.l_mode()<110 and -35<statistics.a_mode()<16 and -28<statistics.b_mode()<20:#if the circle is white
                img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0))#识别到的白色圆形用红色的圆形框出来
                print(circle.x(),circle.y())
            else:
                img.draw_rectangle(area, color = (255, 255, 255))#将非黑、白色的圆用白色的矩形框出来
                wai = img.find_rects(threshold = 10000)
                x_error = wai[0]+wai[2]/2-img.width()/2        #左右偏移量
                y_error = wai[1]+wai[3]/2-img.height()/2       #上下偏移量
                print(x_error,y_error)![0_1561693260419_13-09-04-002.jpg](https://fcdn.singtown.com/7193a081-5396-4b27-8adb-aeab91271772.jpg)
2019-06-28 14:58
I
网红小智智 星瞳科技

c.x(), c.y()

2019-06-28 15:56
4
peter

好的,谢谢啦。在提出这个问题的时候我又仔细思考了下,是自己想复杂啦