# cv_networking_pipeline_linux
Receive by UDP, process with ORB-SLAM3, visualize the result, and send by OSC. Made for Linux. 
UPDATE: Implemented send/receive pipeline with the NDI protocol. 

1. Implemented sending and receiving by NDI + OpenCV. The code is in NDIlib_Send_Video.cpp and in the NDIlib_Recv.cpp

## Installation

### Requirements
1. Install Gstreamer from the following tutorial: Как_устанавливать_GStreamer.pdf included in this repository. (NOTE: The PDF reader in Gitea can show broken files. If that's the case please use the other reader)

### Changes to CMakeLists.txt
1. Change ORB-SLAM3_DIR 
2. Set MY_GST_PATH to the GST_ROOT (Gstreamer installation directory)
3. Set MY_NDI_SDK_PATH (it has to set the  path to ndi_sdk_for_linux directory)
4. Change Pangolin_DIR

### Building
Go to the Gstreamer installation path and source the environment: `cd MediaFramework` and then `source deploy-linux/set-env.sh`
```
cd cv_networking_pipeline_linux` and then `mkdir build && cd build
cmake ..
make
```

## Running

### NDI_Send_Video is designed to work with mono-kitti dataset. On the server:
1. `cd build`
2. `./NDIlib_Send_Video /mnt/disk-small/podmivan/datasets/mono-kitti/00`. You will see the image showed by OpenCV. Now you can press any key to send the frames. 
3. `./NDIlib_Recv`
Now you can see the sending/receiving of the frames. But the frames are broken. The cause is undefined (Although on Windows everything is working fine)

### localization
1. localization_ndi.cpp is not finished
2. image transfer using Gstreamer. On the server: 
```
./localization ~/podmivan/SLAM/ORB_SLAM3/Vocabulary/ORBvoc.txt ~/podmivan/SLAM/ORB_SLAM3/Examples/Monocular/KITTI00-02.yaml "ADMIN (NDIlib_Send_Video)"
```
But it usually also causes segmentation fault. I didn't find the cause, this is why I moved to the developemnt with NDI + OpenCV
