提问人:Amir133 提问时间:11/13/2023 更新时间:11/13/2023 访问量:32
树莓派相机图像颜色与真实颜色不同
Raspberry Pi camera image color are diffrent from real colors
问:
我是 Raspberry Pi 的新手,我正在使用 500 万像素的 Raspberry Pi 相机 1.3 版,我已经用它拍照了。但是拍摄的照片的颜色与物体的实际颜色不同。我想知道为什么会这样?以及如何使图像更接近真实颜色? 谢谢
Raspberry Pi 相机图像:
实物图像(使用手机)
我的树莓派相机配置:
from picamera.array import PiRGBArray
from picamera import PiCamera
import time
import cv2
import operationFramesFuncShape
camera = PiCamera()
camera.resolution = (980, 480)
camera.framerate = 32
camera.rotation = -90
rawCapture = PiRGBArray(camera, size=(980, 480))
# allow the camera to warmup
time.sleep(0.1)
g = camera.awb_gains
camera.awb_mode = 'off'
camera.awb_gains = g
oclass = operationFramesFuncShape.objectFrameClass()
for frame in camera.capture_continuous(rawCapture, format="bgr", use_video_port=True):
# grab the raw NumPy array representing the image, then initialize the timestamp
# and occupied/unoccupied text
image = frame.array
答:
1赞
Tomasz Jędrzejczyk
11/13/2023
#1
您是否尝试过调整白平衡? 请尝试:camera.awb_gains = (1.5, 1.5) 并根据您的需要调整值。
还有为什么分配 g = camera.awb_gains 然后 camera.awb_gains = g ?
评论
0赞
Amir133
11/14/2023
谢谢@tomasz-jędrzejczyk,最后我设置了它,它解决了。camera.awb_gains = (1.8, 1.4)
评论