Marker-based AR implementation of the nostalgic Arkanoid game with OpenGL, OpenCV and C++.
Video: https://youtu.be/FkXOo16MfIE
-
Clone the repository recursively
git clone --recursive https://github.com/alpcihan/ar-arcanoid
-
Use
git submodule update --init
if the repository was cloned without the submodules previously. -
The project automatically builds third-party libraries except for OpenCV.
-
Install OpenCV:
git clone https://github.com/opencv/opencv cd opencv mkdir build cd build cmake .. sudo make install
See src/config/config.h for details about the parameters related to the game settings, camera calibration and marker detection.
The Application uses ArUco markers to estimate the pose of the game objects. Three unique markers are required to play the game (game scene, character controller, and action button).
Default marker codes can be found/changed at src/config/config.h:
...
#define CODE_1 90 // Scene marker
#define CODE_2 7236 // Character controller marker
#define CODE_3 1680 // Action button marker
...
-
Accuracy of the marker detection and scene rendering may vary depending on various factors such as lighting, camera, marker color, resolution, etc.
-
There are 4 parameters to control.
Block size
,Constant
andMax intensity
are the Adaptive Threshold parameters.Focal length
is the field of view value of the projection matrix to calibrate the camera. -
To control the parameters define,
#define PARAMETER_MODE
at config.h.