Skip to content

About

This repository is used for storing sourcecode related to final project of Computer Graphics and Computer Vision

Topics

Resources

Stars

10 stars

Watchers

1 watching

Forks

Latest commit

 

History

46 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Computer Graphics and Computer Vision

Description:

This repository is used for storing sourcecode related to final project of Computer Graphics and Computer Vision

Table of content:

  1. Docker image for Environment
  2. Sourcecode for the project
    1. Baseline sourcecode
    2. Implemented sourcecode

Docker image for Environment

1. Pull docker image

  • Install docker on Linux or WSL
  • Open terminal and run command: docker pull vinhqngo5/ubuntu-opencv-opengl:init-env

2. Start a container

  • 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

3. Connect VScode to running docker container (Just for directly modifying the container)

  • 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

4. Start coding (Just use the docker container environment)

  • 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

Sourcecode for the project

1. Baseline sourcecode

Camera calibration

  • Use camera to take some photo of chessboard image in this and put them into Baseline/ChessBoardSet
  • Run camera calibration, in Baseline folder, use this command: python CameraCalibratioin.py
  • Copy camera information from CameraParameter/data1.txt to /AR source/camera.yml

Compile code and run

2. Implemented sourcecode

⦾ About this game

This is a simple game which targets to provide a similar Pokemon Go like shooting experiences, where a "shooter" shoots "bullets" that can hit "targets" (Pokemon balls hit Pokemons). A large chunk of the game can be handled at just the declarative A-Frame layer in HTML, which is compatible with multi-platform and easy to deploy.

⦾ Demo

⦾ How to play

  • 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.

⦾ Demo on mobile

About

This repository is used for storing sourcecode related to final project of Computer Graphics and Computer Vision

Topics

Resources

Stars

10 stars

Watchers

1 watching

Forks

Packages

Contributors

Languages