Skip to content

Commit

Permalink
Added configuration guide to README and minor modifications to code.
Browse files Browse the repository at this point in the history
  • Loading branch information
IMS94 committed Oct 27, 2018
1 parent a382a68 commit 8754448
Show file tree
Hide file tree
Showing 11 changed files with 2,722 additions and 2,913 deletions.
56 changes: 56 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Camera based Real-time Analytics on Movements of People (CRAMP)

We are developing a system for generating realtime analytics on movements of people in a multiple camera monitored environment.
* Ground Mapped Human Movement Analytics.
* Aggregrated Analytical Maps.
- Human Density Maps
- Head Direction Maps
- Speed Bound Maps
* Per Person Level Analytics using Short Term Re-Identification and Tracking.

_CRAMP_SENSE_ is the Camera Module of system which is responsible for
* Detecting New Persons
* Mapping of detected persons to world space. (Ground Place Mapping)
* Tracking of Persons (for purpose of detecting new persons)
* Obtain snapshots (for re-id purpose) of newly detected persons.
* Communicating results to Analytics Core.

## Getting Started

This consists of 3 main components.

1. Sense (`/sense` directory) - Python components for processing video feeds.

2. Angular Web App (`/ngapp` directory) - An angular web application for viewing
analytics in real time.

3. Java Server (`dist` and `core` directories) - Includes the REST API and database
connection logic.

### Running in development mode

1. First, run the **main** method of `CHASS` class. To run this, following system
properties need to be added to the *run configuration*.
* Use `-D` as shown when passing as VM options.
```
-Ddb.jdbc.url="jdbc:mysql://localhost:3306/analytics?createDatabaseIfNotExist=true"
-Ddb.user="root"
-Ddb.password="root"
-Dorg.augur.sense.mode="ACTIVE"
-Dlog4j.configurationFile=log4j2-dev.xml
```
* Visit `http://localhost:8000` for the dashboard
### Configuration
Go to `Settings -> Camera` and *Add Camera Groups*. Then when you run the
python clients, they will automatically send their camera views for
point mapping configuration. You can configure the mapping as shown below.
![Point Mapping Configuration](point_mapping.png)
## Contributors
* Madhawa Vidanapathirana - [email protected]
* Imesha Sudasingha - [email protected]
* Pasindu Kanchana - [email protected]
* Jayan Vidanapathirana - [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.augur.sense.api.model.CameraGroup;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -89,14 +90,14 @@ public CameraConfig findByCameraId(int cameraId) {
@Override
public CameraConfig findByCameraIpAndPort(String ipAndPort) {
Session session = this.sessionFactory.getCurrentSession();
session.beginTransaction();
Transaction transaction = session.getTransaction().isActive() ? session.getTransaction() : session.beginTransaction();
CameraConfig cameraConfig;
try {
cameraConfig = session.createQuery("from CameraConfig where ipAndPort=:ipAndPort", CameraConfig.class)
.setParameter("ipAndPort", ipAndPort).uniqueResult();
session.getTransaction().commit();
transaction.commit();
} catch (Exception e) {
session.getTransaction().rollback();
transaction.rollback();
logger.error("Error finding camera config by ip: {}", ipAndPort, e);
throw new IllegalStateException("Error executing query", e);
}
Expand Down
6 changes: 4 additions & 2 deletions core/src/main/java/org/augur/sense/web/RestServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public class RestServer implements Startable {
private static final String JETTY_CONFIG = "jetty.xml";
private static final String CONTEXT_PATH = "/api/v1/*";

private static final int SERVER_PORT = 8000;

private Set<Object> controllers = new HashSet<>();
private Server jettyServer;
private Server webServer;
Expand All @@ -73,7 +75,7 @@ public void start() {
}

private void startRestServer() {
this.jettyServer = new Server(8000);
this.jettyServer = new Server(SERVER_PORT);

ResourceConfig config = new ResourceConfig();
controllers.forEach(config::register);
Expand Down Expand Up @@ -118,7 +120,7 @@ private void startRestServer() {
logger.error("Error occurred when starting REST server due to : {}", e.getMessage());
throw new IllegalStateException("Unable to start REST server", e);
}
logger.info("REST Server started successfully ...");
logger.info("REST Server started successfully on port {}...", SERVER_PORT);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion dist/src/main/resources/etc/analytics.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Path to map of the location where we are trying to cover by the analytics
org.augur.sense.config.map=etc/ntb_branch.jpg
org.augur.sense.config.map=etc/map.jpg
Loading

0 comments on commit 8754448

Please sign in to comment.