<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Python | Saikiran Juttu | Robotics Portfolio</title><link>https://juttu-s.github.io/saikiran_juttu.github.io/tags/python/</link><atom:link href="https://juttu-s.github.io/saikiran_juttu.github.io/tags/python/index.xml" rel="self" type="application/rss+xml"/><description>Python</description><generator>Hugo Blox Builder (https://hugoblox.com)</generator><language>en-us</language><lastBuildDate>Thu, 07 Nov 2024 00:00:00 +0000</lastBuildDate><image><url>https://juttu-s.github.io/saikiran_juttu.github.io/media/icon_hu7729264130191091259.png</url><title>Python</title><link>https://juttu-s.github.io/saikiran_juttu.github.io/tags/python/</link></image><item><title>Sparse 3D Reconstruction and Bundle Adjustment</title><link>https://juttu-s.github.io/saikiran_juttu.github.io/project/sparse-reconstruction/</link><pubDate>Thu, 07 Nov 2024 00:00:00 +0000</pubDate><guid>https://juttu-s.github.io/saikiran_juttu.github.io/project/sparse-reconstruction/</guid><description>&lt;p>This project implements a full Structure from Motion (SfM) pipeline on a &lt;strong>Buddha statue&lt;/strong> using a sequence of &lt;strong>24 grayscale images&lt;/strong>. It combines feature detection, epipolar geometry, camera pose recovery, triangulation, and bundle adjustment.&lt;/p>
&lt;hr>
&lt;h3 id="dataset">Dataset&lt;/h3>
&lt;ul>
&lt;li>24 images of a wooden Buddha statue captured at different angles&lt;/li>
&lt;li>Enhanced using &lt;strong>CLAHE (Contrast Limited Adaptive Histogram Equalization)&lt;/strong>&lt;/li>
&lt;li>Features extracted using &lt;strong>SIFT&lt;/strong> with custom parameters&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h3 id="pipeline-overview">Pipeline Overview&lt;/h3>
&lt;h4 id="1-image-preprocessing">1. Image Preprocessing&lt;/h4>
&lt;p>Using CLAHE improves contrast on low-texture surfaces like carved wood.&lt;/p>
&lt;div style="text-align: center;">
&lt;img src="processed.png" width="1000">
&lt;/div>
&lt;hr>
&lt;h4 id="2-sift-feature-detection">2. SIFT Feature Detection&lt;/h4>
&lt;ul>
&lt;li>Applied to all 24 images&lt;/li>
&lt;li>Used &lt;strong>BFMatcher&lt;/strong> with ratio test&lt;/li>
&lt;li>Matches filtered via &lt;strong>RANSAC&lt;/strong> for outlier rejection&lt;/li>
&lt;/ul>
&lt;div style="text-align: center;">
&lt;img src="features.png" width="1000">
&lt;/div>
&lt;hr>
&lt;h4 id="3-essential-matrix--pose-recovery">3. Essential Matrix &amp;amp; Pose Recovery&lt;/h4>
&lt;ul>
&lt;li>Computed Essential matrix using calibrated camera matrix&lt;/li>
&lt;li>Used &lt;code>cv2.recoverPose()&lt;/code> to derive relative rotation and translation between views&lt;/li>
&lt;li>Built a chain of camera poses from image 0 onward&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h4 id="4-triangulation">4. Triangulation&lt;/h4>
&lt;ul>
&lt;li>3D points computed from pixel correspondences using &lt;code>cv2.triangulatePoints()&lt;/code>&lt;/li>
&lt;li>All 3D points stored in homogeneous form&lt;/li>
&lt;li>Colored and visualized using Plotly&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h4 id="5-bundle-adjustment-with-gtsam">5. Bundle Adjustment with GTSAM&lt;/h4>
&lt;ul>
&lt;li>Built a factor graph with:
&lt;ul>
&lt;li>Camera pose priors&lt;/li>
&lt;li>Between factors from pose transitions&lt;/li>
&lt;li>Projection factors from 2D-3D matches&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Used &lt;code>Levenberg-MarquardtOptimizer&lt;/code> for refinement&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h3 id="results">Results&lt;/h3>
&lt;h4 id="initial-3d-trajectory">Initial 3D Trajectory&lt;/h4>
&lt;p>
&lt;figure >
&lt;div class="flex justify-center ">
&lt;div class="w-100" >&lt;img alt="Initial Trajectory" srcset="
/saikiran_juttu.github.io/project/sparse-reconstruction/Initial_plot_hu12090084634136375331.webp 400w,
/saikiran_juttu.github.io/project/sparse-reconstruction/Initial_plot_hu6971695684859321629.webp 760w,
/saikiran_juttu.github.io/project/sparse-reconstruction/Initial_plot_hu11908849571792030370.webp 1200w"
src="https://juttu-s.github.io/saikiran_juttu.github.io/saikiran_juttu.github.io/project/sparse-reconstruction/Initial_plot_hu12090084634136375331.webp"
width="760"
height="282"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;/p>
&lt;h4 id="optimized-3d-trajectory-after-bundle-adjustment">Optimized 3D Trajectory after Bundle Adjustment&lt;/h4>
&lt;p>
&lt;figure >
&lt;div class="flex justify-center ">
&lt;div class="w-100" >&lt;img alt="Optimized Trajectory" srcset="
/saikiran_juttu.github.io/project/sparse-reconstruction/Optimized_plot_hu1365288965832748826.webp 400w,
/saikiran_juttu.github.io/project/sparse-reconstruction/Optimized_plot_hu5432368712792554619.webp 760w,
/saikiran_juttu.github.io/project/sparse-reconstruction/Optimized_plot_hu6617160073620067270.webp 1200w"
src="https://juttu-s.github.io/saikiran_juttu.github.io/saikiran_juttu.github.io/project/sparse-reconstruction/Optimized_plot_hu1365288965832748826.webp"
width="760"
height="282"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;/p>
&lt;ul>
&lt;li>Average reprojection error reduced by ~15%&lt;/li>
&lt;li>Landmark cloud tightened around object geometry&lt;/li>
&lt;li>Rotation drift corrected with global optimization&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h3 id="tools--libraries">Tools &amp;amp; Libraries&lt;/h3>
&lt;ul>
&lt;li>OpenCV (SIFT, RANSAC, triangulation)&lt;/li>
&lt;li>NumPy, Matplotlib, Plotly&lt;/li>
&lt;li>GTSAM (factor graph + BA)&lt;/li>
&lt;li>Python&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h3 id="resources">Resources&lt;/h3>
&lt;ul>
&lt;li>🔗 &lt;a href="https://github.com/juttu-s/Sparse-3D-Reconstruction" target="_blank" rel="noopener">GitHub Repo&lt;/a>&lt;/li>
&lt;/ul>
&lt;hr>
&lt;p>This project demonstrates a scalable pipeline for SfM using minimal dependencies. It serves as a foundation for integrating real-time VIO or stereo SLAM on embedded platforms.&lt;/p></description></item><item><title>Photo Mosaicking of Low-Contrast Underwater Images</title><link>https://juttu-s.github.io/saikiran_juttu.github.io/project/photo-mosaicking/</link><pubDate>Sat, 05 Oct 2024 00:00:00 +0000</pubDate><guid>https://juttu-s.github.io/saikiran_juttu.github.io/project/photo-mosaicking/</guid><description>&lt;p>This project implements a full photo mosaicking and optimization pipeline using low-contrast underwater images from the &lt;strong>Skerki Bank Roman shipwreck&lt;/strong> dataset. The approach registers both sequential and non-sequential images using SIFT and RANSAC, computes affine transformations, and optimizes a global trajectory using GTSAM.&lt;/p>
&lt;hr>
&lt;h3 id="pipeline-breakdown">Pipeline Breakdown&lt;/h3>
&lt;h4 id="clahe-image-enhancement">CLAHE Image Enhancement&lt;/h4>
&lt;ul>
&lt;li>Applies histogram equalization to improve contrast and enhance keypoints.&lt;/li>
&lt;li>OpenCV CLAHE was used on each grayscale frame.&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="line">&lt;span class="cl">&lt;span class="n">clahe&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">cv2&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">createCLAHE&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">clipLimit&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="mf">2.0&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">tileGridSize&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="mi">8&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="mi">8&lt;/span>&lt;span class="p">))&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">clahe_image&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">clahe&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">apply&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">gray_image&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;hr>
&lt;h4 id="sift-feature-detection">SIFT Feature Detection&lt;/h4>
&lt;ul>
&lt;li>Detected keypoints using tuned SIFT settings:
&lt;ul>
&lt;li>&lt;code>nfeatures=5000&lt;/code>, &lt;code>contrastThreshold=0.025&lt;/code>, &lt;code>nOctaveLayers=8&lt;/code>, &lt;code>sigma=1.5&lt;/code>&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="line">&lt;span class="cl">&lt;span class="n">sift&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">cv2&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">SIFT_create&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="o">...&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">kp&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">desc&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">sift&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">detectAndCompute&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">image&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="kc">None&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;hr>
&lt;h4 id="feature-matching--ransac-filtering">Feature Matching + RANSAC Filtering&lt;/h4>
&lt;ul>
&lt;li>Matched descriptors using Brute-Force Matcher + Lowe’s ratio test.&lt;/li>
&lt;li>Applied &lt;code>cv2.estimateAffine2D&lt;/code> with RANSAC to compute and refine transformation.&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="line">&lt;span class="cl">&lt;span class="n">matches&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">bf&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">knnMatch&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">des1&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">des2&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">k&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="mi">2&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">good&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="p">[&lt;/span>&lt;span class="n">m&lt;/span> &lt;span class="k">for&lt;/span> &lt;span class="n">m&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">n&lt;/span> &lt;span class="ow">in&lt;/span> &lt;span class="n">matches&lt;/span> &lt;span class="k">if&lt;/span> &lt;span class="n">m&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">distance&lt;/span> &lt;span class="o">&amp;lt;&lt;/span> &lt;span class="mf">0.75&lt;/span> &lt;span class="o">*&lt;/span> &lt;span class="n">n&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">distance&lt;/span>&lt;span class="p">]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">H&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">mask&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">cv2&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">estimateAffine2D&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">pts1&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">pts2&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">method&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="n">cv2&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">RANSAC&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;hr>
&lt;h4 id="pose-graph-construction-gtsam">Pose Graph Construction (GTSAM)&lt;/h4>
&lt;ul>
&lt;li>Built a factor graph using all non-repeating image pairs.&lt;/li>
&lt;li>Relative poses (affine transforms) were added as edges.&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="line">&lt;span class="cl">&lt;span class="n">graph&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">add&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">BetweenFactorPose2&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">i1&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">i2&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">T_ij&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">noise_model&lt;/span>&lt;span class="p">))&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="initial-trajectoryplot_beforepng">
&lt;figure >
&lt;div class="flex justify-center ">
&lt;div class="w-100" >&lt;img alt="Initial Trajectory" srcset="
/saikiran_juttu.github.io/project/photo-mosaicking/plot_before_hu6875028771095386571.webp 400w,
/saikiran_juttu.github.io/project/photo-mosaicking/plot_before_hu3546410195309766098.webp 760w,
/saikiran_juttu.github.io/project/photo-mosaicking/plot_before_hu3825931163024726418.webp 1200w"
src="https://juttu-s.github.io/saikiran_juttu.github.io/saikiran_juttu.github.io/project/photo-mosaicking/plot_before_hu6875028771095386571.webp"
width="571"
height="455"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;/h2>
&lt;h4 id="global-bundle-adjustment">Global Bundle Adjustment&lt;/h4>
&lt;ul>
&lt;li>Used GTSAM’s Levenberg-Marquardt optimizer to refine global poses.&lt;/li>
&lt;li>Corrects drift and adjusts poses to minimize total residual error.&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="line">&lt;span class="cl">&lt;span class="n">optimizer&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">gtsam&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">LevenbergMarquardtOptimizer&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">graph&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">initial_estimate&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="n">result&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">optimizer&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">optimize&lt;/span>&lt;span class="p">()&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>
&lt;figure >
&lt;div class="flex justify-center ">
&lt;div class="w-100" >&lt;img alt="Optimized Trajectory" srcset="
/saikiran_juttu.github.io/project/photo-mosaicking/plot_after_hu16779151673749428898.webp 400w,
/saikiran_juttu.github.io/project/photo-mosaicking/plot_after_hu14280678253068865284.webp 760w,
/saikiran_juttu.github.io/project/photo-mosaicking/plot_after_hu13790384701387224375.webp 1200w"
src="https://juttu-s.github.io/saikiran_juttu.github.io/saikiran_juttu.github.io/project/photo-mosaicking/plot_after_hu16779151673749428898.webp"
width="580"
height="455"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;/p>
&lt;hr>
&lt;h3 id="techniques-used">Techniques Used&lt;/h3>
&lt;ul>
&lt;li>Image normalization + CLAHE&lt;/li>
&lt;li>SIFT feature detection and matching&lt;/li>
&lt;li>RANSAC for outlier rejection&lt;/li>
&lt;li>Homography estimation using Levenberg–Marquardt&lt;/li>
&lt;li>Graph construction (GTSAM)&lt;/li>
&lt;li>Loop closure detection&lt;/li>
&lt;li>Pose optimization&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h3 id="results">Results&lt;/h3>
&lt;ul>
&lt;li>Successfully registered both sequential and non-sequential image pairs&lt;/li>
&lt;li>Constructed optimized pose graphs for 6 and 29 image subsets&lt;/li>
&lt;li>Achieved a ~20% improvement in alignment after bundle adjustment&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h3 id="-related-files">📁 Related Files&lt;/h3>
&lt;ul>
&lt;li>🔗 &lt;a href="https://github.com/juttu-s/photo-mosaicking-skerki" target="_blank" rel="noopener">GitHub Repository&lt;/a>&lt;/li>
&lt;li>📁 &lt;a href="https://drive.google.com/drive/folders/1AtvT65txGIgAG23NRs3EkvDET036a81O" target="_blank" rel="noopener">Skerki Dataset Reference (Google Drive)&lt;/a>&lt;/li>
&lt;li>📓 &lt;a href="https://juttu-s.github.io/saikiran_juttu.github.io/files/Part1_and_2.ipynb">Project Notebook&lt;/a>&lt;/li>
&lt;li>📓 &lt;a href="https://juttu-s.github.io/saikiran_juttu.github.io/files/Part_3.ipynb">Extended Analysis&lt;/a>&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h3 id="references">References&lt;/h3>
&lt;ul>
&lt;li>Pizarro &amp;amp; Singh (2003): &lt;em>Toward large-area mosaicing for underwater scientific applications.&lt;/em>&lt;/li>
&lt;li>Ballard et al. (1998, 2000): &lt;em>Roman shipwreck discovery using submersible tech.&lt;/em>&lt;/li>
&lt;/ul></description></item><item><title>Automated Insect Leg Labeling using DeepLabCut</title><link>https://juttu-s.github.io/saikiran_juttu.github.io/project/automated-insect-leg-labeling/</link><pubDate>Mon, 15 Apr 2024 00:00:00 +0000</pubDate><guid>https://juttu-s.github.io/saikiran_juttu.github.io/project/automated-insect-leg-labeling/</guid><description>&lt;p>This project proposes a robust and scalable method for automating insect leg labeling using &lt;strong>image processing, feature detection, and clustering&lt;/strong>, enabling seamless integration with &lt;strong>DeepLabCut&lt;/strong> for behavioral analysis.&lt;/p>
&lt;hr>
&lt;h2 id="methodology-overview">Methodology Overview&lt;/h2>
&lt;h3 id="1-data-collection">1. Data Collection&lt;/h3>
&lt;ul>
&lt;li>Captured insect locomotion data using a &lt;strong>ServoSphere&lt;/strong> robot equipped with omni-wheels and a high-speed camera.&lt;/li>
&lt;li>The camera tracked an insect (ant) placed atop the rotating sphere.&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h3 id="2-preprocessing-pipeline">2. Preprocessing Pipeline&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>Grayscale conversion&lt;/strong> and &lt;strong>Gaussian blur&lt;/strong> for noise reduction&lt;/li>
&lt;li>&lt;strong>Canny Edge Detection&lt;/strong> for edge enhancement&lt;/li>
&lt;li>&lt;strong>Binary thresholding&lt;/strong> and &lt;strong>morphological operations&lt;/strong> for skeletonization&lt;/li>
&lt;/ul>
&lt;p>
&lt;figure >
&lt;div class="flex justify-center ">
&lt;div class="w-100" >&lt;img alt="Canny Edge Result" srcset="
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/canny_hu11275747406885085122.webp 400w,
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/canny_hu15745542599272552929.webp 760w,
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/canny_hu3473078471050911037.webp 1200w"
src="https://juttu-s.github.io/saikiran_juttu.github.io/saikiran_juttu.github.io/project/automated-insect-leg-labeling/canny_hu11275747406885085122.webp"
width="555"
height="350"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;br>
&lt;em>Figure: Output after applying Canny edge detection.&lt;/em>&lt;/p>
&lt;hr>
&lt;h3 id="3-feature-extraction">3. Feature Extraction&lt;/h3>
&lt;ul>
&lt;li>Applied &lt;strong>Shi-Tomasi Corner Detection&lt;/strong> on Canny edges for precise joint detection&lt;/li>
&lt;li>Robust to noise and sensitive to detailed motion features&lt;/li>
&lt;/ul>
&lt;p>
&lt;figure >
&lt;div class="flex justify-center ">
&lt;div class="w-100" >&lt;img alt="Shi-Tomasi Detection" srcset="
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/shi_tomasi_hu3655572418342755069.webp 400w,
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/shi_tomasi_hu14103565545081466617.webp 760w,
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/shi_tomasi_hu4890327641649225453.webp 1200w"
src="https://juttu-s.github.io/saikiran_juttu.github.io/saikiran_juttu.github.io/project/automated-insect-leg-labeling/shi_tomasi_hu3655572418342755069.webp"
width="555"
height="350"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;br>
&lt;em>Figure: Shi-Tomasi corner detection highlights potential joint features.&lt;/em>&lt;/p>
&lt;hr>
&lt;h3 id="4-body-removal">4. Body Removal&lt;/h3>
&lt;ul>
&lt;li>Used &lt;strong>Zhang-Suen thinning&lt;/strong> for skeleton extraction&lt;/li>
&lt;li>Applied &lt;strong>connected component labeling&lt;/strong> to segment body parts&lt;/li>
&lt;li>Removed body via &lt;strong>template matching&lt;/strong>&lt;/li>
&lt;/ul>
&lt;p>
&lt;figure >
&lt;div class="flex justify-center ">
&lt;div class="w-100" >&lt;img alt="Skeleton Extraction" srcset="
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/skeleton_extraction_hu7723478630954022702.webp 400w,
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/skeleton_extraction_hu1654188756838549732.webp 760w,
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/skeleton_extraction_hu4799263873215453537.webp 1200w"
src="https://juttu-s.github.io/saikiran_juttu.github.io/saikiran_juttu.github.io/project/automated-insect-leg-labeling/skeleton_extraction_hu7723478630954022702.webp"
width="553"
height="355"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;br>
&lt;em>Figure: Skeleton representation using Zhang-Suen thinning.&lt;/em>&lt;/p>
&lt;p>
&lt;figure >
&lt;div class="flex justify-center ">
&lt;div class="w-100" >&lt;img alt="Connected Components" srcset="
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/connected_components_hu7217986797033856015.webp 400w,
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/connected_components_hu12195037151038958192.webp 760w,
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/connected_components_hu4918036970471170597.webp 1200w"
src="https://juttu-s.github.io/saikiran_juttu.github.io/saikiran_juttu.github.io/project/automated-insect-leg-labeling/connected_components_hu7217986797033856015.webp"
width="545"
height="378"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;br>
&lt;em>Figure: Connected component labeling for body part isolation.&lt;/em>&lt;/p>
&lt;p>
&lt;figure >
&lt;div class="flex justify-center ">
&lt;div class="w-100" >&lt;img alt="Body Template" srcset="
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/template_hu11659726123555705027.webp 400w,
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/template_hu18209107862982516437.webp 760w,
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/template_hu2884419823242467532.webp 1200w"
src="https://juttu-s.github.io/saikiran_juttu.github.io/saikiran_juttu.github.io/project/automated-insect-leg-labeling/template_hu11659726123555705027.webp"
width="499"
height="353"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;br>
&lt;em>Figure: Template matching used to isolate and remove the body region.&lt;/em>&lt;/p>
&lt;hr>
&lt;h3 id="5-leg-detection">5. Leg Detection&lt;/h3>
&lt;ul>
&lt;li>Remaining features correspond to legs&lt;/li>
&lt;li>Calculated angles of features w.r.t. body centroid&lt;/li>
&lt;/ul>
&lt;p>
&lt;figure >
&lt;div class="flex justify-center ">
&lt;div class="w-100" >&lt;img alt="Detected Leg Features" srcset="
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/leg_features_hu7341448728120080587.webp 400w,
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/leg_features_hu18101909398949920466.webp 760w,
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/leg_features_hu14108854493791996505.webp 1200w"
src="https://juttu-s.github.io/saikiran_juttu.github.io/saikiran_juttu.github.io/project/automated-insect-leg-labeling/leg_features_hu7341448728120080587.webp"
width="489"
height="320"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;br>
&lt;em>Figure: Extracted leg features post body removal.&lt;/em>&lt;/p>
&lt;p>
&lt;figure >
&lt;div class="flex justify-center ">
&lt;div class="w-100" >&lt;img alt="Feature Angles" srcset="
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/angles_hu911305775039293742.webp 400w,
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/angles_hu16264059692635278634.webp 760w,
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/angles_hu12389778951175088630.webp 1200w"
src="https://juttu-s.github.io/saikiran_juttu.github.io/saikiran_juttu.github.io/project/automated-insect-leg-labeling/angles_hu911305775039293742.webp"
width="496"
height="338"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;br>
&lt;em>Figure: Angle estimation of each leg with respect to the centroid.&lt;/em>&lt;/p>
&lt;hr>
&lt;h3 id="6-clustering--tip-detection">6. Clustering &amp;amp; Tip Detection&lt;/h3>
&lt;ul>
&lt;li>&lt;strong>KMeans (K=6)&lt;/strong> clusters features into 6 legs&lt;/li>
&lt;li>Furthest feature in each cluster = leg tip&lt;/li>
&lt;/ul>
&lt;p>
&lt;figure >
&lt;div class="flex justify-center ">
&lt;div class="w-100" >&lt;img alt="KMeans Clustering" srcset="
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/kmeans_hu2991777993052901984.webp 400w,
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/kmeans_hu1537055730035741828.webp 760w,
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/kmeans_hu8003083638116927705.webp 1200w"
src="https://juttu-s.github.io/saikiran_juttu.github.io/saikiran_juttu.github.io/project/automated-insect-leg-labeling/kmeans_hu2991777993052901984.webp"
width="556"
height="406"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;br>
&lt;em>Figure: KMeans clustering of features into 6 leg regions.&lt;/em>&lt;/p>
&lt;hr>
&lt;h3 id="7-integration-with-deeplabcut">7. Integration with DeepLabCut&lt;/h3>
&lt;ul>
&lt;li>Created &lt;code>.h5&lt;/code> files with clustered keypoints&lt;/li>
&lt;li>Trained DeepLabCut on auto-labeled dataset&lt;/li>
&lt;li>Achieved performance near manual labeling&lt;/li>
&lt;/ul>
&lt;p>
&lt;figure >
&lt;div class="flex justify-center ">
&lt;div class="w-100" >&lt;img alt="DLC Integration" srcset="
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/integration_hu13320621738235640093.webp 400w,
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/integration_hu5511305675759056958.webp 760w,
/saikiran_juttu.github.io/project/automated-insect-leg-labeling/integration_hu10805202269737531730.webp 1200w"
src="https://juttu-s.github.io/saikiran_juttu.github.io/saikiran_juttu.github.io/project/automated-insect-leg-labeling/integration_hu13320621738235640093.webp"
width="671"
height="615"
loading="lazy" data-zoomable />&lt;/div>
&lt;/div>&lt;/figure>
&lt;br>
&lt;em>Figure: Final annotated labels used with DeepLabCut.&lt;/em>&lt;/p>
&lt;hr>
&lt;h2 id="experimental-results">Experimental Results&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Leg&lt;/th>
&lt;th>TP (Auto)&lt;/th>
&lt;th>FP (Auto)&lt;/th>
&lt;th>TP (Manual)&lt;/th>
&lt;th>FP (Manual)&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>1&lt;/td>
&lt;td>95&lt;/td>
&lt;td>2&lt;/td>
&lt;td>98&lt;/td>
&lt;td>1&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>2&lt;/td>
&lt;td>90&lt;/td>
&lt;td>3&lt;/td>
&lt;td>95&lt;/td>
&lt;td>2&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>3&lt;/td>
&lt;td>85&lt;/td>
&lt;td>4&lt;/td>
&lt;td>90&lt;/td>
&lt;td>2&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>4&lt;/td>
&lt;td>80&lt;/td>
&lt;td>3&lt;/td>
&lt;td>85&lt;/td>
&lt;td>3&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>5&lt;/td>
&lt;td>75&lt;/td>
&lt;td>5&lt;/td>
&lt;td>80&lt;/td>
&lt;td>4&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>6&lt;/td>
&lt;td>70&lt;/td>
&lt;td>3&lt;/td>
&lt;td>75&lt;/td>
&lt;td>3&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;blockquote>
&lt;p>&lt;em>Confusion matrix comparing auto-labeled vs manually labeled results. Accuracy slightly lower, but performance is consistent and scalable.&lt;/em>&lt;/p>
&lt;/blockquote>
&lt;hr>
&lt;h2 id="key-techniques">Key Techniques&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Canny Edge Detection&lt;/strong>&lt;/li>
&lt;li>&lt;strong>Shi-Tomasi GFTT&lt;/strong>&lt;/li>
&lt;li>&lt;strong>Template Matching&lt;/strong>&lt;/li>
&lt;li>&lt;strong>KMeans Clustering&lt;/strong>&lt;/li>
&lt;li>&lt;strong>Zhang-Suen Thinning&lt;/strong>&lt;/li>
&lt;li>&lt;strong>DeepLabCut integration&lt;/strong>&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="insights--future-work">Insights &amp;amp; Future Work&lt;/h2>
&lt;ul>
&lt;li>Automation significantly reduced manual effort&lt;/li>
&lt;li>High reproducibility across ant datasets&lt;/li>
&lt;li>KMeans produced sharper clusters than Ensemble KMeans&lt;/li>
&lt;li>Future work may explore deep learning-based leg segmentation and adaptive clustering strategies&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="resources">Resources&lt;/h2>
&lt;ul>
&lt;li>📄 &lt;a href="report.pdf">Project Report (PDF)&lt;/a>&lt;/li>
&lt;li>🔗 &lt;a href="https://github.com/juttu-s/Pattern-Recognition-and-Computer-Vision/tree/main/Automated%20Insect%20Leg%20Labeling" target="_blank" rel="noopener">GitHub Repository&lt;/a>&lt;/li>
&lt;/ul>
&lt;hr>
&lt;p>This approach provides a &lt;strong>generalizable and scalable method&lt;/strong> for anatomical labeling in biological research and can be extended to other multi-limbed species or anatomical joints.&lt;/p></description></item></channel></rss>