Here are my responses:
-
Where did you get the camera module(s)?
DLSCorp
Model number of the product(s).
IMX477, qty 2 B0241, qty1 B0280 -
What hardware/platform were you working on?
Linux Ubuntu -
Instructions you have followed. (link/manual/etc.)
IMX477 UVC Camera Adapter Board for 12MP Raspberry Pi HQ Camera cannot change settings manually - #3 by kosinski
https://docs.arducam.com/UVC-Camera/Adjust-the-minimum-exposure-time/
-
Problems you were having.
Exposure time not changing. FPS not changing as a result of exposure time not changing. -
The dmesg log from your hardware.
[ 4484.784407] usb 1-4: new high-speed USB device number 10 using xhci_hcd
[ 4484.941868] usb 1-4: New USB device found, idVendor=0c45, idProduct=636d, bcdDevice= 1.00
[ 4484.941883] usb 1-4: New USB device strings: Mfr=2, Product=1, SerialNumber=3
[ 4484.941889] usb 1-4: Product: Arducam IMX477 HQ Camera
[ 4484.941894] usb 1-4: Manufacturer: Arducam Technology Co., Ltd.
[ 4484.941898] usb 1-4: SerialNumber: UC517
[ 4484.947402] usb 1-4: Found UVC 1.00 device Arducam IMX477 HQ Camera (0c45:636d)
[ 4484.957101] input: Arducam IMX477 HQ Camera: Arduc as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.0/input/input19
[ 4484.963503] usb 1-4: 3:1: cannot get freq at ep 0x84
[ 4485.060078] usb 1-4: 3:1: cannot get freq at ep 0x84
[ 4485.063554] usb 1-4: 3:1: cannot get freq at ep 0x84
[ 4489.232807] usb 1-3: new high-speed USB device number 11 using xhci_hcd
[ 4489.401618] usb 1-3: New USB device found, idVendor=0c45, idProduct=636d, bcdDevice= 1.00
[ 4489.401634] usb 1-3: New USB device strings: Mfr=2, Product=1, SerialNumber=3
[ 4489.401641] usb 1-3: Product: Arducam IMX477 HQ Camera
[ 4489.401645] usb 1-3: Manufacturer: Arducam Technology Co., Ltd.
[ 4489.401649] usb 1-3: SerialNumber: UC517
[ 4489.404786] usb 1-3: Found UVC 1.00 device Arducam IMX477 HQ Camera (0c45:636d)
[ 4489.413423] input: Arducam IMX477 HQ Camera: Arduc as /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.0/input/input20
[ 4489.419686] usb 1-3: 3:1: cannot get freq at ep 0x84
[ 4489.595058] usb 1-3: 3:1: cannot get freq at ep 0x84
[ 4489.598095] usb 1-3: 3:1: cannot get freq at ep 0x84
- Troubleshooting attempts you’ve made.
I’ve written a script to measure the exposure time and it is remaining constant at about 0.1 seconds.
import cv2
import numpy as np
import time
from datetime import datetime
# Set the camera index (0 by default, or use 1, 2, etc. for multiple cameras)
camera_index = 2
camera_index2 = 4
# Open the camera capture
cap = cv2.VideoCapture(camera_index, cv2.CAP_V4L2)
cap2 = cv2.VideoCapture(camera_index2, cv2.CAP_V4L2)
# Check if the camera was opened successfully
if not cap.isOpened():
print("Failed to open camera")
exit()
# Set the camera properties (exposure, in this case)
cap.set(cv2.CAP_PROP_AUTO_EXPOSURE, 1) # Disable auto exposure
cap.set(cv2.CAP_PROP_EXPOSURE, 5000) # Set exposure value (0.1 seconds in this case)
cap.set(cv2.CAP_PROP_GAIN, 100) # Set exposure value (0.1 seconds in this case)
cap.set(cv2.CAP_PROP_FRAME_WIDTH,4056)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT,3040)
# Set the camera properties (exposure, in this case)
cap2.set(cv2.CAP_PROP_AUTO_EXPOSURE, 1) # Disable auto exposure
cap2.set(cv2.CAP_PROP_EXPOSURE, 5000) # Set exposure value (0.1 seconds in this case)
cap2.set(cv2.CAP_PROP_GAIN, 100) # Set exposure value (0.1 seconds in this case)
cap2.set(cv2.CAP_PROP_FRAME_WIDTH,4056)
cap2.set(cv2.CAP_PROP_FRAME_HEIGHT,3040)
Running = True
# Read and display frames from the camera
while Running:
Running = False
gray_images = []
gray_images2 = []
# Capture frame-by-frame
for i in range(8):
t1=time.time()
ret, frame = cap.read()
print(f"exposure_time: {time.time()-t1}")
ret, frame2 = cap2.read()
gray_image = cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)
gray_image2 = cv2.cvtColor(frame2,cv2.COLOR_BGR2GRAY)
gray_image=np.uint16(gray_image)
gray_image2=np.uint16(gray_image2)
gray_images.append(gray_image)
gray_images2.append(gray_image2)
image_added = np.zeros(gray_image[0].shape, dtype=np.uint16)
image_added2 = np.zeros(gray_image2[0].shape, dtype=np.uint16)
for image in gray_images:
image_added = image_added+image
for image2 in gray_images2:
image_added2 = image_added2+image2
image_scaled = cv2.normalize(image_added, dst =None, alpha = 0, beta = 65535, norm_type=cv2.NORM_MINMAX)
image_scaled2 = cv2.normalize(image_added2, dst =None, alpha = 0, beta = 65535, norm_type=cv2.NORM_MINMAX)
now = datetime.now() # current date and time
timestamp = now.strftime("%Y-%m-%d %H:%M:%S.%f")
cv2.imwrite(timestamp+'_image.png',image_scaled)
cv2.imwrite(timestamp+'_image2.png', image_scaled2)
# Release the capture and close all windows
cap.release()
cap2.release()
cv2.destroyAllWindows()
- What help do you need?
I would like to be able to change the exposure time.
I would like to upgrade the firmware to allow for longer exposure times than 1 second.
I would like to know the ranges of the settings for gain and exposure time after the firmware is upgraded.