CN108671534A - A kind of robot Chinese chess beginning pendulum chess method and system based on objective contour and framework characteristic - Google Patents
A kind of robot Chinese chess beginning pendulum chess method and system based on objective contour and framework characteristic Download PDFInfo
- Publication number
- CN108671534A CN108671534A CN201810489656.2A CN201810489656A CN108671534A CN 108671534 A CN108671534 A CN 108671534A CN 201810489656 A CN201810489656 A CN 201810489656A CN 108671534 A CN108671534 A CN 108671534A
- Authority
- CN
- China
- Prior art keywords
- chess
- image
- chess piece
- pixel
- coordinate
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F3/00—Board games; Raffle games
- A63F3/00895—Accessories for board games
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F3/00—Board games; Raffle games
- A63F3/02—Chess; Similar board games
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
- G06F18/2411—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
Abstract
The invention discloses a kind of robot Chinese chess beginning based on objective contour and framework characteristic to put chess method and system, this method proposes a coarse positioning, region segmentation, secondary accurate positioning, the pieces of chess positioning and recognition methods being combined with the feature extraction of skeleton and SVM multi-categorizers based on objective contour, realizes intelligent chess robot opening stage from movable pendulum chess function;The system is made of common Chinese chessboard and chess piece, uArm four-degree-of-freedoms mechanical arm, sucker, camera, light source, PC-Based Control system etc., whole system is simple in structure, easy to operate, robot is automatically finished pendulum chess function before allowing to carry out man-machine chess, and also has preferable stability under relative complex environment.
Description
Technical field
The present invention relates to Machine Vision Detection field, more particularly to a kind of robot based on objective contour and framework characteristic
Chess method and system is put in Chinese chess beginning.
Background technology
It is constantly progressive with the continuous development of society with scientific and technological, the entertainment service type artificially represented with Chinese chess machine
Robot is increasingly becoming one of hot spot of robot research field.Traditional chess robot usually uses non-vision positioning
And recognition methods realizes chess piece positioning and identification by customizing special chess piece and electronic chess-plate by hardware circuit.
Through consulting pertinent literature, paper:" the robot controller design based on AVR single chip " (Zhang Yongde, Bi Jintao)
By the way of the chess piece and design electronic chess-plate of special different resistance values, the positioning and knowledge of chess piece are carried out by electronic chess-plate
Not;Paper " the chess robot control system research based on ARM built-in Linuxes " (Zhuan Jianyi) uses the chess of transparent material
Son, such as glass etc. carry out the positioning and identification of chess piece using the electronic chess-plate with photo resistance;" one kind is based on real for patent
Object chessboard man-machine chess's chess robot device " (Jiang Xingfang, Xu Ruiping, Chen Lu etc.) adds Hall to each chess position on chessboard
Element, the level brought by chess piece movement export height difference to obtain chess piece mobile message;Patent " the chess of chess robot
Disk identification device " (Lin Ying, Zhuan Jianyi) is disclosed adds the phases such as resistance and corresponding diode, conventional, electric-resistance on Chinese chess position
Electronic device is closed, the information that voltage and current changes to judge to play chess caused by being moved by chess piece;Patent " a kind of Chinese chess tool and
Electrical beginning pendulum chess method " (Xu Youwu, Lv Jie, Wang Bin etc.) is disclosed and is remembered by using the special chess piece of magnetic metal material
Piece information is recorded, to realize that chess function is put in beginning.But all existing shortcoming is embodied in the following aspects:
(1) positioning of chess piece relies on special chessboard or special chess piece, can not accomplish the positioning and beginning of arbitrary common chess piece
Stage automatically puts chess function;
(2) it needs to add additional sensor or electronic device and electronic circuit in chess robot system, increase
System development costs and complexity;
(3) chess robot man-machine chess intelligence degree is not high.
Invention content
It is positioned without special common chessboard and chess piece existing for beginning pendulum chess stage for existing chess robot
With identification problem, the present invention develops a kind of robot Chinese chess beginning pendulum chess method based on objective contour and framework characteristic and is
System, realizes man-machine chess's opening stage robot and automatically puts chess function, i.e.,:It is real on not customized chessboard and chess piece
Now mechanical arm is recognized from measurement and positioning chess piece position, chess piece character information execute the Automatic Control that pendulum chess is completed in chess piece movement
Process.
A kind of robot Chinese chess beginning pendulum chess method based on objective contour and framework characteristic, includes the following steps:
Step 1:Acquisition is placed with the chess image to be put of chess piece right over chess piece placement region;
Step 2:It treats pendulum chess image and carries out loop truss, obtain initial seat of each chess piece center of circle in chess piece placement region
Mark;
Step 3:The individual chessman image-region in pendulum chess image is treated using the initial coordinate in each chess piece center of circle to carry out
Segmentation, obtains individual chessman image;
Step 4:Color identification is carried out to all individual chessman images;
Step 5:After carrying out binary conversion treatment to all individual chessman image, then extract objective contour figure and skeleton drawing
Hu invariant moment features vectors;
Step 6:The chess piece character SVM classifier of corresponding color is chosen using the color of individual chessman image, inputs chess piece
The corresponding Hu invariant moment features vector of image, obtains the corresponding character of pawn image;
The chess piece character SVM classifier be with the Hu of the objective contour figure of the different chess pieces of same color and skeleton drawing not
Become Character eigenvector as input data, the known character on chess piece is trained SVM classifier and obtains as output data
;
There are two colors for Chinese chess, and there are two chess piece character SVM classifiers, are divided into red and black;
Step 7:Utilize the corresponding character of pawn image, according to beginning rule of chess piece, place chess when obtaining chess piece beginning
Final position coordinate of the center of circle installation position as chess piece on disk, by the final position of chess piece and the center of circle in chess piece placement region
On initial coordinate, be sent to mechanical arm control centre, driving mechanical arm is moved to chess piece center of circle initial coordinate crawl chess piece extremely
Corresponding final position;
Initial coordinate of the chess piece center of circle in chess piece placement region and final position coordinate are transformed by the control centre
Coordinate under world coordinate system where mechanical arm.
Chess piece is placed on chess piece placement region at the beginning, needs to capture to chessboard from chess piece placement region;
Further, the extraction process of the objective contour figure of individual chessman image is as follows:
Binaryzation character picture of the individual chessman image after binary conversion treatment is subjected to the processing of form echelon, is obtained more
A contour area traverses each contour area and calculates its contour area, successively with the maximum contour area of area, as chess piece
The objective contour figure of upper character.
Further, the extraction process of the skeleton drawing of individual chessman image is as follows:
By binaryzation character figure of the individual chessman image after binary conversion treatment according to Zhang formula thinning algorithms carry out with
Lower two-step pretreatment
Step A1:8 neighborhood territory pixels of the foreground pixel point that all pixels value in binaryzation character figure is non-zero are traversed successively
Point, the pixel value zero setting of the foreground pixel point to meeting the following conditions, is updated the pixel value of foreground pixel point:
2≤N (P1)≤6, S (P1)=1, P2*P4*P6=0, P4*P6*P8=0;
Wherein:P1 indicates that foreground pixel point, P2-P9 are 8 neighborhood territory pixels of pixel centered on former scene vegetarian refreshments P1
Point, the pixel centered on P2 right over pixel, and P2-P9 is arranged in the direction of the clock;
N (P1) is denoted as the number for the foreground pixel that gray value in the 8 neighborhood territory pixel points of central pixel point P1 is non-zero,
S (P1) is indicated with sequence counter-clockwise searching loop P2-P9-P2, the cumulative number of pixel value transition from 0 to 1;All pixels point
Value is 0 or 1,0 expression background, and 1 indicates foreground;
Step A2:The updated foreground pixel points of step A1 are traversed through again, to meeting the foreground pixel of the following conditions
The pixel value zero setting of point, updates the pixel value of foreground pixel point again:
2≤N (P1)≤6, S (P1)=1, P2*P4*P8=0, P2*P6*P8=0;
If after step A2, the pixel value of no foreground pixel point is zeroed out, then using current binary image as carefully
Skeleton image after change extracts the character targets skeleton drawing;Otherwise, return to step A1 continues the pixel value to foreground pixel point
It is updated.
Further, the Hu invariant moment features vector extraction process of the objective contour figure or skeleton drawing is as follows:
Step B1:Calculate the m of Hu invariant moment features vector-valued image to be extractedpqSquare and central moment μpq:
Wherein, f (x, y) indicates that objective contour figure or skeleton drawing, size are that M × N, p and q are the integer that value is 0-3, x0
=m10/m00, y0=m01/m00;
Step B2:Centre-to-centre spacing is normalized, normalization centre-to-centre spacing is obtained:
Step B3:Centre-to-centre spacing is normalized using second order and three ranks, calculates the Hu of Hu invariant moment features vector-valued image to be extracted
Not bending moment group { φ1, φ2, φ3, φ4, φ5, φ6, φ7};
Further, the initial coordinate in the individual chessman center of circle to being extracted from chess image to be put is corrected as follows:
Step C1:To the profile in the objective contour figure of obtained individual chessman image, the minimum circumscribed circle of profile is extracted,
Obtain pixel coordinate of the profile circumscribed circle center of circle in individual chessman image;
Step C2:Profile circumscribed circle center pixel coordinate and the central point pixel coordinate of individual chessman image are made the difference, obtained
To the correction amount (x ', y ') of chess piece center pixel coordinate;
Step C3:Obtained correction amount (x ', y ') is added with the initial coordinate in the individual chessman center of circle, obtains the chess piece center of circle
The revised initial coordinate in chess piece placement region.
Further, initial coordinate or revised initial coordinate of the chess piece center of circle in chess piece placement region use
Zhang Zhengyou standardizations are converted on the coordinate system to scaling board, are as follows:
Step D1:Scaling board is placed in chess piece placement region and adjusts position, and scaling board is made to be acquired in chess piece placement region
Image is in a horizontal position;
Step D2:Using scaling board center angle point as coordinate origin, with side parallel with X-axis in chess piece placement region acquisition image
To for X-axis, X value augment directions are positive direction, using scaling board grid lateral length as X-axis unit scales;With with chess piece rest area
It is Y-axis that domain, which acquires Y-axis parallel direction in image, and Y value augment direction is positive direction, using scaling board grid longitudinal length as Y-axis list
Position scale, establishes rectangular coordinate system;
Step D3:By initial coordinate of the chess piece center of circle in chess piece placement region or revised initial coordinate and scaling board
Center origin pixel coordinate makes the difference, and initial coordinate or revised initial of the chess piece center of circle in chess piece placement region is calculated
Position coordinates of the coordinate in the rectangular coordinate system where scaling board.
It finally, will be in the world coordinate system where the position coordinates conversion value mechanical arm on scaling board coordinate system.
The coordinate in pendulum chess region is demarcated using scaling board, after calibration is primary, during subsequent pendulum chess, as long as
Pendulum chess region does not change, then the rectangular coordinate system of scaling board structure can be directly utilized, by the chess piece center of circle in chess piece rest area
Initial coordinate or revised initial coordinate on domain are converted into the rectangular coordinate system where scaling board, without being marked again
It is fixed;
Further, when carrying out binary conversion treatment, used binary-state threshold is handled using equalization and is obtained;
Step E1:Individual chessman image is stepped through, its pixel grey scale mean value is calculated:
Wherein, x, y are respectively pixel coordinate, and NR, NC are respectively individual chessman image pixel line number and columns;
Step E2:According to the pixel grey scale mean value being calculated, structure equalization threshold k * T;
Wherein, K is proportionality coefficient, and value range is (0,1).
When being determined by experiment K and taking 0.75, character binaryzation segmentation effect is preferable.
Further, the process of individual chessman image progress color identification is as follows:
Step F1:It is HSV models by the RGB model conversations of individual chessman image, records each picture in single pawn image
The H values of vegetarian refreshments;
Step F2:According to the H value ranges of different colours pixel, the color of each pixel is judged;
It is different using H (tone) the values value of different pixels, it can be determined that pixel color;
The H value ranges of red pixel:170—180;The H value ranges of black picture element:103—106;
Step F3:Quantity to being belonging respectively to red and black picture element in individual chessman image adds up, and obtains entire
Red and black picture element total quantity in pawn image:NrAnd Nb;Judge NrAnd NbSize, using the color more than quantity as chess
Sub-color.
A kind of robot Chinese chess opening placing system based on objective contour and framework characteristic, including chess piece placement region,
Chessboard, chess piece and scaling board, image acquisition units, robot arm execution unit and control unit:
Described image collecting unit includes screen light source and camera, and planar light source is set to chessboard side, camera
It is set to right over chess piece placement region, the camera, planar light source and robot arm execution unit are controlled by control
Unit processed;
Described control unit puts chess using a kind of above-mentioned robot Chinese chess beginning based on objective contour and framework characteristic
After the image that method acquires image acquisition units is handled, control instruction is sent out to robot arm execution unit, by chess
Son is captured from scaling board, is put to chessboard, is carried out from movable pendulum chess.
The coordinate in pendulum chess region is demarcated using scaling board, after calibration is primary, during subsequent pendulum chess, as long as
Pendulum chess region does not change, then the rectangular coordinate system of scaling board structure can be directly utilized, by the chess piece center of circle in chess piece rest area
Initial coordinate or revised initial coordinate on domain are converted into the rectangular coordinate system where scaling board, without being marked again
It is fixed;
Further, the robot arm execution unit uses uArm four-degree-of-freedom mechanical arms, and mechanical arm tail end is set
It is equipped with sucker.
Advantageous effect
Compared with the prior art, the advantages of the present invention are as follows:
(1) system hardware platform is simple
A kind of intelligent chess robot system of the present invention, composition is simple, only relies on camera and carries out Image Acquisition, is not necessarily to
Additional electronic component, there are no the chess pieces or chessboard that need special material.So that system is uncomplicated, the building of platform has been easy
At.
(2) detection result is good
One kind proposed by the present invention is used for chess piece center of circle localization method twice, and positional accuracy is high, positioning time is short, dual
The system of being positioned so as to can be accurately positioned under normal ambient environment without being interfered by extraneous factor;With the reality independently built
Platform test 15mm diameter pieces of chess positioning results are tested to show:Average localization error exists in 0.5mm, average positioning time
2.6ms ensures recognition accuracy in the case of 98% or more, and chess piece is averaged whole process operation time in 10ms or so.
(3) stability is strong
Character feature identification is carried out using Hu invariant moment features, not only ensure that rotation, translation in character recognition process
With scaling invariance so that system identification stability is strong;And Hu square calculation amounts are small, and it is real-time, it can guarantee chess robot
In real time accurately identify.
Description of the drawings
Fig. 1 is the hardware structure diagram of control system of the present invention;
Fig. 2 is control method flow total figure of the present invention;
Fig. 3 is color identification process schematic diagram;
Fig. 4 is mean value threshold process flow diagram;
Fig. 5 is the flow diagram of secondary accurate positioning method;
Fig. 6 is the chess piece positioning intermediate effect figure of secondary accurate positioning method;
Fig. 7 is that 3*3 picture element matrixs put in order the calculating of schematic diagram and S (P1) in Zhang formula skeletal extraction algorithms
Method;
Fig. 8 is profile and skeletal extraction result figure.
Specific implementation mode
Below in conjunction with drawings and examples, the present invention is described further.
Chess method is put in a kind of robot Chinese chess beginning based on objective contour and framework characteristic, overall procedure as shown in Fig. 2,
Include the following steps:
Step 1:Acquisition is placed with the chess image to be put of chess piece right over chess piece placement region;
Step 2:It treats pendulum chess image and carries out loop truss, obtain initial seat of each chess piece center of circle in chess piece placement region
Mark;
Step 3:The individual chessman image-region in pendulum chess image is treated using the initial coordinate in each chess piece center of circle to carry out
Segmentation, obtains individual chessman image;
Step 4:Color identification is carried out to obtaining individual chessman image, as shown in Figure 3;
The color identification is as follows:
Step F1:It is HSV models by the RGB model conversations of individual chessman image, records each picture in single pawn image
The H values of vegetarian refreshments;
Step F2:According to the H value ranges of different colours pixel, the color of each pixel is judged;
It is different using H (tone) the values value of different pixels, it can be determined that pixel color;
The H value ranges of red pixel:170—180;The H value ranges of black picture element:103—106;
Step F3:Quantity to being belonging respectively to red and black picture element in individual chessman image adds up, and obtains entire
Red and black picture element total quantity in pawn image:NrAnd Nb;Judge NrAnd NbSize, using the color more than quantity as chess
Sub-color.
Step 5:Binary conversion treatment is carried out to obtaining individual chessman imagery exploitation mean value threshold value, as shown in Figure 4;
The obtaining step of the mean value threshold process is as follows:
Step E1:Individual chessman image is stepped through, its pixel grey scale mean value is calculated:
Wherein, x, y are respectively pixel coordinate, and NR, NC are respectively individual chessman image pixel line number and columns;
Step E2:According to the pixel grey scale mean value being calculated, structure equalization threshold k * T;
Wherein, K is proportionality coefficient, and value range is (0,1);
When being determined by experiment K and taking 0.75, character binaryzation segmentation effect is preferable.
Binary conversion treatment is carried out using mean value threshold value:
Step 6:The initial coordinate in the individual chessman center of circle to being extracted from chess image to be put is modified, and obtains chess piece two
It is secondary to be accurately positioned central coordinate of circle, as shown in Figure 5;
Step C1:Obtained binaryzation character picture is subjected to morphocline processing so that between each stroke of character mutually
Connection carries out contours extract to morphocline figure, then traverses each profile successively and calculate its contour area, retains wherein face
The maximum profile of product is as objective contour;To the profile in the objective contour figure of obtained individual chessman image, profile is extracted
Minimum circumscribed circle, obtains pixel coordinate of the profile circumscribed circle center of circle in individual chessman image, and secondary accurate positioning processing is intermediate
Design sketch is as shown in Figure 6;
Step C2:Profile circumscribed circle center pixel coordinate and the central point pixel coordinate of individual chessman image are made the difference, obtained
To the correction amount (x ', y ') of chess piece center pixel coordinate;
Step C3:Obtained correction amount (x ', y ') is added with the initial coordinate in the individual chessman center of circle, obtains the chess piece center of circle
The revised initial coordinate in chess piece placement region.
Step 7:To the revised character picture in the center of circle, the characteristic vector pickup based on objective contour and skeleton is carried out, is obtained
The feature vector chart of character on to each chess piece;
The extraction process of the skeleton drawing of individual chessman image is as follows:
By binaryzation character figure of the individual chessman image after binary conversion treatment according to Zhang formula thinning algorithms carry out with
Lower two-step pretreatment
Step A1:8 neighborhood territory pixels of the foreground pixel point that all pixels value in binaryzation character figure is non-zero are traversed successively
Point, the pixel value zero setting of the foreground pixel point to meeting the following conditions, is updated the pixel value of foreground pixel point:
2≤N (P1)≤6, S (P1)=1, P2*P4*P6=0, P4*P6*P8=0;
Wherein:P1 indicates that foreground pixel point, P2-P9 are 8 neighborhood territory pixels of pixel centered on former scene vegetarian refreshments P1
Point, the pixel centered on P2 right over pixel, and P2-P9 is arranged in the direction of the clock;
N (P1) is denoted as the number for the foreground pixel that gray value in the 8 neighborhood territory pixel points of central pixel point P1 is non-zero,
S (P1) is indicated with sequence counter-clockwise searching loop P2-P9-P2, the cumulative number of pixel value transition from 0 to 1;All pixels point
Value is 0 or 1,0 expression background, and 1 indicates foreground;
3*3 picture element matrixs put in order as shown in Figure 7 with the computational methods of S (P1);
Step A2:The updated foreground pixel points of step A1 are traversed through again, to meeting the foreground pixel of the following conditions
The pixel value zero setting of point, updates the pixel value of foreground pixel point again:
2≤N (P1)≤6, S (P1)=1, P2*P4*P8=0, P2*P6*P8=0;
If after step A2, the pixel value of no foreground pixel point is zeroed out, then using current binary image as carefully
Skeleton image after change extracts the character targets skeleton drawing;Otherwise, return to step A1 continues the pixel value to foreground pixel point
It is updated, final profile and skeletal extraction result figure are as shown in Figure 8.
The Hu invariant moment features vector extraction process of the objective contour figure or skeleton drawing is as follows:
Step B1:Calculate the m of Hu invariant moment features vector-valued image to be extractedpqSquare and central moment μpq:
Wherein, f (x, y) indicates that objective contour figure or skeleton drawing, size are that M × N, p and q are the integer that value is 0-3, x0
=m10/m00, y0=m01/m00;
Step B2:Centre-to-centre spacing is normalized, normalization centre-to-centre spacing is obtained:
Step B3:Centre-to-centre spacing is normalized using second order and three ranks, calculates the Hu of Hu invariant moment features vector-valued image to be extracted
Not bending moment group { φ1, φ2, φ3, φ4, φ5, φ6, φ7};
14 Hu invariant moment features vectors can be obtained with skeleton drawing altogether for objective contour figure;
14 feature vectors of character are transversely arranged, form the feature vector chart of character on chess piece.
Step 8:To obtained feature vector chart, it is divided into two classes by red, black dichromatism, includes respectively 7 kinds of characters per class, respectively
It is red:" soldier ", " horse ", " Trucks ", " phase ", " bodyguard ", " big gun " and " Handsome " 7, black:" soldier ", " horse ", " Trucks ", " as ", " scholar ",
" Gun " and " general " 7, the feature vector chart of respective color is sent into SVM multi-categorizers and is trained, red, black dichromatism is obtained
Character classifier is spare;
Step 9:To the obtained feature vector chart of extraction, by different colours information, the red or black point that is respectively fed to
In class device, character information is obtained, then according to Chinese chess beginning chess piece placement regulation, obtains the character chess piece in beginning in chessboard
Position and world coordinates;
Step 10:The world coordinates of the world coordinates of chess piece initial position and corresponding chessboard position is passed by serial communication
It is defeated by mechanical arm, the chess piece on initial position is put on corresponding chessboard position, completed by the arm actuating station of chess robot
Put chess function.
As shown in Figure 1, a kind of robot Chinese chess opening placing system based on objective contour and framework characteristic, including chess piece
Placement region, chessboard, chess piece and scaling board, image acquisition units, robot arm execution unit and control unit:
Described image collecting unit includes screen light source and camera, and planar light source is set to chessboard side, camera
It is set to right over chess piece placement region, the camera, planar light source and robot arm execution unit are controlled by control
Unit processed;
Described control unit puts chess using a kind of above-mentioned robot Chinese chess beginning based on objective contour and framework characteristic
After the image that method acquires image acquisition units is handled, control instruction is sent out to robot arm execution unit, by chess
Son is captured from scaling board, is put to chessboard, is carried out from movable pendulum chess.
The coordinate in pendulum chess region is demarcated using scaling board, after calibration is primary, during subsequent pendulum chess, as long as
Pendulum chess region does not change, then the rectangular coordinate system of scaling board structure can be directly utilized, by the chess piece center of circle in chess piece rest area
Initial coordinate or revised initial coordinate on domain are converted into the rectangular coordinate system where scaling board, without being marked again
It is fixed;
The robot arm execution unit uses uArm four-degree-of-freedom mechanical arms, and mechanical arm tail end is provided with sucker.
Specific embodiment described herein is only to do distance explanation to spirit of that invention.Technology neck of the present invention
The technical staff in domain can make various modifications or additions to the described embodiments or replace by a similar method
In generation, however, it does not deviate from the spirit of the invention or beyond the scope of the appended claims.
Claims (10)
1. chess method is put in a kind of robot Chinese chess beginning based on objective contour and framework characteristic, which is characterized in that including following
Step:
Step 1:Acquisition is placed with the chess image to be put of chess piece right over chess piece placement region;
Step 2:It treats pendulum chess image and carries out loop truss, obtain initial coordinate of each chess piece center of circle in chess piece placement region;
Step 3:The individual chessman image-region in pendulum chess image is treated using the initial coordinate in each chess piece center of circle to be split,
Obtain individual chessman image;
Step 4:Color identification is carried out to all individual chessman images;
Step 5:After carrying out binary conversion treatment to all individual chessman image, then extract the Hu of objective contour figure and skeleton drawing not
Become Character eigenvector;
Step 6:The chess piece character SVM classifier of corresponding color is chosen using the color of individual chessman image, inputs pawn image
Corresponding Hu invariant moment features vector, obtains the corresponding character of pawn image;
The chess piece character SVM classifier is with the Hu of the objective contour figure of the different chess pieces of same color and skeleton drawing not bending moments
For feature vector as input data, the known character on chess piece is trained acquisition as output data to SVM classifier;
Step 7:Using the corresponding character of pawn image, according to beginning rule of chess piece, when obtaining chess piece beginning on the chessboard of place
Final position coordinate of the center of circle installation position as chess piece, by the final position of chess piece and the center of circle in chess piece placement region
Initial coordinate, is sent to mechanical arm control centre, and driving mechanical arm is moved to chess piece center of circle initial coordinate and captures chess piece to correspondence
Final position;
Initial coordinate of the chess piece center of circle in chess piece placement region and final position coordinate are transformed into machinery by the control centre
Coordinate under world coordinate system where arm.
2. according to the method described in claim 1, it is characterized in that, the extraction process of the objective contour figure of individual chessman image such as
Under:
Binaryzation character picture of the individual chessman image after binary conversion treatment is subjected to the processing of form echelon, obtains multiple wheels
Wide region traverses each contour area and calculates its contour area, successively with the maximum contour area of area, as word on chess piece
The objective contour figure of symbol.
3. according to the method described in claim 1, it is characterized in that, the extraction process of the skeleton drawing of individual chessman image is as follows:
Binaryzation character figure of the individual chessman image after binary conversion treatment is carried out following two according to Zhang formula thinning algorithms
Step processing
Step A1:8 neighborhood territory pixel points of the foreground pixel point that all pixels value in binaryzation character figure is non-zero are traversed successively, it is right
The pixel value zero setting for meeting the foreground pixel point of the following conditions, is updated the pixel value of foreground pixel point:
2≤N (P1)≤6, S (P1)=1, P2*P4*P6=0, P4*P6*P8=0;
Wherein:P1 indicates that foreground pixel point, P2-P9 are 8 neighborhood territory pixel points of pixel centered on former scene vegetarian refreshments P1, P2
Centered on pixel right over pixel, and P2-P9 is arranged in the direction of the clock;
N (P1) is denoted as the number for the foreground pixel that gray value in the 8 neighborhood territory pixel points of central pixel point P1 is non-zero, S
(P1) it indicates with sequence counter-clockwise searching loop P2-P9-P2, the cumulative number of pixel value transition from 0 to 1;All pixels point
Value is 0 or 1,0 expression background, and 1 indicates foreground;
Step A2:The updated foreground pixel points of step A1 are traversed through again, to meeting the foreground pixel point of the following conditions
Pixel value zero setting updates the pixel value of foreground pixel point again:
2≤N (P1)≤6, S (P1)=1, P2*P4*P8=0, P2*P6*P8=0;
If after step A2, the pixel value of no foreground pixel point is zeroed out, then using current binary image as after refining
Skeleton image, extract the character targets skeleton drawing;Otherwise, return to step A1 continues to carry out the pixel value of foreground pixel point
Update.
4. according to the method in claim 2 or 3, which is characterized in that the Hu of the objective contour figure or skeleton drawing not bending moments
Characteristic vector pickup process is as follows:
Step B1:Calculate the m of Hu invariant moment features vector-valued image to be extractedpqSquare and central moment μpq:
Wherein, f (x, y) indicates that objective contour figure or skeleton drawing, size are that M × N, p and q are the integer that value is 0-3, x0=
m10/m00, y0=m01/m00;
Step B2:Centre-to-centre spacing is normalized, normalization centre-to-centre spacing is obtained:
Step B3:Centre-to-centre spacing is normalized using second order and three ranks, the Hu for calculating Hu invariant moment features vector-valued image to be extracted is constant
Square group { φ1, φ2, φ3, φ4, φ5, φ6, φ7};
5. according to the method described in claim 2, it is characterized in that, to the individual chessman center of circle extracted from chess image to be put
Initial coordinate is corrected as follows:
Step C1:To the profile in the objective contour figure of obtained individual chessman image, the minimum circumscribed circle of profile is extracted, is obtained
Pixel coordinate of the profile circumscribed circle center of circle in individual chessman image;
Step C2:Profile circumscribed circle center pixel coordinate and the central point pixel coordinate of individual chessman image are made the difference, chess is obtained
The correction amount (x ', y ') of sub- center pixel coordinate;
Step C3:Obtained correction amount (x ', y ') is added with the initial coordinate in the individual chessman center of circle, obtains the chess piece center of circle in chess
Revised initial coordinate in sub- placement region.
6. method according to claim 1 or 5, which is characterized in that the chess piece center of circle is first in chess piece placement region
Beginning coordinate or revised initial coordinate are converted using Zhang Zhengyou standardizations on the coordinate system to scaling board, and specific steps are such as
Under:
Step D1:Scaling board is placed in chess piece placement region and adjusts position, and scaling board is made to acquire image in chess piece placement region
It is in a horizontal position;
Step D2:Using scaling board center angle point as coordinate origin, it is to acquire X-axis parallel direction in image with chess piece placement region
X-axis, X value augment directions are positive direction, using scaling board grid lateral length as X-axis unit scales;To be adopted with chess piece placement region
Integrating Y-axis parallel direction in image, as Y-axis, Y value augment direction is positive direction, is carved by Y-axis unit of scaling board grid longitudinal length
Degree, establishes rectangular coordinate system;
Step D3:By initial coordinate of the chess piece center of circle in chess piece placement region or revised initial coordinate and scaling board center
Origin pixel coordinate makes the difference, and initial coordinate or revised initial coordinate of the chess piece center of circle in chess piece placement region is calculated
Position coordinates in the rectangular coordinate system where scaling board.
7. according to any one of claim 1-3 or the method described in 5, which is characterized in that when carrying out binary conversion treatment, used
Binary-state threshold, using equalization handle obtain;
Step E1:Individual chessman image is stepped through, its pixel grey scale mean value is calculated:
Wherein, x, y are respectively pixel coordinate, and NR, NC are respectively individual chessman image pixel line number and columns;
Step E2:According to the pixel grey scale mean value being calculated, structure equalization threshold k * T;
Wherein, K is proportionality coefficient, and value range is (0,1).
8. according to the method described in claim 1, it is characterized in that, the process of individual chessman image progress color identification is as follows:
Step F1:It is HSV models by the RGB model conversations of individual chessman image, records each pixel in single pawn image
H values;
Step F2:According to the H value ranges of different colours pixel, the color of each pixel is judged;
The H value ranges of red pixel:170—180;The H value ranges of black picture element:103—106;
Step F3:Quantity to being belonging respectively to red and black picture element in individual chessman image adds up, and obtains entire chess piece
Red and black picture element total quantity in image:NrAnd Nb;Judge NrAnd NbSize, using the color more than quantity as chess piece face
Color.
9. a kind of robot Chinese chess opening placing system based on objective contour and framework characteristic, which is characterized in that including chess piece
Placement region, chessboard, chess piece and scaling board, image acquisition units, robot arm execution unit and control unit:
Described image collecting unit includes screen light source and camera, and planar light source is set to chessboard side, camera setting
Right over chess piece placement region, it is single that the camera, planar light source and robot arm execution unit are controlled by control
Member;
Described control unit is using a kind of any robot based on objective contour and framework characteristic of claim 1-8
After the image that Chinese chess beginning pendulum chess method acquires image acquisition units is handled, control is sent out to robot arm execution unit
System instruction, chess piece is captured from scaling board, is put to chessboard, is carried out from movable pendulum chess.
10. system according to claim 9, which is characterized in that the robot arm execution unit uses uArm four selfs
By degree mechanical arm, and mechanical arm tail end is provided with sucker.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810489656.2A CN108671534B (en) | 2018-05-21 | 2018-05-21 | Robot chess opening and placing method and system based on target contour and skeleton characteristics |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810489656.2A CN108671534B (en) | 2018-05-21 | 2018-05-21 | Robot chess opening and placing method and system based on target contour and skeleton characteristics |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108671534A true CN108671534A (en) | 2018-10-19 |
CN108671534B CN108671534B (en) | 2020-10-02 |
Family
ID=63807297
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810489656.2A Active CN108671534B (en) | 2018-05-21 | 2018-05-21 | Robot chess opening and placing method and system based on target contour and skeleton characteristics |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108671534B (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109376257A (en) * | 2018-10-24 | 2019-02-22 | 贵州省机电研究设计院 | Tealeaves recognition methods based on image procossing |
CN109726721A (en) * | 2018-12-06 | 2019-05-07 | 五邑大学 | A kind of Chinese chess recognition methods based on convolutional neural networks model |
CN110405781A (en) * | 2019-07-15 | 2019-11-05 | 东南大学 | It is a kind of for the mechanical arm of playing chess of man-machine chess, its control system and method |
CN110472625A (en) * | 2019-08-05 | 2019-11-19 | 浙江大学 | A kind of pieces of chess visual identity method based on Fourier descriptor |
CN111507338A (en) * | 2020-04-15 | 2020-08-07 | 广西科技大学 | Chinese chess piece identification method based on binary image skeleton similarity calculation |
CN111536895A (en) * | 2019-02-07 | 2020-08-14 | 发那科株式会社 | Shape recognition device, shape recognition system, and shape recognition method |
CN113878579A (en) * | 2021-09-30 | 2022-01-04 | 北京市商汤科技开发有限公司 | Chess playing method and device, chess playing robot and computer storage medium |
CN114734456A (en) * | 2022-03-23 | 2022-07-12 | 深圳市商汤科技有限公司 | Chess playing method, device, electronic equipment, chess playing robot and storage medium |
CN111536895B (en) * | 2019-02-07 | 2024-04-16 | 发那科株式会社 | Appearance recognition device, appearance recognition system, and appearance recognition method |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4929083A (en) * | 1986-06-19 | 1990-05-29 | Xerox Corporation | Focus and overlay characterization and optimization for photolithographic exposure |
CN102729250A (en) * | 2011-04-02 | 2012-10-17 | 北京石油化工学院 | Chess opening chessman-placing system and method |
CN106127112A (en) * | 2016-06-15 | 2016-11-16 | 北京工业大学 | Data Dimensionality Reduction based on DLLE model and feature understanding method |
CN205734926U (en) * | 2016-03-28 | 2016-11-30 | 桂林电子科技大学 | A kind of identification automatically based on image procossing and location Bai Qi robot |
CN107648833A (en) * | 2017-09-15 | 2018-02-02 | 湖南大学 | A kind of contactless man-machine chess's control method and system based on machine vision |
-
2018
- 2018-05-21 CN CN201810489656.2A patent/CN108671534B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4929083A (en) * | 1986-06-19 | 1990-05-29 | Xerox Corporation | Focus and overlay characterization and optimization for photolithographic exposure |
CN102729250A (en) * | 2011-04-02 | 2012-10-17 | 北京石油化工学院 | Chess opening chessman-placing system and method |
CN205734926U (en) * | 2016-03-28 | 2016-11-30 | 桂林电子科技大学 | A kind of identification automatically based on image procossing and location Bai Qi robot |
CN106127112A (en) * | 2016-06-15 | 2016-11-16 | 北京工业大学 | Data Dimensionality Reduction based on DLLE model and feature understanding method |
CN107648833A (en) * | 2017-09-15 | 2018-02-02 | 湖南大学 | A kind of contactless man-machine chess's control method and system based on machine vision |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109376257A (en) * | 2018-10-24 | 2019-02-22 | 贵州省机电研究设计院 | Tealeaves recognition methods based on image procossing |
CN109726721A (en) * | 2018-12-06 | 2019-05-07 | 五邑大学 | A kind of Chinese chess recognition methods based on convolutional neural networks model |
CN111536895A (en) * | 2019-02-07 | 2020-08-14 | 发那科株式会社 | Shape recognition device, shape recognition system, and shape recognition method |
CN111536895B (en) * | 2019-02-07 | 2024-04-16 | 发那科株式会社 | Appearance recognition device, appearance recognition system, and appearance recognition method |
CN110405781A (en) * | 2019-07-15 | 2019-11-05 | 东南大学 | It is a kind of for the mechanical arm of playing chess of man-machine chess, its control system and method |
CN110472625A (en) * | 2019-08-05 | 2019-11-19 | 浙江大学 | A kind of pieces of chess visual identity method based on Fourier descriptor |
CN110472625B (en) * | 2019-08-05 | 2022-12-20 | 浙江大学 | Chinese chess piece visual identification method based on Fourier descriptor |
CN111507338A (en) * | 2020-04-15 | 2020-08-07 | 广西科技大学 | Chinese chess piece identification method based on binary image skeleton similarity calculation |
CN113878579A (en) * | 2021-09-30 | 2022-01-04 | 北京市商汤科技开发有限公司 | Chess playing method and device, chess playing robot and computer storage medium |
CN113878579B (en) * | 2021-09-30 | 2023-08-18 | 北京市商汤科技开发有限公司 | Chess playing method, device, chess playing robot and computer storage medium |
CN114734456A (en) * | 2022-03-23 | 2022-07-12 | 深圳市商汤科技有限公司 | Chess playing method, device, electronic equipment, chess playing robot and storage medium |
WO2023178920A1 (en) * | 2022-03-23 | 2023-09-28 | 上海商汤智能科技有限公司 | Chess placement method and apparatus, electronic device, chess playing robot, storage medium, and program |
Also Published As
Publication number | Publication date |
---|---|
CN108671534B (en) | 2020-10-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108671534A (en) | A kind of robot Chinese chess beginning pendulum chess method and system based on objective contour and framework characteristic | |
CN109344701B (en) | Kinect-based dynamic gesture recognition method | |
CN106127791B (en) | A kind of contour of building line drawing method of aviation remote sensing image | |
CN104484658A (en) | Face gender recognition method and device based on multi-channel convolution neural network | |
CN104134071A (en) | Deformable part model object detection method based on color description | |
CN110176016B (en) | Virtual fitting method based on human body contour segmentation and skeleton recognition | |
CN108229587A (en) | A kind of autonomous scan method of transmission tower based on aircraft floating state | |
CN105678318B (en) | The matching process and device of traffic sign | |
CN105426825B (en) | A kind of power grid geographical wiring diagram method for drafting based on Aerial Images identification | |
CN110032932B (en) | Human body posture identification method based on video processing and decision tree set threshold | |
CN110956099B (en) | Dynamic gesture instruction identification method | |
CN110135237B (en) | Gesture recognition method | |
CN109920018A (en) | Black-and-white photograph color recovery method, device and storage medium neural network based | |
CN108830908A (en) | A kind of magic square color identification method based on artificial neural network | |
CN112487981A (en) | MA-YOLO dynamic gesture rapid recognition method based on two-way segmentation | |
CN110443295A (en) | Improved images match and error hiding reject algorithm | |
CN110334584A (en) | A kind of gesture identification method based on the full convolutional network in region | |
GUO et al. | Traffic signs recognition based on visual attention mechanism | |
Ma et al. | Crlf: Automatic calibration and refinement based on line feature for lidar and camera in road scenes | |
CN108764447A (en) | A kind of group robot Majiang game intelligence dynamicization system and mahjong identification learning algorithm | |
CN105825204A (en) | Method for identifying power equipment meter at night through intelligent camera | |
CN106980372A (en) | A kind of unmanned plane control method and system without ground control terminal | |
CN114022845A (en) | Real-time detection method and computer readable medium for electrician insulating gloves | |
Huang et al. | Robotic arm grasping and placing using edge visual detection system | |
CN102968618A (en) | Static hand gesture recognition method fused with BoF model and spectral clustering algorithm |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |