DESIGN AND IMPLEMENTATION OF
COLOR TRACKING METHOD ON CHESS
ROBOT USING CAMERA
BY
Ir. Ferrianto Gozali , MSCS and Daniel Adrian
SYSTEM DIAGRAM FOR CHESS ROBOT
GET CHESS BOARD IMAGE GET POSITION AND CALCULATE MOVE
CONTROL ARM ROBOT
INPUT PROCESS
OUTPUT
INPUT
COMPONENT INPUT :
 CHESS PIECES
 CHESS BOARD
 LIGHT AND CAMERA
CHESS PIECES
Purple Rook
Green Knight
Red King
Blue Pawn
Cyan Queen
Yellow Bishop
CHESS BOARD
LIGHT AND CAMERA
CAMERA
 Logitech c525 (HIGH RESOLUTION)
 Logitech c210 (LOW RESOLUTION)
LIGHT
 LED LIGHT WITH SAME COLOR TEMPERATURE
 LUMEN 250, 600, 806
PROCESS
COMPONENT PROCESS
 Color Tracking
 Best Move Calculation
Color tracking
Step to get position of image with color tracking :
 Image Prespective Correction
 Convert RGB image format to HSV image format
 Color filtering
 Find contour position
Color tracking – Image Prespective
Correction
 Correction is made by changing prespective value to get flat image
Color tracking – RGB to HSV
Why ?
COMPARE RGB AND HSV
COMPARE RGB AND HSV
COMPARE RGB AND HSV
COMPARE RGB AND HSV
Conclusion from comparing RGB and HSV
 RGB - > needs accurate color. If color get distraction (be examined by using
different image), RGB filtering can’t get image with same setting
 HSV - > there is noise in result but HSV filtering can get the image with same
setting
Object input : Object color can be changed by environment and color isn’t solid (
pure color )
RGB vs HSV
Color tracking – RGB to HSV
 Look at this test, image RGB used to convert to HSV
Color tracking - Color filtering
 Hue min max, saturation min max dan value min max
Color tracking – Find contour
 Find Contour aims to search white space in black space
 In real there is noise that happen to white space( HSV mode )
 dilate -> increase white space pixel
 Get x and y position
Bestmove Calculation
 Using stockfish 5 chess engine -> open source
OUTPUT
Hand movement
 Send from computer to Arduino by Bluetooth
 Servo : Dynamixel AX18 and BMS 660 MG
 On 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
tracking
Chess
pieces
color
250 lumen as reference 600 lumen as reference 806 lumen as reference
250 600 806 250 600 806 250 600 806
Blue ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
Red ✓ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✓
Light blue ✓ ✓ ✓ ✗ ✓ ✗ ✓ ✓ ✓
Green ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
Purple ✓ ✓ ✗
✓ ✓ ✓
✗ ✓ ✓
Yellow ✓ ✓ ✓
✓ ✓ ✓
✓ ✓ ✓
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 background
Saturation/value Blue Purple Light blue Green Yellow Red
Saturation : 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 background
Saturation/value Blue Purple Light blue Green Yellow Red
Saturation : 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 tracking
Color of chess pieces
Using camera logitech c525 as
reference
Using camera logitech c210 as
reference
Camera 1 Camera 2 Camera 1 Camera 2
Blue ✗ ✓ ✓ ✓
Red ✗ ✓ ✓ ✗
Light Blue ✓ ✓ ✓ ✗
Green ✗ ✓ ✓ ✓
Purple ✗ ✓ ✓ ✓
Yellow ✗ ✓ ✓ ✗
Testing movement detection with color
tracking
Gambar sebelum Gambar sesudah Hasil pembacaan
King from (2,5) to (2,4)
Pawn from (3,5) to (3,4)
Testing movement detection with color
tracking
Gambar sebelum Gambar sesudah Hasil pembacaan
Queen from (4,5) to
(4,4)
Conclusion
 Color tracking can be implemented in a chess robot
 Changes in lumen 250,600 and 806 cause error in several color but this
problem can be solved by adjust the setting
 Saturation 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 human
 Differences camera represented by logitech c525 and logitech c210 showed
