Cargo Management Reference Implementation

Version: 2022.1   Published: 08/30/2021  

Last Updated: 10/23/2022

Overview

Use an Intel® RealSense™ camera to create a solution that detects regular and irregularly shaped packages and tracks newly added and removed packages in the cargo area of a transportation vehicle. 

Select Configure & Download to download the reference implementation and the software listed below. 

Configure & Download

NOTE: This software package will not work on the People's Republic of China (PRC) network.

Screenshot of running Cargo Management

 

  • Time to Complete: Approximately 60 minutes
  • Programming Language: Python*

Recommended Hardware

The hardware below is recommended for use with this reference implementation. See the Recommended Hardware page for other suggestions. 


Target System Requirements

  • Ubuntu* 20.04.4 LTS
  • 6th to 10th Generation Intel® Core™ processors with Intel® Iris® Plus graphics or Intel® HD Graphics
  • Intel® RealSense™ D400 series camera
  • Minimum 20 GB free space

How It Works

Cargo Management Reference Implementation does the following:    

  • Detects regularly shaped box’s Length, Width and Height dimensions up to 53 ft.  
  • Detects an irregularly shaped package’s Length, Width and Height dimensions using an outline bounding box, up to 53 ft for each dimension and a minimum of 2 inches.  
  • Provides a simple User Interface to interact with the driver for tracking and reviewing detected events. 
  • Sends the detected packages and their dimensions as notifications to Amazon Web Services* (AWS) to display them on a Dashboard.

Architecture Diagram


Get Started

Prerequisites

  • Install Intel® RealSense™ SDK for Ubuntu using instructions on GitHub
  • Print configuration chessboard from GitHub on page A4. Place it on camera view on a horizontal setup.

Step 1: Install the Reference Implementation

Select Configure & Download to download the reference implementation and then follow the steps below to install it. 

Configure & Download

NOTE: If the host system already has Docker* images and containers, you might encounter errors while building the reference implementation packages. If you do encounter errors, refer to the Troubleshooting section at the end of this document before starting the reference implementation installation.

1. Open a new terminal, go to the downloaded folder and unzip the downloaded RI package.

cargo_management.zip

 

​2. Go to the cargo_management/ directory.

cd cargo_management/

 

​3. Change permission of the executable edgesoftware file.

chmod 755 edgesoftware

 

4. Run the command below to install the Reference Implementation.

./edgesoftware install

 

5. During the installation, you will be prompted for the Product Key. The Product Key is contained in the email you received from Intel confirming your download.

Screenshot of product key

6. When the installation is complete, you see the message “Installation of package complete” and the installation status for each module.

Screenshot of install success

 

NOTE: If you encounter any issues, please refer to the Troubleshooting section at the end of this document. Installation failure logs will be available at the path:  /var/log/esb-cli/Cargo_Management_2022.1/output.log

7.   In order to start the application, change the directory using the cd command printed at the end of the installation process: 

cd
<INSTALL_PATH>/cargo_management/Cargo_Management_2022.1/Cargo_Management/EII-CargoManagement-UseCase

 

Step 2: Run the Application

Prerequisites

 

1. Run the application. Copy and run the make webui command from the end of the installation log:

make webui EII_BASE=<INSTALL_PATH>/cargo_management/Cargo_Management_<version>/IEdgeInsights REPO_FOLDER=<INSTALL_PATH>/cargo_management/Cargo_Management_<version>/Cargo_Management/EII-CargoManagement-UseCase

For example: 

make webui EII_BASE=/home/intel/cargo_management/Cargo_Management_2022.1/IEdgeInsights REPO_FOLDER=/home/intel/cargo_management/Cargo_Management_2022.1/Cargo_Management/EII-CargoManagement-UseCase

 

2. Open the Web UI: Go to 127.0.0.1:9093 on your web browser.

Screenshot of open the WebUI

 

3. If you installed your ThingsBoard Cloud Server and you have enabled S3 Bucket Server on your AWS account, you can provide your configured AWS Access Key ID, AWS Secret Access Key, Thingsboard IP, Thingsboard Port and Thingsboard Device token on the Cloud Data Configuration tab. After you complete the Cloud configuration, make sure you click on the Save Credentials and Save Token buttons. Now you can import the ThingsBoard dashboard as described at the end of the Set Up ThingsBoard* Cloud Data to enable all dashboard features, including the cloud storage.

 

Screenshot of ThingsBoard Local Cloud Server

 

4. Access the Cargo Management Dashboard by selecting Run Use Case. The web application should detect the camera. Configure as below. 

Optionally, you can also set the simulation data that you want to use. You can choose between using the KnowGo Simulator or simply use the CSV pre-recorded simulation data.

 

Screenshot of Run Use Case

 

5.  After 30-40 seconds, the Visualizer should pop up and the camera should be configured. If the Visualizer does not pop up, make sure you have placed the calibration chessboard in camera view.

 

Screenshot of Visualizer

 

6. Place one object at a time on the chessboard calibration area to have the object measured. After you remove the object, the counter increases. The images below show how the objects are measured and counted. The total cargo volume is also calculated until the cargo is full.

 

Screenshot of measuring cargo

 

Screenshot of measuring cargo

 

7. After the visualiser starts, you can go to the ThingsBoard link and check the alerts sent by the reference implementation. If you configured the AWS credentials, you will also have access to video snapshots taken by the application on the video stream.

