Resizing and rescaling in OpenCV:
Resizing and rescaling are most important step in image processing .
Displaying large images need a lot of processing.We do rescaling to reduce computational costs.
Rescaling is a process of modifying height and width of image or video to particular height and width.
Generally rescaling is done for larger images to convert them to smaller images without losing information in it.
frame.shape[1] denotes width of frame
frame.shape[0] denotes height of frame
scale is float value which can be used to shrink or
enlarge image
cv2.resize() converts a frame into particular dimensions.
Different interpolation methods are used to resize the image.
Preferable interpolation methods are cv.INTER_AREA for shrinking and cv.INTER_CUBIC(slow) & cv.INTER_LINEAR for zooming.
By default, interpolation method used is cv.INTER_LINEAR.
We can also perform rescaling on videos as given below
Program
0 Comments
Post a Comment