I cloned the OpenCV example from ‘torizon-samples/opencv at bullseye · toradex/torizon-samples · GitHub’.
I ran a ‘docker build’ command using the example but I got an error. Please see attached screenshot of the error message I am getting after executing the dockerfile from the ‘torizon-samples/opencv at bullseye · toradex/torizon-samples · GitHub’.
I believe the issue, based on the picture you provided, has to do with needing to configure your development machine in order to cross build ARM containers.
Have you already configured your development machine as outlined here: Configure Build Environment for Torizon Containers | Toradex Developer Center
If not could you follow the article and then try the build again. Please let me know if this doesn’t resolve the issue.
Awesome!! I followed those instructions and I was able to build successfully and succesfully ‘push’ to Docker. In addition, I was also able to successfully ‘pull’ to my target. But I am now getting error messages on my target after I try to run the OpenCV example on my target. It looks like it cannot open the display. The Ixora carrier is connected via HDMI to HDMI monitor. Please see attached and let me know if I am doing anything wrong.
Did you have output on this HDMI display before trying to run this openCV container?
Also its hard to tell what the full
docker run command you are trying to run is. Instead could you run the docker-compose.yml from the sample repo: torizon-samples/docker-compose.yaml at bullseye · toradex/torizon-samples · GitHub
You just need to replace
torizonextras/opencv-example-arm64 with the name of the container you built. Then transfer this yml file to the module and run
docker-compose -f docker-compose.yaml up.
Try that and let me know how it works.
- Yes, the HDMI display worked because I saw the Portainer screen.
- I executed ‘docker run --rm -it -v /var/run/dbus:/var/run/dbus -v /dev:/dev milo1116/gs-torizon’. For testing purposes, I changed the ‘opencv-example.py’ to a ‘hello world’ output and that worked.
- I tried ‘scp’ command to transfer from my HOST to target but getting ‘Permission Denied’. I know my password is correct because I can log on into the HOST using the same password with serial and it worked. In addition, I can ping the target from HOST so I know network is ok.
Since my SCP command is not working. How else can I transfer the yml file to the target?
Yeah you should be using the docker-compose.yml provided in the sample code rather than that docker run command. As you can see by the yml file this is a multi-container example.
As for transferring the file, if scp doesn’t work for you can’t you just copy and paste the file contents to the device via the serial console?
Aha! Very good! It works!! I did what you suggested and it works!!!
Here are a couple more findings to assist you, too:
- I had to use a different HDMI monitor. The previous HDMI monitor had outputted the Portainer UI, but NOT the opencv example display output. To make it work, I used another HDMI monitor.
Now that I know OpenCV and Python are ok. I am now looking into a video stream instead of a still image. I am currently using the Alvium 1500 Series Camera. Do you have any examples or articles for such applications?
Glad that this works for you now.
As for further examples, we typically only document simple use cases to help customers get started. Also I’m not much of an OpenCV expert so I can’t comment too detailed on implementation.
However generally speaking what I imagine you’d have to do now is first create some kind of gstreamer video pipeline to get video from your camera. Then you’d have to create logic that processes the video with OpenCV, typically frame by frame or on a set of frames depending on what your goal is. Again I’m just speaking generally as I’m sure there’s many methods here to implement this.