Screenshot of Intel Fleet Manager

 

8. You can also check the cloud storage from the Reference Implementation Storage tab.

Screenshot of Cloud Video Clips

 

Run in Parallel with Automated License Plate Recognition Reference Implementation  

To run this task, you will need to download and install the Automated License Plate Recognition Reference Implementation

Prerequisites  

Steps to Run the Application 

  1. Change directory to Cargo Management Use Case path on terminal 1:
    cd <INSTALL_PATH>/cargo_management/Cargo_Management_2022.1/Cargo_Management/EII-CargoManagement-UseCase

    Screenshot of use case path on terminal 1
     
  2. Change directory to Automated License Plate Recognition Use Case path on terminal 2:
    cd <INSTALL_PATH>/automated_license_plate_recognition/Automated_License_Plate_Recognition_2022.1/Automated_License_Plate_Recognition/EII-LicensePlateRecognition-UseCase 

    Screenshot of use case path on terminal 2
  3. Run the following command on terminal 1 to start the webserver application: 
    Copy and run the make webui command from the end of the installation:
    make webui EII_BASE=<INSTALL_PATH>/cargo_management/Cargo_Management_2022.1/IEdgeInsights REPO_FOLDER=<INSTALL_PATH>/cargo_management/Cargo_Management_2022.1/Cargo_Management/EII-CargoManagement-UseCase

     

  4. Run the following command on terminal 2 to start the webserver application: 
    Copy and run the make webui command from the end of the installation:
    make webui EII_BASE=<INSTALL_PATH>/cargo_management/Cargo_Management_2022.1/IEdgeInsights REPO_FOLDER=<INSTALL_PATH>/automated_license_plate_recognition/Automated_License_Plate_Recognition_2022.1/Automated_License_Plate_Recognition/EII-LicensePlateRecognition-UseCase

    Screenshot of running command on terminal 2
     
  5. Open your browser and go to 127.0.0.1:9093.

  6. Access the Cargo Management Dashboard by selecting Run Use Case. The web application should detect the camera. Configure as below.
    Screenshot of Run Use Case
     

  7. Click on Run Use Case and wait for Visualizer to run.

  8. Open the Automated License Plate Recognition page by going to address 127.0.0.1:9095.

  9. Configure Automated License Plate Recognition by setting the video source, the target and click on Run Use Case.

    Screenshot of configuring use case




    At this point, Cargo Management will close, and then both use cases will start.

    Screenshot of both use cases running

NOTE: If you reinstall the first reference implementation, you must also reinstall the second reference implementation. 

 


Summary and Next Steps

You successfully ran the Cargo Management application and displayed the result using Amazon Web Services* (AWS). 

As next step try the following: Using the current implementation, try to make the algorithm more reliable or make a preconfigured calibration. This will make it possible to detect multiple objects at the same time.


Learn More

To continue your learning, see the following guides and software resources:



Known Issues

Uninstall Reference Implementation

If you uninstall one of the reference implementations, you need to reinstall the other reference implementations because the Docker images will be cleared. 


Troubleshooting

Installation Failure

If the host system already has Docker images and its containers running, you will have issues during the RI installation. You must stop/force stop existing containers and images.

  • To remove all stopped containers, dangling images, and unused networks: 

    sudo docker system prune --volumes
  • To stop Docker containers: 

    sudo docker stop $(sudo docker ps -aq)
  • To remove Docker containers:

    sudo docker rm $(sudo docker ps -aq)
  • To remove all Docker images:

    sudo docker rmi -f $(sudo docker images -aq)

Docker Image Build Failure

If Docker image build on corporate network fails, follow the steps below.

  1. Get DNS server using the command: 
    nmcli dev show | grep 'IP4.DNS'
  2. Configure Docker to use the server. Paste the line below in the  /etc/docker/daemon.json file:
    { "dns": ["<dns-server-from-above-command>"] }
  3. Restart Docker: 
    sudo systemctl daemon-reload && sudo systemctl restart docker

Installation Failure Due to Ubuntu Timezone Setting 

While building the reference implementation, if you see this error:  /etc/timezone && apt-get install -y tzdata && ln -sf /usr/share/zoneinfo/${HOST_TIME_ZONE} /etc/localtime && dpkg-reconfigure -f noninteractive tzdata' returned a non-zero code: 1 make: *** [config] Error 1 

Run the following command in your terminal: 

sudo timedatectl set-local-rtc 0

Installation Encoding Issue 

While building the reference implementation, if you see this error: ERROR: 'latin-1' codec can't encode character '\u2615' in position 3: ordinal not in range(256) 

Run the following command in your terminal: 

export LANG=en_US.UTF-8

Can't Connect to Docker Daemon

If you can't connect to Docker Daemon at http+docker://localhost, run the following command in your terminal: 

sudo usermod -aG docker $USER

Log out and log in to Ubuntu.  

Check before retrying to install if group Docker is available for you by running the following command in your terminal: 

groups

The output should contain Docker.

Visualizer Does Not Start

Make sure you have updated the camera firmware and the chessboard calibration is placed on camera view. 

To update the camera firmware, download the latest firmware.

Support Forum 

If you're unable to resolve your issues, contact the Support Forum.  

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.