**Describe what it is that you want to accomplish**
I am attempting to determine the noise floor of the camera by capturing images at various exposure times and then analyzing the average pixel intensities. I expect the pixel intensity values to vary with changes in exposure time, particularly I'm using raw capture without any demosaicing to get true sensor output in a grayscale format.
I want an array of counts basically. The amount of counts hitting each pixel.
**Describe alternatives you've considered**
I've attempted both capturing raw images directly using libcamera-raw command and also through a Python script utilizing Picamera2. The pixel values I retrieve are always between 254-256, regardless of the exposure time set (ranging from 100 microseconds to 1 second). I'm doing this with the camera covered to see if I can get some values for electronic noise / dark current noise, but the values are always the same. I'm assuming this suggests an issue with how I am capturing or interpreting the raw data. Here's what I've tried:
Adjusting the camera settings such as exposure time and analog gain.
Using different methods to capture and process the raw data.
Checked this behavior with a brand new camera module to ensure hardware issues like my chemically removed Bayer filter aren't influencing results. (It isnt)
**Additional context**
Below is the Python code I've been using for these tests. It configures the camera, captures images at different exposure times, and calculates average pixel intensities. Despite the camera being covered, the pixel intensities remain consistently at ~255 across all exposure settings, which is unexpected and leads me to suspect a flaw in how the raw data is being captured or processed.
I also used this command with libcamera-raw which shows the same issue:
I am most likely missing something very simple...
I am attempting to determine the noise floor of the camera by capturing images at various exposure times and then analyzing the average pixel intensities. I expect the pixel intensity values to vary with changes in exposure time, particularly I'm using raw capture without any demosaicing to get true sensor output in a grayscale format.
I want an array of counts basically. The amount of counts hitting each pixel.
**Describe alternatives you've considered**
I've attempted both capturing raw images directly using libcamera-raw command and also through a Python script utilizing Picamera2. The pixel values I retrieve are always between 254-256, regardless of the exposure time set (ranging from 100 microseconds to 1 second). I'm doing this with the camera covered to see if I can get some values for electronic noise / dark current noise, but the values are always the same. I'm assuming this suggests an issue with how I am capturing or interpreting the raw data. Here's what I've tried:
Adjusting the camera settings such as exposure time and analog gain.
Using different methods to capture and process the raw data.
Checked this behavior with a brand new camera module to ensure hardware issues like my chemically removed Bayer filter aren't influencing results. (It isnt)
**Additional context**
Below is the Python code I've been using for these tests. It configures the camera, captures images at different exposure times, and calculates average pixel intensities. Despite the camera being covered, the pixel intensities remain consistently at ~255 across all exposure settings, which is unexpected and leads me to suspect a flaw in how the raw data is being captured or processed.
Code:
import timeimport numpy as npfrom picamera2 import Picamera2from matplotlib import pyplot as pltpicam2 = Picamera2()config = picam2.create_still_configuration(raw={'format': 'SBGGR12', 'size': (4056, 3040)})picam2.configure(config)print('Sensor configuration:', picam2.camera_configuration()['sensor'])print('Stream Configuration:', picam2.camera_configuration()['raw'])exposure_times = [100, 1000, 10000, 100000, 1000000]average_intensities = []for exposure_time in exposure_times: picam2.set_controls({"ExposureTime": exposure_time, 'AnalogueGain': 1.0}) time.sleep(1) picam2.start() time.sleep(5) data8 = picam2.capture_array('raw') data16 = data8.view(np.uint16) avg_intensity = np.mean(data16) average_intensities.append(avg_intensity) plt.figure() plt.imshow(data16) plt.colorbar() plt.show() picam2.stop() time.sleep(5)for i, exposure_time in enumerate(exposure_times): print(f'Exposure Time: {exposure_time / 1000:.3f} ms - Average Intensity: {average_intensities[i]:.2f}')
I also used this command with libcamera-raw which shows the same issue:
Code:
libcamera-raw -t 1000 --analoggain 1.0 --shutter 1000000 --mode 4056:3040:12:U -o test1000000.raw
Statistics: Posted by JosephDemarest — Wed May 29, 2024 8:15 pm — Replies 0 — Views 19