This repository is about the Android AR Timber measureing Application.
We are a CurveSurf team of the 2021 Sungkyunkwan University Industry-Academic Cooperation Project, and we created this measuring app, which is the company's task.
The app distinguishes and recognizes a single piece of wood while filming the cross section of the wood pile in real time, which measures the diameter and number of wood without any tools, visualizes it on-screen, and also provides the ability to manipulate the measured information by capturing.
We use Google AR Core Sdk, CurvSurf FindSurfaceAPI, OpenGL version 2.0 and OpenCV JAVA Sdk module for development.
JDK Version and Taget API
minSdkVersion 24
targetSdkVersion 30
buildToolsVersion 30.0.3
Jdk Version 1_8
Implementation
Google AR Core Sdk 1.25.0
org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0
GLESVersion 0x00020000 (2.0)
OpenCV SDK Module 4.5.2
Due to size issue, this repo does not contain OpenCV module.
To build our app, you must manually import OpenCV to :opencv
by following steps:
- Remove opencv dependencies ( Project Structure > Depenendcies > app > remove opencv)
- Same window, Remove opencv module ( ... > opencv > remove module )
- Import Opencv sdk using name space :opencv(4.5.2)
- Add opencv dependencies
Note that this procedure is only needed after cloning this repo. You do not need to repeat this.
- Collect Point Cloud by pressing the record button and slowly moving the smartphone left and right.
- Fix the collected Point Cloud by pressing the stop button.
- Set Seed Point and find Plane by touching the screen.
- Send camera image data (format: YUV420_N12) to JNI. (OpenCV codes)
- Perform image processing (OpenCV) to get timber contours
Method I: perform classical image processing (heuristic) method (see cpp/TimberDetector.h for more details)
Mehtod II: perform hog & svm classifier to find regions that encloses a timber, which are later than converted into circular contours* - Find Bounding Box from each Contour.
- Find Ellipse inscribed in Bounding box and derive diameter information.
- Display the number of timber and diameter of each timber on the screen.
- Move the information at the time to the Result View by pressing the capture button.
- Filter specific timber by touching image or adjusting the range of diameter.
(* although when using method II, converting enclosing rectangles to contours is redundant because they're going to be converted back to boxes again, due to maintain compatability with method I, which returns a series of contours, such extra step was employed)