mlx90640调色问题 调色不一致
-
import image, time, fir drawing_hint = image.BICUBIC # or image.BILINEAR or 0 (nearest neighbor) # Initialize the thermal sensor fir.init() w = fir.width() h = fir.height() if (fir.type() == fir.FIR_MLX90621): w = w * 10 h = h * 10 elif (fir.type() == fir.FIR_MLX90640): w = w * 10 h = h * 10 elif (fir.type() == fir.FIR_MLX90641): w = w * 10 h = h * 10 elif (fir.type() == fir.FIR_AMG8833): w = w * 20 h = h * 20 # FPS clock clock = time.clock() while (True): clock.tick() try: img = fir.snapshot(x_size=w, y_size=h, color_palette=fir.PALETTE_IRONBOW, hint=drawing_hint, copy_to_fb=True) except OSError: continue # Print FPS. print(clock.fps())
为什么例程里这张图mlx90640调色是这样的
而我仿照编写的程序 为了放在摄像头图像上import image, time, fir, sensor drawing_hint = image.BILINEAR # or image.BILINEAR or 0 (nearest neighbor) or image.BICUBIC # Initialize the thermal sensor sensor.reset() #初始化摄像头,reset()是sensor模块里面的函数 sensor.set_pixformat(sensor.RGB565) #设置图像色彩格式,有RGB565色彩图和GRAYSCALE灰度图两种 sensor.set_framesize(sensor.QVGA) #设置图像像素大小 sensor.skip_frames(time = 2000) fir.init(type=fir.FIR_MLX90640, refresh=32) w = fir.width()*10 h = fir.height()*10 ir_buffer = fir.snapshot(x_size=w, y_size=h, pixformat=sensor.GRAYSCALE) clock = time.clock() while (True): clock.tick() img = sensor.snapshot() ta, ir, to_min, to_max = fir.read_ir() to_max=to_max/0.92 fir.draw_ir(ir_buffer, ir, alpha=256, hint=drawing_hint) img.draw_image(ir_buffer, 0, 0, alpha=256,color_palette=fir.PALETTE_IRONBOW)
出来的图像调色是这样的
怎么才能变成上面那幅图的调色
-
我怎么感觉图像颜色反了,温度越低反而越深,怎么调整一下比较合适
-