Measuring object in image, where scale object exists

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
JoshHardman
Posts: 2
Joined: 2014-04-01T12:18:07-07:00
Authentication code: 6789

Measuring object in image, where scale object exists

Post by JoshHardman »

Hi,

I have an idea, but am not sure how to execute it, and whether I can do so with ImageMagick

I wish to upload a photo of an object, and then that object be measured automatically - using a scaled item in the photo that I have supplied measurements for (i.e. a coin, card, etc.).

For example... I want to know the dimensions of a piece of paper - with this software/script I would be able to:
1. Tell ImageMagick the dimensions of the scale item (coin, card, etc. - this info would be stored)
2. Take a photo of scale item next to, or on top of, item to be measured
3. ImageMagick works out measurements of the item based on the scale item which is in the photo.

Is this possible with ImageMagick?

I have sample images if required.

I thank you all for your time, I am new to this software and understand my question may be tedious!

- Josh
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Measuring object in image, where scale object exists

Post by snibgo »

I would approach it like this:

1. From the image, extract the pixel dimensions of the two objects.

2. If the objects are two-dimensional and the camera axis is perpendicular, the maths is trivial.

For step 1, the objects should contrast well with the background. If the objects are not entirely flat (and they never are), it is best if the objects are white and the background is black. Otherwise, the objects will cast shadows, which gets messy.
snibgo's IM pages: im.snibgo.com
JoshHardman
Posts: 2
Joined: 2014-04-01T12:18:07-07:00
Authentication code: 6789

Re: Measuring object in image, where scale object exists

Post by JoshHardman »

snibgo wrote:I would approach it like this:

1. From the image, extract the pixel dimensions of the two objects.

2. If the objects are two-dimensional and the camera axis is perpendicular, the maths is trivial.

For step 1, the objects should contrast well with the background. If the objects are not entirely flat (and they never are), it is best if the objects are white and the background is black. Otherwise, the objects will cast shadows, which gets messy.
Hi - thanks for your reply

Camera will not be fixed, nor will lighting, conditions, etc.
Post Reply