2

I have python code which is showing the live video feed from usb Logitech Camera. Below is the code snippet:

vcap = cv2.VideoCapture(1)

while (1):
    ret, frame = vcap.read()

    cv2.imshow('Input', frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

vcap.release()
cv2.destroyAllWindows()

Output:

enter image description here

Above is the screenshot taken from opencv window and below is the photo taken from windows default camera app.:

enter image description here

We can notice that opencv by defaults crop some of the left and right portion from the frame. How can remove this feature from opencv.?

S Andrew
  • 5,592
  • 27
  • 115
  • 237

1 Answers1

2

This is about the resolution settings. Windows app. or OpenCV uses different resolutions. Cameras which have their own drivers you can't set their resolution settings by OpenCV.

Since your camera is a webcam(usb) camera, you can use set property. As mentioned here.

Yunus Temurlenk
  • 4,085
  • 4
  • 18
  • 39