Commit 34106515 authored by Rohan  Kumar's avatar Rohan Kumar
Browse files

"adding README"

parent db343383
Loading
Loading
Loading
Loading
+37 −33
Original line number Diff line number Diff line
# Group8: Optimized Monocular VSLAM

## Using Maven
# Documentation

Maven is a tool to build and run Java projects. For this project we are using it to automate the process of installing dependencies and compiling the system.
**Nafis Abeer**: 

The file named pom.xml in the main directory controls how maven builds the project on each run, and also holds dependencies. The most important fields are `properties`, which holds the information about JDK and execution, and `dependencies`, which holds information on external sources needed to compile the project. 
**Rohan Kumar**: roku@bu.edu

On each run, Maven will run test cases and compile into the target directory of the project. 
**Zane Mroue**:

### Installation
**Samuel Gulinello**:

For Mac you can just use `brew install maven`.
**Sanford Edelist**:

### Usage 
### Description

In the pom.xml file, under properties, we can add a line like the following:
Visual Simultaneous Localization and Mapping (VSLAM) is the process of taking camera feed, as well as its position, and building a map of the current local world, specifically using visual input. This project uses this process, and builds upon it by also tracking objects within a frame. In this comes two problems: object detection, and then subsequent mapping and tracking of objects within a 3D space.

`<exec.mainClass>object_detection.ObjectDetector</exec.mainClass>`
### Implementation

What this says is that when we call `mvn exec:java`, we search under src/java and execute the `main` method of the `ObjectDetector.java` class file. In this way we can test out any main method that we want.

The best way to use this in Intellij is by creating a build configuration using the following steps:
1. In the top right, find the dropdown of the `Run` options. (this should be the left of the play button and the debug button)
2. Press `Edit Configurations...`
3. Press `Add new configuration`
4. Find the maven icon and create this build config.
5. Give the config a name, and then under `Run`, add `clean compile exec:java`, which does each command in succession.
For simplicity, the general system framework is shown below:

### Resources
```mermaid
graph LR;
    Z[Camera/Video] -->|Input| A
    A[VSLAM]-->|KeyFrames| B[YOLOv4];
    A-->|Features| C[Object Tracking];
    A-->|Features| E
    B-->|Object Detection|C;
    C-->|Objects| D[Database];
    D-->|Objects| E[GUI];
```

- https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
- https://maven.apache.org/run-maven/index.html 
- **Camera/Video**: as of right now, we use prerecorded video as our examples and tests, but this system can be easily extended to real time camera systems or drone footage
  - the output are the frames that constitute the video
- **VSLAM**: using the MATLAB VSLAM algorithm, this process takes the raw frame and does two things: finds "features", or important points used for tracking, and finds "keyframes", which are a subset of the entire set of frames that capture the most information about the video (i.e. movement gives points their 3D position)
  - the outputs are the keyframes and the features
- **YOLOv4**: using a Java library, we perform deep learning using the YOLOv4 model, which is a convolutional neural network that takes a keyframe, and finds bounding boxes around each object that the model can discern
  - the output are the bounding boxes around each object for each frame
- **Object Tracking**: the significant contribution using data structures and algorithms, this system takes the bounding boxes of each object (in 2D on a single frame), and the features (in 3D on the same frame), finds each feature in each bounding box, and then tries to rectify the objects in the current frame with objects found in past frames. We solve this by implementing a data structure called an [ObjectSet](./src/main/java/object_detection/ObjectSet.java). For each object that has already been found, we compare a new object, and if there is some percentage of similarity in features contained in both objects, we combine these two objects and update the database correspondingly.
  - there is further explanation and runtime analysis in the Appendix A
  - the output is an iteratively more accurate set of objects that correspond to reality
- **Database**: for ease of retrieving, updating, and storing Objects and corresponding features, we use a MongoDB database
  - the output is storage for those objects from object tracking
- **GUI**: for an outward facing display of our work, we implemented a Javascript UI, that creates a server, such that we can view the system's output in any browser. 
  - the output is a clean point cloud view of objects and features that the camera has seen

## Working on this project:
- when creating a new branch, go into the Issues tab, click on the Issue you are working on, and create a branch off of that issue
- only change things in that branch, and then when finished we can all push into master
- within the group8 directory, create a subdirectory like:
  - group8/gui
  - group8/database
  - etc
- do your work within these subdirectories so we don't have issues resolving changes at the end
### Features


## Working with YOLO at current state

Install dependencies 
# Appendix

`mvn clean install -DskipTests`
### A: Runtime and Space Analysis of ObjectSet

Run program
**TODO**

`mvn exec:java`
+3 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@


    <dependencies>
        <!-- Spark framework for webdev -->
        <dependency>
            <groupId>com.sparkjava</groupId>
            <artifactId>spark-core</artifactId>
@@ -44,12 +45,14 @@
            <artifactId>log4j-slf4j-impl</artifactId>
            <version>2.20.0</version>
        </dependency>
        <!-- For JUnit (testing), with JUnit Jupiter -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.7.0</version>
            <scope>test</scope>
        </dependency>
        <!-- MongoDB -->
        <dependency>
            <groupId>org.mongodb</groupId>
            <artifactId>mongodb-driver-sync</artifactId>

src/README.md

0 → 100644
+54 −0
Original line number Diff line number Diff line
# Group8: Optimized Monocular VSLAM

## Using Maven

Maven is a tool to build and run Java projects. For this project we are using it to automate the process of installing dependencies and compiling the system.

The file named pom.xml in the main directory controls how maven builds the project on each run, and also holds dependencies. The most important fields are `properties`, which holds the information about JDK and execution, and `dependencies`, which holds information on external sources needed to compile the project. 

On each run, Maven will run test cases and compile into the target directory of the project. 

### Installation

For Mac you can just use `brew install maven`.

### Usage 

In the pom.xml file, under properties, we can add a line like the following:

`<exec.mainClass>object_detection.ObjectDetector</exec.mainClass>`

What this says is that when we call `mvn exec:java`, we search under src/java and execute the `main` method of the `ObjectDetector.java` class file. In this way we can test out any main method that we want.

The best way to use this in Intellij is by creating a build configuration using the following steps:
1. In the top right, find the dropdown of the `Run` options. (this should be the left of the play button and the debug button)
2. Press `Edit Configurations...`
3. Press `Add new configuration`
4. Find the maven icon and create this build config.
5. Give the config a name, and then under `Run`, add `clean compile exec:java`, which does each command in succession.

### Resources

- https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
- https://maven.apache.org/run-maven/index.html 

## Working on this project:
- when creating a new branch, go into the Issues tab, click on the Issue you are working on, and create a branch off of that issue
- only change things in that branch, and then when finished we can all push into master
- within the group8 directory, create a subdirectory like:
  - group8/gui
  - group8/database
  - etc
- do your work within these subdirectories so we don't have issues resolving changes at the end


## Working with YOLO at current state

Install dependencies 

`mvn clean install -DskipTests`

Run program

`mvn exec:java`