{"id":743,"date":"2025-07-28T22:07:26","date_gmt":"2025-07-28T12:07:26","guid":{"rendered":"https:\/\/www.samontab.com\/web\/?p=743"},"modified":"2025-07-28T22:07:28","modified_gmt":"2025-07-28T12:07:28","slug":"photogrammetry-from-images-to-a-3d-mesh","status":"publish","type":"post","link":"https:\/\/www.samontab.com\/web\/2025\/07\/photogrammetry-from-images-to-a-3d-mesh\/","title":{"rendered":"Photogrammetry: From Images to a 3D Mesh"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img data-dominant-color=\"a17e7f\" data-has-transparency=\"false\" style=\"--dominant-color: #a17e7f;\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"881\" src=\"https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/summary-1-1024x881.avif\" alt=\"\" class=\"wp-image-755 not-transparent\" srcset=\"https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/summary-1-1024x881.avif 1024w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/summary-1-300x258.avif 300w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/summary-1-768x661.avif 768w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/summary-1.avif 1132w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/en.wikipedia.org\/wiki\/Photogrammetry\" data-type=\"link\" data-id=\"https:\/\/en.wikipedia.org\/wiki\/Photogrammetry\" target=\"_blank\" rel=\"noreferrer noopener\">Photogrammetry<\/a> is the art and science of reconstructing 3D geometry from 2D images. In this post, I&#8217;ll walk you through the full pipeline, from a simple set of photos to a detailed 3D mesh.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Pipeline Overview:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Input Images<\/strong>: Overlapping photos of a scene or object<\/li>\n\n\n\n<li><strong>Feature Extraction &amp; Matching<\/strong>: Detect and match keypoints between views<\/li>\n\n\n\n<li><strong>Sparse Reconstruction<\/strong>: Estimate camera poses and triangulate a sparse 3D point cloud using Structure-from-Motion<\/li>\n\n\n\n<li><strong>Dense Reconstruction<\/strong>: Build a high-resolution point cloud using multi-view stereo<\/li>\n\n\n\n<li><strong>Normals Estimation<\/strong>: Compute surface normals from the dense cloud<\/li>\n\n\n\n<li><strong>Mesh Generation<\/strong>: Construct the final 3D mesh<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Input Images<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To start, you need multiple images of your subject taken from different viewpoints. It&#8217;s important to move around the object rather than just rotating the camera. Translation is key for recovering depth information. Simply rotating the camera will only produce a panorama, not a 3D model. Also, ensure there&#8217;s significant overlap between images so the software can find enough matching features. For this example, I used the Gerrard Hall dataset from COLMAP, which contains 100 images of a building taken with the same camera. They look like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-dominant-color=\"6e7e7f\" data-has-transparency=\"false\" style=\"--dominant-color: #6e7e7f;\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"342\" src=\"https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/montage-1024x342.avif\" alt=\"\" class=\"wp-image-744 not-transparent\" srcset=\"https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/montage-1024x342.avif 1024w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/montage-300x100.avif 300w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/montage-768x256.avif 768w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/montage-1536x513.avif 1536w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/montage-2048x684.avif 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Feature Extraction &amp; Matching<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To align images, we first extract keypoints (distinctive features in each photo) using algorithms like SIFT. Then, we match these features between image pairs using a matcher such as FLANN. To reduce false matches, we apply <strong>Lowe&#8217;s ratio test<\/strong>, which keeps only the matches where the closest descriptor is significantly better than the second-best (typically with a ratio threshold of 0.75). Next, we apply <strong>RANSAC<\/strong> to estimate a <strong>homography<\/strong> and identify consistent matches, called <strong>inliers<\/strong>, based on geometric alignment. This combined filtering ensures that only accurate, reliable matches are used for 3D reconstruction.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-dominant-color=\"6b706b\" data-has-transparency=\"false\" style=\"--dominant-color: #6b706b;\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"334\" src=\"https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/matches-1024x334.avif\" alt=\"\" class=\"wp-image-745 not-transparent\" srcset=\"https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/matches-1024x334.avif 1024w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/matches-300x98.avif 300w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/matches-768x250.avif 768w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/matches.avif 1157w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Sparse Reconstruction<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Once features are matched, we estimate the camera poses using <strong>Structure-from-Motion (SfM)<\/strong>. This process incrementally recovers the position and orientation of each camera. With these poses and the matched features, we triangulate 3D points to build a <strong>sparse point cloud<\/strong>, which is a rough representation of the scene&#8217;s geometry.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-dominant-color=\"fb7f81\" data-has-transparency=\"false\" style=\"--dominant-color: #fb7f81;\" loading=\"lazy\" decoding=\"async\" width=\"1008\" height=\"660\" src=\"https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/sparse.avif\" alt=\"\" class=\"wp-image-746 not-transparent\" srcset=\"https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/sparse.avif 1008w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/sparse-300x196.avif 300w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/sparse-768x503.avif 768w\" sizes=\"auto, (max-width: 1008px) 100vw, 1008px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Dense Reconstruction<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Sparse reconstruction gives us a structural backbone, but to capture finer detail, we need dense data. Using techniques like <strong>multi-view stereo (MVS)<\/strong> or <strong>depth map fusion<\/strong>, we generate a <strong>dense point cloud<\/strong> by estimating depth for many or all image pixels. This dense representation reveals intricate surface features and prepares the data for meshing.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-dominant-color=\"118080\" data-has-transparency=\"false\" style=\"--dominant-color: #118080;\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/pointcloud-1-1024x576.avif\" alt=\"\" class=\"wp-image-748 not-transparent\" srcset=\"https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/pointcloud-1-1024x576.avif 1024w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/pointcloud-1-300x169.avif 300w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/pointcloud-1-768x432.avif 768w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/pointcloud-1-1536x864.avif 1536w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/pointcloud-1.avif 1713w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Normals Estimation<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">With a dense point cloud available, we can estimate <strong>surface normals<\/strong>, which are vectors that indicate the direction each surface is facing. Normals are typically computed by analysing a point&#8217;s local neighborhood using methods like <strong>PCA<\/strong>, or derived directly from mesh geometry. They are essential for realistic rendering, lighting, and further geometric processing.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-dominant-color=\"1a787a\" data-has-transparency=\"false\" style=\"--dominant-color: #1a787a;\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"243\" src=\"https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/norm-1024x243.avif\" alt=\"\" class=\"wp-image-750 not-transparent\" srcset=\"https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/norm-1024x243.avif 1024w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/norm-300x71.avif 300w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/norm-768x182.avif 768w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/norm-1536x364.avif 1536w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/norm.avif 1667w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Mesh Generation<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">From the dense point cloud and normals, we create a continuous 3D surface. Algorithms such as <strong>Poisson surface reconstruction<\/strong>, <strong>Delaunay triangulation<\/strong>, or <strong>ball-pivoting<\/strong> connect nearby points into a mesh of triangles. The resulting <strong>3D mesh<\/strong> accurately models the object&#8217;s shape and can be used in a variety of applications including visualisation, simulation, 3D printing, and CAD.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-dominant-color=\"cf7f80\" data-has-transparency=\"false\" style=\"--dominant-color: #cf7f80;\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"578\" src=\"https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/mesh-1-1024x578.avif\" alt=\"\" class=\"wp-image-752 not-transparent\" srcset=\"https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/mesh-1-1024x578.avif 1024w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/mesh-1-300x169.avif 300w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/mesh-1-768x434.avif 768w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/mesh-1-1536x867.avif 1536w, https:\/\/www.samontab.com\/web\/wp-content\/uploads\/2025\/07\/mesh-1.avif 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">At this point, you have a full 3D mesh reconstructed from your photos. You can now refine it further by <strong>cleaning up noise<\/strong>, <strong>filling holes<\/strong>, <strong>simplifying the mesh<\/strong>, or even <strong>texturing<\/strong> it using the original images. The final model can be exported for rendering, editing, or integration into other workflows.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And that&#8217;s it! Starting from a simple photo set, you can produce a complete and accurate 3D model of a real-world object or scene.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Photogrammetry is the art and science of reconstructing 3D geometry from 2D images. In this post, I&#8217;ll walk you through the full pipeline, from a simple set of photos to a detailed 3D mesh. Pipeline Overview: Input Images To start, you need multiple images of your subject taken from different viewpoints. It&#8217;s important to move [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29,6],"tags":[48,69,46,117,115,112,116,120,111,113,119,121,118],"class_list":["post-743","post","type-post","status-publish","format-standard","hentry","category-computer-vision","category-photography","tag-3d","tag-computer-vision","tag-depth","tag-features","tag-image-processing","tag-images","tag-matching","tag-multi-view-stereo","tag-photogrammetry","tag-photos","tag-sfm","tag-stereo","tag-structure-from-motion"],"_links":{"self":[{"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/posts\/743","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/comments?post=743"}],"version-history":[{"count":0,"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/posts\/743\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/media?parent=743"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/categories?post=743"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.samontab.com\/web\/wp-json\/wp\/v2\/tags?post=743"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}