Jetson Inference - Python - DetectNet - Send mail

Hi,

I used jetson-inference with detectnet-camera.py, how to save a image (file captured) when a motion detected ?

Thanks for your reply

Marco

Hi,

One of the way is to use opencv for the motion detection using the custom logic to check diff between the frames.
Also, jetcam has some in-build functions to attach callbacks to the camera value changes. Please check below link if you can use that in your solution.

https://github.com/NVIDIA-AI-IOT/jetcam
https://github.com/NVIDIA-AI-IOT/jetcam/blob/master/notebooks/usb_camera/usb_camera.ipynb

For image capture you can use “cv2.imencode” to encode current frame values in jpg/png format and then write the encoded values to file in binary mode using “open(’*.png’, ‘wb’)”.

Please let us know in case of queries related to TRT.

Thanks