Results 1 to 4 of 4

Thread: Measure photo

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Re: Measure photo

    Example
    What if i take a picture of a big picture frame with a hand placed 6inch reference square on it.
    Then draw a box around the 6 inch reference
    Then draw a box around the picture frame.

    If i can the calculate how many pixels for the 6 inch square i can get how many pixels are in 6 inches.

    I can then try and calculate how many pixels high and wide the picture frame is....from the prior calculations i know how many pixels are in 6 inches.... if the frame is 12x12 i would simply do the math...

    Does this soumd doable.....just have to be rough numbers.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,315
    Thanks
    314
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Measure photo

    Yes, it is doable if:

    - you can detect the 6-inch square in your image
    - you can detect the box around your "frame" (whatever that is) in your image

    If you can do this interactively, then it is relatively simple: Display the image at full resolution. Click first on opposite diagonal corners of your 6-inch square. Count the number of pixels on the horizontal side - that's pixels / inch (ppi) in the x direction. Do the same for the vertical side - that's pixels / inch for y. Next, click on opposite diagonal corners of your boxed frame. Count the number of x and y pixels, divide by the appropriate ppi measurement and you get your frame dimensions in inches.

    If you have to do this automatically, then it's hard, because you have to do the image processing needed to detect each of these squares. And you need to be able to do it presumably on arbitrary images which could have rectangular things in them that aren't your squares, the camera could be tilted so the squares are skewed or not aligned with the x-y axis, and lots of other possible defects. But once you have found the two rectangles and correct for these defects, the math is the same.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. How to make svg painters measure text correctly
    By ceraolo in forum Qt Programming
    Replies: 4
    Last Post: 11th January 2014, 09:35
  2. Measure Qt Application Performance
    By JcPep in forum Newbie
    Replies: 0
    Last Post: 16th July 2013, 10:50
  3. Time measure beetwen events
    By felo188 in forum Qt Programming
    Replies: 1
    Last Post: 18th August 2011, 14:18
  4. Replies: 2
    Last Post: 26th April 2010, 07:58
  5. How to measure memory of Qt Application,
    By rajeshs in forum Qt Programming
    Replies: 2
    Last Post: 10th July 2007, 17:03

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.