Vehicle detection is crucial for analyzing traffic flow data to enhance planning in intelligent transportation systems. Machine Learning technology has increasingly been utilized for vehicle detection in both 2D real-time traffic flow videos and 3D point clouds. However, adverse weather conditions such as fog, rain, snow, extreme wind, and others pose challenges for 2D vehicle detection. 3D LiDAR point clouds offer more resistance to these conditions. While much research on 3D vehicle detection has focused on autonomous driving with LiDAR cameras on vehicles, there is a research gap in real-time vehicle detection for intelligent transportation with stationary LiDAR cameras on highways/freeways. This project aims to develop a system that collects real-time traffic flow data through 3D LiDAR cameras, processes the data for vehicle detection and classification, and provides a web-based service that enables real-time vehicle tracking, classification, and statistical traffic flow data visualization.
- React
- Bootstrap
- Node.js
- Firebase
This guide is designed to help developers quickly set up their project environment and database. Ensure all prerequisites listed in the "Getting Started" section are completed before proceeding.
- Python 3
- PostgreSQL
- Command line access
This section provides a detailed guide for setting up the PostgreSQL database for the RTTM system.
- PostgreSQL 14.12 or higher (installed via Homebrew on macOS)
- Command line access
- User account with sudo privileges
-
Start PostgreSQL Ensure your PostgreSQL server is running. On macOS with Homebrew installation, use:
brew services start postgresql@14
If it's already running and you need to restart:
brew services restart postgresql@14
-
Create the RTTM Database Connect to PostgreSQL as the superuser. On macOS, this is typically your system username:
psql postgres
Once connected, create the RTTM database:
CREATE DATABASE "RTTM";
-
Create and Configure User Still in the PostgreSQL prompt, create the 'jim2' user if it doesn't exist and grant necessary privileges:
CREATE USER jim2 WITH PASSWORD 'rttm'; ALTER USER jim2 WITH CREATEDB; GRANT ALL PRIVILEGES ON DATABASE "RTTM" TO jim2;
-
Connect to the RTTM Database Exit the current session and connect to the RTTM database as jim2:
\q psql -U jim2 -h localhost -d RTTM
Enter the password ('rttm') when prompted.
-
Initialize Database Schema Once connected to the RTTM database, run the initialization script:
\i website/scriptsServer/init-db.sql
Note: Ensure you're in the correct directory where the init-db.sql file is located, or provide the full path to the file.
-
Verify Database Creation After running the initialization script, you can verify the table creation:
\dt
This should display a list of tables including:
- FramePrediction
- HistoricalData
- HistoricalData_LaneVehicleCount
- HistoricalData_VehicleTypeCount
- Lane
- ModifiedVehicle
- Real_Time_Traffic_Data
- User
- VehicleDetectionEvent
- VehicleHistory
- VehicleType
- Weather
- If you encounter permission issues, ensure the 'jim2' user has been created and granted appropriate permissions.
- If the init-db.sql file is not found, check your current directory and file path.
- For any connection issues, verify that PostgreSQL is running and that you're using the correct host, port, and credentials.
Remember to keep your database credentials secure and never commit them to version control.
- Navigate to the website directory:
cd website
- Execute scripts to set up the environment:
- Generate the initial data frame:
python 3DGenerateDataFrameMod.py
- Populate the database:
Run the following scripts in sequence:
python ProcessAggregatedData.py
python ProcessPerSecondData.py
python ProcessPerMinuteData.py
python ProcessPerHourData.py
python ProcessPerDayData.py
python ProcessPerWeekData.py
python ProcessPerMonthData.py
python ProcessPerYearData.py
After running these scripts, proceed with the server setup.
- Start the server:
Navigate to the scriptsServer
directory and run the server:
cd scriptsServer
node server.js
- Start the frontend:
Open a new terminal, navigate to the website
directory, and run:
npm start
To start the scripts server, follow these steps:
- Navigate to the server directory:
cd website/scriptsServer
- Install dependencies using Yarn:
yarn add express dotenv bcrypt cors express-validator jsonwebtoken pg
- Start the server:
node server.js
- Navigate to the server directory:
cd website/scriptsServer
- Start the camera server (ensure the camera is attached):
python server2DCamera.py
- Clone the repository:
git clone https://github.com/CalTransProject/rttm.git
- Install packages:
npm install
- Navigate into the website directory:
cd website
- Start the web server:
npm start
username: rttm45304@gmail.com
password: 1234abcd
- Traffic Camera Management
- Real-Time Data Processing
- Predictive Traffic Analysis
- Historical Data Visualization
- User-friendly Interface and Responsive Design
- User Management
Interested in contributing to the RTTM project? Here's how you can help:
-
Fork the Project
-
Create a feature branch:
git checkout -b feature/ANewFeature
- Commit your changes:
git commit -m 'Added ANewFeature'
- Push to the branch:
git push origin feature/ANewFeature
- Open a Pull Request