0

i cant seem to resize the frame output of my ip camera opened in opencv python3

    import cv2

    cap = cv2.VideoCapture('rtsp://admin:[email protected]/1')

    cap.set(3, 176)
    cap.set(4, 144)

    while(True):
        ret, frame = cap.read()
        cv2.imshow('frame',frame)
        if cv2.waitKey(1) & 0xFF == ord('q'):
            cv2.destroyAllWindows()
            break

outputting a large frame

1 Answer 1

2

Your issue looks very similar to other questions posted here Try to take a look on this one and see if it can helps you: similar question

Basically you must check if :

  1. your camera drivers support this feature
  2. the property codes you use for setting the output resolution match the ones expected from the vendor drivers
  3. the resolution is actually supported by your camera

An alternative workaround, very easy but consider it as worst case, could be resize the frame after the aquisition:

success,image = cap.read()
resize = cv2.resize(image, (176, 144)) 
Sign up to request clarification or add additional context in comments.

1 Comment

thanks for the answer, it is working now.. sorry took tooooo long to check. but appreciate the answer so much

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.