that different camera affect the results of chess pieces detection
THANK YOU

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

  • 1.
    DESIGN AND IMPLEMENTATIONOF COLOR TRACKING METHOD ON CHESS ROBOT USING CAMERA BY Ir. Ferrianto Gozali , MSCS and Daniel Adrian
  • 2.
    SYSTEM DIAGRAM FORCHESS ROBOT GET CHESS BOARD IMAGE GET POSITION AND CALCULATE MOVE CONTROL ARM ROBOT INPUT PROCESS OUTPUT
  • 3.
    INPUT COMPONENT INPUT : CHESS PIECES  CHESS BOARD  LIGHT AND CAMERA
  • 4.
    CHESS PIECES Purple Rook GreenKnight Red King Blue Pawn Cyan Queen Yellow Bishop
  • 5.
  • 6.
    LIGHT AND CAMERA CAMERA Logitech c525 (HIGH RESOLUTION)  Logitech c210 (LOW RESOLUTION) LIGHT  LED LIGHT WITH SAME COLOR TEMPERATURE  LUMEN 250, 600, 806
  • 7.
    PROCESS COMPONENT PROCESS  ColorTracking  Best Move Calculation
  • 8.
    Color tracking Step toget position of image with color tracking :  Image Prespective Correction  Convert RGB image format to HSV image format  Color filtering  Find contour position
  • 9.
    Color tracking –Image Prespective Correction  Correction is made by changing prespective value to get flat image
  • 10.
    Color tracking –RGB to HSV Why ?
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
    Conclusion from comparingRGB and HSV  RGB - > needs accurate color. If color get distraction (be examined by using different image), RGB filtering can’t get image with same setting  HSV - > there is noise in result but HSV filtering can get the image with same setting Object input : Object color can be changed by environment and color isn’t solid ( pure color )
  • 16.
  • 17.
    Color tracking –RGB to HSV  Look at this test, image RGB used to convert to HSV
  • 18.
    Color tracking -Color filtering  Hue min max, saturation min max dan value min max
  • 19.
    Color tracking –Find contour  Find Contour aims to search white space in black space  In real there is noise that happen to white space( HSV mode )  dilate -> increase white space pixel  Get x and y position
  • 20.
    Bestmove Calculation  Usingstockfish 5 chess engine -> open source
  • 21.
    OUTPUT Hand movement  Sendfrom computer to Arduino by Bluetooth  Servo : Dynamixel AX18 and BMS 660 MG  On 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.
  • 22.
  • 23.
    Testing the effectof different lumen on color tracking Chess pieces color 250 lumen as reference 600 lumen as reference 806 lumen as reference 250 600 806 250 600 806 250 600 806 Blue ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ Red ✓ ✓ ✓ ✗ ✓ ✓ ✓ ✓ ✓ Light blue ✓ ✓ ✓ ✗ ✓ ✗ ✓ ✓ ✓ Green ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ Purple ✓ ✓ ✗ ✓ ✓ ✓ ✗ ✓ ✓ Yellow ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ Information : ✓ (Detected) ✗ (Not detected)
  • 24.
    Testing the effectof color saturation and value on color tracking
  • 25.
    Testing the effectof color saturation and value on color tracking – white background Saturation/value Blue Purple Light blue Green Yellow Red Saturation : 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% ✗ ✗ ✗ ✗ ✗ ✗
  • 26.
    Testing the effectof color saturation and value on color tracking – black background Saturation/value Blue Purple Light blue Green Yellow Red Saturation : 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% ✗ ✗ ✗ ✗ ✗ ✗
  • 27.
    Testing the effectof different type of camera on color tracking Color of chess pieces Using camera logitech c525 as reference Using camera logitech c210 as reference Camera 1 Camera 2 Camera 1 Camera 2 Blue ✗ ✓ ✓ ✓ Red ✗ ✓ ✓ ✗ Light Blue ✓ ✓ ✓ ✗ Green ✗ ✓ ✓ ✓ Purple ✗ ✓ ✓ ✓ Yellow ✗ ✓ ✓ ✗
  • 28.
    Testing movement detectionwith color tracking Gambar sebelum Gambar sesudah Hasil pembacaan King from (2,5) to (2,4) Pawn from (3,5) to (3,4)
  • 29.
    Testing movement detectionwith color tracking Gambar sebelum Gambar sesudah Hasil pembacaan Queen from (4,5) to (4,4)
  • 30.
    Conclusion  Color trackingcan be implemented in a chess robot  Changes in lumen 250,600 and 806 cause error in several color but this problem can be solved by adjust the setting  Saturation 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 human  Differences camera represented by logitech c525 and logitech c210 showed that different camera affect the results of chess pieces detection
  • 31.

Editor's Notes

  • #10 Homography matrix - > matrix transform untuk prespektif 3x3
  • #12 Dengan hsv dan rgb dapat di filter
  • #13 Kemudian diuji dengan low quality image maka hasil hsv terdapat noise
  • #14 Kemudian dicoba image dengan bayangan pada gambarnya…hasilnya hsv dapat memfilter warna pada gambar sedangkan rgb terpotong
  • #15 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 tidak
  • #20 Demo dilate