Ask Your Question
0

USB 3.0 Basler Camera with Opencv hangs on using imwrite/imshow

asked 2015-06-05 05:32:17 -0600

dementor gravatar image

updated 2015-06-17 08:01:11 -0600

I am using Basler USB 3.0 Camera with Pylon SDK on an Odroid. I convert the image from Pylon format to Mat using the answers on this link. Commenting the imshow and printing image data and pixel values work but keeping the imshow hangs the code at camera.RetrieveResult which is responsible for retrieving data from camera buffer to SDK's Pylon image buffer which is then converted to Mat.

Things I tried:

  • xserver problem since I am using ssh to odroid but I used a monitor too and the same problem.
  • imshow/imwrite thread interfering with camera buffer reading but using it in a different thread did not solve the problem either. Moreover, having imshow in a function that is not even called is creating the problem.

Moreover, using all other opencv functions seem to work fine but since I can't see the image, I can't be sure.

There is also a similar unanswered question on stackoverflow on this.

Can anyone help me understand the problem?

edit retag flag offensive close merge delete

Comments

Did you ever find solution to this? I am running into this same problem on Ubuntu 14.04 machine.

shaviland3 gravatar imageshaviland3 ( 2015-09-18 09:18:59 -0600 )edit

Hi, which Odroid board and which version of Pylon are you using? I have some serious problems to get the Pylon 5 SDK working on an Odroid XU4 board...

hgmeyer gravatar imagehgmeyer ( 2016-09-02 07:54:12 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2015-10-15 04:39:30 -0600

pklab gravatar image

The tecnique is to map a cv::Mat over the pylon::CGrabResultPtr buffer so you have to take care to buffer size wich depends from image size and pixel format (gray or RGB?) and buffer life cycle.

See my answer to how-to-access-basler-gige-camera-through-opencv-in-ubuntu-1404, it's for Giga eth but 2nd way should solve your issue too

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2015-06-05 05:32:17 -0600

Seen: 4,397 times

Last updated: Oct 15 '15