<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Opencv on ZK Punk</title>
		<link>https://www.ZKPunk.dev/tags/opencv/</link>
		<description>Recent content in Opencv on ZK Punk</description>
		<generator>Hugo</generator>
		<language>en</language>
		
		
		
		
			<lastBuildDate>Wed, 25 Sep 2019 13:53:05 -0500</lastBuildDate>
		
			<atom:link href="https://www.ZKPunk.dev/tags/opencv/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Select Sections From Images of Newspaper clippings, receipts etc Using Opencv and Python</title>
				<link>https://www.ZKPunk.dev/posts/select-sections-from-newspaper-clipping-images-using-opencv-and-python/</link>
				<pubDate>Wed, 25 Sep 2019 13:53:05 -0500</pubDate>
				<guid>https://www.ZKPunk.dev/posts/select-sections-from-newspaper-clipping-images-using-opencv-and-python/</guid>
				<description>&lt;p&gt;We often take pictures of menus, receipts, and message boards etc. They are often not aligned properly. In this post, I will show you how to select the pertinet parts and allign them as correctly as possible.&lt;/p&gt;&#xA;&lt;table&gt;&#xA;&#x9;&lt;thead&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;th style=&#34;text-align: center&#34;&gt;Original&lt;/th&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;th style=&#34;text-align: center&#34;&gt;Processed&lt;/th&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&lt;/thead&gt;&#xA;&#x9;&lt;tbody&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: center&#34;&gt;&lt;img src=&#34;https://www.ZKPunk.dev/img/sudoku_newspaper_small.jpg&#34; alt=&#34;Sudoku &#34;&gt;&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: center&#34;&gt;&lt;img src=&#34;https://www.ZKPunk.dev/img/sudoku.jpg&#34; alt=&#34;Sudoku&#34;&gt;&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s get started.&lt;/p&gt;&#xA;&lt;h3 id=&#34;1-find-the-anchor-points&#34;&gt;&#xA;  1. Find the anchor points&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#1-find-the-anchor-points&#34;&gt;&#xA;    &lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;We will first load the image of a newspaper clipping containing the sudoku puzzle. Next, we will find out the cordinates of the four corners of the puzzle in the original image.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Create and apply simple filters to an image using OpenCV and Python</title>
				<link>https://www.ZKPunk.dev/posts/create-filters-1/</link>
				<pubDate>Mon, 16 Sep 2019 13:55:46 -0500</pubDate>
				<guid>https://www.ZKPunk.dev/posts/create-filters-1/</guid>
				<description>&lt;p&gt;In this blog post, I will show you how we can enhance our images using colored filters&#xA;and add border backgrounds.&lt;/p&gt;&#xA;&lt;table&gt;&#xA;&#x9;&lt;thead&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;th style=&#34;text-align: center&#34;&gt;Original&lt;/th&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;th style=&#34;text-align: center&#34;&gt;Original w/ color filter&lt;/th&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;th style=&#34;text-align: center&#34;&gt;Original w/ color border&lt;/th&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&lt;/thead&gt;&#xA;&#x9;&lt;tbody&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: center&#34;&gt;&lt;img src=&#34;https://www.ZKPunk.dev/img/blagaj_resized.jpg&#34; alt=&#34;Blagaj&#34;&gt;&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: center&#34;&gt;&lt;img src=&#34;https://www.ZKPunk.dev/img/blagaj_red_filter.jpg&#34; alt=&#34;Blagaj&#34;&gt;&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: center&#34;&gt;&lt;img src=&#34;https://www.ZKPunk.dev/img/blagaj_black_border.jpg&#34; alt=&#34;Blagaj&#34;&gt;&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;Let&amp;rsquo;s get started.&lt;/p&gt;&#xA;&lt;h3 id=&#34;1-simple-color-filter&#34;&gt;&#xA;  1. Simple color filter&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#1-simple-color-filter&#34;&gt;&#xA;    &lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;Lets start with first creating a color filter - an image with just a single color. This is as simple&#xA;as creating a 3-D array and filling each pixel with the same value. In the code below I create an&#xA;array of the same size (682,512,3) as that of the target image and fill each pixel with the color&#xA;red (0,0,255).&lt;/p&gt;</description>
			</item>
			<item>
				<title>Adding text to an image using OpenCV and Python</title>
				<link>https://www.ZKPunk.dev/posts/add-text-image/</link>
				<pubDate>Thu, 22 Aug 2019 23:08:06 -0700</pubDate>
				<guid>https://www.ZKPunk.dev/posts/add-text-image/</guid>
				<description>&lt;p&gt;In a series of upcoming blog posts, I will be using OpenCV to manipulate images. In this post, I will be adding text to an image (below), I took of a Dervish monastery at the beautiful village of Blagaj in Bosnia.&lt;/p&gt;&#xA;&lt;table&gt;&#xA;&#x9;&lt;thead&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;th style=&#34;text-align: center&#34;&gt;Resized Original&lt;/th&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;th style=&#34;text-align: center&#34;&gt;Resized Original w/ text&lt;/th&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&lt;/thead&gt;&#xA;&#x9;&lt;tbody&gt;&#xA;&#x9;&#x9;&#x9;&lt;tr&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: center&#34;&gt;&lt;img src=&#34;https://www.ZKPunk.dev/img/blagaj_resized.jpg&#34; alt=&#34;Blagaj&#34;&gt;&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&#x9;&#x9;&lt;td style=&#34;text-align: center&#34;&gt;&lt;img src=&#34;https://www.ZKPunk.dev/img/blagaj_resized_text.jpg&#34; alt=&#34;Blagaj&#34;&gt;&lt;/td&gt;&#xA;&#x9;&#x9;&#x9;&lt;/tr&gt;&#xA;&#x9;&lt;/tbody&gt;&#xA;&lt;/table&gt;&#xA;&lt;p&gt;Lets get started.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Read Image&lt;/li&gt;&#xA;&lt;li&gt;Resize Image by aspect ratio&lt;/li&gt;&#xA;&lt;li&gt;Add text to resized image&lt;/li&gt;&#xA;&lt;li&gt;Save resized image with text&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;1-cv2imread---read-an-image&#34;&gt;&#xA;  1. &lt;code&gt;cv2.imread()&lt;/code&gt; - Read an Image&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#1-cv2imread---read-an-image&#34;&gt;&#xA;    &lt;i class=&#34;fa fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;Link to heading&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;Link to heading&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;The function &lt;code&gt;cv2.imread()&lt;/code&gt; takes a path to the image file and reads it into a variable for further computations. You can use &lt;code&gt;cv2.imshow()&lt;/code&gt; to display the image. However, the execution would be so fast,&#xA;that you won&amp;rsquo;t be able to see the picture loaded. Hence, you would want to pause the program while it&amp;rsquo;s displaying the image using &lt;code&gt;cv2.waitKey()&lt;/code&gt;.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
