Design and implementation of color tracking method on Chess Robot Using Camera

31
DESIGN AND IMPLEMENTATION OF COLOR TRACKING METHOD ON CHESS ROBOT USING CAMERA BY Ir. Ferrianto Gozali , MSCS and Daniel Adrian

Transcript of Design and implementation of color tracking method on Chess Robot Using Camera

DESIGN AND IMPLEMENTATION OF COLOR TRACKING METHOD ON CHESS ROBOT USING CAMERA

DESIGN AND IMPLEMENTATION OF COLOR TRACKING METHOD ON CHESS ROBOT USING CAMERABY Ir. Ferrianto Gozali , MSCS and Daniel Adrian

SYSTEM DIAGRAM FOR CHESS ROBOT

GET CHESS BOARD IMAGEGET POSITION AND CALCULATE MOVECONTROL ARM ROBOTINPUTPROCESSOUTPUT

INPUTCOMPONENT INPUT :CHESS PIECESCHESS BOARDLIGHT AND CAMERA

CHESS PIECES

PurpleRookGreenKnightRedKingBluePawnCyanQueenYellowBishop

CHESS BOARD

LIGHT AND CAMERACAMERALogitech c525 (HIGH RESOLUTION)Logitech c210 (LOW RESOLUTION)LIGHTLED LIGHT WITH SAME COLOR TEMPERATURE LUMEN 250, 600, 806

PROCESSCOMPONENT PROCESSColor TrackingBest Move Calculation

Color trackingStep to get position of image with color tracking :Image Prespective Correction Convert RGB image format to HSV image formatColor filteringFind contour position

Color tracking Image Prespective Correction Correction is made by changing prespective value to get flat image

Homography matrix - > matrix transform untuk prespektif 3x39

Color tracking RGB to HSVWhy ?

COMPARE RGB AND HSV

Dengan hsv dan rgb dapat di filter11

COMPARE RGB AND HSV

Kemudian diuji dengan low quality image maka hasil hsv terdapat noise12

COMPARE RGB AND HSV

Kemudian dicoba image dengan bayangan pada gambarnyahasilnya hsv dapat memfilter warna pada gambar sedangkan rgb terpotong13

COMPARE RGB AND HSV

Kemudian diuji coba dengan low quality image, warna merah yang terang dan terdapat bayangan pada image hasil hsv tetap dapat memfilter hampir 95% area sedangkan rgb tidak14

Conclusion from comparing RGB and HSVRGB - > needs accurate color. If color get distraction (be examined by using different image), RGB filtering cant get image with same settingHSV - > there is noise in result but HSV filtering can get the image with same settingObject input : Object color can be changed by environment and color isnt solid ( pure color )

RGB vs HSV

Color tracking RGB to HSVLook at this test, image RGB used to convert to HSV

Color tracking - Color filteringHue min max, saturation min max dan value min max

Color tracking Find contour Find Contour aims to search white space in black spaceIn real there is noise that happen to white space( HSV mode )dilate -> increase white space pixelGet x and y position

Demo dilate19

Bestmove CalculationUsing stockfish 5 chess engine -> open source

OUTPUTHand movementSend from computer to Arduino by BluetoothServo : Dynamixel AX18 and BMS 660 MGOn the rail, there are black line to determine position for the workspace. There are ten position of the workspace that is for trash, for button and for chessboard.

Result

Testing the effect of different lumen on color trackingChess pieces color250 lumen as reference600 lumen as reference806 lumen as reference250600806250600806250600806BlueRedLight blueGreenPurpleYellow

Information : (Detected) (Not detected)

Testing the effect of color saturation and value on color tracking

Testing the effect of color saturation and value on color tracking white backgroundSaturation/valueBluePurpleLight blueGreenYellowRedSaturation : 25%Value : 100%Saturation : 50%Value : 100%Saturation : 75%Value : 100%Saturation : 100%Value : 100%Saturation : 100%Value : 75%Saturation : 100%Value : 50%Saturation : 100%Value :25%

Testing the effect of color saturation and value on color tracking black backgroundSaturation/valueBluePurpleLight blueGreenYellowRedSaturation : 25%Value : 100%Saturation : 50%Value : 100%Saturation : 75%Value : 100%Saturation : 100%Value : 100%Saturation : 100%Value : 75%Saturation : 100%Value : 50%Saturation : 100%Value :25%

Testing the effect of different type of camera on color trackingColor of chess piecesUsing camera logitech c525 as referenceUsing camera logitech c210 as referenceCamera 1Camera 2Camera 1Camera 2BlueRedLight BlueGreenPurpleYellow

Testing movement detection with color tracking

Gambar sebelumGambar sesudahHasil pembacaanKing from (2,5) to (2,4)Pawn from (3,5) to (3,4)

Testing movement detection with color tracking

Gambar sebelumGambar sesudahHasil pembacaanQueen from (4,5) to (4,4)

ConclusionColor tracking can be implemented in a chess robotChanges in lumen 250,600 and 806 cause error in several color but this problem can be solved by adjust the settingSaturation level can still be detected by the camera to the optimum for white background and black background between 50% to 100% for value 100%Value level can still be detected by the camera to the optimum for white background and black background between 75% to 100% for saturation 100%The robot is able to know the chess pieces are moved by humanDifferences camera represented by logitech c525 and logitech c210 showed that different camera affect the results of chess pieces detection

THANK YOU

TOOLSEMGU CV FOR IMAGE PROCESSINGSTOCKFISH 5 FOR CHESS ENGINEEXE CONNECTOR TO CONNECT PROGRAM AND CHESS ENGINEXAMPP FOR LOCAL SERVERVB.NET TO DEVELOP PROGRAMARDUINO IDE TO DEVELOP ARM ROBOT PROGRAM

REFERENCEKonstantin Kosteniuk. Retrieved desember 15, 2014 fromhttps://chessprogramming.wikispaces.com/Konstantin+KosteniukCynthia, M., Brian, M., Roberto, A., Marc, P.D., Liefeng, B., Robert, C., Mike, K., Louis, L., Joshua, R.S., Dieter, F.(2013). Gambit: A Robust Chess-Playing Robotic System. University of WashingtonMrs. Sonal, D., Prof. V. B. Baru.(2013). Applications of RFID in Interactive Board Games. Sinhgad College of EngineeringEmir, S., Melita Ahic-Djokic.(2008). Simple computer vision system for chess playing robot manipulator as a Project-based learning example. Faculty of Electrical Engineering, University of SarajevoEMGU CV Retreived desember 15, 2014 fromhttp://www.emgu.com/wiki/Kyle, H.(2013, September 21).OpenCV Tutorial: Multiple Object Tracking in Real Time [Video file] Retrieved from https://www.youtube.com/watch?v=4KYlHgQQAtsKyle, H.(2013, March 11). Tutorial: Real-Time Object Tracking Using OpenCV [Video File].Retrieved from https://www.youtube.com/watch?v=bSeFrPrqZ2A