After taking say 5-10 pictures I want to try and get the values in camera_status_t;
save them, go to lightsleep, wakeup on a trigger, recall the values
and hopefully take one frame buffer capture without a green tint.
Using the source code at:
I think that I need to call: ov2640_detect(int slv_addr, sensor_id_t *id)
and then: ov2640_init(sensor_t *sensor)
However, I am not able to work out what to put in the call to ov2640_detect()
I have read that the slv_addr is 0x3C, but don't have a clue what to put in as
the 2nd parameter. I read somewhere that sensor_id_t *id might be used if you
have multiple sensors ... I only have one OV2640. Likewise, in ov2640_init()
what is sensor_t *sensor?
I hope that after I am able to detect the sensor that I will then be able to
get all the camera_status_t values.
If this approach is flawed please tell me.
Thank you.
I built a lot of ESP32 cameras, but I have no idea what you want to do. The green tint issue is simply some adjustments to the settings, but I have no clue regarding the status values. Have you looked at the code behind that function?
I have found that taking about 3 pictures removes colour and exposure issues. However, 3 pictures take about 600ms. For vehicles travelling at 30-50KMH getting a good snapshot is difficult, especially when they could be going in either direction.
My "bright" idea was to take 5-10 pictures, save the sensor values and even update them every say 10 minutes, again hoping that taking periodic snapshots would keep those sensor values fairly close to what the current lighting conditions require.
I have read other suggestions for getting rid of green tint, however exposure has also been an issue that "3 pictures" seems to sort.
I have looked at the code in those functions, however things with pointers in them is my weakness.
My unfamiliarity with the source code resulted in me diving-down to the low-level. Thanks for the prompt as even looking in esp_camera.h it would have not been obvious how I would get individual sensor values.
sensor_t * esp_camera_sensor_get(void);
/**
* @brief Save camera settings to non-volatile-storage (NVS)
*
* @param key A unique nvs key name for the camera settings
*/
As in any digital camera, there are settings to adjust hue, saturation, etc. I don't know off the top of my head, but just transfer the raw image and use your post-processing software (Adobe Lightroom) to adjust. If you just transfer the raw, you can always make any adjustments later; if you do it in camera, it's pretty much one and done. I have not taken a JPEG in decades, not even on my iPhone.
That usually means you are trying to access some resource which has not been properly allocated..
that’s actually why I use the if (s) , if the esp_camera_sensor_get() fails then s will be garbage and accessing it will cause the same error your seeing now..