<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mohan Vamsi on Medium]]></title>
        <description><![CDATA[Stories by Mohan Vamsi on Medium]]></description>
        <link>https://medium.com/@mohanvamsi75?source=rss-b465e1ec54d5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*j7H8MO3vjP1AT8i0.jpg</url>
            <title>Stories by Mohan Vamsi on Medium</title>
            <link>https://medium.com/@mohanvamsi75?source=rss-b465e1ec54d5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 17:41:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mohanvamsi75/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why Lakehouse Matters: A Deep Dive into the Data Architecture Evolution]]></title>
            <link>https://medium.com/@mohanvamsi75/why-lakehouse-matters-a-deep-dive-into-the-data-architecture-evolution-8bf8f6fbe5a5?source=rss-b465e1ec54d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/8bf8f6fbe5a5</guid>
            <category><![CDATA[apache-iceberg]]></category>
            <category><![CDATA[delta-lake]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[delta]]></category>
            <category><![CDATA[apache-hudi]]></category>
            <dc:creator><![CDATA[Mohan Vamsi]]></dc:creator>
            <pubDate>Fri, 05 Dec 2025 20:01:21 GMT</pubDate>
            <atom:updated>2025-12-05T20:01:21.070Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O7OT9LeFW3aFzhexpoEcHg.png" /></figure><p>The term <em>Lakehouse</em> has become central in modern data engineering discussions. But Lakehouses did not appear out of thin air — they are the natural outcome of decades of evolution in how we store, manage, and analyze data.</p><p>To understand why Lakehouses matter, we must first revisit the path that led us here: from early OLTP systems, to Data Warehouses, to Hadoop-based Data Lakes, and finally to the metadata-driven Lakehouse architectures we rely on today.</p><h3>Understanding the Foundation: What Is Data?</h3><p>At its core, <em>data</em> is a recorded representation of events — transactions, interactions, system logs, sensor readings, and more. Businesses realized early that such data holds immense value, but only if it can be stored efficiently and analyzed meaningfully. This realization shaped multiple generations of data systems.</p><h3>The Era of OLTP: Serving Transactional Needs</h3><p>Online Transaction Processing (OLTP) databases such as Oracle, MySQL, and PostgreSQL became the backbone of operational applications.</p><p>They excelled at:</p><ul><li>Fast inserts and updates</li><li>Reliable transactions</li><li>Low-latency, high-concurrency workloads</li></ul><p>For business operations — orders, payments, bookings — OLTP systems were (and still are) ideal.</p><h3>Stretching OLTP for Analytics</h3><p>As organizations became more data-driven, they attempted to use OLTP databases for analytical workloads. However:</p><ul><li>Analytical queries performed large scans</li><li>These scans slowed down transactional operations</li></ul><p>A temporary workaround emerged: <strong>replicate the OLTP database</strong> and run analytics on the replica. This improved isolation but did not change the fact that OLTP systems were not designed for analytical read patterns.</p><h3>The Rise of OLAP and the Data Warehouse</h3><p>To address analytical workload requirements, specialized OLAP (Online Analytical Processing) systems were introduced. These systems optimized for:</p><ul><li>Large-scale aggregations</li><li>Complex queries</li><li>High-throughput reads</li></ul><p>This led to major distinctions between OLTP and OLAP systems:</p><h3>Schema Design Differences</h3><ul><li><strong>OLTP systems</strong> use <em>normalized schemas</em> to support fast writes.</li><li><strong>OLAP systems</strong> use <em>denormalized schemas</em> (star or snowflake) for efficient analytical reads.</li></ul><h3>Storage Layout Differences</h3><ul><li><strong>OLTP systems</strong> favor <em>row-oriented storage</em> for transactional access patterns.</li><li><strong>OLAP systems</strong> adopt <em>column-oriented storage</em> to accelerate analytical queries.</li></ul><p>Over time, OLAP databases became known as <strong>Data Warehouses</strong>, engineered specifically to support business analytics at scale.</p><h3>The Challenges of Data Warehousing</h3><p>While Data Warehouses delivered strong analytical performance, they also presented several challenges:</p><ul><li>High cost of specialized hardware and licenses</li><li>Limited flexibility in storing diverse data types</li><li><strong>Tightly coupled storage and compute</strong>, which forced organizations to scale both even when only one dimension needed growth</li></ul><p>These limitations created pressure for a more flexible and scalable alternative.</p><h3>HDFS and the Emergence of the Data Lake</h3><p>The introduction of Hadoop Distributed File System (HDFS) transformed the landscape.</p><p>HDFS enabled organizations to store massive volumes of data on <strong>commodity hardware</strong>, eliminating the need for specialized infrastructure. Enterprises quickly began storing all kinds of data — structured, semi-structured, and unstructured — leading to the term <strong>Data Lake</strong>.</p><p>This shift marked the decoupling of storage and compute for the first time in mainstream practice.</p><h3>MapReduce and the First Wave of Distributed Processing</h3><p>Hadoop brought with it the <strong>MapReduce framework</strong>, a general-purpose computation engine capable of processing large datasets residing in HDFS.</p><p>While MapReduce was powerful, it was cumbersome. Writing analytical jobs required significant engineering effort, raising a natural question:</p><p><strong>“Can we query the Data Lake using SQL rather than writing MapReduce jobs?”</strong></p><h3>Apache Hive: Bringing SQL to the Data Lake</h3><p>Apache Hive provided the answer by offering a SQL interface on top of HDFS. Hive translated SQL queries into MapReduce jobs and returned results as if one were querying a traditional database.</p><p>A key innovation was the introduction of the <strong>Hive Metastore (Catalog)</strong>, which:</p><ul><li>Represented directories of files as structured tables</li><li>Stored schema and table definitions</li><li>Enabled SQL engines to interpret raw files consistently</li></ul><p>As the Hadoop ecosystem matured, MapReduce was gradually replaced by faster engines like <strong>Apache Tez</strong> and <strong>Apache Spark</strong>, yet the Hive Metastore remained a central component.</p><p>Hadoop’s open, modular design effectively made it a <strong>deconstructed database</strong>, with each project implementing a part of the larger system.</p><h3>Data Lakes Move to the Cloud</h3><p>With the advent of cloud computing, organizations migrated Data Lakes from HDFS to cloud object stores such as:</p><ul><li>Amazon S3</li><li>Google Cloud Storage</li><li>Azure Data Lake Storage (ADLS)</li></ul><p>This preserved the separation of storage and compute while delivering virtually infinite scalability and reduced operational burden.</p><p>Yet, Data Lakes still had fundamental reliability gaps.</p><h3>The Limitations of Traditional Data Lakes</h3><p>Despite their scalability and low storage cost, classical Data Lakes struggled with several issues:</p><h3>1. Lack of ACID Transactions</h3><p>Multiple writers modifying the same directory could easily corrupt data.</p><h3>2. Weak Schema Enforcement</h3><p>Schema was typically validated during reads, allowing bad data to silently enter the lake.</p><h3>3. Complex Security</h3><p>Security had to be enforced separately at the storage and compute layers.</p><h3>4. Operational Complexity</h3><p>Developers needed to coordinate and configure numerous components to avoid data inconsistencies.</p><p>These gaps restricted Data Lakes from achieving the reliability and governance standards of Data Warehouses.</p><h3>The Lakehouse: Bridging Data Lake Flexibility with Warehouse Reliability</h3><p>Lakehouse architecture emerged in response to a simple question:</p><p><strong>“Can we achieve warehouse-like reliability without sacrificing Data Lake scalability?”</strong></p><p>Lakehouses accomplish this by introducing a <strong>metadata layer</strong> — a structured set of metadata files stored alongside data in the Data Lake.</p><p>This metadata layer defines:</p><ul><li>How data files relate to a table</li><li>How read operations should interpret those files</li><li>How writes, updates, and deletes must be recorded</li><li>How concurrent writers coordinate</li><li>How schema evolves over time</li></ul><p>These rules form a <strong>table format specification</strong>, ensuring consistency and reliability.</p><h3>Leading Lakehouse Table Formats</h3><p>Several independent projects evolved to implement Lakehouse principles, including:</p><ul><li><strong>Delta Lake</strong></li><li><strong>Apache Hudi</strong></li><li><strong>Apache Iceberg</strong></li></ul><p>While each project originated from different motivations and use cases, they share a common vision:<br> <strong>making Data Lakes as reliable as Data Warehouses while retaining openness and scalability.</strong></p><p>These table formats are sometimes compared to file formats — except instead of organizing bytes within a file, they organize <em>collections of files</em> across the Data Lake, governed by rich metadata.</p><h3>What Comes Next?</h3><p>The deeper mechanics of how Lakehouse metadata layers solve transactional consistency, schema evolution, and multi-writer coordination is a rich topic that deserves its own dedicated exploration.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8bf8f6fbe5a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Email trackers work?]]></title>
            <link>https://medium.com/@mohanvamsi75/how-email-trackers-work-42ad08f16d78?source=rss-b465e1ec54d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/42ad08f16d78</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[internet-marketing]]></category>
            <category><![CDATA[internet]]></category>
            <dc:creator><![CDATA[Mohan Vamsi]]></dc:creator>
            <pubDate>Sun, 13 Dec 2020 14:51:39 GMT</pubDate>
            <atom:updated>2020-12-14T03:33:09.118Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*WqB7kQOhXxrGBdQ50jImtg.png" /></figure><p>To give context around E-mail trackers, these are used by email senders to know if the receiver has opened the mail or how many times they have opened the mail.</p><p>In short, the blue ticks feature of WhatsApp for E-mail.</p><blockquote>Simple answer is content of email is not always just text but can also be HTML.</blockquote><p>HTML is HyperText Markup Language used to build web pages, this has originated to add spice to simple plain text by providing features like including images, GIF, and Hyper-Links.</p><p>We can insert the images in the HTML in two ways</p><ul><li>Internal images( part of mail)</li><li>External images( images loaded from external source)</li></ul><p>In the case of external images when the browser tries to render the HTML page from the HTML file it doesn’t have the image as a part of the email to display, so it has to first download the image using the URL from an external source.</p><blockquote>So the trick is, if we count the number of times the image is downloaded from the external source then we know the number of times the E-mail has opened.</blockquote><h3>General Flow of the tracking process:</h3><p>There are three players in the flow</p><ul><li>Sender (S)</li><li>Image hosting server (I)</li><li>Receiver (R)</li></ul><p>Sender (S) wants to send an email to Receiver (R) and wants to get notified whenever receiver opens the email.</p><p>S -&gt; “Hey (I), Here is an image I wanted to host on the web. Can you host it in your server?”</p><p>I -&gt; “Sure, Here is the link to your image www.hostmyimage.com/a1b2c3de “</p><p>S -&gt; “Thank you, Can you ping me whenever anyone download my image from your server”</p><p>I -&gt; “Sure.”</p><p>S mailto: R</p><p>&lt;html&gt;</p><p>&lt;body&gt;</p><p>&lt;p&gt;Hi R, Can you sign the copy and respond back. &lt;/p&gt;</p><p><strong>&lt;img src=”www.hostmyimage.com/a1b2c3de”&gt;</strong></p><p>&lt;/body&gt;</p><p>&lt;/html&gt;</p><p>When R opens the email, his mail renderer downloads the image from I without him doing anything other than just opening the mail.</p><p>I -&gt; “Hey S, look some one downloaded your image at this timestamp and it is requested from 16.22.xx.xx IP address”</p><p>To block such trackers and keep users safe many mail renderers don’t download external images in the mails by default. Gmail don’t do this by default.</p><p>To see all the above in action, you can open any random mail from your Gmail promotion section and view the HTML version of it. You will find many images referenced to external source. Marketers use this tracker to calculate their campaign reach and so on.</p><p>lly, Medium notifies me whenever anyone claps this story, So that I can track who all understands the above 😊</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42ad08f16d78" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Science Behind the Camera — Part2]]></title>
            <link>https://medium.com/analytics-vidhya/science-behind-the-camera-part2-e46e1bcc7548?source=rss-b465e1ec54d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/e46e1bcc7548</guid>
            <category><![CDATA[cameras]]></category>
            <category><![CDATA[science]]></category>
            <category><![CDATA[photography]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[art]]></category>
            <dc:creator><![CDATA[Mohan Vamsi]]></dc:creator>
            <pubDate>Sun, 12 Apr 2020 13:11:18 GMT</pubDate>
            <atom:updated>2020-04-25T20:34:49.966Z</atom:updated>
            <content:encoded><![CDATA[<h3>Science Behind the Camera — Part2</h3><p>Ever heard of PIN Hole Glasses? You will get to understand how pin Hole glasses works by understanding science behind camera.(check the end of story if you are eager)</p><p>In <a href="https://link.medium.com/cMjmHM0fe5">part-1</a> of series, we have discussed the need for Shutter and Aperture in the construction of the camera. In the end, we have constructed a Pin Hole Camera and observed a problem that images are not sharp.</p><p>In this part, we are going to deal with that problem using Convex Lens.</p><h3>Flaws with Pin Hole Camera:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iKViTdObW1UuZpfkmVbtSg.gif" /><figcaption>Pin Hole Camera</figcaption></figure><p>Pin Hole camera has just a small hole called Aperute in front of the image sensor. As we can see from the above illustration the captured is not as sharp as the object we want to capture. Not sharp I mean, corresponding to a single point of the object we have small spread in its image. Let’s understand how this spread is affected by the distance of an object from the aperture and size of the aperture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z4JkPQb4ljGgP7Mqhd56FA.gif" /><figcaption>Relation of Object distance and Blur Radius.</figcaption></figure><p>Objects far away from aperture cast smaller blur radius and objects near to aperture cast larger blur radius. One thing to be observed is the minimum blur radius that is cast is the radius of the Aperture, when the light rays coming are parallel(Object is very far away). Let’s see the same relation in the graph for better understanding(Ignore this if too complicated).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IseRpKHkGCMe8ek7bjBTfw.gif" /></figure><p>In Pin Hole Camera, there is no single object distance that can cast a ‘0’ blur radius on the sensor.</p><blockquote>In Pin Hole Camera, where ever you place the object in front of the camera there is a non zero spread on the image sensor, It’s just that our human eye can’t observe some blur radius.</blockquote><p>With the aim to deal this let’s understand Convex Lens.</p><h3>Convex Lens:</h3><p>Lenses are optical instruments that bend the light. Convex Lenses are those type that bends light towards their center. They try to make the light rays come together. Watch <a href="https://www.youtube.com/watch?v=jQqF76ZkSLU">this </a>demonstration video for a better understanding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SNloEZrpgKFri4vtXgbUig.gif" /></figure><p>In the above illustration, we see the parallel rays hitting the convex lens and converged on to the sensor. Let’s consider a single point with diverging rays and how the convex lens converges the rays on the image sensor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G_YuYeNGE-bz17mfjBnuKw.gif" /></figure><p>The lens is doing a similar job of converging the light rays that are hitting on the lens.</p><blockquote>In the above both illustrations with lenses, there is some coincidence. We always placed the image sensor at the same place where the light rays are converging.</blockquote><p>It is not always the case. Generally, the image sensor(image plane)will be fixed(immovable). Let’s consider the object is placed a little closer to the lens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tLrqCWTquiYI5Fm_Wx7RCA.gif" /><figcaption>The object is closer to the Lens.</figcaption></figure><p>In the above scenario, the image sensor is hindering the light rays to converge to a point. What image sensor sees is a <strong>blur radius </strong>again. This blur radius increases if the object is coming close to the lens from the initial position.</p><p>Let’s consider an object away from the initial position.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*73WoD3uLys-cKZKfG4kaVQ.gif" /><figcaption>Object away from the initial position.</figcaption></figure><p>In this scenario, the light rays converged before hitting the image sensor. Since there is no hindrance to light rays they start diverging from the converging point and hit the image sensor.</p><blockquote>What if we put this convex lens optical instrument behind our Aperture?</blockquote><h3>Convex Lens behind the Aperture:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YUO-v7-UJcReS40CSsbfmw.gif" /><figcaption>Without convex lens</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kPvIzZludjsXrfvwNuHHrQ.gif" /><figcaption>With Convex Lens behind Aperture.</figcaption></figure><p>By placing the convex lens behind the Aperture, we are able to converge the light rays to a single point on the image sensor instead of forming a big blur radius. This is the case when light rays converge exactly on the image sensor.</p><blockquote>Will the aperture size impacts in this case?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XYD-cE5Q6fIElkquNPIimg.gif" /><figcaption>Reduced Aperture Size.</figcaption></figure><p>The Aperture size doesn’t change the blur radius in this case but it decreases the number of light rays entering. This decreases the brightness of the captured image.</p><blockquote>Did we completely got rid of Blur Radius? Not Exactly!</blockquote><p>Consider the case when the light rays are not converged to a single point on the image sensor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PwtKopA1_AxJRTppz6brnA.gif" /><figcaption>The object is closer to the aperture.</figcaption></figure><p>In the above case, we got the blur radius again. We did not get rid of blur radius but at least we reduced its radius drastically with the introduction of the convex lens. Similarly, when the object is placed away from the aperture we start to observe the blur radius again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m5U0KjADyn1D4RaTT-N-7Q.gif" /><figcaption>The Object is away from Aperture.</figcaption></figure><blockquote>There is exactly one position where if you place the object, all the light rays converge to a single point on the image sensor. The far from this position we place the object, the larger the Blur Radius is.</blockquote><p>If we want to relocate this one position that is exactly in focus(zero blur radius) we can move the convex lens. The position of the convex lens determines the position that is in focus.</p><h3>Impact of Aperture Size on Blur Radius:</h3><p>Let’s check how the Aperture size impacts the blur radius when the object is displaced from the position in focus.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kgQS7kfQIcvUh8TENa_zWQ.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YYxf2NIZwq4CmH5rS-B-Tg.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LYSoMerPw8hAi07c7lT-2A.gif" /></figure><p>As we can see from the above illustration, the blur radius decreases with a decrease in Aperture size.</p><blockquote>Blur Radius is determined by the distance of the object from the position that is in focus and the size of Aperture.</blockquote><h3>Is it worth introducing Lens to achieve a single position that is in focus?</h3><p>In a Pin Hole Camera, we don’t have at least a single position where if we place the object we get ‘zero’ blur radius. With the introduction of the convex lens, we are able to achieve a ‘zero’ blur radius at least at a single position.</p><p>We learned that we can control the blur radius by changing the Aperture size.</p><blockquote>We also learned that we always don’t need ‘zero’ blur radius because human eyes can’t perceive blur up to a certain radius.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dm1_vijSijccZ-kPqBhOyA.gif" /></figure><blockquote>The range of positions where if we place the object, the human eye perceives the image as a sharp image even with a non-zero blur radius is called <strong>Depth of Field</strong>.</blockquote><p>The <strong>Depth of Field</strong> is controlled by the size of the Aperture. If the aperture size is small, a wide range of positions is perceived as in focus by the human eye.</p><p>If we want to have all the positions in front of the camera to be in focus, we need to set Aperture as small as possible.</p><p>Let&#39;s see the same relation in graph illustration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wo1WqIvE7Lkmvdrl5T7HJg.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u7Sx95WUbTJSTHuSnpixWg.gif" /></figure><h3>Conclusion</h3><ul><li>We have built a Pin Hole Camera with the introduction of <strong>Aperture</strong>.</li><li>To address the problem of the image not being sharp, we have introduced <strong>Convex Lens</strong>.</li><li>After the introduction of the lens, we got to know that it can make only some regions look sharp called <strong>Depth of Field</strong>.</li><li>We learned how to control the <strong>Depth of Field</strong> with the Aperture Size.</li></ul><h3>Pin Hole Glasses</h3><p>Let’s try to understand how Pin Hole Glasses can be used to solve the problem of short-sightedness and long-sightedness problems with the knowledge we gained.</p><p>Even the Camera is built by inspiring the human eye. Even inside the eye, we have a convex lens that can be moved by muscles.</p><p>The human eyesight problem occurs when the muscles are unable to move the lens in certain positions. As we learned from the camera that if we decrease the aperture size to very small, all the objects in front of the camera will be in focus. i.e, infinity Depth of Field.</p><p>Similarly, if we place glasses with very small holes in front of our eyes we can achieve very large Depth of Field and we will be able to see almost all the objects that are far away and close to the eye.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6pH_AkFurl6WDwZbR8o--A.jpeg" /><figcaption>Pin Hole Glasses. (Source: Wikipedia)</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e46e1bcc7548" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/science-behind-the-camera-part2-e46e1bcc7548">Science Behind the Camera — Part2</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Science Behind the Camera — Part 1]]></title>
            <link>https://medium.com/analytics-vidhya/science-behind-the-camera-part-1-288c96e64b59?source=rss-b465e1ec54d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/288c96e64b59</guid>
            <category><![CDATA[science]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[cameras]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[photography]]></category>
            <dc:creator><![CDATA[Mohan Vamsi]]></dc:creator>
            <pubDate>Sat, 28 Mar 2020 11:36:33 GMT</pubDate>
            <atom:updated>2020-04-25T20:27:58.900Z</atom:updated>
            <content:encoded><![CDATA[<h3>Science Behind the Camera — Part 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*DS_7E-pY4sMiPoV57NVnjw.jpeg" /></figure><p>An Engineers’ perspective of Camera design. To understand the science behind let’s try to build the camera from scratch.</p><h3>What is a Camera?</h3><p>A device that can record the image of the physical objects in front of it that a <strong>human eye can perceive</strong>. This device mimics the function of the human eye.</p><h3>What do we record and How do we record?</h3><p>The whole physical world is visible because of light. There are objects which emit light by themselves and which doesn’t. All the objects absorb some portion of light and reflect the remaining depending on their nature.</p><blockquote>We differentiate between two objects based on the light-emitting from them, it can be self-generated or reflected light.</blockquote><p>We need to record <strong>light</strong>. To do this we need an instrument that is sensitive to light. During the days of analog cameras, we use <strong>Photographic Film </strong>to record light. In present-day digital cameras, we use <strong>Digital Image Sensor</strong>. Let us consider the digital image sensor in our discussions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*cPXqGAaVQg2iSjzuQ5hftw.png" /><figcaption>Photographic Film</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*335qdoDKRWAw2nt5C07aKg.jpeg" /><figcaption>Digital Image Sensor</figcaption></figure><blockquote>These image sensors can be considered as buckets collecting light with an <strong>upper limit</strong> to the amount of light they can record. Light just <strong>overflows</strong> if the amount exceeds the limit.</blockquote><h3>Image Sensors</h3><p>A Cameras image sensor is a collection of digital light sensors arranged in a rectangular pattern. Each unit of a digital image sensor is called <strong>Pixel</strong>. The dimension of this rectangular pattern is referred to as the <strong>Resolution of Image Sensor.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*qZ4syASSUblB2B8WPY10qA.jpeg" /><figcaption>5 x 5 Image Sensor</figcaption></figure><p>Example sensor resolution of image-sensors are:<br>High Definition(1280 x 720)<br>Full High Definition(1920 x 1080)<br>Ultra High Definition</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*smzdwPuYh7mQZDkvnY2F3Q.jpeg" /></figure><p>Each Pixel can be assumed as a bucket that collects light that is exposed to. Similar to bucket the pixels have limited size to how much light it can hold. If more light is exposed to them exceeding their limit, then that light spills over. The value the sensor outputs depend on the light it captured.</p><p>Initially when no light is captured the pixel displays black color(0). Slowly when the pixel starts to capture light the pixel displays different levels of grey color, reaching the white color when the pixel reaches its maximum(255).</p><p>The pixel value is independent of the wavelength of light(irrespective of the color of light).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*-1kgUeom59jEcRfIik_oSw.gif" /><figcaption>The light sensor as a container collecting light.</figcaption></figure><p>The present setup of the image sensor can only capture monochromatic light i.e, black and white images without any color information.</p><h3>Color Image Sensor</h3><p>Any Coloured image can be decomposed into three components, <strong>red</strong>-colored component, <strong>green</strong>-colored component, <strong>blue</strong>-colored component. So, if we want to capture a color image we want all these three red, blue, green components.</p><p>If we want to capture the red-colored component of the scene we need to place the red color filter in front of the image sensor, this allows only red color present in the scene. Similarly, for capturing green and blue component we need to place corresponding filters in front of the image sensor.</p><p>If we want to capture a color image with the present setup, we need to capture thrice with different filters each time, to take a single photograph (People used to do this in the early days). We need to solve this problem of capturing thrice to get a single color image.</p><h3>Bayer Filter</h3><p>Rather than capturing thrice with different filters each time we are going to design a new kind of color filter such that we can capture the scene with just one filter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*CUdeDYj7s1H6yFiBK8Vpeg.png" /></figure><p>In this single filter, some of the pixels will have a red color filter, some will have green and remaining blue filters. The missing pixel values can be interpolated(approximated) from the neighboring pixel values. Thus producing three components(Red, green, blue) of the image with the single capture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*hYilmNSmHAutmqYf5wsJkQ.png" /><figcaption>Producing RGB components with Single capture.</figcaption></figure><p>Now we have designed a good image sensor which with the help of Bayer filter can also record color information.</p><h3>Is a camera just a light sensor?</h3><p>Since our image sensors have a limit to the amount of light they can hold, we can’t expose our sensors to light for too long. This is the reason people use the darkroom to process photographs captured using photographic film.</p><p>We need to protect our image sensor from more light. We need to allow light to reach the sensor for only the short time required. So we add a new cover over sensor called “<strong>Shutter</strong>” which shuts the light towards the sensor most of the time. The amount of time Shutter is opened to allow light is called “<strong>Shutter Speed</strong>”.</p><blockquote>Shutter Speed is <strong>common </strong>for all the pixels in the sensors. We can’t control shutter speed(exposure time) for each pixel. Some Pixels may fill fast while others slow depending upon the intensity of light exposed on that Pixel.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*UwJJ3mkvcbpwv2iqpIy_MA.gif" /></figure><p>Initially, when the sensor is not exposed yet, no pixel contains any amount of light so all the pixels display black. As we start exposing to the scene each pixel starts receiving light at a different rate based on the scene. After long enough exposure time all the pixels reach their <strong>upper limit</strong> and start to overflow, then all the pixels display white color.</p><p>To understand more about the outcome of a common shutter to all the pixels in my other blog, <a href="https://blog.usejournal.com/hdr-its-not-high-definition-8ce767131e1d">HDR</a>.</p><h3>Why can’t we photograph using Just an Image sensor with a shutter?</h3><p>We have the scene we want to capture and the image sensor with a shutter to record the light. If we open the shutter for a short duration of time without overexposing, the sensor receives light and converts it to pixel values. We have generated the image from pixel values but the question is,</p><blockquote>Do the Captured pixels exactly correspond to the scene we want to capture?</blockquote><p>To verify this, we need to understand some properties of light.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JRPppW_4C_pjO_UACzgarw.gif" /><figcaption>The object reflects Light in all directions.</figcaption></figure><blockquote>When a physical object receives light from any light source it reflects light in<strong> all the directions</strong> except mirrors which reflect in only one direction(angle of incidence = angle of reflection).</blockquote><p>From now on we can assume each point of physical object emits reflected light in all directions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KeEARkMKoHrIYiAPj9LEhw.gif" /><figcaption>All the points of object emitting light in all directions.</figcaption></figure><p>Since we know how the objects reflect light, let us see what kind of light is received by each pixel in the sensor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8t59t9s1p3rIPOYKfrureA.gif" /><figcaption>Two pixels receiving approximately the same light from all the points.</figcaption></figure><p>Consider any two pixels on the image sensor and <strong>Each pixel</strong> in the image sensor receives light from all the points in the scene which is not desired.</p><blockquote>The amount of light received by all the pixels will be almost the same, <strong>the generated pixels values make no sense.</strong></blockquote><p>The ideal desired scenario is there is one pixel corresponding to a single point of the object, i.e, one to one mapping of the image sensor and the scene.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vf4PfcO-zF2dbiakqAUuug.gif" /><figcaption>Ideal Mapping.</figcaption></figure><p>To make the pixels correspond to the scene we want to capture, we need to restrict the light received by a single-pixel to be from a very small region of the scene but not from the whole scene like before. Ideally, we need to make one to one correspondence between points in the scene and the points on the sensor.</p><h3>Introducing Aperture to the camera setup</h3><p>We are introducing a new light blocker in front of the image sensor. This light blocker has a small hole to allow light to pass through called <strong>Aperture</strong>. How is this Aperture going to solve the need to create one to one mapping?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NuP2UvVyg0X-jAND-zohJw.gif" /><figcaption>Introducing Aperture</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QhpRy4UNNCKt8GVV5J6evQ.gif" /><figcaption>Aperture blocks unnecessary light.</figcaption></figure><p>To make ideal one to one mapping the aperture should be <strong>just a point</strong> but physically this is not possible. The aperture has a considerable radius. Because of this considerable radius, the single point of the scene makes a radius on the image plane rather than a single point.</p><blockquote>The image is blurry and blurriness increases with an increasing radius of Aperture.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-0eG_pbkUi6LyRVW1ViYPA.gif" /><figcaption>Near to one-one mapping</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iKViTdObW1UuZpfkmVbtSg.gif" /><figcaption>Pin Hole Camera</figcaption></figure><blockquote><strong>Human Eyes can’t recognize blur if the blur radius is small enough and less than a certain threshold. Human Eye perceive the image as a sharp image.</strong></blockquote><p>This present setup of the camera is called <strong>Pin Hole Camera</strong>. We have built a basic version of a camera that can capture an image.</p><p>But captured images are not sharp, the blurriness in the image increases if the object is close to the camera.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z4JkPQb4ljGgP7Mqhd56FA.gif" /></figure><p>Objects far away from the aperture form a smaller radius on the sensor. Objects close to the aperture form a larger radius. Thus Objects far away make sharper images on the sensor than the closer objects in this setup.</p><p>The shape of the blur is the same as the shape of the Aperture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kIkX_P8G0nrV__nKBQODdA.gif" /><figcaption>Aperture shape defines the blur shape.</figcaption></figure><h3>Why do we call image blurry and how the radius relates to blurriness?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EzeeIjV-z5__v9FDEeiAyg.gif" /></figure><p>If the image is not sharp then we call the image is blurry. Information of a single point of the object is spread over a broad region on the image sensor, the amount of spread is determined by the <strong>blur radius</strong>. Hence in the above demonstration where we are trying to capture a thin line, but we got a blurred image that is thicker.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gnauoseIC1rNV6hCwNKCHA.jpeg" /><figcaption>Example Blurred Image.</figcaption></figure><p>In Part 1 of this series, I have discussed the need for Shutter and Aperture in the construction of a camera. I am going to discuss how we are going to solve the problem of blurriness with the introduction of the lens in the <a href="https://link.medium.com/qPDwnnOPC5">part 2</a> of the series.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=288c96e64b59" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/science-behind-the-camera-part-1-288c96e64b59">Science Behind the Camera — Part 1</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HDR — It’s not High Definition …]]></title>
            <link>https://medium.com/@mohanvamsi75/hdr-its-not-high-definition-8ce767131e1d?source=rss-b465e1ec54d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ce767131e1d</guid>
            <category><![CDATA[computational-photography]]></category>
            <category><![CDATA[hdr]]></category>
            <category><![CDATA[photography]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[hdr-photography]]></category>
            <dc:creator><![CDATA[Mohan Vamsi]]></dc:creator>
            <pubDate>Sat, 01 Feb 2020 18:09:11 GMT</pubDate>
            <atom:updated>2020-02-05T21:24:22.807Z</atom:updated>
            <content:encoded><![CDATA[<h3>HDR — It’s not High Definition …</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*AJ9-NWwNfL4Y2X9HtUtuLQ.jpeg" /></figure><p>Most of you might have observed the HDR option in the settings of the mobile Camera application. Does it improve your image quality? What changes does it bring to the table?</p><h3>Is HDR related to terms like <strong>HD,</strong> <strong>FHD,</strong> <strong>UHD</strong>?</h3><p><strong>HD</strong> refers to <strong>High Definition</strong>, <strong>FHD</strong> refers to <strong>Full High Definition</strong>, <strong>UHD</strong> refers to <strong>Ultra High Definition</strong>. All these terms are representing the number of pixels that a camera can capture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*8UQNtycPQKfnYFW0QMkfKQ.jpeg" /></figure><blockquote>HDR is <strong>not</strong> related to Number of Pixels. So it is not related to HD, FHD, UHD.</blockquote><h3>So, What is HDR?</h3><p><strong>HDR </strong>refers to High Dynamic Range. From the term, it is obvious that we are quantifying the term ‘<strong>Dynamic Range</strong>’ and we want it to be high.</p><blockquote>HDR — <strong>High Dynamic Range</strong></blockquote><h3>Let’s define ‘Dynamic Range’.</h3><blockquote>Dynamic Range is the ratio between the largest and smallest values that a certain quantity can assume. Often used in the context of <strong>Light</strong> and <strong>Sound</strong> signals.</blockquote><p>For example, if we consider 15cm ruler Its Dynamic Range is 150. Since the minimum it can measure is 0.1cm and the maximum length it can measure is 15cm its dynamic range would be 15/0.1 = 150.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*9nwrTm4QlJf9hkSxMqJBnQ.png" /></figure><p>Length can be measured in meters(m), what do you think the unit of measurement of light signal? It is <strong>Lumen (Cd/m2).</strong></p><h3>Since we know What is Dynamic Range, What is its relevance to Camera?</h3><p>The camera is a device that captures light that it is exposed to.</p><blockquote>The ideal Camera should capture all the Dynamic Range(Smallest to Largest) of light existing in nature that it is exposed to capture.</blockquote><h3>What is the Dynamic Range of real-world light sources?</h3><p>There exists a very wide range of light sources in the real world from <strong>Candle</strong> <strong>Light</strong> to <strong>Sun</strong> <strong>Light</strong> with varying luminance levels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*WFSUEe8khgSrXCgytIWfvw.png" /></figure><p>The Dynamic Range is around10¹².</p><p>So, our ideal camera should capture all this range. But in the practical world, the captured image is stored in <strong>8 bits per pixel</strong>, i.e, each pixel has just 256 levels (0 – 255).</p><blockquote>If you are capturing Candlelight and Sunlight simultaneously what should be the pixel values of corresponding lights in captured image?</blockquote><h3>Problem with real-world Cameras</h3><blockquote>The real-world cameras have the limitation of capturing only Low Dynamic Range of light.</blockquote><p>But to build our ideal camera we need to capture all the range(High Dynamic Range) of lights.</p><blockquote>The process of capturing High Dynamic Range(HDR) images using Low Dynamic Range(LDR) Cameras is called <strong>HDR-Imaging</strong>.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*wYaJtK1sQkdHuDAxKkDSNQ.png" /></figure><h3>Example HDR image Generated from LDR images</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*C32FDpDK34scfJjThBq1QA.jpeg" /><figcaption>a) Low Dynamic Range Image of the Scene</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*KP9dQ99K1FclAWZs6SoN-g.jpeg" /><figcaption>b) Low Dynamic Range Image of the Scene</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*2_jz09xU9L-V7brmUiJbkg.jpeg" /><figcaption>c) Low Dynamic Range Image of the Scene</figcaption></figure><p>Observe the first LDR image(a), It captures the very good details of the Sky but fails to capture the foreground buildings(mostly dark) and water. In the second LDR image(b) the Sky details start to blow out(become white instead of its actual color) and we start to see the details of water. In the third LDR image(c) the Sky details are completely blown out(complete white) and we can observe good details of the foreground buildings.</p><p>We use the above three Low Dynamic Range(LDR) images to generate HDR image which should contain the details of all the objects in the scene i.e, Sky, water and foreground buildings in our case. This image should be close to how a human eye observes this scene.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*-sXYn2MyJpI5pylaZqUdtA.jpeg" /><figcaption>d) Final HDR image generated using the above images.</figcaption></figure><h3>What is Causing this limitation in Camera?</h3><p>The core of the digital camera is an image sensor. The sensor can be assumed as a series of buckets that collect the light. Each pixel can be assumed as a single bucket. If the light received by the single bucket exceeds its capacity, it just overflows the extra light. Finally, each pixel is assigned with one value between 0 and 255 depending upon the amount of light captured in the bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/378/1*2ZnzHEK1JqZeGuDeK3g1og.jpeg" /></figure><p>The amount of light collected by a pixel also depends on the time the sensor is exposed to light. Exposure time can be controlled with shutter speed.</p><p>Let’s see the example by controlling the exposure time.</p><p>For the sake of analogy we will measure light in liters (lt) and intensity of light in liters/second (lt/s). A single bucket is our one-pixel sensor. The bucket is always covered with a lid(shutter) always except when we want to capture an image. If we open the lid for a long time all the buckets will be overflowed leaving white image without any information. This amount of time the lid is open is called Exposure Time and it is the same for all buckets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*G-OtIfLD6zPjjPIyf1ZNKA.jpeg" /></figure><p>Consider our bucket is of size 255 liters and the intensity of candlelight is 0.5 lt/s. We need 2s of Exposure Time to recognize the presence of light and assign pixel value 1 and after 510s the bucket overflows. So the optimum exposure time is 2–510 seconds.</p><p>Consider the intensity of sunlight is 1020 lt/s. The bucket overflows just by 0.25s exposure time. Optimum exposure time to capture sunlight is 0.001 — 0.25 seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*3aPhEPxtNdzyTyhxwRLiTw.jpeg" /><figcaption>Exposure Time less than 0.25 Seconds</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*5ULASHm0jvA6Oa2SCe-RkA.jpeg" /><figcaption>Exposure is greater than 0.25 S and less than 2 S</figcaption></figure><blockquote>There is no Common Exposure time that can capture both Sunlight and candlelight at the same time without either blowing out or underexposing.</blockquote><p>The limited capacity of the image sensor which causes the light overflow and inability to measure low light with high accuracies are the main reasons behind this limitation.</p><h3>Merging Technique</h3><p>To Solve this limitation without changing the camera hardware, researchers came with a technique that captures multiple images of the same scene with different exposure times such that at least some regions of the scene are captured in good detail in each image. Merging images with different exposures is called <strong>Exposure Bracketing</strong>. This technique outputs a <strong>High Dynamic Range </strong>image.</p><h3>Interesting facts</h3><p>Even the Human eye has this limitation but its range is very high than digital cameras. It is very difficult to focus on dark regions of the road when high beam lights of the opposite car are focused on your eye during night drives.</p><p>When you are in a dark room and then if the light turns on, you will close your eyes quickly because your eyes need time to adjust the new Dynamic range.</p><p>The Concept of HDR applies to our ears too, the same way as the eyes. You can’t hear what a person beside you talking to you in the presence of loudspeaker but in a silent room, you can hear even small whisper.</p><p>The small sound from earphones seems like a loudspeaker.</p><p>Nowadays you will find many display devices with an HDR feature. These displays are able to show light with a high dynamic range.</p><p>Photographs Source: <a href="https://www.easyhdr.com/examples/ostrow-tumski/">https://www.easyhdr.com/examples/ostrow-tumski/</a></p><p>📝 Read this story later in <a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_read_later_text">Journal</a>.</p><p>👩‍💻 Wake up every Sunday morning to the week’s most noteworthy stories in Tech waiting in your inbox. <a href="https://usejournal.com/newsletter/noteworthy-in-tech/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_text">Read the Noteworthy in Tech newsletter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ce767131e1d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>