OpenCV-PYTHON MAGICAL LIBRARY In this blog, we will study the rescaling of the image and resolution of the video. As discussed in the previous tutorial about reading and display of the image, we'll continue with other features of OpenCV. RESCALING OF THE IMAGE In this section, we are going to discuss our second OpenCV example. We will see how to rescale the image. RESCALE THE IMAGE import cv2 as cv def rescaleFrame (frame,scale = 0.75 ): width = int(frame . shape[ 1 ] * scale) height = int(frame . shape[ 0 ] * scale) dimensions = (width,height) return cv . resize(frame,dimensions,interpolation = cv . INTER_AREA) img = cv . imread( "D:\Downloads\luisa-azevedo-h8cUkYFZrzI-unsplash (1).jpg" ) image_resized = rescaleFrame(img,scale = 0.40 ) cv . imshow( "image" ,img) cv . imshow( "image resized" ,image_resized) rescaleFrame= This is the function of rescaling. cv.INTER_AREA=This is used for shrinkin g. RESOLUTION OF ...
A place for learners and programmers