Skip to content

Trying to use OpenCV on the classic 1986 – Arkanoid Series brick breaker game, to track the ball and perform few operations.

Notifications You must be signed in to change notification settings

dheeraj-allamaneni/Brick-Breaker-OpenCV

Repository files navigation

Brick-Breaker-OpenCV

openCV operations on the classic 1986 – Arkanoid Series brick breaker game, to track the ball and perform few interesting operations.

Code Requirements

  • Numpy - 1.13.3
  • OpenCV - 3.2.0

Converting color input to Black and White

Let us convert all the red color bricks to orange

Now lets do something cool ! changes the color of the ball to red, and also continuously draws the trajectory of the ball

  1. Long story short, First i tried to solve this problem in MATLAB!

Yes, I have realized how bad the idea of video processing in MATLAB was but i had spent a lot of time and then found the centroid location of the ball and then saved it into a .mat file; then decided i will from now work on python. 2. Imported the centroid data to python using "scipy.io.loadmat()" and then to change the color of the ball to red i have drawn red circle at the centroid location using "cv2.circle()" and then for trajectory i was using the previous centroid locations, then formed like a diminishing history line plotting.
  • I have placed the centroid data in "centroid_data"

Batch 1

Batch 2

Lets count number of blocks in each column

I have solved this in MATLAB !!!.

Wait! I can explain this, I started this whole project from here, so initially started with MATLAB.My Bad.

Batch 1

Batch 2