Javacv: Black Sidebars appear on the captured image

Created on 25 Oct 2019  路  4Comments  路  Source: bytedeco/javacv

I'm using OpenCVFrameGrabber to grabbe frames from my USB cam but the grabbed image has black bars appears on each side but when i try Windows Camera app it doesn't have these bars ,Is there is some configs I'm missing ?

OpenCVFrameGrabber grabber = new OpenCVFrameGrabber(0);
grabber.setImageWidth(captureWidth);
grabber.setImageHeight(captureHeight);
grabber.start();

Frame capturedFrame = grabber.grab();
Java2DFrameConverter converter = new Java2DFrameConverter();
converter.convert(capturedFrame);
question

All 4 comments

Could you try VideoInputFrameGrabber instead? It usually works better than OpenCV on Windows...

Thank you It's really better solved the problem without modification

How did you solve it?

I just replaced the OpenCVFrameGrabber with VideoInputFrameGrabber and it did the trick I think it handles the aspect ration internally

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RaGreen picture RaGreen  路  4Comments

jakubondrus picture jakubondrus  路  4Comments

chrisliu12345 picture chrisliu12345  路  4Comments

y4nnick picture y4nnick  路  3Comments

myScoopAndroidCamera picture myScoopAndroidCamera  路  4Comments