Using the camera to estimate the size of objects

683 views
Skip to first unread message

Scott Ferguson

unread,
Apr 2, 2014, 7:01:48 AM4/2/14
to

This project uses two screens-

Screen1 uses a formula to estimate the distance between two locations on an object in the distance.
It needs to know how many normal steps there are between the camera and the object and the distance between points (in pixels) on a picture of that object.

PhotoTagSCR screen gets a picture returned by the device's camera and calculates the pixel distance between two points tagged by the user on a canvas containing the picture.
That value is returned to Screen1.


Screen1 blocks: use a formula to determine size based on the number of steps between the camera and an object and the object's relative size in pixels in a photo

PhotoTagSCR blocks: mark two points on a picture and determine the distance in pixels between them using the distance formula


Note that the project is designed so it can be tested with screen switching during development (data is shared between screens with TinyDB.)

Once the app is loaded into your device via the Companion app, you can test the app anywhere as long as you don't exit the app.

Possible enhancements you could add:

  • user calibration option to allow for different walking step lengths
  • using two GPS waypoints to mark the distance from camera to object
  • maintaining a gallery of saved images which could be tagged again to measure other parts of the picture
  • allowing the user to get distances for any number of objects in the current picture



SizeEstimator2.aia
SizeEstimator2.apk

Gustavo Barretto Vila

unread,
Oct 26, 2016, 4:26:21 PM10/26/16
to App Inventor Developers Library
Hi Scott. 
In your app because you use -1 and 32 as i'm showing in the image that i'm posted.
I'm testing your app in mobile phone LG and Sangsung and when taked picture and set canvas 1 backgroundimage to imageholderSP the picture rotate 90º and decreases.
You can help me?

Scott Ferguson

unread,
Oct 27, 2016, 12:19:51 PM10/27/16
to App Inventor Developers Library
Sorry. I no longer provide support for these projects.
---
sf
Reply all
Reply to author
Forward
0 new messages