<?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 Mansi Kataria on Medium]]></title>
        <description><![CDATA[Stories by Mansi Kataria on Medium]]></description>
        <link>https://medium.com/@zoomout?source=rss-291ca5eb1f7e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*FEUaogNUHEnIWVYctrv2CQ.jpeg</url>
            <title>Stories by Mansi Kataria on Medium</title>
            <link>https://medium.com/@zoomout?source=rss-291ca5eb1f7e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 05:55:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zoomout/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[Detect tip of tongue using OpenCV]]></title>
            <link>https://zoomout.medium.com/detect-tip-of-tongue-using-opencv-9d15e0b18c3?source=rss-291ca5eb1f7e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9d15e0b18c3</guid>
            <category><![CDATA[tip-of-tongue-detection]]></category>
            <category><![CDATA[tip-of-tongue-tracking]]></category>
            <category><![CDATA[face-tongue-detection]]></category>
            <category><![CDATA[opencv]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Mansi Kataria]]></dc:creator>
            <pubDate>Thu, 10 Feb 2022 10:15:48 GMT</pubDate>
            <atom:updated>2022-02-10T10:17:08.405Z</atom:updated>
            <content:encoded><![CDATA[<p>Quite often we find ourselves in a situation where we want to do more with a face image than just detect the common facial landmarks like mouth, lips, eyes, jaw, etc.</p><p>I recently worked on a social media related project where I had to detect the tip of the tongue in real-time video and track the tip as it moves.</p><p>My first approach was to find a solution using existing libraries and if the accuracy is not up to the mark, create a custom model.</p><p>In this article, I’ll show you a solution using existing libraries.</p><p>List of libraries required for the project:</p><ol><li><em>imutils — </em>for real-time video capture</li><li><em>OpenCV — </em>for image processing</li><li><em>dlib — </em>for facial landmark detection</li><li><em>scipy — </em>for distance calculation on facial landmarks</li><li><em>math</em></li><li><em>numpy</em></li></ol><p>Let’s create 2 python scripts:</p><ol><li><em>face_utils.py</em> — for facial landmark detection and detect is mouth is open</li><li><em>detect-tongue-tip-real-time.py</em> — for real-time video capture and processing each frame to detect the tip of the tongue</li></ol><p>Here I’m not explaining the facial landmark detection part in detail, because that is covered in a separate <a href="https://zoomout.medium.com/how-to-use-facial-landmarks-obtained-from-dlib-b82129e5b352">article</a>.</p><p>Utility functions in <em>face_utils.py</em>:</p><p><strong><em>get_mouth_loc_with_height</em></strong></p><p><em>It returns,</em> <em>mouth coordinates, the height of mouth and inner mouth, shape coordinated of mouth</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9968f022decaa7ceee441df6d1150f93/href">https://medium.com/media/9968f022decaa7ceee441df6d1150f93/href</a></iframe><p><strong><em>draw_mouth</em></strong></p><p><em>draws the dotted line on the mouth part on the face in the image, based on landmarks</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fa60b4a3e615a8da9d4917d8ab997dfa/href">https://medium.com/media/fa60b4a3e615a8da9d4917d8ab997dfa/href</a></iframe><p><strong><em>mouth_aspect_ratio</em></strong></p><p><em>Calculate aspect ratio of mouth based on landmarks (Ref: </em><a href="https://github.com/mauckc/mouth-open/blob/master/detect_open_mouth.py">https://github.com/mauckc/mouth-open/blob/master/detect_open_mouth.py</a><em>)</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/671e0489bf8a93528a2cb39e63d83df5/href">https://medium.com/media/671e0489bf8a93528a2cb39e63d83df5/href</a></iframe><p>Moving on to actual logic. Let’s discuss it step by step:</p><ol><li>Enhance image for that rest of image processing will have a better accuracy.</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1b6a8b30b67d01cd411a1badcf052588/href">https://medium.com/media/1b6a8b30b67d01cd411a1badcf052588/href</a></iframe><p>2. Check whether the face is detected and the mouth is open.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c8bb080f6722b4686d1014d51a6d488f/href">https://medium.com/media/c8bb080f6722b4686d1014d51a6d488f/href</a></iframe><p>3. If the mouth is open, use local feature detector <a href="https://docs.opencv.org/3.4/d1/d89/tutorial_py_orb.html#:~:text=As%20an%20OpenCV%20enthusiast%2C%20the,Kurt%20Konolige%20and%20Gary%20R.&amp;text=ORB%20is%20basically%20a%20fusion,modifications%20to%20enhance%20the%20performance.">ORB</a> in OpenCV, after experimentation I found that ORB works better than blob detectors.</p><p>Once we have key points, we find the key point that is lowest in the image to give us the tip of the tongue, and then get corresponding key points in the actual image, because in the first step we resized the image.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a25e9e7912b4dbeb977d25cc339adcd9/href">https://medium.com/media/a25e9e7912b4dbeb977d25cc339adcd9/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vAxaCoHn3VMEMkdXar9pUQ.png" /></figure><p>And that is all….</p><p>Here is a demo in the real-time video:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*uSFrJ-_uREfS60tqf0CpPg.gif" /></figure><p>For the entire codebase, more demo, and other details, here is the <a href="https://github.com/mansikataria/tongue-tip-detection-and-tracking">project</a>.</p><p><strong>Is this the accurate way?</strong></p><p>This process gives us a pretty good approximation of the tip of the tongue. Still, there are a few assumptions that are made in this process, which will not be always true, like:</p><ol><li>The tip of the tongue is always at the bottom of the mouth area.</li><li>The tip of the tongue won&#39;t be going below the lower lip.</li></ol><p>In order to make the process more accurate, I am working on a custom model (will publish an article about it once that is ready).</p><p>That’s all for this one folk! ciao…</p><p>Feel free to connect with me on <a href="https://twitter.com/_mansi___">Twitter</a> or <a href="https://www.linkedin.com/in/mansirkataria/">LinkedIn</a> and drop me a note if you have any questions. If you like this article, follow me right here on <a href="https://zoomout.medium.com/">Medium</a>.</p><p>Mansi Kataria</p><blockquote>Email: <a href="/service/mailto:jackraiferbaruch@gmail.com">mkataria920@gmail.com</a> <br>LinkedIN: <a href="https://www.linkedin.com/in/mansirkataria/">https://www.linkedin.com/in/mansirkataria/</a><br>Twitter: <a href="https://twitter.com/_mansi___">https://twitter.com/_mansi___</a><br>Medium: <a href="https://zoomout.medium.com/">https://zoomout.medium.com</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9d15e0b18c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A ConvNet for the 2020s]]></title>
            <link>https://zoomout.medium.com/a-convnet-for-the-2020s-aa74632b4c2?source=rss-291ca5eb1f7e------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa74632b4c2</guid>
            <category><![CDATA[facebook-ai-research]]></category>
            <category><![CDATA[convnext]]></category>
            <category><![CDATA[latest-convolution]]></category>
            <category><![CDATA[convnets]]></category>
            <category><![CDATA[computer-vision-latest]]></category>
            <dc:creator><![CDATA[Mansi Kataria]]></dc:creator>
            <pubDate>Thu, 20 Jan 2022 13:11:49 GMT</pubDate>
            <atom:updated>2022-02-10T10:20:54.818Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a brief overview of Facebook AI’s latest Paper on ConvNets.</p><blockquote>The “Roaring 20s” of visual recognition began with the introduction of Vision Transformers (ViTs), which quickly superseded ConvNets as the state-of-the-art image classifica-tion model. A vanilla ViT, on the other hand, faces difficulties when applied to general computer vision tasks such as object detection and semantic segmentation. It is the hierarchical Transformers (e.g., Swin Transformers) that reintroduced several ConvNet priors, making Transformers practically viable as a generic vision backbone and demonstrating remarkable performance on a wide variety of vision tasks.</blockquote><p><strong>What is this paper about?</strong></p><p>It is an exploratory journey starting from basic ConvNets to Vision Transformers and to Hierarchical Vision Transformers, to discover various key points that have contributed to better performance along the way and also test the limitation of pure ConvNets.</p><blockquote>The outcome of this exploration is a family of pure ConvNet models dubbed Con-vNeXt.</blockquote><p><strong>Why are ConvNets still dominant?</strong></p><ol><li>In many applications, the “sliding window strategy” is intrinsic to visual processing.</li><li>They have several built-in inductive biases.</li><li>Without ConvNet’s inductive biases, the vanilla ViT model faces many challenges, mainly its quadratic complexity with respect to the input size.</li><li>Hierarchical Transformers takes on a hybrid approach to bridge the gap between ConvNets and ViT, and it brings back in the convolution.</li><li>These attempts to bring back convolutions come with a price, a naive implementation of sliding window self-attention can be expensive, the speed can be optimized with advanced approaches but the system becomes more sophisticated in design.</li></ol><p>So, it’s almost ironic that a ConvNet already satisfies many of those desired properties, albeit in a straightforward, no-frills way.</p><p><strong>Steps in this exploratory research</strong></p><ol><li>Start with a standard ResNet (like a ResNet50), which would be trained with improved methods.</li><li>Gradually modernize the architecture to the construction of a Hierarchical Vision Transform (eg, Swin-T).</li><li>The explorations are directed to investigate and follow different levels of designs from a Swin Transformer while maintaining the network’s simplicity as a standard ConvNet.</li></ol><p>Here is the figure of the outcome of this journey:</p><blockquote>We modernize a standard ConvNet (ResNet) towards the design of a hierarchical vision Transformer (Swin), without introducing any attention-based modules. The foreground bars are model accuracies in the ResNet-50/Swin-T FLOP regime; results for the ResNet-200/Swin-B regime are shown with the gray bars. A hatched bar means the modification is not adopted. Detailed results for both regimes are in the appendix. Many Transformer archi-tectural choices can be incorporated in a ConvNet, and they lead to increasingly better performance. In the end, our pure ConvNet model, named ConvNeXt, can outperform the Swin Transformer.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*X6ugWvPR2_SQQ30_RH1aDA.png" /></figure><p><strong>Result of this research</strong></p><blockquote>As a result, we propose a family of pure ConvNets dubbed ConvNeXt.</blockquote><p>The resulting network, called “ConvNeXt” outperforms all state-of-the-art Convolutional Networks, including Swin Transformers.</p><p>Here is the Architecture of ConvNeXt compared to ResNet block and Swin Transformer:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*i2UXprljyYqCPQ_1XKj9rg.png" /></figure><p>Here are the links to their <a href="https://github.com/facebookresearch/ConvNeXt">Github implementation</a> and <a href="https://arxiv.org/pdf/2201.03545v1.pdf">Research paper</a>…</p><p>That’s all for this one folk!</p><p>If you like my articles, you can help me by following me here on Medium</p><p>See you in the neXt one ;) ciao…</p><p>References:</p><p>[1] Zhuang Liu and Hanzi Mao and Chao-Yuan Wu and Christoph Feichtenhofer and Trevor Darrell and Saining Xie, A ConvNet for the 2020s(2022), arXiv preprint arXiv:2201.03545</p><p><a href="https://paperswithcode.com/paper/a-convnet-for-the-2020s">Papers with Code - A ConvNet for the 2020s</a></p><p>Feel free to connect with me on <a href="https://twitter.com/_mansi___">Twitter</a> or <a href="https://www.linkedin.com/in/mansirkataria/">LinkedIn</a> and drop me a note if you have any questions. If you like this article, follow me right here on <a href="https://zoomout.medium.com/">Medium</a>.</p><p>Mansi Kataria</p><blockquote><em>Email: </em><a href="/service/mailto:jackraiferbaruch@gmail.com"><em>mkataria920@gmail.com</em></a><em><br>LinkedIN: </em><a href="https://www.linkedin.com/in/mansirkataria/"><em>https://www.linkedin.com/in/mansirkataria/</em></a><em><br>Twitter: </em><a href="https://twitter.com/_mansi___"><em>https://twitter.com/_mansi___</em></a><em><br>Medium: </em><a href="https://zoomout.medium.com/"><em>https://zoomout.medium.com</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa74632b4c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use facial landmarks obtained from dlib]]></title>
            <link>https://zoomout.medium.com/how-to-use-facial-landmarks-obtained-from-dlib-b82129e5b352?source=rss-291ca5eb1f7e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b82129e5b352</guid>
            <category><![CDATA[opencv-python]]></category>
            <category><![CDATA[facial-landmarks]]></category>
            <category><![CDATA[dlib-python]]></category>
            <category><![CDATA[facial-landmark-extract]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Mansi Kataria]]></dc:creator>
            <pubDate>Thu, 13 Jan 2022 06:53:08 GMT</pubDate>
            <atom:updated>2022-02-10T10:21:38.591Z</atom:updated>
            <content:encoded><![CDATA[<p>Now, sometimes we need to do more than just detecting a face like check if the eyes are closed, or see if the tongue is out.</p><p>To do this, we’d need to extract, crop, measure specific parts of the face.</p><p>Let’s see step by step how to achieve this:</p><p><strong>Step 1:</strong></p><p>Use <em>dlib </em>to get facial landmarks on any image containing a face.</p><p>This article is more about how to use the result from the <em>dlib </em>face detection results, so I won&#39;t go deep into the initial face detection part.</p><p>Here’s the python code for it:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7b8d38c9506ca8effd3c021a5d54fe82/href">https://medium.com/media/7b8d38c9506ca8effd3c021a5d54fe82/href</a></iframe><p>This is the result we’d get by running this code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/322/1*XHyiv0T3mf3MvyAG8FDedQ.jpeg" /><figcaption>dlib facial landmarks</figcaption></figure><p>Now, in terms of code, the below line gives us the rectangle for each face:</p><blockquote>rects = detector(gray, 1)</blockquote><p>Where <em>rects </em>is a list of rectangles having one element for each face in the image</p><p><em>shape </em>contains the list of coordinated corresponding to each facial part</p><p>We convert it into a NumPy array to access each part:</p><blockquote>from imutils import face_utils</blockquote><blockquote>shape = face_utils.shape_to_np(shape)</blockquote><p><strong>Step 2</strong></p><p>Now, here is the guide for us to know what index will be what part of the face:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*g_mt5lWkGSYfB8SZoBEyEw.jpeg" /><figcaption>Reference for indices in “shape” NumPy array</figcaption></figure><p>Let’s say we want to just extract the “mouth” part.</p><p>As we can see in this image above, indices 49 through 68 corresponds to the mouth.</p><p>We can fetch these indices manually :</p><blockquote>shape[48:67] #(index starts from 0)</blockquote><p>OR</p><p>use <em>face_utils(</em>from<em> imutils):</em></p><blockquote>face_utils.FACIAL_LANDMARKS_IDXS.items()</blockquote><p>The <em>face_utils.FACIAL_LANDMARKS_IDXS.items() </em>is a dictionary constant with the value shown below:</p><blockquote>FACIAL_LANDMARKS_68_IDXS = OrderedDict([(“mouth”, (48, 68)), (“inner_mouth”, (60, 68)), (“right_eyebrow”, (17, 22)),(“left_eyebrow”, (22, 27)), (“right_eye”, (36, 42)), (“left_eye”, (42, 48)),(“nose”, (27, 36)), (“jaw”, (0, 17))])</blockquote><p>Loop through this dictionary and get the indices (x and y) for entry where value is “mouth”, get the coordinates, and create a bounding box to extract that part from the image.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ac013865e3fab87fb994469385ee2788/href">https://medium.com/media/ac013865e3fab87fb994469385ee2788/href</a></iframe><p>The result from the above code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*lUeGIBrJ46k4uMfMmLjhIA.jpeg" /><figcaption>Extracted “mouth” part</figcaption></figure><p>Similarly, you can extract other parts:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*dNfQLz7sd9N5qWTrZ5fO1Q.jpeg" /><figcaption>inner mouth</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*pIrJr75rwd8l1KKEtehkHQ.jpeg" /><figcaption>jaw</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*49XBL4JpcCN-TAcvPWUTZA.jpeg" /><figcaption>left eye</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*l0y7zhRtsXRhRWlsXmtgGA.jpeg" /><figcaption>left eyebrow</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*vt6lK4lAqf_uquo-0K4NFA.jpeg" /><figcaption>right eye</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*XCcoBpjTp7H1KQQ2dUInSA.jpeg" /><figcaption>right eyebrow</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*XackqLzp3VgGZ36mgehfcw.jpeg" /><figcaption>nose</figcaption></figure><p>The python script for this one is available on my GitHub: <a href="https://github.com/mansikataria/tongue-tip-detection-and-tracking/blob/main/facial_landmarks.py">https://github.com/mansikataria/tongue-tip-detection-and-tracking/blob/main/facial_landmarks.py</a></p><p>That’s it for this one folk!</p><p>Ciao….</p><p>Feel free to connect with me on <a href="https://twitter.com/_mansi___">Twitter</a> or <a href="https://www.linkedin.com/in/mansirkataria/">LinkedIn</a> and drop me a note if you have any questions. If you like this article, follow me right here on <a href="https://zoomout.medium.com/">Medium</a>.</p><p>Mansi Kataria</p><blockquote><em>Email: </em><a href="/service/mailto:jackraiferbaruch@gmail.com"><em>mkataria920@gmail.com</em></a><em><br>LinkedIN: </em><a href="https://www.linkedin.com/in/mansirkataria/"><em>https://www.linkedin.com/in/mansirkataria/</em></a><em><br>Twitter: </em><a href="https://twitter.com/_mansi___"><em>https://twitter.com/_mansi___</em></a><em><br>Medium: </em><a href="https://zoomout.medium.com/"><em>https://zoomout.medium.com</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b82129e5b352" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Detect blur images using OpenCV]]></title>
            <link>https://zoomout.medium.com/detect-blur-images-using-opencv-6f3b7056e722?source=rss-291ca5eb1f7e------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f3b7056e722</guid>
            <category><![CDATA[data-cleaning]]></category>
            <category><![CDATA[blur-detection]]></category>
            <category><![CDATA[image-processing]]></category>
            <category><![CDATA[opencv]]></category>
            <category><![CDATA[computer-vision]]></category>
            <dc:creator><![CDATA[Mansi Kataria]]></dc:creator>
            <pubDate>Mon, 03 Jan 2022 17:47:06 GMT</pubDate>
            <atom:updated>2022-02-10T10:22:20.477Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever occurred the need to clean up a huge image dataset?</p><p>How about a program that will detect blurriness for you, based on how much blur is OK for you, and delete those blurry images!</p><h4>Let’s make use of OpenCV and create it…</h4><p>Step 1:</p><p>For this program, we’ll need <em>imutils</em></p><blockquote>pip install imutils</blockquote><p>Step 2:</p><p>Open your favorite editor and let’s start writing some code.</p><p>We’ll use the <em>Laplacian transform </em>on images and then take the variance of it to detect the blurry-ness. More on the intuition of this concept later…</p><p>The code is simple, get the Laplacian transform using OpenCV, decide a threshold of blurry-ness based on your dataset and you are done.</p><p><a href="https://github.com/mansikataria/animation-gan/blob/master/detect_blur.py">animation-gan/detect_blur.py at master · mansikataria/animation-gan</a></p><h4>Testing our Detect Blur program</h4><p>I have a dataset of 6 images as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XGxZ9t5CzFWl0zOIFWEAAA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pw3FU16IS02W8f4OuvVp_Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H9SvyHlNu_Pf-eTlW0ON8Q.jpeg" /><figcaption>Set 1 — Blurry images for my dataset</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_qHk0DsjzKz-ocnq5bWyTg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vAe4ywFiXBDklSYNVycsPA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2VJfFx5PB4AZdNMRWMAjaA.jpeg" /><figcaption>Set 2 — Clear/Not Blurry images for my dataset</figcaption></figure><p>Running the following command outputs the Image name with Focus Measure and result whether “Blurry” or “Not Blurry”</p><blockquote>python3 detect_blur.py — images blur_test — delete false</blockquote><p>Output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GHlN6brTWvmn4sQwsZDhSw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JHKTFCE0gfgFlQ6-K_30vg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VNNLXOdkwNpCDxixzjYfoQ.jpeg" /><figcaption>Blurry &amp; Focus measure: 91.44, 124.37, and 127.49 respectively</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wKrq4KvEsuS81InQdUuhqQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rZEopzVU76ieJ72t8Ue2Nw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mKfJoUp2MP3YYBqYedHnmw.jpeg" /><figcaption>Not Blurry &amp; Focus Measure 276.71, 142.66, and 130.13 respectively</figcaption></figure><p>In this case, the default threshold value I used for Focus Measure is 130.3.</p><p>How do I set it?</p><p>I experimented with different values starting from 100 and also checked the FM values for various image samples.</p><p>This threshold can vary based on your dataset.</p><h4>Significance of Laplacian operator to detect blurry-ness</h4><p>The Laplacian operator can be used to measure the 2nd derivative of an image (Ref: <a href="https://docs.opencv.org/3.4/d5/db5/tutorial_laplace_operator.html">https://docs.opencv.org/3.4/d5/db5/tutorial_laplace_operator.html</a>)</p><p>It will highlight the regions of the image with rapid intensity changes, more like edge detection.</p><p>The assumption here is that if an image contains <em>high variance</em> then there is a widespread of responses, both edge-like and non-edge-like, representative, of a normal, in-focus image. But if there is <em>very low variance</em>, then there is a tiny spread of responses, indicating there are very few edges in the image. As we know, the more an image is blurred, <em>the fewer edges there are</em>.</p><p>(Ref: <a href="https://www.pyimagesearch.com/2015/09/07/blur-detection-with-opencv/">https://www.pyimagesearch.com/2015/09/07/blur-detection-with-opencv/</a>)</p><p>Feel free to connect with me on <a href="https://twitter.com/_mansi___">Twitter</a> or <a href="https://www.linkedin.com/in/mansirkataria/">LinkedIn</a> and drop me a note if you have any questions. If you like this article, follow me right here on <a href="https://zoomout.medium.com/">Medium</a>.</p><p>Mansi Kataria</p><blockquote><em>Email: </em><a href="/service/mailto:jackraiferbaruch@gmail.com"><em>mkataria920@gmail.com</em></a><em><br>LinkedIN: </em><a href="https://www.linkedin.com/in/mansirkataria/"><em>https://www.linkedin.com/in/mansirkataria/</em></a><em><br>Twitter: </em><a href="https://twitter.com/_mansi___"><em>https://twitter.com/_mansi___</em></a><em><br>Medium: </em><a href="https://zoomout.medium.com/"><em>https://zoomout.medium.com</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f3b7056e722" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>