

{"id":120200,"date":"2024-03-15T18:00:29","date_gmt":"2024-03-15T12:30:29","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=120200"},"modified":"2024-03-15T18:22:31","modified_gmt":"2024-03-15T12:52:31","slug":"geometric-transformations-of-images-using-opencv","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/geometric-transformations-of-images-using-opencv\/","title":{"rendered":"Geometric Transformations of Images using OpenCV"},"content":{"rendered":"<p>Step into a world where images defy their boundaries and pixels dance to a new rhythm. Welcome to the captivating realm of &#8216;Geometric Transformations Using OpenCV.&#8217;<\/p>\n<p>In this journey, we&#8217;ll unveil the magic of reshaping reality, where images bend, twist, and evolve with the touch of a code. From elegant translations to captivating rotations, we&#8217;ll unlock the artistry of OpenCV, giving you the power to sculpt visual narratives that transcend the ordinary.<\/p>\n<p>Through affine translation, rotation, and scaling, you&#8217;ll reshape reality itself. But that&#8217;s not all \u2013 we&#8217;ll also explore the vibrant realm of color maps, adding hues and tones that breathe life into every pixel. Get ready to wield the OpenCV wand and craft visual wonders that stretch the boundaries of imagination.<\/p>\n<h2>Affine Transformation in OpenCV: Bridging Reality and Imagination<\/h2>\n<p>An affine transformation in OpenCV is a geometric manipulation applied to an image that includes translation (shifting), rotation, scaling, and shearing while preserving parallel lines. It&#8217;s represented by a transformation matrix that defines how each pixel&#8217;s position is altered. This transformation maintains the linearity of points and angles, allowing for accurate adjustments of an image&#8217;s shape and orientation. Affine transformations are widely employed in tasks like image alignment, distortion correction, and object transformation within computer vision and image processing.<\/p>\n<p>Within the realm of image manipulation, the concept of &#8220;Affine Transformation&#8221; stands as a potent tool to reshape reality while preserving the integrity of lines and angles. OpenCV empowers this process through its cv2.getPerspectiveTransform() function, allowing the transformation of images from one perspective to another. In this section, we delve into the essence of cv2.getPerspectiveTransform(), breaking down its syntax, parameters, and accompanying code.<\/p>\n<p><strong>Syntax :<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">cv2.getPerspectiveTransform(src_points, dst_points)<\/pre>\n<p><strong>Parameters :<\/strong><\/p>\n<ul>\n<li><strong>Src_points:<\/strong> A set of four source points in the input image.<\/li>\n<li><strong>Dst_points:<\/strong> The corresponding destination points in the output image.<\/li>\n<\/ul>\n<p><strong>Code with Explanation :<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import cv2\r\nimport numpy as np\r\n\r\n# Load the source image\r\nsrc_image = cv2.imread(r\"C:\\Users\\satchit\\OneDrive\\Desktop\\OpenCV Data Flair\\Geometric transformations using openCV\\skiing-pic.jpg\")\r\n\r\n# Define the source and destination points\r\nsrc_points = np.float32([[100, 100], [200, 100], [100, 200], [200, 200]])  # Replace these with your actual coordinates\r\ndst_points = np.float32([[0, 0], [300, 0], [0, 400], [300, 400]])         # Replace these with your desired destination coordinates\r\n\r\n# Calculate the perspective transformation matrix\r\nmatrix = cv2.getPerspectiveTransform(src_points, dst_points)\r\n\r\n# Apply the perspective transformation using cv2.warpPerspective()\r\nresult_image = cv2.warpPerspective(src_image, matrix, (600, 700))  # Replace 300 and 400 with your desired output dimensions\r\n\r\n# Display the original and transformed images\r\ncv2.imshow('Original Image', src_image)\r\ncv2.imshow('Transformed Image', result_image)\r\ncv2.waitKey(0)\r\ncv2.destroyAllWindows()<\/pre>\n<p><strong>Original Image :<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Affine-Transformation-original.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-125949 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Affine-Transformation-original.webp\" alt=\"Affine Transformation original\" width=\"800\" height=\"721\" \/><\/a><\/p>\n<p><strong>Transformed Image :<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Affine-Transformation-transformed.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-125951 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Affine-Transformation-transformed.webp\" alt=\"Affine Transformation transformed\" width=\"600\" height=\"715\" \/><\/a><\/p>\n<p><strong>Explanation :<\/strong><\/p>\n<p>1. Load the source image using cv2.imread().<\/p>\n<p>2. Define the source and destination points, where src_points represent the coordinates of points in the source image, and dst_points are the corresponding points in the desired output image.<\/p>\n<p>3. Calculate the perspective transformation matrix using cv2.getPerspectiveTransform(), based on the source and destination points.<\/p>\n<p>4. Apply the perspective transformation using cv2.warpPerspective(), using the calculated matrix.<\/p>\n<p>5. Use cv2.imshow() to display both the original and transformed images.<\/p>\n<p>The cv2.getPerspectiveTransform() function facilitates the creation of a transformation matrix, enabling the conversion of images from one perspective to another. This operation is particularly useful for tasks like rectifying skewed images or mapping flat surfaces to a desired perspective. Adjust the source and destination points to control the transformation effect, opening up a world of possibilities for altering image viewpoints with precision.<\/p>\n<h3>Rotation and Scaling in OpenCV: Reshaping Reality with Precision<\/h3>\n<p>The transformation matrix of the type allows a picture to be rotated given an angle \u03b8.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Rotation-and-Scaling-formula.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-125952 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Rotation-and-Scaling-formula.webp\" alt=\"Rotation and Scaling formula\" width=\"304\" height=\"105\" \/><\/a><\/p>\n<p>However, OpenCV offers scaled rotation with a centre of rotation that is customizable, allowing you to rotate in any direction you like. The updated transformation matrices are provided below,<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Rotation-and-Scaling-.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-125953 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Rotation-and-Scaling-.webp\" alt=\"Rotation and Scaling \" width=\"555\" height=\"255\" \/><\/a><\/p>\n<p>Prepare to enter the realm of image transformation as we unravel the artistry of &#8220;Rotation and Scaling&#8221; techniques using OpenCV. These tools empower you to twist the axis of perception and resize the canvas of imagination. In this segment, we&#8217;ll delve into the elegance of `cv2.rotate()` and `cv2.resize()`, unveiling their syntax, parameters, and accompanying code.<\/p>\n<h4>cv2.rotate() :<\/h4>\n<p><strong>Syntax :<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">cv2.rotate(src, rotateCode)<\/pre>\n<p><strong>Parameters :<\/strong><\/p>\n<ul>\n<li><strong>Src:<\/strong> The source image.<\/li>\n<li><strong>rotateCode:<\/strong> Specifies the rotation type. Options are,<\/li>\n<li>cv2.ROTATE_90_CLOCKWISE,<\/li>\n<li>cv2.ROTATE_90_COUNTERCLOCKWISE, and<\/li>\n<li>cv2.ROTATE_180.<\/li>\n<\/ul>\n<p><strong>Code with Explanation :<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import cv2\r\nimport numpy as np\r\n\r\n# Load the source image\r\nsrc_image = cv2.imread(r\"C:\\Users\\satchit\\OneDrive\\Desktop\\OpenCV Data Flair\\Geometric transformations using openCV\\skiing-pic.jpg\")\r\n\r\n# Apply 90-degree clockwise rotation using cv2.rotate()\r\nrotated_image = cv2.rotate(src_image, cv2.ROTATE_90_CLOCKWISE)\r\n\r\n# Display the original and rotated images\r\ncv2.imshow('Original Image', src_image)\r\ncv2.imshow('Rotated Image', rotated_image)\r\ncv2.waitKey(0)\r\ncv2.destroyAllWindows()<\/pre>\n<p><strong>Original Image :<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Rotation-and-Scaling-original.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-125954 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Rotation-and-Scaling-original.webp\" alt=\"Rotation and Scaling original\" width=\"800\" height=\"721\" \/><\/a><\/p>\n<p><strong>Rotated Image :<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Rotation-and-Scaling-rotated-1.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-125955 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Rotation-and-Scaling-rotated-1.webp\" alt=\"Rotation and Scaling rotated\" width=\"700\" height=\"768\" \/><\/a><\/p>\n<p><strong>Explanation :<\/strong><\/p>\n<p>1. Load the source image using cv2.imread().<\/p>\n<p>2. Apply a 90-degree clockwise rotation using cv2.rotate() with the cv2.ROTATE_90_CLOCKWISE option.<\/p>\n<p>3. Display both the original and rotated images using cv2.imshow().<\/p>\n<h4>cv2.resize() :<\/h4>\n<p><strong>Syntax :<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">cv2.resize(src, dsize, dst, fx, fy, interpolation)<\/pre>\n<p><strong>Parameters :<\/strong><\/p>\n<ul>\n<li><strong>Src:<\/strong> The source image.<\/li>\n<li><strong>Dsize:<\/strong> The desired size of the output image.<\/li>\n<li><strong>Fx, fy <\/strong>Scaling factors along the x and y axes (optional).<\/li>\n<li><strong>Interpolation:<\/strong> Specifies the interpolation method (default is cv2.INTER_LINEAR).<\/li>\n<\/ul>\n<p><strong>Code with Explanation :<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import cv2\r\nimport numpy as np\r\n\r\n# Load the source image\r\nsrc_image = cv2.imread(r\"C:\\Users\\satchit\\OneDrive\\Desktop\\OpenCV Data Flair\\Geometric transformations using openCV\\skiing-pic.jpg\")\r\n\r\n# Define the new dimensions\r\nnew_width = 640\r\nnew_height = 480\r\n\r\n# Apply resizing using cv2.resize()\r\nresized_image = cv2.resize(src_image, (new_width, new_height))\r\n\r\n# Display the original and resized images\r\ncv2.imshow('Original Image', src_image)\r\ncv2.imshow('Resized Image', resized_image)<\/pre>\n<p><strong>Resized Image :<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Rotation-and-Scaling-resized.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-125956 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Rotation-and-Scaling-resized.webp\" alt=\"Rotation and Scaling resized\" width=\"1366\" height=\"768\" \/><\/a><\/p>\n<p><strong>Explanation :<\/strong><\/p>\n<p>1. Load the source image using cv2.imread().<\/p>\n<p>2. Define the new dimensions for the resized image.<\/p>\n<p>3. Apply resizing using cv2.resize() with the specified dimensions.<\/p>\n<p>4. Display both the original and resized images using cv2.imshow().<\/p>\n<p>Rotation and Scaling in OpenCV demonstrates how these functions empower you to manipulate images&#8217; orientations and sizes with precision. Whether you&#8217;re fine-tuning an image&#8217;s perspective or resizing it to fit a new context, OpenCV&#8217;s capabilities offer the means to seamlessly reshape your visual narratives.<\/p>\n<h3>Image Reflection in OpenCV: Mirroring Realities<\/h3>\n<p>In the world of computer vision, images are the portals through which we glimpse reality. Yet, reality often comes in dualities, where reflection is a powerful tool to unravel hidden patterns.<\/p>\n<p>OpenCV empowers us to explore this world of reflection, where images can be mirrored to reveal new perspectives. In this journey of Image Reflection in OpenCV, we&#8217;ll dive into the syntax, parameters, and code of cv2.warpAffine(), uncovering how to create visual reflections that echo the intricacies of the real world.<\/p>\n<p><strong>cv2.warpAffine() &#8211; Syntax and Parameters :<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">cv2.warpAffine(image, M, (width, height))<\/pre>\n<p><strong> image:<\/strong> The input image to be transformed.<\/p>\n<p><strong>M:<\/strong> The transformation matrix.<\/p>\n<p><strong>(width, height):<\/strong> Dimensions of the output image.<\/p>\n<p><strong>Code Example &#8211;<\/strong> Image Reflection :<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import cv2\r\nimport numpy as np\r\n\r\n# Load an image\r\nimage = cv2.imread(r\"C:\\Users\\satchit\\OneDrive\\DataFlair\\skiing-pic.jpg\")\r\n\r\n# Create a reflection matrix\r\nreflection_matrix = np.array([[-1, 0, image.shape[1]],\r\n                              [0, 1, 0]], dtype=np.float32)\r\n\r\n# Apply the reflection using warpAffine\r\nreflected_image = cv2.warpAffine(image, reflection_matrix, (image.shape[1], image.shape[0]))\r\n\r\n# Display the original and reflected images\r\ncv2.imshow('Original Image', image)\r\ncv2.imshow('Reflected Image', reflected_image)\r\ncv2.waitKey(0)\r\ncv2.destroyAllWindows()<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Image-Reflection-original.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-125957 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Image-Reflection-original.webp\" alt=\"Image Reflection original\" width=\"800\" height=\"721\" \/><\/a><\/p>\n<p><strong>Reflected Image:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Image-Reflection-reflected.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-125958 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Image-Reflection-reflected.webp\" alt=\"Image Reflection reflected\" width=\"1200\" height=\"1074\" \/><\/a><\/p>\n<p>In this code example, we begin by loading an input image using cv2.imread(). We then create a reflection matrix (reflection_matrix) to perform the mirroring transformation. This matrix flips the image horizontally around the y-axis, effectively creating a mirror reflection.<\/p>\n<p>Using cv2.warpAffine(), we apply the reflection matrix to the input image, generating a reflected version. The dimensions of the reflected image remain the same as the original.<\/p>\n<p>Finally, we use cv2.imshow() to display both the original and reflected images side by side. By comparing the two, the effect of the reflection becomes evident, shedding light on hidden symmetries and patterns.<\/p>\n<p>Image reflection in OpenCV takes us beyond mere pixels, unravelling the dualities hidden within visual content. Through the magic of cv2.warpAffine(), we can transform images to reveal mirrored realities that echo the intricacies of the real world. As we delve into this journey of visual transformation, we gain a deeper appreciation for the ways in which images can be transformed, revealing new perspectives and enriching our understanding of the visual realm.<\/p>\n<h3>Color Maps in OpenCV: Painting Images with Emotions<\/h3>\n<p>Prepare to embark on a journey of visual expression with the enchanting world of &#8220;Color Maps&#8221; in OpenCV. Like an artist&#8217;s palette, color maps breathe life into grayscale images, infusing them with vibrant hues and emotional tones. In this segment, we&#8217;ll unveil the syntax, parameters, and accompanying code for color maps, where grayscale metamorphoses into a symphony of colors.<\/p>\n<p><strong>Syntax :<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">colored_image = cv2.applyColorMap(src_image, colormap)<\/pre>\n<p><strong>Parameters :<\/strong><\/p>\n<ul>\n<li><strong>src_image:<\/strong> The grayscale source image.<\/li>\n<li><strong>colormap:<\/strong> The chosen color map, such as cv2.COLORMAP_JET, cv2.COLORMAP_HOT, cv2.COLORMAP_COOL, and more.<\/li>\n<\/ul>\n<p><strong>Code with Explanation :<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import cv2\r\nimport numpy as np\r\n\r\n# Load the source image\r\nsrc_image = cv2.imread(r\"C:\\Users\\satchit\\OneDrive\\Desktop\\OpenCV Data Flair\\Geometric transformations using openCV\\skiing-pic.jpg\", cv2.IMREAD_GRAYSCALE)\r\n\r\n# Apply the Jet color map using cv2.applyColorMap()\r\ncolored_image_jet = cv2.applyColorMap(src_image, cv2.COLORMAP_JET)\r\n\r\n# Display the grayscale and colored images\r\ncv2.imshow('Grayscale Image', src_image)\r\ncv2.imshow('Colored Image (Jet)', colored_image_jet)\r\ncv2.waitKey(0)\r\ncv2.destroyAllWindows()<\/pre>\n<p><strong>Original Image :<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Color-Maps-original.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-125960 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Color-Maps-original.webp\" alt=\"Color Maps original\" width=\"795\" height=\"713\" \/><\/a><\/p>\n<p><strong>Color mapped image :<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-125962\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/Color-Maps-image.webp\" alt=\"Color Maps image\" width=\"799\" height=\"717\" data-wp-editing=\"1\" \/><\/p>\n<p><strong>Explanation :<\/strong><\/p>\n<p>1. Load the grayscale source image using cv2.imread() with the cv2.IMREAD_GRAYSCALE flag.<\/p>\n<p>2. Apply the desired color map (in this case, Jet) using cv2.applyColorMap().<\/p>\n<p>3. Display both the original grayscale image and the colored image using cv2.imshow().<\/p>\n<p>Color maps act as a prism, transforming grayscale images into a spectrum of emotions. By choosing the right color map, you can evoke specific feelings or emphasize patterns in your data. OpenCV&#8217;s treasure trove of color maps beckons you to explore the world of visual storytelling with every shade and tint.<\/p>\n<h3>Summary<\/h3>\n<p>In the realm of OpenCV&#8217;s image transformation, we&#8217;ve journeyed from reshaping reality to infusing emotions into grayscale canvases. Our toolkit encompassed geometric marvels like rotation and scaling, while color maps turned grayscale gradients into vivid emotional stories.<\/p>\n<p>Through code and creativity, we&#8217;ve harnessed the power of pixels to craft narratives that transcend the ordinary. As we conclude this exploration, remember that every line of code is a brushstroke on the canvas of imagination, turning data into visual symphonies that resonate far beyond the screen.<\/p>\n<p>OpenCV has opened doors to a realm where technology and art merge, leaving us with endless possibilities to explore. So, go forth, weave your own pixel stories, and let the transformation begin anew.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Step into a world where images defy their boundaries and pixels dance to a new rhythm. Welcome to the captivating realm of &#8216;Geometric Transformations Using OpenCV.&#8217; In this journey, we&#8217;ll unveil the magic of&#46;&#46;&#46;<\/p>\n","protected":false},"author":86671,"featured_media":132169,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27755],"tags":[30113,30114,30112,31028,9267,29991],"class_list":["post-120200","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-opencv-tutorials","tag-geometric-transformations-of-images","tag-geometric-transformations-of-images-in-opencv","tag-geometric-transformations-of-images-using-opencv","tag-learn-opencv","tag-opencv","tag-opencv-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Geometric Transformations of Images using OpenCV - DataFlair<\/title>\n<meta name=\"description\" content=\"In the realm of OpenCV&#039;s image transformation, we&#039;ve journeyed from reshaping reality to infusing emotions into grayscale canvases.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/?p=120200\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Geometric Transformations of Images using OpenCV - DataFlair\" \/>\n<meta property=\"og:description\" content=\"In the realm of OpenCV&#039;s image transformation, we&#039;ve journeyed from reshaping reality to infusing emotions into grayscale canvases.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/?p=120200\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-15T12:30:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-15T12:52:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/geometric-transformations-using-opencv.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Geometric Transformations of Images using OpenCV - DataFlair","description":"In the realm of OpenCV's image transformation, we've journeyed from reshaping reality to infusing emotions into grayscale canvases.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/?p=120200","og_locale":"en_US","og_type":"article","og_title":"Geometric Transformations of Images using OpenCV - DataFlair","og_description":"In the realm of OpenCV's image transformation, we've journeyed from reshaping reality to infusing emotions into grayscale canvases.","og_url":"https:\/\/data-flair.training\/blogs\/?p=120200","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2024-03-15T12:30:29+00:00","article_modified_time":"2024-03-15T12:52:31+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/geometric-transformations-using-opencv.webp","type":"image\/webp"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/?p=120200#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/?p=120200"},"author":{"name":"TechVidvan Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/0e594f928e31fc96628ac40f6ae74f49"},"headline":"Geometric Transformations of Images using OpenCV","datePublished":"2024-03-15T12:30:29+00:00","dateModified":"2024-03-15T12:52:31+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/?p=120200"},"wordCount":1366,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/?p=120200#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/geometric-transformations-using-opencv.webp","keywords":["geometric transformations of images","geometric transformations of images in opencv","geometric transformations of images using opencv","learn opencv","opencv","opencv tutorials"],"articleSection":["OpenCV Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/?p=120200#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/?p=120200","url":"https:\/\/data-flair.training\/blogs\/?p=120200","name":"Geometric Transformations of Images using OpenCV - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/?p=120200#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/?p=120200#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/geometric-transformations-using-opencv.webp","datePublished":"2024-03-15T12:30:29+00:00","dateModified":"2024-03-15T12:52:31+00:00","description":"In the realm of OpenCV's image transformation, we've journeyed from reshaping reality to infusing emotions into grayscale canvases.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/?p=120200#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/?p=120200"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/?p=120200#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/geometric-transformations-using-opencv.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/11\/geometric-transformations-using-opencv.webp","width":1200,"height":628,"caption":"geometric transformations using opencv"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/?p=120200#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"OpenCV Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/opencv-tutorials\/"},{"@type":"ListItem","position":3,"name":"Geometric Transformations of Images using OpenCV"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/0e594f928e31fc96628ac40f6ae74f49","name":"TechVidvan Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c89190da3d4010c71ba476b618ab10fdc2335c82cdfa0ad5002d98d0f2473444?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c89190da3d4010c71ba476b618ab10fdc2335c82cdfa0ad5002d98d0f2473444?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c89190da3d4010c71ba476b618ab10fdc2335c82cdfa0ad5002d98d0f2473444?s=96&d=mm&r=g","caption":"TechVidvan Team"},"description":"TechVidvan Team provides high-quality content &amp; courses on AI, ML, Data Science, Data Engineering, Data Analytics, programming, Python, DSA, Android, Flutter, full stack web dev, MERN, and many latest technology.","url":"https:\/\/data-flair.training\/blogs\/author\/test001\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/120200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/86671"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=120200"}],"version-history":[{"count":5,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/120200\/revisions"}],"predecessor-version":[{"id":132168,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/120200\/revisions\/132168"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/132169"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=120200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=120200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=120200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}