1

I have a code that will resize the videostream using imutils

vStream = VideoStream(src=args["webcam"]).start()
frme = vStream.read()
frme = imutils.resize(frme, width=280)
gray = cv2.cvtColor(frme, cv2.COLOR_BGR2GRAY)

However it is maintaining the aspect ratio and because of that the face will become smaller and I may not be able to perform some videostream processing because I need the face to become closer to the camera.

Is there a way where size of the videostream has the width of 280 at the same time the face is closer to camera? .... zoom ? Crop?

Beginner
  • 1,700
  • 4
  • 22
  • 42

1 Answers1

0

In https://github.com/CJoseFlores/python-OpenCV-Zoom is code that uses imutils.resize() and cropping for zoom in a videostream ( grabbing frame from stream -> zooming -> display zoomed frames as stream ). Alternatively you can use cv.INTER_LINEAR() ( linear interpolation ) for zooming

ralf htp
  • 9,149
  • 4
  • 22
  • 34