How to save photos in external trigger mode with OV9281 UC599

Hi again,

I’m having trouble with adapting the ./ov9281_external_trigger.c program in a way that allows me to save a picture when triggered. I’ve modified the video2stdout example so I can see when the photo gets triggered, and I added a save_image call near the bottom of the code and it will save on the first run of the example. But it will do this regardless of a trigger or not, and only once.

Do the VCC and FSIN pins on the camera board a function I could call on in a loop, so that when it sees a pulse, it will save an image?

Or is there any suggestions on how to start with this?

Thanks again

Hello,

When the external trigger signal is sent to the FSIN pin, it will trigger the camera to output a picture. At this time we can get an image using save_image. video2stdout demo is used to output h264 streaming. if you want to get one encode image, you should use our capture demo.

https://github.com/ArduCAM/MIPI_Camera/blob/master/RPI/capture.c

 

Hello,

When the external trigger signal is sent to the FSIN pin, it will trigger the camera to output a picture. At this time we can get an image using save_image. video2stdout demo is used to output h264 streaming. if you want to get one encode image, you should use our capture demo.

https://github.com/ArduCAM/MIPI_Camera/blob/master/RPI/capture.c

 

Ok I’ve got the save_image in the trigger mode demo working already. However it will only save one image with every run of the demo code. I’m wanting to save multiple images over a period of time, whenever I activate a trigger.

I put the save_image in a while loop, in the appropriate area, but it will save a picture on the first run, without needing to be triggered. Then the subsequent loops will give me no images.

I noticed;

#define V4L2_CID_ARDUCAM_EXT_TRI (V4L2_CID_ARDUCAM_BASE + 1)

this in arducam_mipicamera.h. I haven’t been able to find it defined in any of your other demo codes. What does this define exactly?

Thanks again

 

Hello,

In fact you just need to use BUFFER *buffer = arducam_capture(camera_instance, &fmt, 12000) to get image in the loop.

What’s more, we have external trigger mode. You can choose our external trigger mode and using arducam_capture API to get the each image when the trigger signal is come.

About how to use the arducam_capture API, we have a demo that you can refer https://github.com/ArduCAM/MIPI_Camera/blob/master/RPI/capture2opencv.cpp

 

 

while(1){

cv::Mat *image = get_image(camera_instance, width, height);

if(!image)

continue;

#if 0

Mat dynamicImg = dynamicThreWihteBalance(*image);

cv::imshow(“Arducam”, dynamicImg);

#endif

cv::imshow(“Arducam”, *image);

cv::waitKey(10);

delete image;

}

<p style=“text-align: left;”>Thanks for your assistance.</p>
<p style=“text-align: left;”>I haven’t been able to get to it yet. I’ll have a closer read about using the API when I get a chance.</p>
<p style=“text-align: left;”>Cheers</p>

Hello,

Let me know if you need more help.