Problem Using JPEG Stream in Tracker

Hello there,

I am having a little bit of difficulty using the opencv tracker with my system, and was hoping that you all could help. I am currently using an Arducam Mini OV2640 with an arduiino uno. Using the arduino code below, the setup relays a stream of JPEGs to my computer through the serial comm, and stores them as a temporary file (tmp.jpg). Using the attached python code, I can display the video stream on my computer; therefore, I know that the first part of my project works. However, when I select the file location as the VideoInput for the standard object tracking project ("a minimal tracking script", also attached) it displays only one frame of the video, and then freezes. The program doesn't freeze itself, but the video stream shows nothing beyond the first frame. When I use my computer's built-in webcam as the VideoInput, everything works fine. Please let me know if you have any ideas for workarounds, or solutions to this problem.

 

Thank you in advance.

GroG's picture

Ahoy and Welcome

Ahoy and Welcome "onlineaccount" :)

I had to re-read your post in order to understand, at first I thought you were not using MRL at all - but now I understand.

The reason it doesn't change is because MRL running on your computer opens the file only once. So the original file-handle of the original picture is the only thing which is processed.

It does not know the file has changed, and needs re-opening.

When you use VideoInput, it knows it connecting to a "stream" of images.

GroG's picture

Since I don't know what your

Since I don't know what your long term goal is I can suggest a work-around of streaming your image as a mjpeg server with the Python script

https://gist.github.com/n3wtron/4624820 

If I knew your long term goal I might suggest better ways to refactor and simplify your process.