logo

示例代码,包装盒子上淘宝二维码识别不出来什么情况?

2021-02-27 18:10
Z
sgyu

# QRCode Example

#

# This example shows the power of the OpenMV Cam to detect QR Codes

# using lens correction (see the qrcodes_with_lens_corr.py script for higher performance).

import sensor, image, time

sensor.reset()

sensor.set_pixformat(sensor.RGB565)

sensor.set_framesize(sensor.QVGA)

sensor.skip_frames(time = 2000)

sensor.set_auto_gain(False) # must turn this off to prevent image washout...

clock = time.clock()

while(True):

clock.tick()

img = sensor.snapshot()

img.lens_corr(1.8) # strength of 1.8 is good for the 2.8mm lens.

for code in img.find_qrcodes():

img.draw_rectangle(code.rect(), color = (255, 0, 0))

print(code)

print(clock.fps())

2021-02-28 10:19
Z
sgyu

测试发现OpenMV Cam使用镜头校正来检测QR码的功能,未能识别部分二维码。不做镜头校正可以识别

2021-03-02 16:14
I
网红小智智 星瞳科技

如果是OV5640就不用矫正。