我无法从python代码中了解这种形状

时间:2019-03-24 02:55:47

标签: python-3.x numpy opencv

我是python的新手。我在Google上搜索有关python代码的信息,以进行路牌检测,我找到了一些代码,但我不明白该代码的含义。

elif dominant_color[0] > 80:
            zone_0 = square[square.shape[0]*3//8:square.shape[0]
                            * 5//8, square.shape[1]*1//8:square.shape[1]*3//8]
            cv2.imshow('Zone0', zone_0)
            zone_0_color = warnadominan(zone_0, 1)

            zone_1 = square[square.shape[0]*1//8:square.shape[0]
                            * 3//8, square.shape[1]*3//8:square.shape[1]*5//8]
            cv2.imshow('Zone1', zone_1)
            zone_1_color = warnadominan(zone_1, 1)

            zone_2 = square[square.shape[0]*3//8:square.shape[0]
                            * 5//8, square.shape[1]*5//8:square.shape[1]*7//8]
            cv2.imshow('Zone2', zone_2)
            zone_2_color = warnadominan(zone_2, 1)

预先感谢

1 个答案:

答案 0 :(得分:0)

Assuming square has shape (8, 8)

我认为此图可能会有所帮助:

enter image description here

编辑:代码正在尝试提取图像中显示的区域