4
4uva
@4uva
0
声望
4
楼层
329
资料浏览
0
粉丝
0
关注
4uva 发布的帖子
-
RE: 拍的图片不对,内容有错位现象
import cpufreq import pyb import sensor,image, time,math from pyb import LED,Timer,UART sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.QQVGA) # Set frame size to QVGA (320x240) sensor.skip_frames(time = 2000) #延时跳过一些帧,等待感光元件变稳定 sensor.set_auto_gain(False) sensor.set_auto_whitebal(False) clock = time.clock() # Create a clock object to track the FPS. sensor.set_auto_exposure(True, exposure_us=5000) # 设置自动曝光 qrcodes_flag=0 def opv_find_qrcodes(): #sensor.skip_frames(30) global qrcodes_flag sensor.set_auto_gain(False) img = sensor.snapshot() img.lens_corr(1.5) # strength of 1.8 is good for the 2.8mm lens. for code in img.find_qrcodes(): clock.tick() img.draw_rectangle(code[0:4]) qrcodes_flag += 1 if(qrcodes_flag==5 ):# img.save("/example1.jpg") if(qrcodes_flag==10):# img.save("/example2.jpg") if(qrcodes_flag==15):# img.save("/example3.jpg") print(code) opv_find_qrcodes()