![]() # scaling the original image to defined dimensions Height _ 1 = int(img_1.shape * scale_percent _ 1 / 100) Width _ 1 = int(img_1.shape * scale_percent _ 1 / 100) # defining the scaled imaged percent part of the original size of the input image Print (Scaled Dimensions of the original image are: ',img _ 1.shape) Img_1 = cv2.imread('/ desktop/ img/ python3/ educba.png', cv2.IMREAD_UNCHANGED)Ĭv2.imshow("Displaying the original image / source image :", img_1 # command im read is used in order to read the image which is being sourced by the programmer # command used to import the Open CV library to utilize the scale image function * resize(* src, * dsize * *] *] *] *) Example of Open CV Scale image:įollowing is an example that illustrates the use of the scaling method using the open CV library in Python 3 programming language: Syntax and functions used for scaling imageįollowing is the syntax which is used for implementing the Open CV scale image function: cv2 *. In certain applications, the output image which is being scaled needs to be of a certain height and width to fit the brief in such a case, both the height as well as the width of the image can be scaled that is increasing or decreasing both the height and the width of the original image according to the specific output results that are needed.only the height of the input image is scaled, either increasing or decreasing the overall height of the image but at the same time keeping the width of the original image unchanged.only the width of the input image is scaled, either increasing or decreasing the overall width of the image but at the same time keeping the height of the original image unchanged.in such an application, two output images can be resulted by scaling of the image to be performed No preservation is observed for the overall aspect ratio for the input image – In this situation, the aspect ratio is not needed to be preserved for the applications which use such output images.Upscale or increasing the overall size of the image that the user provides. ![]()
0 Comments
Leave a Reply. |