<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>emre şahin's digital garden 🍃 - Computer Vision</title>
    <link>https://emresahin.net/categories/computer-vision/</link>
    <description>Posts in the Computer Vision category</description>
    <language>en</language>
    <managingEditor>contact@emresahin.net (Emre Şahin)</managingEditor>
    <lastBuildDate>Tue, 15 Sep 2026 19:46:32 +0000</lastBuildDate>
    <atom:link href="https://emresahin.net/categories/computer-vision/rss.xml" rel="self" type="application/rss+xml"/>
    <item>
      <title>Patch Histogram Feature</title>
      <published>2014-04-10T14:00:00+00:00</published>
      <updated>2014-04-10T14:00:00+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Thu, 10 Apr 2014 14:00:00 +0000</pubDate>
      <link>https://emresahin.net/patch-histogram/</link>
      <guid isPermaLink="true">https://emresahin.net/patch-histogram/</guid>
      <description>This post introduces a new feature for binary blobs, such as connected components in text. The feature is called patch histogram , and it represents the histogram of 3x3 patches of black and white pixels. We collect all 3x3 patches and count their frequencies. A 3x3 patch for a binary image conta...</description>
      <category>Computer Vision</category>
      <category>Image Processing</category>
      <category>Histogram</category>
      <category>Python</category>
      <category>Feature Extraction</category>
      <content:encoded><![CDATA[<p>This post introduces a new feature for binary blobs, such as connected components in text.</p>
<p>The feature is called <em>patch histogram</em>, and it represents the histogram of 3x3 patches of black and white pixels. We collect all 3x3 patches and count their frequencies.</p>
<p>A 3x3 patch for a binary image contains $2^9 = 512$ different combinations. For each of these combinations, we assign a unique ID. I wrote the implementation in Python; here is a lookup table that converts all possible 3x3 patches to their IDs.</p>
<pre><code class="language-python">patch_histogram_dict = {}
for f in range(0, 512):
    i22 = f &amp; 1
    i21 = (f &gt;&gt; 1) &amp; 1
    i20 = (f &gt;&gt; 2) &amp; 1
    i12 = (f &gt;&gt; 3) &amp; 1
    i11 = (f &gt;&gt; 4) &amp; 1
    i10 = (f &gt;&gt; 5) &amp; 1
    i02 = (f &gt;&gt; 6) &amp; 1
    i01 = (f &gt;&gt; 7) &amp; 1
    i00 = (f &gt;&gt; 8) &amp; 1
    patch_histogram_dict[ma(i00, i01, i02, i10, i11, i12, i20, i21, i22)] = f
</code></pre>
<p>I was looking for a <em>skeleton feature</em> that can be applied to components after a medial axis transform. However, in this version, we will use binarized connected component images directly and explore the skeletal version later.</p>
<p>Above, we used a function <code>ma</code> to convert a set of numbers to a tuple of tuples. It’s as simple as:</p>
<pre><code class="language-python">def ma(i00, i01, i02, i10, i11, i12, i20, i21, i22):
    return ((i00, i01, i02),
            (i10, i11, i12),
            (i20, i21, i22))
</code></pre>
<p>The first step in feature generation is marking each pixel of the image with its ID. Then, a simple <code>np.histogram</code> call generates the histogram.</p>
<pre><code class="language-python">for i in range(1, rows - 1):
    for j in range(1, cols - 1):
        s = framed[(i-1):(i+2), (j-1):(j+2)]
        marks[i-1, j-1] = patch_dict[ma(s[0, 0], s[0, 1], s[0, 2],
                                        s[1, 0], s[1, 1], s[1, 2],
                                        s[2, 0], s[2, 1], s[2, 2])]
</code></pre>
<p><code>framed</code> is a copy of the original image with a 1-pixel frame, so that boundary pixels are also counted without much boundary checking. <code>patch_dict</code> is a parameter that the function receives. Its default value is the dictionary that we created above, but any kind of patch dictionary can be used.</p>
<p>The feature is generated using a call to <code>numpy.histogram</code> as follows:</p>
<pre><code class="language-python">histogram = numpy.histogram(marked_points,
                            hist_range,
                            density=True,
                            bins=bins)
</code></pre>
<p><code>marked_points</code> are the results of the pixel counting loop above. <code>hist_range</code> is the minimum and maximum value for the patch dictionary. The <code>density</code> parameter is set to <code>True</code> so that the histogram is normalized to 1, making the feature size-invariant. <code>bins</code> is a parameter we can set freely, but by default, it’s equal to the range of elements.</p>
<p>Comparisons can be performed using standard histogram comparison methods, such as EMD (Earth Mover’s Distance) or Chi-Square distance metrics.</p>]]></content:encoded>
    </item>
    <item>
      <title>Paper Review: Shape Classification Using Zernike Moments</title>
      <published>2014-04-04T00:00:00+00:00</published>
      <updated>2014-04-04T00:00:00+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Fri, 04 Apr 2014 00:00:00 +0000</pubDate>
      <link>https://emresahin.net/shape-classification-using-zernike-moments/</link>
      <guid isPermaLink="true">https://emresahin.net/shape-classification-using-zernike-moments/</guid>
      <description>Q: What is a moment? A moment is defined as: $$m_{p,q}(x,y) = \int_{-\infty}^{+\infty} \int_{-\infty}^{+\infty} x^p y^q f(x,y) dxdy$$ In other words, it is the summation of the figure with respect to the function $f$ for both axes. Q: What are Zernike moments? Zernike moments are complex polynomi...</description>
      <category>Computer Vision</category>
      <category>Research</category>
      <category>Zernike moments</category>
      <category>Hu moments</category>
      <category>Shape classification</category>
      <category>Paper review</category>
      <category>Mathematics</category>
      <category>Image Processing</category>
      <content:encoded><![CDATA[<h1 id="q-what-is-a-moment">Q: What is a moment?</h1>
<p>A moment is defined as:</p>
<p>$$m_{p,q}(x,y) = \int_{-\infty}^{+\infty} \int_{-\infty}^{+\infty} x^p y^q f(x,y) dxdy$$</p>
<p>In other words, it is the summation of the figure with respect to the function $f$ for both axes.</p>
<h1 id="q-what-are-zernike-moments">Q: What are Zernike moments?</h1>
<p>Zernike moments are complex polynomial functions used to sum the elements of a shape. They were first introduced in the 1930s. The higher the order, the more complex the shape that can be represented. Order 1 Zernike moments (ZMs) are ellipsoid planes where one side is higher than the other.</p>
<h1 id="q-what-is-the-difference-between-hu-moments-and-zernike-moments">Q: What is the difference between Hu moments and Zernike moments?</h1>
<p>The importance of Zernike moments lies in their rotational invariance. However, Hu moments are also said to have these properties. Thus, Hu moments appear to be simpler alternatives to Zernike moments.</p>
<h1 id="q-what-are-their-properties">Q: What are their properties?</h1>
<p>Zernike moments use polar coordinates, making it easy to describe rotational invariance.</p>]]></content:encoded>
    </item>
    <item>
      <title>Turning Ottoman Letters into Graphs (1)</title>
      <published>2012-09-22T17:00:00+00:00</published>
      <updated>2012-09-22T17:00:00+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Sat, 22 Sep 2012 17:00:00 +0000</pubDate>
      <link>https://emresahin.net/12123-4-1014/</link>
      <guid isPermaLink="true">https://emresahin.net/12123-4-1014/</guid>
      <description>Today’s work was about sharding a page’s components and recording them as new images. Instead of artificial boundaries (like word/sentence boundaries), the labeling should rely on connected components. There are two problems here. In Arabic-based writing systems, dots play a significant role, muc...</description>
      <category>Dervaze</category>
      <category>Computer Vision</category>
      <category>Document Analysis</category>
      <category>Ottoman</category>
      <category>Arabic</category>
      <category>connected components</category>
      <category>character recognition</category>
      <category>document processing</category>
      <category>graphs</category>
      <content:encoded><![CDATA[<p>Today’s work was about sharding a page’s components and recording them
as new images. Instead of <em>artificial</em> boundaries (like word/sentence
boundaries), the labeling should rely on connected components.</p>
<p>There are two problems here. In Arabic-based writing systems, <em>dots</em>
play a significant role, much more so than in Latin-based scripts.
Therefore, these dots should be classified correctly.</p>
<p>The second problem is that the connected components are not always
reliable. There are unduly divided components which are part of a single
component. We can’t label them as they are, and uniting them into a uniform
component requires manual intervention—something we try to avoid.</p>
<p>In the coming days, I’ll try to exemplify these problems and how we treat
them.</p>]]></content:encoded>
    </item>
    <item>
      <title>Paper Review: High Performance Layout Analysis for Arabic and Urdu</title>
      <published>2012-07-25T14:00:00+00:00</published>
      <updated>2012-07-25T14:00:00+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Wed, 25 Jul 2012 14:00:00 +0000</pubDate>
      <link>https://emresahin.net/high-performance-layout-analysis-arabic-urdu/</link>
      <guid isPermaLink="true">https://emresahin.net/high-performance-layout-analysis-arabic-urdu/</guid>
      <description>Authors: Syed Saqib Bukhari, Faisal Shafait, and Thomas M. Breuel Keywords: ridge printed text non-text segmentation gaussian-filter bank reading order Q1: How is line skew determined? There is a $\theta$ parameter in the Gaussian kernel which is used to produce ridges. This may be used in detect...</description>
      <category>paper-review</category>
      <category>computer-vision</category>
      <category>layout-analysis</category>
      <category>arabic</category>
      <category>urdu</category>
      <category>document-processing</category>
      <category>ocr</category>
      <content:encoded><![CDATA[<p><strong>Authors:</strong> Syed Saqib Bukhari, Faisal Shafait, and Thomas M. Breuel</p>
<p><strong>Keywords:</strong></p>
<ul>
<li>ridge</li>
<li>printed text</li>
<li>non-text segmentation</li>
<li>gaussian-filter bank</li>
<li>reading order</li>
</ul>
<h2 id="q1-how-is-line-skew-determined">Q1: How is line skew determined?</h2>
<p>There is a $\theta$ parameter in the Gaussian kernel which is used to produce ridges. This <em>may</em> be used in detecting the skew, but since it’s constant for an entire page, a varying line skew will probably decrease its performance.</p>
<h2 id="q2-how-are-non-text-portions-detected">Q2: How are non-text portions detected?</h2>
<p>The paper does not include a description but cites “S. S. Bukhari, F. Shafait, and T. M. Breuel, ‘Improved document image segmentation algorithm using multiresolution morphology,’ in Proc. SPIE Document Recognition and Retrieval XVIII, San Jose, CA, USA, Jan. 2011” as a source for an improved technique.</p>
<h2 id="q3-which-heuristics-are-used-in-reading-order-determination">Q3: Which heuristics are used in reading order determination?</h2>
<p>Breuel is reported to have an algorithm in “T. M. Breuel, ‘High performance document layout analysis,’ in Symposium on Document Image Understanding Technology, Greenbelt, MD, USA, April 2003.” The paper says the authors modified the algorithm for right-to-left scripts. No further details are provided.</p>
<h2 id="q4-how-large-is-the-dataset-and-what-does-it-contain">Q4: How large is the dataset, and what does it contain?</h2>
<p>25 Arabic documents and 20 Urdu documents are used.</p>
<h2 id="q5-are-there-any-techniques-applicable-to-divans">Q5: Are there any techniques applicable to divans?</h2>
<p>There might be, if any of them were described in detail. We already have more sophisticated text line detection techniques. For the others, I’ll need to read the cited works.</p>]]></content:encoded>
    </item>
    <item>
      <title>Paper Review: Computerized Paleography: Tools for Historical Manuscripts</title>
      <published>2012-07-23T07:08:00+00:00</published>
      <updated>2012-07-23T07:08:00+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Mon, 23 Jul 2012 07:08:00 +0000</pubDate>
      <link>https://emresahin.net/12061-15-2433/</link>
      <guid isPermaLink="true">https://emresahin.net/12061-15-2433/</guid>
      <description>Authors: Lior Wolf, Liza Potikha, Nachum Dershowitz, Roni Shweka, Yaacov Choueka Keywords: handwritten paleography fragments SIFT sparse coding dictionaries Q1: What is the ultimate goal of the authors? The two main goals are providing tools to bring together fragments of the same page (specifica...</description>
      <category>Computer Vision</category>
      <category>Paper Review</category>
      <category>Paleography</category>
      <category>handwriting</category>
      <category>historical documents</category>
      <category>SIFT</category>
      <category>classic CV</category>
      <category>sparse coding</category>
      <category>Cairo Genizah</category>
      <category>paleography</category>
      <content:encoded><![CDATA[<p>Authors: Lior Wolf, Liza Potikha, Nachum Dershowitz, Roni Shweka, Yaacov Choueka</p>
<h1 id="keywords">Keywords:</h1>
<ul>
<li>handwritten</li>
<li>paleography</li>
<li>fragments</li>
<li>SIFT</li>
<li>sparse coding</li>
<li>dictionaries</li>
</ul>
<h1 id="q1-what-is-the-ultimate-goal-of-the-authors">Q1: What is the ultimate goal of the authors?</h1>
<p>The two main goals are providing tools to bring together fragments of the same page (specifically from the Cairo Genizah) and trying to classify handwriting and dates.</p>
<h1 id="q2-how-is-sift-used">Q2: How is SIFT used?</h1>
<p>SIFT is used at various points of a letter to generate descriptors. There are 100,000 descriptors overall before inputting them into k-means. SIFT serves as the main classification technique.</p>
<h1 id="q3-how-did-they-produce-the-letter-dictionaries">Q3: How did they produce the letter dictionaries?</h1>
<p>They produced letter dictionaries using the generated SIFT descriptors and k-means clustering to find representative visual words.</p>
<h1 id="q4-what-is-sparse-coding-and-its-importance">Q4: What is sparse coding and its importance?</h1>
<p>Sparse coding is used to code documents (or any other codable thing) with a separating/descriptive code which also shows the similarity between items. An example might be the bag of visual words approach.</p>
<h1 id="q5-are-there-any-relevant-techniques-for-our-research">Q5: Are there any relevant techniques for our research?</h1>
<p>This is relevant to the Divan matching problem. This work might be cited in historical document matching, although it covers techniques that are generally well-known in the field.</p>]]></content:encoded>
    </item>
    <item>
      <title>Paper Review: A practical approximation algorithm for LMS line estimator</title>
      <published>2012-07-21T14:00:00+00:00</published>
      <updated>2012-07-21T14:00:00+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Sat, 21 Jul 2012 14:00:00 +0000</pubDate>
      <link>https://emresahin.net/12059-20-154/</link>
      <guid isPermaLink="true">https://emresahin.net/12059-20-154/</guid>
      <description>Authors: David M. Mount, Nathan S. Netanyahu, Kathleen Romanik, Ruth Silverman, Angela Y. Wue Keywords: LMS estimator O(n logn) bracelet slab random approximation quantiles Q1: What is LMS? Given a set of points $p_0, …, p_n$, LMS finds a line $q_0, q_1$ that minimizes the median of the square of...</description>
      <category>Computer Vision</category>
      <category>Paper Review</category>
      <category>estimator</category>
      <category>classic CV</category>
      <category>approximation</category>
      <category>LMS</category>
      <category>line estimation</category>
      <content:encoded><![CDATA[<h1 id="authors-david-m-mount-nathan-s-netanyahu-kathleen-romanik-ruth-silverman-angela-y-wue">Authors: David M. Mount, Nathan S. Netanyahu, Kathleen Romanik, Ruth Silverman, Angela Y. Wue</h1>
<h1 id="keywords">Keywords:</h1>
<ul>
<li>LMS estimator</li>
<li>O(n logn)</li>
<li>bracelet</li>
<li>slab</li>
<li>random</li>
<li>approximation</li>
<li>quantiles</li>
</ul>
<h1 id="q1-what-is-lms">Q1: What is LMS?</h1>
<p>Given a set of points $p_0, …, p_n$, LMS finds a line $q_0, q_1$ that
minimizes the <em>median</em> of the square of distances of $p_0, …, p_n$.
This is in contrast with summing up all the squared distances and
minimizing them as in OLS (Ordinary Least Squares).</p>
<h1 id="q2-how-are-approximations-done-using-lms">Q2: How are approximations done using LMS?</h1>
<p>There are exact solutions for the LMS problem. This paper presents an
algorithm with lower complexity. It tries to find an LMS approximation
in a band defined by a parameter $\epsilon_r$.</p>
<h1 id="q3-on-which-parameters-does-the-algorithm-depend">Q3: On which parameters does the algorithm depend?</h1>
<p>The algorithm <em>approxLMS</em> depends on a set of lines, a set of quantiles,
and two error bounds $\epsilon_r$ and $\epsilon_q$.</p>
<h1 id="q4-how-can-this-help-in-our-line-approximations">Q4: How can this help in our line approximations?</h1>
<p>This paper is aimed towards providing an efficient algorithm for random
approximations. Since we need <em>repeatability</em> in our keypoint detection,
it might be harder (or impossible) to prove that the algorithm produces
the exact same line endings in each run with a similar set of points. Hence,
it’s not usable in our studies.</p>]]></content:encoded>
    </item>
    <item>
      <title>A Fast Local Descriptor for Dense Matching</title>
      <published>2012-07-19T14:00:00+00:00</published>
      <updated>2012-07-19T14:00:00+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Thu, 19 Jul 2012 14:00:00 +0000</pubDate>
      <link>https://emresahin.net/12057-21-1773/</link>
      <guid isPermaLink="true">https://emresahin.net/12057-21-1773/</guid>
      <description>Authors: Engin Tola, Vincent Lepetit, Pascal Fua Keywords: Stereo image descriptor circle quantization formalization binary mask Depth estimation Q1: How is depth estimation related to object recognition? Objects are located in a 3D environment, and in order to recognize them correctly, we need t...</description>
      <category>Computer Vision</category>
      <category>Paper Reviews</category>
      <category>DAISY</category>
      <category>descriptor</category>
      <category>dense matching</category>
      <category>computer vision</category>
      <category>paper review</category>
      <content:encoded><![CDATA[<h1 id="authors-engin-tola-vincent-lepetit-pascal-fua">Authors: Engin Tola, Vincent Lepetit, Pascal Fua</h1>
<h1 id="keywords">Keywords:</h1>
<ul>
<li>Stereo image</li>
<li>descriptor</li>
<li>circle</li>
<li>quantization</li>
<li>formalization</li>
<li>binary mask</li>
<li>Depth estimation</li>
</ul>
<h1 id="q1-how-is-depth-estimation-related-to-object-recognition">Q1: How is depth estimation related to object recognition?</h1>
<p>Objects are located in a 3D environment, and in order to recognize them
correctly, we need to be able to recreate their layout in a scene. With
such an aid, we can successfully determine the object boundaries.</p>
<h1 id="q2-what-does-the-descriptor-contain">Q2: What does the descriptor contain?</h1>
<p>It is a concatenation of vectors. The first vector is the Gaussian of
the center point with a $\Sigma_0$, the second set of vectors are
circles lying on circle $R_1$, the third set of vectors are circles
lying on circle $R_2$… Each vector contains orientation maps after a
Gaussian convolution.</p>
<h1 id="q3-on-which-datasets-did-the-authors-try-the-technique">Q3: On which datasets did the authors try the technique?</h1>
<p>As far as I can tell, it is a custom dataset that contains the view of
the same scene from many perspectives.</p>
<h1 id="q4-what-is-the-salience-criterion-for-keypoints">Q4: What is the salience criterion for keypoints?</h1>
<p>The aim of the technique is not matching these keypoints to each other
by selecting the most appropriate ones. The computation is done on <em>all</em>
pixels/keypoints. Hence, no criterion for keypoint filtering is reported.</p>]]></content:encoded>
    </item>
    <item>
      <title>Paper Review: FREAK: Fast Retina Keypoint</title>
      <published>2012-07-16T15:51:00+00:00</published>
      <updated>2012-07-16T15:51:00+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Mon, 16 Jul 2012 15:51:00 +0000</pubDate>
      <link>https://emresahin.net/12055-0-861/</link>
      <guid isPermaLink="true">https://emresahin.net/12055-0-861/</guid>
      <description>URL: http://www.ivpe.com/papers/freak.pdf Authors: Alexandre Alahi, Raphael Ortiz, Pierre Vandergheynst Keywords: Keypoint Binary descriptor Retina Sampling Saccadic Coarse-to-fine Orientation Q1: What is the formula for the retina pattern? The one difference from BRISK is that the pattern has ov...</description>
      <category>Computer Vision</category>
      <category>Paper Reviews</category>
      <category>FREAK</category>
      <category>binary descriptor</category>
      <category>keypoint</category>
      <category>sampling</category>
      <category>computer vision</category>
      <category>paper review</category>
      <content:encoded><![CDATA[<p>URL: http://www.ivpe.com/papers/freak.pdf</p>
<h1 id="authors-alexandre-alahi-raphael-ortiz-pierre-vandergheynst">Authors: Alexandre Alahi, Raphael Ortiz, Pierre Vandergheynst</h1>
<h1 id="keywords">Keywords:</h1>
<ul>
<li>Keypoint</li>
<li>Binary descriptor</li>
<li>Retina</li>
<li>Sampling</li>
<li>Saccadic</li>
<li>Coarse-to-fine</li>
<li>Orientation</li>
</ul>
<h1 id="q1-what-is-the-formula-for-the-retina-pattern">Q1: What is the formula for the <em>retina</em> pattern?</h1>
<p>The one difference from BRISK is that the pattern has overlapping circles. In
BRISK, they were tangential. <em>Redundancy increases recognition</em>.</p>
<p>The circles are log-polar. In this case, it is similar to Shape Context
descriptors, but we do not divide into regions; we create increasingly
larger circles on polar lines.</p>
<h1 id="q2-what-do-the-descriptors-contain">Q2: What do the descriptors contain?</h1>
<p>A binary descriptor is a string of bits. A bit corresponds to a pair of
receptive fields. If the intensity of the first receptive field is <em>larger</em>
than the second, the bit is set to 1; otherwise, it is zero.</p>
<h1 id="q3-how-does-the-sampling-work">Q3: How does the sampling work?</h1>
<p>Each circle in the pattern is called a receptive field. A Gaussian kernel is
applied to these fields, and their intensities are calculated.</p>
<h1 id="q4-is-there-scale-invariance-how">Q4: Is there scale invariance? How?</h1>
<p>There is no discussion of scale invariance, but scale invariance seems
to arise from the building of the descriptor. Since the circles are
created in log-polar orbits and bits are put into the descriptor according
to their contribution to recognition, scale invariance follows these.</p>
<h1 id="q5-how-is-rotation-invariance-achieved">Q5: How is rotation invariance achieved?</h1>
<p>Orientation is calculated using 45 symmetric pairs from the center. It
has larger steps than those of BRISK and thus needs lower memory.</p>]]></content:encoded>
    </item>
  </channel>
</rss>
