Image acquisition problem in VisualStudio

asked 2017-06-06 08:37:36 -0600

jack94 gravatar image

Hi I have the problem shown in the picture attached: on the right the capture i have from the camera default program (it's a Point Grey Grasshopper), on the left the image i get with cv:videocapture in Visual Studio (2017), you can see it's kind of the same image, but shown 3 times with bad resolution. I already tried using different OpenCv libraries but nothing changes. Using a regulare USB webcam and same software everything works fine. Can anybody help me? C:\fakepath\Immagine.png Thanks Giacomo

edit retag flag offensive close merge delete

Comments

I think point grey camera are not compatible with opencv. I thnik you find some code on gihub like this one or in opencv 3 blueprints p31 @StevenPuttemans

LBerger gravatar imageLBerger ( 2017-06-06 11:12:02 -0600 )edit

That looks like it's Bayer, and maybe column major instead of the expected row major. Dunno. I'd have to see a raw frame, and probably some color in the image too.

Tetragramm gravatar imageTetragramm ( 2017-06-06 18:39:37 -0600 )edit

PG is indeed not directly supported in OpenCV. So you need the flycapture backend to support it for you. Not that experienced in it though the book contains guidance in Python by Joseph Howse.

StevenPuttemans gravatar imageStevenPuttemans ( 2017-06-07 04:21:16 -0600 )edit

@Tetragramm that's all I get from the camera, no color.

@StevenPuttemans@LBerger I used the same camera some time ago with an old PC that I had to change because of performance issues, and it worked fine; I will take a look at the code you linked me

jack94 gravatar imagejack94 ( 2017-06-07 05:23:20 -0600 )edit

All the links to the packages are on the PG website, right here.

StevenPuttemans gravatar imageStevenPuttemans ( 2017-06-07 06:01:51 -0600 )edit

Actually, @LBerger 's code worked fine, thanks a lot!!

jack94 gravatar imagejack94 ( 2017-06-07 07:49:59 -0600 )edit