Commit 78a6f36e authored by Rohan  Kumar's avatar Rohan Kumar
Browse files

Merge branch 'updatedDatabase'

# Conflicts:
#	src/main/java/MongoDBConnector.java
parents 5d699b83 c3f9142b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -13,4 +13,9 @@
      <module name="group8" target="17" />
    </bytecodeTargetLevel>
  </component>
  <component name="JavacSettings">
    <option name="ADDITIONAL_OPTIONS_OVERRIDE">
      <module name="vslam-objects" options="-parameters" />
    </option>
  </component>
</project>
 No newline at end of file

INSTALL.txt

deleted100644 → 0
+0 −0

Empty file deleted.

README.md

deleted100644 → 0
+0 −81
Original line number Diff line number Diff line
# Documentation

**Nafis Abeer**: nafis@bu.edu

**Rohan Kumar**: roku@bu.edu

**Zane Mroue**: zanem@bu.edu

**Samuel Gulinello**: samgul@bu.edu

**Sanford Edelist**: edelist@bu.edu

### Description

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.

### Implementation


For simplicity, the general system framework is shown below:

```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];
```

- **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

### Features

> need to fill in this area

# Code

The following links:
- [The branch and directory containing Java 17 Code to be executed](./../../tree/master/src/main/java)
- [The data needed for the examples used for this system](./../../tree/master/src/main/java/vslam/KeyFrames)
- [The testing code for this system](./../../tree/master/src/test/java/)

# Work Breakdown

**Nafis Abeer**:

**Rohan Kumar**:

**Zane Mroue**:

**Samuel Gulinello**:

**Sanford Edelist**:

# Appendix

### A: Runtime and Space Analysis of ObjectSet

> TODO

### B: References and Material Used

> need to fill in references and also ALL LIBRARIES USED (MATLAB, YOLO, Javascript stuff, etc)

#### Personal Access token
Qzkmjrtrda1yGxkxyz8C
+73 −37
Original line number Diff line number Diff line
@@ -15,32 +15,65 @@
        <exec.mainClass>object_detection.ObjectDetector</exec.mainClass>
    </properties>

    <!-- FOR THE YOLO USAGE:
    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <exec.mainClass>yolo.YOLODetector</exec.mainClass>
    </properties>
    -->
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version> <!-- Try changing the version here -->
                <configuration>
                    <source>17</source>
                    <target>17</target>
                    <compilerArgs>
                        <arg>-parameters</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <!-- Spring Boot Starter Web -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>3.2.4</version>
        </dependency>

        <!-- Spring Boot Starter Thymeleaf -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
            <version>3.2.4</version>
        </dependency>

    <dependencies>
        <!-- For JUnit (testing), with JUnit Jupiter -->
        <!-- Spring Boot DevTools -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.7.0</version>
            <scope>test</scope>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <version>3.2.4</version>
        </dependency>
        <!-- MongoDB

        <!-- Spring Web MVC -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>6.1.4</version>
        </dependency>

        <!-- Gson for JSON processing -->
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.8.9</version>
        </dependency>

        <!-- MongoDB Driver -->
        <dependency>
            <groupId>org.mongodb</groupId>
            <artifactId>mongodb-driver-sync</artifactId>
            <version>5.0.1</version>
            <scope>runtime</scope>
            <version>4.7.1</version>
        </dependency>
        -->

        <!-- JavaCV dependencies -->
        <dependency>
            <groupId>org.bytedeco</groupId>
@@ -62,32 +95,35 @@
            <artifactId>javacpp</artifactId>
            <version>1.5.7</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>3.2.4</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-thymeleaf -->

        <!-- Spring Boot Starter Test -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
            <artifactId>spring-boot-starter-test</artifactId>
            <version>3.2.4</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.v4</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-devtools -->

        <!-- Mockito for mocking in tests -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <version>3.2.4</version>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>4.0.0</version>
            <scope>test</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc -->

        <!-- Mockito integration with JUnit 5 -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>6.1.4</version>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>4.0.0</version>
            <scope>test</scope>
        </dependency>


    </dependencies>
    
</project>
+0 −10
Original line number Diff line number Diff line
package database;

import object_detection.types.ObjectSet;

public class DatabaseUpdater {

    public static boolean updateDB(ObjectSet objSet){
        return true;
    }
}
Loading