PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, July 29, 2022

[FIXED] How to match physical slab dimensions to image dimensions

 July 29, 2022     asp.net, c#, image, image-processing     No comments   

Issue

I need to know how to approach about dimension conversion. I have some physical slabs. I'm taking pictures of them and getting few coordinates of special pixels. Up to here everything seem well.

The point is I want to convert actual dimensions to pixel. So the best approach seems to calculate known physical dimension to pixel such as this formula.

        var referenceWidth = (double)physicalWidth /image.width  ;

What should be the best approach?


Solution

The easiest way is to use a reference object of known size, like a coin, or a ruler. Measure how many pixels the reference object is will allow you to compute the size of a pixel

pixelsize = actual size of reference / size of reference in pixels

If you then mark the corners of the slabs you can compute the actual size of them:

actual size of slab = pixelSize * size of slab in pixels

This assumes the photo is fairly "flat", i.e. the objects are more or less two dimensional, the photo is taken perpendicular to the objects, the lens is fairly narrow, the lens distortion is fairly small etc.

Another alternative would be if you know the focal length and camera to object distance, that would allow you to compute the pixel size without a reference.

The dpi value would be more or less useless to compute the actual object size, it refers to the print size of the photo, not the size of any objects in the photo. Unless you have used a flat bed scanner, then the dpi might actually correspond to real life sizes.

A possible alternative would be to use existing photometry software to convert a random set of photos to 3D.



Answered By - JonasH
Answer Checked By - Senaida (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing