Search

CN-117036664-B - Method, system, device and storage medium for positioning chess game by robot

CN117036664BCN 117036664 BCN117036664 BCN 117036664BCN-117036664-B

Abstract

The invention discloses a method, a system, a device and a storage medium for positioning chess games by a robot, wherein the method comprises the steps of obtaining a current chess game image, identifying corresponding current chess game information through the current chess game image, judging whether the current chess game information exists in at least one piece of history chess game information, screening out the history chess game information with the current chess game information if the current chess game information exists, and obtaining a plurality of positions to be selected corresponding to the current chess game information according to the screened history chess game information; and determining a first falling position matched with the current chess face information according to the plurality of falling positions to be selected, and controlling the robot to fall according to the first falling position. The invention can effectively avoid the situation that the found chess falling points are repeated when facing the same chess surface, reduces the repeatability of chess playing, protects the diversity of chess playing, can effectively improve the chess playing effect and the chess playing experience of users, and meets the diversity requirement of most players on human-computer chess playing.

Inventors

  • HU LIANG
  • ZHANG JINGSHENG
  • YANG KUN
  • WANG RUI
  • WANG YONG

Assignees

  • 广东职业技术学院

Dates

Publication Date
20260512
Application Date
20230815

Claims (10)

  1. 1. A method for robotically locating a game of chess, comprising the steps of: acquiring a current chess face image, and identifying corresponding current chess face information through the current chess face image; Acquiring a plurality of pieces of history chess information, judging whether the current chess information exists in at least one piece of history chess information, if so, entering the next step; Screening the history chess game information with the current chess game information, and acquiring a plurality of positions of to-be-selected falling pieces corresponding to the current chess game information according to the screened history chess game information; determining a first falling position matched with the current chess face information according to a plurality of to-be-selected falling positions, and controlling a robot to fall according to the first falling position; wherein the determining whether the current chess face information exists in at least one piece of history chess game information comprises: performing a matching step on each piece of history chess face information of each piece of history chess game information to judge whether the history chess face information is matched with the current chess face information; When each piece of history chess information of all pieces of history chess information is matched, judging that the current chess information exists in at least one piece of history chess information if the history chess information of at least one piece of history chess information is matched with the current chess information; wherein, for each history chess face information of each history chess game information, the matching step comprises: acquiring one or more pieces of coordinates of current chess face information, calculating a hash value of each piece of coordinates, and taking a sequence of the calculated hash values of each piece of coordinates as a first hash sequence; acquiring one or more pieces of history coordinates in current history chess face information, calculating a hash value of each piece of history coordinates, and taking a sequence of the calculated hash values of each piece of history coordinates as a second hash sequence; judging whether the first hash sequence has a first appearance position of at least one element in the second hash sequence, if so, taking all the elements of the first hash sequence with the first appearance position in the second hash sequence as existence elements, calculating the occupation ratio of the existence elements in all the elements in the first hash sequence, recording the occupation ratio as a first occupation ratio, and entering the next step, otherwise, entering the matching of the history chess face information; Constructing a bloom filter according to the second hash sequence; mapping each element of the first hash sequence to the bloom filter, respectively; calculating the similarity of the elements of the first hash sequence successfully mapped to the bloom filter and the mapped point positions in the bloom filter; Taking all elements successfully mapped to the first hash sequence of the bloom filter, the similarity of which is greater than a similarity threshold value, as query elements, and judging whether the number of the query elements is greater than or equal to a number threshold value; If yes, calculating the ratio of the query element in all elements in the first hash sequence, recording the ratio as a second ratio, and entering the next step, otherwise, entering the next step of matching the history chess face information; calculating the sum of the first duty ratio given with the first weight and the second duty ratio given with the second weight, and recording the summation result as a chess face existence coefficient; judging whether the existence coefficient of the chess face is larger than an existence threshold value or not; If yes, the current chess face information is matched with the current history chess face information, the history chess game information of the matched current history chess face information is recorded as history chess game information with the current chess face information, the next history chess face information is matched, and otherwise the next history chess face information is matched.
  2. 2. The method of claim 1, further comprising determining a second discard position matching the current face information based on the current face information when it is determined that the current face information is not present in at least one of the historical game information, and controlling the robot to discard the game based on the second discard position.
  3. 3. A method of positioning a game of chess with a robot as recited in claim 2, wherein the step of controlling the robot to drop the game of chess based on the location of the game of chess includes: determining coordinate information of the falling position in the current chess face, namely first coordinate information; constructing a first conversion relation between a chess face coordinate system and a camera coordinate system, and converting the first coordinate information into second coordinate information through the first conversion relation, wherein the second coordinate information is coordinate information of the falling position under the camera coordinate; And constructing a second conversion relation between the camera coordinate system and the robot coordinate system, and converting the second coordinate information into third coordinate information through the second conversion relation, wherein the third coordinate information is the coordinate information of the falling position under the robot coordinate system.
  4. 4. A method of positioning a game of chess with a robot as recited in claim 3, wherein the step of controlling the robot to drop the game of chess according to said drop location further comprises: and generating a chess-playing instruction according to the third coordinate information and sending the chess-playing instruction to the robot, wherein the chess-playing instruction carries the third coordinate information, so that the robot controls the mechanical arm to place chessmen to the chess-playing position according to the chess-playing instruction.
  5. 5. A method of robotically positioning a game as claimed in claim 4 wherein said drop positions comprise either a first drop position or a second drop position.
  6. 6. The method of robotically positioning a game of chess of claim 1, further comprising image preprocessing said current face image prior to said identifying corresponding current face information from said current face image.
  7. 7. A system for robotically positioning a game of chess, comprising: The acquisition unit is used for acquiring the current chess face image; the chess face identification unit is used for identifying corresponding current chess face information through the current chess face image; the chess game judging unit is used for acquiring a plurality of pieces of history chess game information and judging whether the current chess game information exists in at least one piece of history chess game information or not; the position selection unit is used for screening out the history chess game information with the current chess game information when the current chess game information exists in at least one piece of history chess game information, and acquiring a plurality of positions of to-be-selected falling pieces corresponding to the current chess game information according to the screened history chess game information; The first position determining unit is used for determining a first falling position matched with the current chess face information according to a plurality of falling positions to be selected; The first control unit is used for controlling the robot to drop according to the first drop position; wherein the determining whether the current chess face information exists in at least one piece of history chess game information comprises: performing a matching step on each piece of history chess face information of each piece of history chess game information to judge whether the history chess face information is matched with the current chess face information; When each piece of history chess information of all pieces of history chess information is matched, judging that the current chess information exists in at least one piece of history chess information if the history chess information of at least one piece of history chess information is matched with the current chess information; wherein, for each history chess face information of each history chess game information, the matching step comprises: acquiring one or more pieces of coordinates of current chess face information, calculating a hash value of each piece of coordinates, and taking a sequence of the calculated hash values of each piece of coordinates as a first hash sequence; acquiring one or more pieces of history coordinates in current history chess face information, calculating a hash value of each piece of history coordinates, and taking a sequence of the calculated hash values of each piece of history coordinates as a second hash sequence; judging whether the first hash sequence has a first appearance position of at least one element in the second hash sequence, if so, taking all the elements of the first hash sequence with the first appearance position in the second hash sequence as existence elements, calculating the occupation ratio of the existence elements in all the elements in the first hash sequence, recording the occupation ratio as a first occupation ratio, and entering the next step, otherwise, entering the matching of the history chess face information; Constructing a bloom filter according to the second hash sequence; mapping each element of the first hash sequence to the bloom filter, respectively; calculating the similarity of the elements of the first hash sequence successfully mapped to the bloom filter and the mapped point positions in the bloom filter; Taking all elements successfully mapped to the first hash sequence of the bloom filter, the similarity of which is greater than a similarity threshold value, as query elements, and judging whether the number of the query elements is greater than or equal to a number threshold value; If yes, calculating the ratio of the query element in all elements in the first hash sequence, recording the ratio as a second ratio, and entering the next step, otherwise, entering the next step of matching the history chess face information; calculating the sum of the first duty ratio given with the first weight and the second duty ratio given with the second weight, and recording the summation result as a chess face existence coefficient; judging whether the existence coefficient of the chess face is larger than an existence threshold value or not; If yes, the current chess face information is matched with the current history chess face information, the history chess game information of the matched current history chess face information is recorded as history chess game information with the current chess face information, the next history chess face information is matched, and otherwise the next history chess face information is matched.
  8. 8. A system for robotically positioning a game as in claim 7, further comprising: a second position determining unit, configured to determine, when it is determined that the current face information does not exist in at least one piece of history game information, a second drop position that matches the current face information according to the current face information; And the second control unit is used for controlling the robot to drop according to the second drop position.
  9. 9. A robotic game positioning apparatus, comprising: At least one processor; at least one memory for storing at least one program; a method of robotically positioning a game as claimed in any one of claims 1 to 6 when at least one of said programs is executed by at least one of said processors.
  10. 10. A storage medium having stored therein processor executable instructions which, when executed by a processor, are for performing a method of positioning a game of chess for a robot as claimed in any one of claims 1 to 6.

Description

Method, system, device and storage medium for positioning chess game by robot Technical Field The invention relates to the technical field of chess playing control, in particular to a method, a system, a device and a storage medium for positioning chess games by a robot. Background Weiqi, a strategy type two-player chess game, called 'chess' in ancient times in China. Go uses rectangular grid-shaped chessboard and black-white two-color round chessmen to play, the regular chessboard is provided with 19 line segments in length and breadth, 361 crossing points, the chessmen must walk on crossing points of blank non-forbidden points, the two sides alternately move the chessmen, the chessmen cannot move or regress after falling, and the chessmen are more than the mesh number. Along with the development of artificial intelligence, intelligent robots are currently on the market, and man-machine playing is realized through playing with the intelligent robots, so that the playing capability is improved. During playing, the intelligent robot realizes important playing function when searching for chess points. However, most of the current searching algorithms are used for searching the optimal chess falling points, so that the situation that the chess falling points found when facing the same chess surface are repeated easily occurs, and the user and the robot play the same chess repeatedly, so that the real chess playing teaching effect cannot be achieved. Disclosure of Invention The invention aims to provide a method, a system, a device and a storage medium for positioning chess by a robot, which are used for solving one or more technical problems in the prior art and at least providing a beneficial selection or creation condition. The technical problem is solved by the method for positioning the chess game by the robot, which comprises the following steps: acquiring a current chess face image, and identifying corresponding current chess face information through the current chess face image; Acquiring a plurality of pieces of history chess information, judging whether the current chess information exists in at least one piece of history chess information, if so, entering the next step; Screening the history chess game information with the current chess game information, and acquiring a plurality of positions of to-be-selected falling pieces corresponding to the current chess game information according to the screened history chess game information; and determining a first falling position matched with the current chess face information according to the plurality of to-be-selected falling positions, and controlling the robot to fall according to the first falling position. As a further improvement of the technical scheme, the method further comprises the steps of determining a second falling position matched with the current chess face information according to the current chess face information when judging that the current chess face information does not exist in at least one piece of history chess game information, and controlling the robot to fall according to the second falling position. As a further improvement of the above technical solution, the step of controlling the robot to drop according to the drop position includes: determining coordinate information of the falling position in the current chess face, namely first coordinate information; constructing a first conversion relation between a chess face coordinate system and a camera coordinate system, and converting the first coordinate information into second coordinate information through the first conversion relation, wherein the second coordinate information is coordinate information of the falling position under the camera coordinate; And constructing a second conversion relation between the camera coordinate system and the robot coordinate system, and converting the second coordinate information into third coordinate information through the second conversion relation, wherein the third coordinate information is the coordinate information of the falling position under the robot coordinate system. As a further improvement of the above technical solution, the step of controlling the robot to drop according to the drop position further includes: and generating a chess-playing instruction according to the third coordinate information and sending the chess-playing instruction to the robot, wherein the chess-playing instruction carries the third coordinate information, so that the robot controls the mechanical arm to place chessmen to the chess-playing position according to the chess-playing instruction. As a further improvement of the above technical solution, the drop position includes either one of the first drop position or the second drop position. As a further improvement of the technical scheme, before the corresponding current chess face information is identified through the current chess face image, the method further comprises the step of carrying o