Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2.1.1 -V3: (NEW FEATURE) AR Ruler Measurement (beta) for DBH #219

Closed
TreeMama opened this issue Aug 5, 2021 · 10 comments
Closed

V2.1.1 -V3: (NEW FEATURE) AR Ruler Measurement (beta) for DBH #219

TreeMama opened this issue Aug 5, 2021 · 10 comments
Assignees

Comments

@TreeMama
Copy link
Owner

TreeMama commented Aug 5, 2021

ToDO:

** note: to add the AR option it seems VERY likely that we might have to convert the expo project to straight react-native**

  • Try to add a beta AR option for measuring the DBH of a tree - call it "(beta) Measure with camera"
  • The AR will allow the user to measure BOTH multi-stem trees (where the DBH of everything at 4.5 feet of height are measured - then summed) AND single stem entries
  • The final value will be added to the 'Add new' screen (in the 'Measure with Camera' text box) with the 'Estimate' box checked
  • There also will be an additional binary field added to the backend firebase database called 'AR_Measured' - which will be marked as 'true' everytime a user uses this method to measure the DBH
  • ALSO (very important) Make sure the DBH value is populated with the numeric value from the AR_Measurement! (Note: DBH is a required input - and must be present in order for a user to use the 'Tree Benefits Calculator' or save a tree)
  • 'estmated_dbh' will be marked also as 'true' everytime this method is used
  • Based on the package changes needed to convert to react-native, necessary updates to the README file are included as part of this ticket.

Once the above is done/tested:

  • add 3 new graphics into the tutorial (after the current 'Add new' tutorial page) -->
  • 1st tutorial graphic that shows the DBH options box (AR included - marked as 'beta') and the text should read: "To calculate DBH (Diameter at Breast Height) you can either measure the tree yourself..." (show a picture with an arrow pointing to the "Measure & Enter DBH manually" text box)
  • 2nd tutorial graphic says "...or use our AR-driven camera detection option." (show a picture with an arrow pointing to the "Measure with camera" text box).
  • 3rd tutorial graphic shows the DBH AR screen (looking at a tree) and says "To use the camera option, simply line up the tree trunk with the red lines on the screen."

This feature will be released in a future release with the note "beta" (on the DBH selection options).

Current examples to follow for the AR measure design screen (similar to our design, the user aligns the tree width to the 2 vertical lines):
https://www.arboreal.se/en/new-method-to-measure-a-tree/

Check this thread for possible react-native package options (viro is suggested)

https://www.reddit.com/r/reactnative/comments/dwkwvj/is_react_native_have_similar_package_like_ar_ruler/

viro:
https://github.com/viromedia/viro
E-z-8PVVEAIIRCH_edits

@kailynnelson kailynnelson self-assigned this Aug 12, 2021
@kailynnelson
Copy link
Collaborator

Working on this design! 2-3w timeline.

@kailynnelson

This comment has been minimized.

@kailynnelson kailynnelson removed their assignment Sep 5, 2021
@kailynnelson
Copy link
Collaborator

Just emailed you back, Ari - I saw your comments and just gave you editor permission to be able to make more edits yourself. I've had some recent scheduling changes, so I'm not sure when I'd be able to come back around to this!

@TreeMama
Copy link
Owner Author

TreeMama commented Sep 6, 2021

Thanks @kailynnelson !

Enclosed is the final design - ready for development!
E-z-8PVVEAIIRCH_edits

@TreeMama TreeMama changed the title V2.5 - AR Ruler Measurement (beta) for DBH V2.1 - AR Ruler Measurement (beta) for DBH Sep 6, 2021
@TreeMama TreeMama changed the title V2.1 - AR Ruler Measurement (beta) for DBH V2.1.1 -V3: (NEW FEATURE) AR Ruler Measurement (beta) for DBH Oct 11, 2021
@mhaidli
Copy link
Collaborator

mhaidli commented Oct 15, 2021

I looked into adding AR ruler functionality to the app. unfortunately I could not get the code to work given time limitations, but it was still a useful exercise and there are some insights I can share.

Overall I think that adding it through Viro is probably the way to go. The tutorial I used is found here: https://docs.viromedia.com/docs/viro-platform-overview. I couldn't get it to work, but the tutorial is well-written and with more time to play around with it it could work.

The only downside to Viro is that there seems to be no code example of an AR ruler. This means that we would have to use Viro's API to somehow create our own way to measure distance, which may be complicated (see viromedia/viro#807 and viromedia/viro#54)

An alternative could be using ARCore (https://shibuiyusuke.medium.com/measuring-distance-with-arcore-6eb15bf38a8f) for android or ARKit for iOS (see https://www.thedroidsonroids.com/blog/how-to-create-a-measuring-app-with-arkit-in-ios-11 or https://virtualrealitypop.com/ios-11-tutorial-how-to-measure-objects-with-arkit-743d2ec78afc).

@andaniel2029
Copy link
Collaborator

I tried a lot of research to implement this feature.

during development, the library or dependencies for measuring dbh of the tree may be changed, the main goal is to get the dbh value.

  • the important point is to get the distance from the camera to the tree and the rate of the distance unit
  • once the user get the image of the tree, then need to generate depth maps from it
  • extract tree position and width of the tree
  • compare the distance from the camera to the tree with the width of the tree based on the rate of the unit
  • need to control the rate value regarding the experimental values

it requires some maths and AI technologies as well

here is the GitHub repository link for depth map.

https://github.com/nianticlabs/monodepth2

@christyheaton
Copy link

Testing notes (Feb 24 2022 Android APK)

  1. Negative values are always invalid - they should never show up as a result. Instead when the math calculates a negative value (like the '-298 in' here) can you have a pop up - which can be closed - that appears and says 'Calibration error! Please try again.' Also - there use to be a setting on the DBH entry box that the value could never be negative - can we turn that back on?

  2. Can we make the accelerometer 'x, y, z' text values bold and more visible? Also can they be moved farther away (to the left) from the camera icon (or make the camera icon slightly smaller so there is less chance of overlap?)

Capture1

@TreeMama
Copy link
Owner Author

TreeMama commented Mar 1, 2022

@christyheaton (thanks for testing - and thank you @andaniel2029 for this great new tool!)

I'd add to Christy's #1 test note (the negative values note) that maybe the measuring process starts over again after the user closes the 'Calibration error! Please try again.' msg box.

@christyheaton
Copy link

christyheaton commented Mar 11, 2022

Testing notes:

Works well with medium trees where the trunk is clearly visible!

Some changes that would be helpful:

Instead of having to click the "?" icon to see instructions of how to use the app, have the following text appear by default when you open the DBH calculator:

"Fit the width of the tree trunk at breast height (4.5 ft) between the two lines, then hit the "check icon". (For multiple trunks, select the "?" at bottom of screen)."

The, when user hits the "?" the message should show up with the instructions for multiple trunks (as a popup, perhaps?):

"Multiple Trunks: For each individual trunk, fit the width of the trunk at breast height (4.5 ft) between the two lines. Select "Enter Another" to add the next trunk."

After the user has taken the first measurement and clicked the check icon, have the text in the screen say:

"Center the line at the bottom of the tree, then touch the "camera icon"."

@TreeMama
Copy link
Owner Author

TreeMama commented Jun 21, 2022

Now available for all users in release 63!! Great job team (@christyheaton and @andaniel2029 and @kailynnelson )!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants