This repository is used for storing sourcecode related to final project of Computer Graphics and Computer Vision
- Install docker on Linux or WSL
- Open terminal and run command:
docker pull vinhqngo5/ubuntu-opencv-opengl:init-env
- First of all, we need to change directory to the current Sourcecode (in this example is this repository)
- Second, we need to allow container for accessing the graphics card:
sudo xhost + - Open terminal and run command:
docker run -it -v "$PWD":/root/CV-CG -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY --device="/dev/video0:/dev/video0" <image-name> - Now, your repository will mount into /root/CV-CG
- Install extension: Remote container - ms-vscode-remote.remote-containers
- Then we need to give user permission to docker group by:
sudo sudo usermod -aG docker ${USER}. log out and log back in so that your group membership is re-evaluated or type the following command:su -s ${USER} - Press ctrl + shift + P: remote -> attach to running container
- Mount working directory in the left panel
- Open vscode in the repository folder and code, every changes will be saved
- To compile C++ code, use this command:
g++ main.cpp -o main -I /usr/local/include/opencv4 -L /usr/local/lib -lopencv_core -lopencv_highgui - There maybe some changes in running command, if use "opencv2/core" -> add -lopencv_core
- Then chmod and run code like normal
- Shoud do: create make file for convenience
- Use camera to take some photo of chessboard image in this and put them into
Baseline/ChessBoardSet - Run camera calibration, in
Baselinefolder, use this command:python CameraCalibratioin.py - Copy camera information from
CameraParameter/data1.txtto/AR source/camera.yml
- Use keyboard keys A W S D and mouse for moving around and chaging view in PC.
- Use gestures =>(swipe right) and <=(swipe left) for changing view in Mobile.
- Pressing space for shooting in PC. Velocity of the bullets are based on how long you press the button.
- Use gesture swipe up for shooting in Mobile. Velocity of the bullets are based on how fast you swipe.


