Skip to content

ledaiduongvnth/vgate-control-camera-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#BUILD INSTRUCTION

Install default OS for the device

1, For Jetson nano:

https://developer.nvidia.com/embedded/learn/get-started-jetson-nano-devkit

2, For Jetson tx2

https://docs.nvidia.com/sdk-manager/install-with-sdkm-jetson/index.html#install-with-sdkm-jetson

Install dependencies:

sudo apt-get install -y curl libjsoncpp-dev libboost-all-dev libc-ares-dev libglew-dev libssl-dev cmake build-essential autoconf libtool pkg-config

Install Freetype to support display Vietnamese language:

cd
curl -L  https://download.savannah.gnu.org/releases/freetype/freetype-2.9.1.tar.gz > freetype-2.9.1.tar.gz 
tar xvfz freetype-2.9.1.tar.gz
cd freetype-2.9.1
./configure
make
sudo make install
sudo ldconfig

Install Grpc c++

cd
git clone -b v1.23.0 https://github.com/grpc/grpc
cd grpc
git submodule update --init

Install protobuf from source

cd third_party/protobuf
mkdir -p cmake/build
cd cmake/build
cmake  -Dprotobuf_BUILD_TESTS=OFF ..
make -j4
sudo make install
sudo ldconfig

To avoid "all warnings being treated as errors" while compiling boringssl:

cd ~/grpc/third_party/boringssl
sudo apt install nano
nano CMakeLists.txt

remove flag: "-Werror" on CMakeLists.txt

Build and install Grpc

cd ~/grpc
mkdir -p cmake/build
cd cmake/build
cmake -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DgRPC_PROTOBUF_PROVIDER=package -DgRPC_ZLIB_PROVIDER=package -DgRPC_CARES_PROVIDER=package -DgRPC_SSL_PROVIDER=package -D_gRPC_CARES_LIBRARIES=cares -DgRPC_CARES_PROVIDER=kludge -DCMAKE_BUILD_TYPE=Release ../..
make -j4
sudo make install 
sudo ldconfig

Build the project

1, Clone the project source

cd
git clone https://github.com/ledaiduongvnth/vgate-control-camera-client.git

2, Install jetson-utils lib:

cd ~/vgate-control-camera-client/jetson-utils
mkdir build
cd build
cmake ..
make -j4
sudo make install 
sudo ldconfig

3, Compile the source code:

cd ~/vgate-control-camera-client
mkdir build
cd build
cmake ..
make -j4

4, Run the binary:

./camera_client

Customize the display screen by the customer's requirements:

All the customization is performed inside of the vgate-control-camera-client/utils/image_proc.h Given a list of face's boxes and face's labels Which are stored in sortTrackers.trackers.

void WriteTextAndBox(cv::Mat &displayImage, DrawText &drawer, SORTtracker sortTrackers) {
    for (auto it = sortTrackers.trackers.begin(); it != sortTrackers.trackers.end();) {
        /* Box contains face's coordinates Which is an Opencv Rect_, see more https://docs.opencv.org/3.4/d2/d44/classcv_1_1Rect__.html */
        Rect_<float> pBox = (*it).box;
        // label of the face
        it->name
        it++;
    }
}

Using Supervisor to manage the program(Optional):

Install redis

sudo apt install python3-pip
sudo pip3 install redis

Install supervisor

sudo apt install supervisor
sudo service supervisor stop
cd ~/vgate-control-camera-client/zsupervisor
sudo cp camera-client.conf relay.conf /etc/supervisor/conf.d/
sudo service supervisor restart