logo

使用cascade文件,是不是要吧圖像弄成灰才能夠識別呢?為什麼我彩色的,總是沒有識別出來?

2020-04-15 09:53
B
gohw

使用cascade文件,是不是要吧圖像弄成灰才能夠識別呢?為什麼我彩色的,總是沒有識別出來?

2020-04-15 14:29
I
网红小智智 星瞳科技

提供一下全部代码和cascode文件。我测试一下。

2020-04-15 14:41
B
gohw


import sensor, time, image
sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)
sensor.set_framesize(sensor.LCD)
sensor.skip_frames(time = 2000)
sensor.set_auto_gain(False)
sensor.set_framesize(sensor.LCD)
sensor.set_auto_whitebal(False)
stopgrey_cascade = image.HaarCascade("stopgrey.cascade", stages=25)
print(stopgrey_cascade)
clock = time.clock()

while (True):
    clock.tick()
    img = sensor.snapshot()
    objects = img.find_features(stopgrey_cascade, threshold=0.75, scale_factor=1.25)

    for r in objects:
        img.draw_rectangle(r)

    print(clock.fps())
B
gohw

@kidswong999 文件怎么上传呢?

B
gohw
21df1292-27fc-4ad0-9554-68d35d63c182.jpg
B
gohw

@gohw 图片为上图

2020-04-16 17:42
I
网红小智智 星瞳科技

haar算法只能使用灰度的。