ArduCAM / RaspberryPi

This is Arducam camera demos used on Raspberry Pi paltform
BSD 3-Clause "New" or "Revised" License
162 stars 97 forks source link

Selecting camera A sometimes produces garbage #31

Open rafitzadik opened 4 years ago

rafitzadik commented 4 years ago

I use the code below with the multicam board revision 2.2, and while most pictures come out correctly, I occasionally get a bad picture like this: pic-1584650521-1-reduced

This only happens with camera A. As the code continues with camera B and C, these work well.

Any ideas why? I do need full resolution, but don't care much about speed of execution. If more sleep() commands would help, that is fine...

code snippet:

` i2c = "/usr/sbin/i2cset -y 1 0x70 0x00 0x04" os.system(i2c) gp.output(7, False) gp.output(11, False) gp.output(12, True) time.sleep(1) with PiCamera() as camera: camera.annotate_background = picamera.Color('black') camera.annotate_text = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') camera.resolution = (3280,2464) print("Starting camera 1 warmup preview") camera.start_preview() time.sleep(5) print("Camera 1 Exposure Parameters: Speed: ", camera.exposure_speed, " AWB: ", camera.awb_gains); speed = camera.exposure_speed; awb = camera.awb_gains; camera.exposure_mode = 'off' camera.awb_mode = 'off' camera.shutter_speed = speed camera.awb_gains = awb camera.capture("{0}-1.jpg".format(name))

i2c = "/usr/sbin/i2cset -y 1 0x70 0x00 0x05"
os.system(i2c)
gp.output(7, True)
gp.output(11, False)
gp.output(12, True)
time.sleep(1)
with PiCamera() as camera:
    camera.annotate_background = picamera.Color('black')
    camera.annotate_text = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
    camera.resolution = (3280,2464)
    camera.exposure_mode = 'off'
    camera.awb_mode = 'off'
    camera.shutter_speed = speed
    camera.awb_gains = awb
    print("Camera 2 Exposure Parameters: Speed: ", camera.exposure_speed, " AWB: ", camera.awb_gains);
    camera.capture("{0}-2.jpg".format(name))

i2c = "/usr/sbin/i2cset -y 1 0x70 0x00 0x06"
os.system(i2c)
time.sleep(1)
gp.output(7, False)
gp.output(11, True)
gp.output(12, False)
with PiCamera() as camera:
    camera.annotate_background = picamera.Color('black')
    camera.annotate_text = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
    camera.resolution = (3280,2464)
    camera.exposure_mode = 'off'
    camera.awb_mode = 'off'
    camera.shutter_speed = speed
    camera.awb_gains = awb
    print("Camera 3 Exposure Parameters: Speed: ", camera.exposure_speed, " AWB: ", camera.awb_gains);
    camera.capture("{0}-3.jpg".format(name))

`