WO2018120097A1 - Computer vision-based method and system for recognizing black piece and white piece - Google Patents
Computer vision-based method and system for recognizing black piece and white piece Download PDFInfo
- Publication number
- WO2018120097A1 WO2018120097A1 PCT/CN2016/113678 CN2016113678W WO2018120097A1 WO 2018120097 A1 WO2018120097 A1 WO 2018120097A1 CN 2016113678 W CN2016113678 W CN 2016113678W WO 2018120097 A1 WO2018120097 A1 WO 2018120097A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- gray value
- value
- average gray
- detection area
- image
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/56—Extraction of image or video features relating to colour
-
- 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/136—Segmentation; Edge detection involving thresholding
Definitions
- Embodiments of the present invention relate to the field of image recognition technologies, and in particular, to a black and white sub-identification method and system based on computer vision.
- the game system of various types of robots is increasingly rich.
- the traditional means of detecting chess pieces in the traditional game system is to place various sensors on the board, such as photosensitive sensors or Hall sensors. This detection method requires the chess pieces and the chessboard. The transformation will result in a corresponding increase in costs and a complicated construction.
- the visual-based chessboard recognition system can not only reduce the cost of transforming the chess pieces and the chessboard, but also make the game system more concise and easy to maintain, and more and more popularization.
- the existing visual-based black and white chess recognition system has the intensity of the light source. Uniformity and stability have higher requirements, and the requirements for lighting conditions are also more demanding, otherwise it is prone to false detection.
- the embodiment of the invention provides a black-and-white sub-identification method and system based on computer vision, so as to solve the technical problem of the false detection phenomenon caused by the light factor in the prior art visual-based black and white chess recognition system.
- a technical solution adopted by the embodiment of the present invention is to provide a black and white sub-identification method based on computer vision, the method comprising:
- the step of comparing the first region average gray value with the difference value and the summation value, and further determining the falling state of the first detection region includes:
- the first detection region is provided with a black child, and if the first region average gray value is greater than the summation value, the first A white sub is disposed in the detection area, and if the first area average gray value is between the difference and the summation value, the first detection area is in a sub-state.
- the method further comprises:
- the determination threshold is a product of a reference determination threshold and a one-hund score, wherein the difference between the actual average chessboard grayscale value and the reference chessboard average grayscale value is smaller, and the percentage is smaller.
- the determination threshold is calculated by the following formula:
- T abs (H b - abs (HH b )) ⁇ T b / H b ;
- T is the decision threshold
- H b is the reference checkerboard average gray value
- T b is the reference decision threshold
- H is the actual checkerboard average gray value
- abs is an absolute value function
- the method for determining the reference determination threshold includes:
- the reference determination threshold is set based on the reference checkerboard average grayscale value, the reference grayscale value of the sunspot, and the reference grayscale value of the white matter.
- the reference illumination condition is such that the reference checkerboard average gray value is between 100 and 150, and the reference gray value of the sunspot is less than the reference checkerboard average gray value exceeds 50, the white matter
- the reference grayscale value is greater than the illumination condition in which the reference checkerboard average grayscale value exceeds 50.
- the method further comprises: acquiring actual ambient light brightness under the actual lighting condition;
- the determination threshold the difference between the actual ambient light brightness and the reference ambient light brightness, the smaller the determination threshold.
- the step of setting the first detection area and the second detection area on the image to be identified includes: setting the first detection area and the second detection area respectively at each grid point of the board And determining a fall state of each of the grid points, wherein the first detection area and the second detection area are set to be square, and the width of the first detection area is equal to the sunspot and/or the The diameter of the white, the width of the second detection area is equal to the three grid widths of the board.
- the method further includes: generating corresponding characters according to the determined falling state of each of the grid points, thereby forming a character string indicating a falling state of all the grid points, wherein different falling sub-states are Different characters are represented.
- a technical solution adopted by the embodiment of the present invention is to provide a black and white sub-identification system based on computer vision, the system comprising an image acquisition device and an image processor, wherein the image acquisition device is used in actual Acquiring an image to be recognized of the board in an illumination condition; the image processor is configured to set a first detection area and a second detection area on the image to be identified, and calculate the image to be recognized in the first detection area a first region average gray value and a second region average gray value of the image to be identified in the second detection region, wherein an area of the second detection region is larger than the first detection region and surrounds the a first detection area, the image processor further calculating a difference between the average grayscale value of the second region and the determination threshold, and a summation value of the average grayscale value of the second region and the determination threshold, and The first region average gray value is compared with the difference value and the summation value, thereby determining a falling state of the first detection region.
- the comparison result of the image processor is that the average grayscale value of the first region is smaller than the difference, it is determined that a black spot is set in the first detection region, and if the comparison result of the image processor is If the first region average gray value is greater than the summation value, it is determined that the first detection region is provided with white, if the comparison result of the image processor is that the first region average gray value is between And between the difference value and the summation value, determining that the first detection area is in a sub-state.
- the image capture device is further configured to acquire an adjusted reference image when the checkerboard is in a sub-state without the sub-state, and the image processor calculates an actual checkerboard average of the checkboard according to the adjusted reference image. a gray value, and determining the decision threshold based on the actual checkerboard average grayscale value and a reference checkerboard average grayscale value under the reference illumination condition, wherein the actual checkerboard average grayscale value and the reference checkerboard average The larger the difference in the gray value, the smaller the decision threshold.
- the determination threshold is a product of a reference determination threshold and a one hundred fraction, wherein the actual chess The greater the difference between the disc average gray value and the reference board average gray value, the smaller the percentage.
- the determination threshold is calculated by the following formula:
- T abs (H b - abs (HH b )) ⁇ T b / H b ;
- T is the decision threshold
- H b is the reference checkerboard average gray value
- T b is the reference decision threshold
- H is the actual checkerboard average gray value
- abs is an absolute value function
- the image capture device is further configured to acquire, according to a reference illumination condition, a first reference image when the checkerboard is in a sub-state, and obtain, when the checkerboard is set, a black and white when the checkerboard is set. a second reference image, the image processor further calculating the reference chessboard average gray value of the chessboard according to the first reference image, calculating a reference grayscale value of the sunspot according to the second reference image, and the The reference gradation value of the white matter, and further setting the reference determination threshold value based on the reference checkerboard average gradation value, the reference gradation value of the sunspot, and the reference gradation value of the white matter.
- the reference illumination condition is such that the reference checkerboard average gray value is between 100 and 150, and the reference gray value of the sunspot is less than the reference checkerboard average gray value exceeds 50, the white matter
- the reference grayscale value is greater than the illumination condition in which the reference checkerboard average grayscale value exceeds 50.
- system further comprises a light sensor for acquiring actual ambient light brightness under the actual lighting condition, the image processor according to the actual ambient light brightness and the reference ambient light brightness under the reference lighting condition
- the determination threshold is adjusted, and the difference between the actual ambient light brightness and the reference ambient light brightness is larger, and the determination threshold is smaller.
- the image processor sets the first detection area and the second detection area respectively at each grid point to be detected of the board, and further determines a falling state of each grid point to be detected.
- the first detection area and the second detection area are arranged in a square shape, and the width of the first detection area is equal to the diameter of the sunspot and/or the white matter, and the width of the second detection area is equal to The three grid widths of the board.
- the image processor respectively generates corresponding characters according to the determined falling state of each of the to-be-detected grid points, thereby forming a character string representing all the falling state of the grid point to be detected, wherein different The drop state is represented by different characters.
- the beneficial effects of the embodiment of the present invention are: in the computer vision-based black-and-white sub-identification method and system provided by the embodiment of the present invention, the difference between the average gray value of the second region and the determination threshold is calculated according to the determination threshold value. And the summation value of the two, and then comparing the average gray value of the first region with the difference and the sum value, thereby determining the state of the falling of the first detection region, because the determination threshold is set according to the actual environment, so that the The method is adapted to different lighting conditions and reduces false detection due to light factors. Improve the recognition accuracy of black and white.
- FIG. 1 is a schematic flow chart of a first embodiment of a computer vision-based black and white sub-identification method provided by the present invention
- FIG. 2 is a schematic structural view of a first detection area and a second detection area in the first embodiment
- FIG. 3 is a schematic flow chart of a second embodiment of a computer vision-based black and white sub-identification method provided by the present invention.
- FIG. 4 is a partial flow chart of a third embodiment of a computer vision-based black and white sub-identification method provided by the present invention.
- FIG. 5 is a partial flow chart of a fourth embodiment of a computer vision-based black and white sub-identification method provided by the present invention.
- FIG. 6 is a schematic flow chart of a fifth embodiment of a computer vision-based black and white sub-identification method provided by the present invention.
- FIG. 7 is a schematic structural diagram of a computer vision-based black and white sub-identification system according to a first embodiment of the present invention.
- FIG. 8 is a schematic structural diagram of a second embodiment of a computer vision based black and white sub-identification system provided by the present invention.
- FIG. 1 is a schematic flowchart of a computer vision-based black and white sub-identification method according to a first embodiment of the present invention
- FIG. 2 is a first detection area and a second detection area in the first embodiment.
- the difference between the average gray value of the second region and the preset determination threshold and the sum of the two are calculated, and then the average gray value of the first region is compared with the difference and the sum. Further, the state of the falling of the first detection area is determined.
- the calibration method of this embodiment includes the following steps:
- Step S11 Acquire an image to be recognized of the board under actual lighting conditions.
- the image to be recognized is the image of the entire board, including the 19*19 grid.
- the line area (see the grid line area of Figure 2), not just the image of the area to be detected.
- Step S12 setting a first detection area and a second detection area on the image to be identified, wherein the area of the second detection area is larger than the first detection area and surrounds the first detection area.
- setting the first detection area and the second detection area on the image to be identified means that the first detection area and the second detection area are respectively set at each grid point of the board, and then each grid point is further The falling state is determined, wherein the first detecting area and the second detecting area are arranged in a square shape, and the width of the first detecting area is equal to the diameter of the black and/or white, and the width of the second detecting area is equal to three grids of the board The width, where the three grid widths are specifically two full grid widths plus two half grid widths.
- the first detection area and the second detection area are concentrically arranged, that is, the centers of the first detection area and the second detection area are consistent; when the first detection area is located at the edge of the board
- the first detection area and the second detection area may be concentrically arranged, or may be set differently.
- the second detection area does not exceed the checkerboard
- the first detection area and the second detection area may be concentrically set.
- the first detection area and the second detection area may be disposed differently, and the center of the first detection area is farther from the center of the second detection area than the edge of the board.
- Step S13 calculating a first region average gray value of the image to be recognized in the first detection area and a second region average gray value of the image to be identified in the second detection area.
- the gray value refers to the color depth or the difference between light and dark in the black and white image.
- the gray value ranges from 0 to 255, where white is 255 and black is 0.
- the average gray value is obtained by summing the gray values of all the pixels and dividing by the sum of the number of pixels, thereby obtaining the first region average gray value H n and the image to be recognized in the first detection region.
- Step S14 Calculating a difference between the second region average gray value and the preset determination threshold and a summation value of the second region average gray value and the preset determination threshold.
- the decision threshold can be fixed.
- the determination threshold is a fixed value set according to experience, or a reference determination threshold under reference illumination conditions, wherein the specific determination manner of the reference determination threshold is as follows.
- the determination threshold may also be changed, for example, calculated according to a preset algorithm, and the specific calculation manner of calculating the determination threshold according to a preset algorithm is as follows.
- the unit of the determination threshold is a gray value, and the determination threshold is set to T, and the difference between the average gray value of the second region and the determination threshold is calculated as (H m -T), the average gray value of the second region and the determination threshold.
- the summed value is set to (H m +T).
- Step S15 comparing the first region average gray value with the difference value and the summation value, thereby determining the falling state of the first detection region.
- the determination threshold since the determination threshold is provided, the difference between the average gray value of the second region and the determination threshold and the sum of the two values are calculated, and then The first region average gray value is compared with the difference value and the summation value, thereby determining the falling state of the first detection region, because the determination threshold is set according to the actual environment, so that the method is adapted to different lighting conditions, reducing The false detection caused by the light factor improves the recognition accuracy of the black and white sub-score.
- the step S15 is further specifically: if the first region average gray value is less than the difference, the first detection region is provided with a sunspot, and if the first region average gray value is greater than the summation value, the first detection region is set. There is a white sub-, if the first region average gray value is between the difference and the summation value, the first detection region is in a sub-state.
- the first detection region is provided with a sunspot; if the first region average gray value is greater than the summation value , that is, (H n >(H m +T)), white matter is set in the first detection region; if the average gray value of the first region is between the difference and the summation value, ie ((H m -T) ) ⁇ H n ⁇ (H m + T)), the first detection area is in a sub-state.
- FIG. 3 is a schematic flowchart diagram of a second embodiment of a computer vision-based black and white sub-identification method provided by the present invention.
- the determination threshold is further determined based on the actual board average gray value and the reference board average gray value under the reference lighting condition.
- the calibration method of this embodiment includes the following steps:
- Steps S21-S25 are substantially the same as steps S11-S15 of the first embodiment, and are not described herein again.
- the difference between this embodiment and the first embodiment is that the embodiment further includes the following steps before step S21:
- Step S201 Acquire an adjustment reference image when the board is in a sub-state without being in actual lighting conditions.
- the adjustment reference image is obtained when the board is in the sub-state.
- the actual lighting conditions include excessive light, too dark light, uneven light or unstable light.
- it means that there is no chessboard. Falling into the sunspot or white, adjusting the reference image is just a 19*19 gridline area.
- Step S202 Calculate the actual average gray value of the chessboard according to the adjusted reference image.
- the actual average gray value H of the board of the 19*19 grid line is calculated.
- Step S203 determining a determination threshold according to the actual checkerboard average gray value and the reference checkerboard average gray value under the reference illumination condition, wherein the difference between the actual checkerboard average grayscale value and the reference checkerboard average grayscale value is larger, and the determination threshold is smaller.
- the image to be recognized of the board is obtained under a preset set of illumination conditions, and the black sub-gray value and the white sub-gray value on the to-be-identified image satisfy a preset condition, and the set of illumination conditions is a reference illumination condition.
- the average gray value of the image to be recognized that acquires the board without the sub-state under the reference illumination condition is the average gray value of the reference board.
- the reference board average gray value is a fixed value.
- the preset condition may be that the average value of the reference board is within a specified range.
- the determination threshold is a product of the reference determination threshold and the one hundred fraction, wherein the difference between the actual average chessboard gradation value and the reference chessboard average gradation value is larger, and the percentage is smaller.
- the specific calculation method of the reference determination threshold please refer to the following.
- the decision threshold is calculated by the following formula:
- T abs (H b - abs (HH b )) ⁇ T b / H b ;
- T is the decision threshold
- H b is the reference checkerboard average gray value
- T b is the reference decision threshold
- H is the actual checkerboard average gray value
- abs is the absolute value function.
- the determination threshold T is an integer.
- FIG. 4 is a schematic flowchart of determining a reference determination threshold in a computer vision-based black and white sub-identification method provided by the present invention.
- the reference determination threshold is set based on the reference checkerboard average gradation value, the reference gradation value of the sunspot, and the reference gradation value of the white matter.
- the calibration method of this embodiment includes the following steps:
- Step S301 Acquire a first reference image when the board is in a sub-state without under the reference illumination condition.
- the reference illumination condition is such that the reference board average gray value is between 100 and 150, and the reference gray value of the sunspot is less than the reference board average gray value exceeds 50, and the white matter reference gray value is greater than the reference board average gray value exceeds 50 lighting conditions.
- the reference illumination condition refers to the first reference image when the board is in the sub-state without natural light and the light is uniform, that is, a gray image or a color image.
- Step S302 Calculate a reference chessboard average gray value of the board according to the first reference image.
- Gray level refers to black and white display
- the difference between the brightness and the darkness of the displayed pixel points is different in color display in the color display.
- the gray level depends on the number of bits of the refresh memory cell corresponding to each pixel and the performance of the display itself. When the display is black and white, the gray level can be directly obtained; when the display is colored, calculation is required to obtain the gray level.
- RGB red, green and blue
- Gray R * 0.3 + G * 0.59 + B * 0.11;
- Gray (R * 30 + G * 59 + B * 11) / 100;
- Gray (R * 77 + G * 151 + B * 28) >> 8;
- R, G, and B in the original RGB (R, G, B) are uniformly replaced by Gray, and generally obtained by the average method.
- the average gray value of the reference board in the reference lighting condition is generally between 100 and 150, and may be 120, 130 or 140.
- the actual measured reference board average gray value exceeds 100 to 150 under the reference illumination condition, it is set such that the reference board average gray value is between 100 and 150.
- Step S303 Acquire a second reference image when the board is provided with sunspots and whites under the reference illumination condition.
- Step S304 Calculate the reference gray value of the sunspot and the reference gray value of the white matter according to the second reference image.
- the sunspots and whites were taken under reference lighting conditions to obtain the reference gray values of the sunspots and whites, respectively. See the above for specific calculation methods.
- the reference gray value of the sunspot is less than 50 of the reference board average gray value, and the white matter reference gray value is greater than the reference board average gray value by more than 50.
- the reference gray value of the sunspot ranges from 0 to 50, optionally 20, 30 or 40; the reference gray value of the white sub-range ranges from 200 to 255, optionally 210, 225 or 235.
- Step S305 The reference determination threshold is set based on the reference checkerboard average gradation value, the reference gradation value of the sunspot, and the reference gradation value of the white matter.
- the reference determination threshold is set according to the reference checkerboard average gray value, the reference gray value of the sunspot, and the reference gray value of the white matter, wherein the reference gray value of the sunspot and the reference gray value of the white matter do not change much, and the reference is mainly made to the reference chessboard. Average gray value.
- the reference determination threshold is one-half of a difference between a reference chessboard average gray value and a sunspot reference gray value or a difference between a white sub-reference gray value and a reference chessboard average gray value.
- One of the points, at this time, according to the benchmark decision threshold can better separate the state of the board black, white or no child; wherein the two differences are subject to the smaller, and one-half of the difference is rounded to Integer.
- the reference gray value of the sunspot is 25
- the reference gray value of the white matter is 235
- the average value of the reference chessboard is 125
- the reference determination threshold can be determined to be one-half of the difference 100, and the reference is obtained.
- the decision threshold is 50.
- the gray value is 75 or less for the sunspot, the gray value is 175 or more for the white, and the gray value is between 75 and 175.
- the steps of calculating the reference chessboard average gray value and the reference determination threshold are added, so that the determination threshold is based on the reference chessboard average gray value and the reference.
- the decision threshold is set such that the method is further adapted to the light conditions of natural light, further reducing false detections due to the light factor of the checkerboard.
- FIG. 5 is a partial flow chart of a fourth embodiment of a computer vision-based black and white sub-identification method provided by the present invention.
- the determination threshold is adjusted by the actual ambient light luminance and the reference ambient light luminance under the reference illumination conditions.
- the calibration method of this embodiment includes the following steps:
- step S201 - step S203 is replaced with step S401 - step S402:
- Step S401 Acquire actual ambient light brightness under actual lighting conditions.
- Luminance refers to the physical quantity of the illuminant surface, and the unit of brightness is candela/square meter (cd/m2), which is the human perception of the intensity of light. Adjusting the decision threshold based on the actual ambient light brightness and the reference ambient light level under the reference illumination conditions is another embodiment.
- Step S402 The determination threshold is adjusted according to the actual ambient light brightness and the reference ambient light brightness under the reference illumination condition, and the difference between the actual ambient light brightness and the reference ambient light brightness is larger, and the determination threshold is smaller.
- FIG. 6 is a schematic flowchart diagram of a fifth embodiment of a computer vision-based black-and-white sub-identification method provided by the present invention.
- the determination threshold is adjusted in accordance with the actual ambient light luminance and the reference ambient light luminance under the reference illumination conditions.
- the calibration method of this embodiment includes the following steps:
- Steps S51-S55 are substantially the same as steps S11-S15 of the first embodiment, and are not described herein again.
- the difference between this embodiment and the first embodiment is that the embodiment further includes after step S55:
- Step S56 respectively generate corresponding characters according to the determined falling state of each grid point, thereby forming a character string indicating the falling state of all the grid points, wherein different falling sub-states are represented by different characters.
- setting the first detection area and the second detection area on the image to be identified means that the first detection area and the second detection area are respectively set on each grid point of the board, and then the falling state of each grid point is further Determining, wherein the first detection area and the second detection area are arranged in a square shape, and the width of the first detection area is equal to the diameter of the black and/or white, and the width of the second detection area is greater than or equal to the two grid widths of the board .
- the width of the second detection area is greater than the width of the two grids of the board, including the area of 3*3.
- the corresponding character is generated as n. Includes three.
- the result is packed before the output, which can be started from the upper left corner and packed in rows, for example, the result of the 3x3 grid is packaged as the string nnnbnwnnn, and the string can be sent out.
- FIG. 7 is a schematic structural diagram of a computer vision-based black and white sub-identification system according to a first embodiment of the present invention.
- the computer vision-based black and white sub-identification system 10 includes an image acquisition device 11 and an image processor 13, and the image acquisition device 11 is electrically connected to the image processor 13, wherein the image acquisition device 11 is composed of a camera and a lens.
- the image acquisition device 11 is composed of a camera and a lens.
- it is a CCD camera and a CCTV lens ("Closed Circuit Television", CCTV for short).
- the CCTV lens is a lens used by a closed circuit television, and can also be called a surveillance lens.
- the CCD camera is mounted at an appropriate distance directly above the board, with a CCTV lens of appropriate focal length to enable the CCD camera to capture the entire board exactly;
- the image processor 13 is composed of a visual industrial control machine and visual processing software.
- the image capturing device 11 is configured to acquire an image to be recognized of the board under actual lighting conditions; the image processor 13 is configured to set a first detecting area and a second detecting area on the image to be recognized, and calculate an image to be recognized. a first region average gray value in the first detection area and a second region average gray value in the second detection area, wherein the area of the second detection area is larger than the first detection area and surrounds the first detection.
- the image processor 13 further calculates a difference between the average gray value of the second region and the determination threshold, and a sum of the average gray value of the second region and the determination threshold, and compares the average gray value of the first region with the difference The summation value is compared to determine the drop state of the first detection area, wherein the difference between the actual illumination condition and the reference illumination condition is larger, and the determination threshold is smaller.
- the image acquisition device 11 is further configured to: when the actual illumination condition is obtained, obtain an adjustment reference image when the board is in a sub-state, obtain a first reference image when the board is in a sub-state under the reference illumination condition, and under the reference illumination condition Obtain a second reference image when the board is set with sunspots and whites.
- the other corresponding steps in the foregoing method embodiment are all performed by the image processor 13 of the identification system 10. Therefore, the image processor 13 will not be described here. For details, refer to the description of the corresponding steps above.
- FIG. 8 is a schematic structural diagram of a second embodiment of a computer vision based black and white sub-identification system provided by the present invention.
- the computer vision based black and white sub-identification system 20 further includes a light sensor 22, and the image capture device 21 and the light sensor 22 are electrically coupled to the image processor 23, respectively.
- the photosensor 22 of the present embodiment is used to obtain the actual ambient light brightness under actual illumination conditions, and the image processor 23 determines the determination threshold according to the actual ambient light brightness and the reference ambient light brightness under the reference illumination condition, the actual ambient light brightness and the reference environment. The greater the difference in brightness, the smaller the decision threshold.
- the light sensor 22 is a natural light sensor, that is, a solar light sensor.
- the solar sensor can identify 180 degrees in the horizontal and vertical directions, or specify the angle; it can also identify the location of the sun and identify cloudy, cloudy, semi-cloudy, sunny and evening days; tracking position recognition can also be performed.
- the lightness measurement range of the photosensor 22 is 0-100 cd/m2.
- the image capturing device 21 and the light sensor 22 may be used in combination, and a specific light source may be further added to improve the lighting conditions, or only natural light may be used instead of the light source.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Multimedia (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
Disclosed in embodiments of the present invention are a computer vision-based method and system for recognizing a black piece and a white piece. The method comprises: obtaining an image to be recognized on a chessboard in an actual light condition; arranging a first detection region and a second detection region on the image to be recognized; computing a first region average gray scale value in the first detection region and a second region average gray scale value in the second detection region; determining a difference and a sum between the second region average gray scale value and a preset determining threshold; comparing the first region average gray scale value with the difference and the sum, so as to determine a chess piece movement state in the first detection region. In this way, in the method, the determining threshold is set according an actual environment, so that the method is applicable to different light conditions, thereby reducing faulty detections caused by a light factor, and improving the accuracy rate for recognizing a black piece and a white piece.
Description
本发明实施例涉及图像识别技术领域,特别是涉及一种基于计算机视觉的黑白子识别方法及系统。Embodiments of the present invention relate to the field of image recognition technologies, and in particular, to a black and white sub-identification method and system based on computer vision.
目前,各类机器人的对弈系统日益丰富,然而传统的对弈系统中对棋子的检测手段还是以在棋盘上安置各类传感器,如光敏传感器或者霍尔传感器,这种检测手段需要对棋子和棋盘进行改造,从而导致成本会相应的提升,而且构造复杂。At present, the game system of various types of robots is increasingly rich. However, the traditional means of detecting chess pieces in the traditional game system is to place various sensors on the board, such as photosensitive sensors or Hall sensors. This detection method requires the chess pieces and the chessboard. The transformation will result in a corresponding increase in costs and a complicated construction.
基于视觉的棋盘识别系统不仅可以降低改造棋子及棋盘的成本,而且还可以使对弈系统更加简洁易于维护,得到越来越多的推广,然而现有基于视觉的黑白棋识别系统对于光源的强度、均匀性、稳定性均具有较高的要求,对于打光条件要求也比较苛刻,否则容易出现误检测的现象。The visual-based chessboard recognition system can not only reduce the cost of transforming the chess pieces and the chessboard, but also make the game system more concise and easy to maintain, and more and more popularization. However, the existing visual-based black and white chess recognition system has the intensity of the light source. Uniformity and stability have higher requirements, and the requirements for lighting conditions are also more demanding, otherwise it is prone to false detection.
【发明内容】[Summary of the Invention]
本发明实施例提供一种基于计算机视觉的黑白子识别方法及系统,以解决现有技术中基于视觉的黑白棋识别系统由于光线因素产生误检测现象的技术问题。The embodiment of the invention provides a black-and-white sub-identification method and system based on computer vision, so as to solve the technical problem of the false detection phenomenon caused by the light factor in the prior art visual-based black and white chess recognition system.
为解决上述技术问题,本发明实施例采用的一个技术方案是:提供一种基于计算机视觉的黑白子识别方法,所述方法包括:In order to solve the above technical problem, a technical solution adopted by the embodiment of the present invention is to provide a black and white sub-identification method based on computer vision, the method comprising:
在实际光照条件下获取棋盘的待识别图像;Obtaining an image to be recognized of the board under actual lighting conditions;
在所述待识别图像上设置第一检测区域和第二检测区域,其中所述第二检测区域的面积大于所述第一检测区域且包围所述第一检测区域;Setting a first detection area and a second detection area on the image to be identified, wherein an area of the second detection area is larger than the first detection area and surrounds the first detection area;
计算所述待识别图像在所述第一检测区域内的第一区域平均灰度值及所述待识别图像在所述第二检测区域内的第二区域平均灰度值;Calculating a first region average gray value of the to-be-identified image in the first detection area and a second region average gray value of the to-be-identified image in the second detection area;
计算所述第二区域平均灰度值与预设的判定阈值的差值,以及计算所述第二区域平均灰度值和所述预设的判定阈值的求和值;Calculating a difference between the average grayscale value of the second region and a preset determination threshold, and calculating a summation value of the average grayscale value of the second region and the preset determination threshold;
将所述第一区域平均灰度值与所述差值以及所述求和值进行比较,进而判定所述第一检测区域的落子状态。
Comparing the first region average gray value with the difference value and the summation value to determine a falling state of the first detection region.
其中,所述将所述第一区域平均灰度值与所述差值和所述求和值进行比较,进而判定所述第一检测区域的落子状态的步骤包括:The step of comparing the first region average gray value with the difference value and the summation value, and further determining the falling state of the first detection region includes:
若所述第一区域平均灰度值小于所述差值,则所述第一检测区域内设置有黑子,若所述第一区域平均灰度值大于所述求和值,则所述第一检测区域内设置有白子,若所述第一区域平均灰度值介于所述差值与所述求和值之间,则所述第一检测区域处于无子状态。If the first region average gray value is smaller than the difference, the first detection region is provided with a black child, and if the first region average gray value is greater than the summation value, the first A white sub is disposed in the detection area, and if the first area average gray value is between the difference and the summation value, the first detection area is in a sub-state.
其中,所述方法进一步包括:Wherein, the method further comprises:
在所述实际光照条件下获取所述棋盘处于无子状态时的调整参考图像;Obtaining an adjustment reference image when the checkerboard is in a sub-state without the actual illumination condition;
根据所述调整参考图像计算所述棋盘的实际棋盘平均灰度值;Calculating an actual chessboard average gray value of the chessboard according to the adjusted reference image;
根据所述实际棋盘平均灰度值与所述基准光照条件下的基准棋盘平均灰度值来确定所述判定阈值,其中所述实际棋盘平均灰度值与所述基准棋盘平均灰度值的差异越大,所述判定阈值越小。Determining the determination threshold according to the actual checkerboard average gray value and the reference chessboard average gray value under the reference illumination condition, wherein the difference between the actual checkerboard average grayscale value and the reference checkerboard average grayscale value The larger the decision threshold, the smaller.
其中,所述判定阈值为基准判定阈值与一百分数的乘积,其中所述实际棋盘平均灰度值与所述基准棋盘平均灰度值的差异越大,所述百分数越小。The determination threshold is a product of a reference determination threshold and a one-hund score, wherein the difference between the actual average chessboard grayscale value and the reference chessboard average grayscale value is smaller, and the percentage is smaller.
其中,所述判定阈值通过如下公式计算:Wherein, the determination threshold is calculated by the following formula:
T=abs(Hb-abs(H-Hb))×Tb/Hb;T = abs (H b - abs (HH b )) × T b / H b ;
其中,T为所述判定阈值,Hb为所述基准棋盘平均灰度值,Tb为所述基准判定阈值,所述H为所述实际棋盘平均灰度值,abs为绝对值函数。Where T is the decision threshold, H b is the reference checkerboard average gray value, T b is the reference decision threshold, H is the actual checkerboard average gray value, and abs is an absolute value function.
其中,确定所述基准判定阈值的方法包括:The method for determining the reference determination threshold includes:
在基准光照条件下获取所述棋盘处于无子状态时的第一基准图像;Obtaining, in a reference illumination condition, a first reference image when the checkerboard is in a sub-state;
根据所述第一基准图像计算所述棋盘的所述基准棋盘平均灰度值;Calculating the reference chessboard average gray value of the chessboard according to the first reference image;
在所述基准光照条件下获取所述棋盘设置有黑子和白子时的第二基准图像;Obtaining, in the reference illumination condition, a second reference image when the chessboard is provided with sunspots and whites;
根据所述第二基准图像计算所述黑子的基准灰度值和所述白子的基准灰度值;Calculating a reference gray value of the sunspot and a reference gray value of the white light according to the second reference image;
根据所述基准棋盘平均灰度值、所述黑子的基准灰度值和所述白子的基准灰度值设置所述基准判定阈值。The reference determination threshold is set based on the reference checkerboard average grayscale value, the reference grayscale value of the sunspot, and the reference grayscale value of the white matter.
其中,所述基准光照条件为使得所述基准棋盘平均灰度值介于100到150之间,且所述黑子的基准灰度值小于所述基准棋盘平均灰度值超过50,所述白子的基准灰度值大于所述基准棋盘平均灰度值超过50的光照条件。Wherein the reference illumination condition is such that the reference checkerboard average gray value is between 100 and 150, and the reference gray value of the sunspot is less than the reference checkerboard average gray value exceeds 50, the white matter The reference grayscale value is greater than the illumination condition in which the reference checkerboard average grayscale value exceeds 50.
其中,所述方法进一步包括:获取所述实际光照条件下的实际环境光亮度;Wherein, the method further comprises: acquiring actual ambient light brightness under the actual lighting condition;
根据所述实际环境光亮度与所述基准照明条件下的基准环境光亮度来调整
所述判定阈值,所述实际环境光亮度与基准环境光亮度的差异越大,所述判定阈值越小。Adjusting according to the actual ambient light brightness and the reference ambient light brightness under the reference illumination condition
The determination threshold, the difference between the actual ambient light brightness and the reference ambient light brightness, the smaller the determination threshold.
其中,所述在所述待识别图像上设置第一检测区域和第二检测区域的步骤包括:在所述棋盘的每个网格点分别设置所述第一检测区域和所述第二检测区域,进而对每个网格点的落子状态进行判定,其中所述第一检测区域和所述第二检测区域设置成正方形,且所述第一检测区域的宽度等于所述黑子和/或所述白子的直径,所述第二检测区域的宽度等于所述棋盘的三个网格宽度。The step of setting the first detection area and the second detection area on the image to be identified includes: setting the first detection area and the second detection area respectively at each grid point of the board And determining a fall state of each of the grid points, wherein the first detection area and the second detection area are set to be square, and the width of the first detection area is equal to the sunspot and/or the The diameter of the white, the width of the second detection area is equal to the three grid widths of the board.
其中,所述方法进一步包括:根据所判定的每个所述网格点的落子状态分别生成对应的字符,进而形成表示所有所述网格点的落子状态的字符串,其中不同的落子状态由不同的字符进行表示。The method further includes: generating corresponding characters according to the determined falling state of each of the grid points, thereby forming a character string indicating a falling state of all the grid points, wherein different falling sub-states are Different characters are represented.
为解决上述技术问题,本发明实施例采用的一个技术方案是:提供一种基于计算机视觉的黑白子识别系统,所述系统包括图像采集设备以及图像处理器,所述图像采集设备用于在实际光照条件下获取棋盘的待识别图像;所述图像处理器用于在所述待识别图像上设置第一检测区域和第二检测区域,并计算所述待识别图像在所述第一检测区域内的第一区域平均灰度值及所述待识别图像在所述第二检测区域内的第二区域平均灰度值,其中所述第二检测区域的面积大于所述第一检测区域且包围所述第一检测区域,所述图像处理器进一步计算所述第二区域平均灰度值与判定阈值的差值以及所述第二区域平均灰度值和所述判定阈值的求和值,并将所述第一区域平均灰度值与所述差值和所述求和值进行比较,进而判定所述第一检测区域的落子状态。In order to solve the above technical problem, a technical solution adopted by the embodiment of the present invention is to provide a black and white sub-identification system based on computer vision, the system comprising an image acquisition device and an image processor, wherein the image acquisition device is used in actual Acquiring an image to be recognized of the board in an illumination condition; the image processor is configured to set a first detection area and a second detection area on the image to be identified, and calculate the image to be recognized in the first detection area a first region average gray value and a second region average gray value of the image to be identified in the second detection region, wherein an area of the second detection region is larger than the first detection region and surrounds the a first detection area, the image processor further calculating a difference between the average grayscale value of the second region and the determination threshold, and a summation value of the average grayscale value of the second region and the determination threshold, and The first region average gray value is compared with the difference value and the summation value, thereby determining a falling state of the first detection region.
其中,若所述图像处理器的比较结果为所述第一区域平均灰度值小于所述差值,则判定所述第一检测区域内设置有黑子,若所述图像处理器的比较结果为所述第一区域平均灰度值大于所述求和值,则判定所述第一检测区域内设置有白子,若所述图像处理器的比较结果为所述第一区域平均灰度值介于所述差值与所述求和值之间,则判定所述第一检测区域处于无子状态。If the comparison result of the image processor is that the average grayscale value of the first region is smaller than the difference, it is determined that a black spot is set in the first detection region, and if the comparison result of the image processor is If the first region average gray value is greater than the summation value, it is determined that the first detection region is provided with white, if the comparison result of the image processor is that the first region average gray value is between And between the difference value and the summation value, determining that the first detection area is in a sub-state.
其中,所述图像采集设备进一步用于在所述实际光照条件下获取所述棋盘处于无子状态时的调整参考图像,所述图像处理器根据所述调整参考图像计算所述棋盘的实际棋盘平均灰度值,并根据所述实际棋盘平均灰度值与所述基准光照条件下的基准棋盘平均灰度值来确定所述判定阈值,其中所述实际棋盘平均灰度值与所述基准棋盘平均灰度值的差异越大,所述判定阈值越小。The image capture device is further configured to acquire an adjusted reference image when the checkerboard is in a sub-state without the sub-state, and the image processor calculates an actual checkerboard average of the checkboard according to the adjusted reference image. a gray value, and determining the decision threshold based on the actual checkerboard average grayscale value and a reference checkerboard average grayscale value under the reference illumination condition, wherein the actual checkerboard average grayscale value and the reference checkerboard average The larger the difference in the gray value, the smaller the decision threshold.
其中,所述判定阈值为基准判定阈值与一百分数的乘积,其中所述实际棋
盘平均灰度值与所述基准棋盘平均灰度值的差异越大,所述百分数越小。Wherein the determination threshold is a product of a reference determination threshold and a one hundred fraction, wherein the actual chess
The greater the difference between the disc average gray value and the reference board average gray value, the smaller the percentage.
其中,所述判定阈值通过如下公式计算:Wherein, the determination threshold is calculated by the following formula:
T=abs(Hb-abs(H-Hb))×Tb/Hb;T = abs (H b - abs (HH b )) × T b / H b ;
其中,T为所述判定阈值,Hb为所述基准棋盘平均灰度值,Tb为所述基准判定阈值,所述H为所述实际棋盘平均灰度值,abs为绝对值函数。Where T is the decision threshold, H b is the reference checkerboard average gray value, T b is the reference decision threshold, H is the actual checkerboard average gray value, and abs is an absolute value function.
其中,所述图像采集设备进一步用于在基准光照条件下获取所述棋盘处于无子状态时的第一基准图像,且在所述基准光照条件下获取所述棋盘设置有黑子和白子时的第二基准图像,所述图像处理器进一步根据所述第一基准图像计算所述棋盘的所述基准棋盘平均灰度值,根据所述第二基准图像计算所述黑子的基准灰度值和所述白子的基准灰度值,并进一步根据所述基准棋盘平均灰度值、所述黑子的基准灰度值和所述白子的基准灰度值设置所述基准判定阈值。The image capture device is further configured to acquire, according to a reference illumination condition, a first reference image when the checkerboard is in a sub-state, and obtain, when the checkerboard is set, a black and white when the checkerboard is set. a second reference image, the image processor further calculating the reference chessboard average gray value of the chessboard according to the first reference image, calculating a reference grayscale value of the sunspot according to the second reference image, and the The reference gradation value of the white matter, and further setting the reference determination threshold value based on the reference checkerboard average gradation value, the reference gradation value of the sunspot, and the reference gradation value of the white matter.
其中,所述基准光照条件为使得所述基准棋盘平均灰度值介于100到150之间,且所述黑子的基准灰度值小于所述基准棋盘平均灰度值超过50,所述白子的基准灰度值大于所述基准棋盘平均灰度值超过50的光照条件。Wherein the reference illumination condition is such that the reference checkerboard average gray value is between 100 and 150, and the reference gray value of the sunspot is less than the reference checkerboard average gray value exceeds 50, the white matter The reference grayscale value is greater than the illumination condition in which the reference checkerboard average grayscale value exceeds 50.
其中,所述系统进一步包括光传感器,用于获取所述实际光照条件下的实际环境光亮度,所述图像处理器根据所述实际环境光亮度与所述基准照明条件下的基准环境光亮度来调整所述判定阈值,所述实际环境光亮度与基准环境光亮度的差异越大,所述判定阈值越小。Wherein the system further comprises a light sensor for acquiring actual ambient light brightness under the actual lighting condition, the image processor according to the actual ambient light brightness and the reference ambient light brightness under the reference lighting condition The determination threshold is adjusted, and the difference between the actual ambient light brightness and the reference ambient light brightness is larger, and the determination threshold is smaller.
其中,所述图像处理器在所述棋盘的每个待检测网格点分别设置所述第一检测区域和所述第二检测区域,进而对每个待检测网格点的落子状态进行判定,其中所述第一检测区域和所述第二检测区域设置成正方形,且所述第一检测区域的宽度等于所述黑子和/或所述白子的直径,所述第二检测区域的宽度等于所述棋盘的三个网格宽度。The image processor sets the first detection area and the second detection area respectively at each grid point to be detected of the board, and further determines a falling state of each grid point to be detected. Wherein the first detection area and the second detection area are arranged in a square shape, and the width of the first detection area is equal to the diameter of the sunspot and/or the white matter, and the width of the second detection area is equal to The three grid widths of the board.
其中,所述图像处理器根据所判定的每个所述待检测网格点的落子状态分别生成对应的字符,进而形成表示所有所述待检测网格点的落子状态的字符串,其中不同的落子状态由不同的字符进行表示。The image processor respectively generates corresponding characters according to the determined falling state of each of the to-be-detected grid points, thereby forming a character string representing all the falling state of the grid point to be detected, wherein different The drop state is represented by different characters.
本发明实施例的有益效果是:在本发明实施例所提供的基于计算机视觉的黑白子识别方法及系统中由于设有判定阀值,根据计算第二区域平均灰度值与判定阈值的差值以及两者求和值,然后将第一区域平均灰度值与差值和求和值进行比较,进而判定第一检测区域的落子状态,因判定阀值是依据实际环境设定的,使得该方法适应于不同的光线条件,减少了由于光线因素导致的误检测,
提高黑白子的识别准确率。The beneficial effects of the embodiment of the present invention are: in the computer vision-based black-and-white sub-identification method and system provided by the embodiment of the present invention, the difference between the average gray value of the second region and the determination threshold is calculated according to the determination threshold value. And the summation value of the two, and then comparing the average gray value of the first region with the difference and the sum value, thereby determining the state of the falling of the first detection region, because the determination threshold is set according to the actual environment, so that the The method is adapted to different lighting conditions and reduces false detection due to light factors.
Improve the recognition accuracy of black and white.
图1是本发明提供的基于计算机视觉的黑白子识别方法第一实施方式的流程示意图;1 is a schematic flow chart of a first embodiment of a computer vision-based black and white sub-identification method provided by the present invention;
图2是第一实施方式中第一检测区域和第二检测区域的结构示意图;2 is a schematic structural view of a first detection area and a second detection area in the first embodiment;
图3是本发明提供的基于计算机视觉的黑白子识别方法第二实施方式的流程示意图;3 is a schematic flow chart of a second embodiment of a computer vision-based black and white sub-identification method provided by the present invention;
图4是本发明提供的基于计算机视觉的黑白子识别方法第三实施方式的部分流程示意图;4 is a partial flow chart of a third embodiment of a computer vision-based black and white sub-identification method provided by the present invention;
图5是本发明提供的基于计算机视觉的黑白子识别方法第四实施方式的部分流程示意图;5 is a partial flow chart of a fourth embodiment of a computer vision-based black and white sub-identification method provided by the present invention;
图6是本发明提供的基于计算机视觉的黑白子识别方法第五实施方式的流程示意图;6 is a schematic flow chart of a fifth embodiment of a computer vision-based black and white sub-identification method provided by the present invention;
图7是本发明提供的基于计算机视觉的黑白子识别系统第一实施例的结构示意图;7 is a schematic structural diagram of a computer vision-based black and white sub-identification system according to a first embodiment of the present invention;
图8是本发明提供的基于计算机视觉的黑白子识别系统第二实施例的结构示意图。FIG. 8 is a schematic structural diagram of a second embodiment of a computer vision based black and white sub-identification system provided by the present invention.
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本发明的一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
请一并参阅图1和图2,图1是本发明提供的基于计算机视觉的黑白子识别方法第一实施方式的流程示意图,图2是第一实施方式中第一检测区域和第二检测区域的结构示意图。在本实施例中,根据计算第二区域平均灰度值与预设的判定阈值的差值以及两者的求和值,然后将第一区域平均灰度值与差值和求和值进行比较,进而判定第一检测区域的落子状态。具体来说,本实施例的标定方法包括以下步骤:1 and FIG. 2, FIG. 1 is a schematic flowchart of a computer vision-based black and white sub-identification method according to a first embodiment of the present invention, and FIG. 2 is a first detection area and a second detection area in the first embodiment. Schematic diagram of the structure. In this embodiment, the difference between the average gray value of the second region and the preset determination threshold and the sum of the two are calculated, and then the average gray value of the first region is compared with the difference and the sum. Further, the state of the falling of the first detection area is determined. Specifically, the calibration method of this embodiment includes the following steps:
步骤S11:在实际光照条件下获取棋盘的待识别图像。
Step S11: Acquire an image to be recognized of the board under actual lighting conditions.
在实际光照条件下获取棋盘的待识别图像,实际光照条件包括光线过强、光线过暗、光线不均匀或者光线不稳定等等情况,待识别图像是整个棋盘的图像,包括19*19网格线区域(见图2的网格线区域),而不仅仅是待检测区域的图像。Obtain the image to be recognized of the board under actual lighting conditions. The actual lighting conditions include excessive light, too dark light, uneven light or unstable light. The image to be recognized is the image of the entire board, including the 19*19 grid. The line area (see the grid line area of Figure 2), not just the image of the area to be detected.
步骤S12:在待识别图像上设置第一检测区域和第二检测区域,其中第二检测区域的面积大于第一检测区域且包围第一检测区域。Step S12: setting a first detection area and a second detection area on the image to be identified, wherein the area of the second detection area is larger than the first detection area and surrounds the first detection area.
如图2所示,在待识别图像上设置第一检测区域和第二检测区域是指在棋盘的每个网格点分别设置第一检测区域和第二检测区域,进而对每个网格点的落子状态进行判定,其中,第一检测区域和第二检测区域设置成正方形,且第一检测区域的宽度等于黑子和/或白子的直径,第二检测区域的宽度等于棋盘的三个网格宽度,其中,三个网格宽度具体为两个完整的网格宽度外加两个二分之一的网格宽度。As shown in FIG. 2, setting the first detection area and the second detection area on the image to be identified means that the first detection area and the second detection area are respectively set at each grid point of the board, and then each grid point is further The falling state is determined, wherein the first detecting area and the second detecting area are arranged in a square shape, and the width of the first detecting area is equal to the diameter of the black and/or white, and the width of the second detecting area is equal to three grids of the board The width, where the three grid widths are specifically two full grid widths plus two half grid widths.
具体的,当第一检测区域位于棋盘的中部时,第一检测区域和第二检测区域同心设置,即第一检测区域和第二检测区域的中心一致;当第一检测区域位于棋盘的最边缘处时,第一检测区域和第二检测区域可以同心设置,或者不同心设置,举例来说,当第二检测区域时未超出棋盘时,第一检测区域和第二检测区域可以同心设置,当第二检测区域时超出棋盘时,第一检测区域和第二检测区域可以不同心设置,且第一检测区域的中心较第二检测区域的中心远离棋盘的边缘处。Specifically, when the first detection area is located in the middle of the board, the first detection area and the second detection area are concentrically arranged, that is, the centers of the first detection area and the second detection area are consistent; when the first detection area is located at the edge of the board The first detection area and the second detection area may be concentrically arranged, or may be set differently. For example, when the second detection area does not exceed the checkerboard, the first detection area and the second detection area may be concentrically set. When the second detection area exceeds the board, the first detection area and the second detection area may be disposed differently, and the center of the first detection area is farther from the center of the second detection area than the edge of the board.
步骤S13:计算待识别图像在第一检测区域内的第一区域平均灰度值及待识别图像在第二检测区域内的第二区域平均灰度值。Step S13: calculating a first region average gray value of the image to be recognized in the first detection area and a second region average gray value of the image to be identified in the second detection area.
灰度值是指黑白图像中点的颜色深度或者亮暗差别,灰度值范围一般从0到255,其中,白色为255,黑色为0。平均灰度值是将所有像素点的灰度值进行求和后再除以求和的像素点个数,从而计算获得第一检测区域内的第一区域平均灰度值Hn及待识别图像在第二检测区域内的第二区域平均灰度值Hm。The gray value refers to the color depth or the difference between light and dark in the black and white image. The gray value ranges from 0 to 255, where white is 255 and black is 0. The average gray value is obtained by summing the gray values of all the pixels and dividing by the sum of the number of pixels, thereby obtaining the first region average gray value H n and the image to be recognized in the first detection region. The second region average gray value H m in the second detection region.
步骤S14:计算第二区域平均灰度值与预设的判定阈值的差值以及第二区域平均灰度值和预设的判定阈值的求和值。Step S14: Calculating a difference between the second region average gray value and the preset determination threshold and a summation value of the second region average gray value and the preset determination threshold.
判定阈值可以是固定的。例如,判定阈值是根据经验而设定的一个固定值,或者是基准光照条件下的基准判定阈值,其中,基准判定阈值的具体确定方式请参考下文。判定阈值还可以是变化的,例如根据预设的算法计算得出,根据预设的算法计算得出判定阈值的具体计算方式请参考下文。判定阈值的单位为
灰度值,判定阈值设为T,计算得出第二区域平均灰度值与判定阈值的差值设为(Hm-T),第二区域平均灰度值和判定阈值的求和值设为(Hm+T)。The decision threshold can be fixed. For example, the determination threshold is a fixed value set according to experience, or a reference determination threshold under reference illumination conditions, wherein the specific determination manner of the reference determination threshold is as follows. The determination threshold may also be changed, for example, calculated according to a preset algorithm, and the specific calculation manner of calculating the determination threshold according to a preset algorithm is as follows. The unit of the determination threshold is a gray value, and the determination threshold is set to T, and the difference between the average gray value of the second region and the determination threshold is calculated as (H m -T), the average gray value of the second region and the determination threshold. The summed value is set to (H m +T).
步骤S15:将第一区域平均灰度值与差值以及求和值进行比较,进而判定第一检测区域的落子状态。Step S15: comparing the first region average gray value with the difference value and the summation value, thereby determining the falling state of the first detection region.
在本发明实施例所提供的基于计算机视觉的黑白子识别方法及系统中由于设有判定阀值,根据计算第二区域平均灰度值与判定阈值的差值以及两者求和值,然后将第一区域平均灰度值与差值和求和值进行比较,进而判定第一检测区域的落子状态,因判定阀值是依据实际环境设定的,使得该方法适应于不同的光线条件,减少了由于光线因素导致的误检测,提高黑白子的识别准确率。In the computer vision-based black-and-white sub-identification method and system provided by the embodiment of the present invention, since the determination threshold is provided, the difference between the average gray value of the second region and the determination threshold and the sum of the two values are calculated, and then The first region average gray value is compared with the difference value and the summation value, thereby determining the falling state of the first detection region, because the determination threshold is set according to the actual environment, so that the method is adapted to different lighting conditions, reducing The false detection caused by the light factor improves the recognition accuracy of the black and white sub-score.
其中,步骤S15进一步具体为:若第一区域平均灰度值小于差值,则第一检测区域内设置有黑子,若第一区域平均灰度值大于求和值,则第一检测区域内设置有白子,若第一区域平均灰度值介于差值与求和值之间,则第一检测区域处于无子状态。The step S15 is further specifically: if the first region average gray value is less than the difference, the first detection region is provided with a sunspot, and if the first region average gray value is greater than the summation value, the first detection region is set. There is a white sub-, if the first region average gray value is between the difference and the summation value, the first detection region is in a sub-state.
具体的,若第一区域平均灰度值小于差值,即(Hn<(Hm-T)),则第一检测区域内设置有黑子;若第一区域平均灰度值大于求和值,即(Hn>(Hm+T)),则第一检测区域内设置有白子;若第一区域平均灰度值介于差值与求和值之间,即((Hm-T)≤Hn≤(Hm+T)),则第一检测区域处于无子状态。Specifically, if the first region average gray value is less than the difference, that is, (H n <(H m -T)), the first detection region is provided with a sunspot; if the first region average gray value is greater than the summation value , that is, (H n >(H m +T)), white matter is set in the first detection region; if the average gray value of the first region is between the difference and the summation value, ie ((H m -T) ) ≤ H n ≤ (H m + T)), the first detection area is in a sub-state.
如图3所示,图3是本发明提供的基于计算机视觉的黑白子识别方法第二实施方式的流程示意图。在本实施例中,进一步根据实际棋盘平均灰度值与基准光照条件下的基准棋盘平均灰度值来确定判定阈值。具体来说,本实施例的标定方法包括以下步骤:As shown in FIG. 3, FIG. 3 is a schematic flowchart diagram of a second embodiment of a computer vision-based black and white sub-identification method provided by the present invention. In the present embodiment, the determination threshold is further determined based on the actual board average gray value and the reference board average gray value under the reference lighting condition. Specifically, the calibration method of this embodiment includes the following steps:
步骤S21-S25与第一实施例的步骤S11-S15基本一致,在此不再赘述。本实施例与第一实施例的区别之处在于,本实施例在步骤S21之前进一步包括以下步骤:Steps S21-S25 are substantially the same as steps S11-S15 of the first embodiment, and are not described herein again. The difference between this embodiment and the first embodiment is that the embodiment further includes the following steps before step S21:
步骤S201:在实际光照条件下获取棋盘处于无子状态时的调整参考图像。Step S201: Acquire an adjustment reference image when the board is in a sub-state without being in actual lighting conditions.
在实际光照条件下获取棋盘处于无子状态时的调整参考图像,实际光照条件包括光线过强、光线过暗、光线不均匀或者光线不稳定等等情况,无子状态时是指棋盘上还没有落入黑子或者白子,调整参考图像仅仅是19*19网格线区域。Under the actual lighting conditions, the adjustment reference image is obtained when the board is in the sub-state. The actual lighting conditions include excessive light, too dark light, uneven light or unstable light. When there is no sub-state, it means that there is no chessboard. Falling into the sunspot or white, adjusting the reference image is just a 19*19 gridline area.
步骤S202:根据调整参考图像计算棋盘的实际棋盘平均灰度值。Step S202: Calculate the actual average gray value of the chessboard according to the adjusted reference image.
根据调整参考图像,计算19*19网格线棋盘的实际棋盘平均灰度值H。
According to the adjustment reference image, the actual average gray value H of the board of the 19*19 grid line is calculated.
步骤S203:根据实际棋盘平均灰度值与基准光照条件下的基准棋盘平均灰度值来确定判定阈值,其中实际棋盘平均灰度值与基准棋盘平均灰度值的差异越大,判定阈值越小。Step S203: determining a determination threshold according to the actual checkerboard average gray value and the reference checkerboard average gray value under the reference illumination condition, wherein the difference between the actual checkerboard average grayscale value and the reference checkerboard average grayscale value is larger, and the determination threshold is smaller. .
在一组预设的光照条件下获取棋盘的待识别图像,且该待识别图像上的黑子灰度值以及白子的灰度值满足预设的条件,则该组光照条件就是基准光照条件。在基准光照条件下获取无子状态的棋盘的待识别图像的平均灰度值就是基准棋盘平均灰度值。当预设的光照条件确定时,基准棋盘平均灰度值就是一固定值。预设的条件可以是基准棋盘平均灰度值在一指定范围内。The image to be recognized of the board is obtained under a preset set of illumination conditions, and the black sub-gray value and the white sub-gray value on the to-be-identified image satisfy a preset condition, and the set of illumination conditions is a reference illumination condition. The average gray value of the image to be recognized that acquires the board without the sub-state under the reference illumination condition is the average gray value of the reference board. When the preset lighting conditions are determined, the reference board average gray value is a fixed value. The preset condition may be that the average value of the reference board is within a specified range.
其中,判定阈值为基准判定阈值与一百分数的乘积,其中实际棋盘平均灰度值与基准棋盘平均灰度值的差异越大,百分数越小,基准判定阈值的具体计算方式请参考下文。The determination threshold is a product of the reference determination threshold and the one hundred fraction, wherein the difference between the actual average chessboard gradation value and the reference chessboard average gradation value is larger, and the percentage is smaller. For the specific calculation method of the reference determination threshold, please refer to the following.
具体的,判定阈值通过如下公式计算:Specifically, the decision threshold is calculated by the following formula:
T=abs(Hb-abs(H-Hb))×Tb/Hb;T = abs (H b - abs (HH b )) × T b / H b ;
其中,T为判定阈值,Hb为基准棋盘平均灰度值,Tb为基准判定阈值,H为实际棋盘平均灰度值,abs为绝对值函数。判定阈值T为整数。Where T is the decision threshold, H b is the reference checkerboard average gray value, T b is the reference decision threshold, H is the actual checkerboard average gray value, and abs is the absolute value function. The determination threshold T is an integer.
在一实际应用例,设基准棋盘平均灰度值Hb为128,基准判定阈值Tb为30,则判定阈值计算得:T=abs(128-abs(H-128))×30/128。其中,实际棋盘平均灰度值与基准棋盘平均灰度值的差异越大,判定阈值越小。In a practical embodiment, provided reference board mean gray value H b 128, the reference determination threshold value T b is 30, then the determination threshold calculated: T = abs (128-abs (H-128)) × 30/128. Wherein, the greater the difference between the actual checkerboard average gray value and the reference checkerboard average gray value, the smaller the decision threshold.
如图4所示,图4是本发明提供的基于计算机视觉的黑白子识别方法中确定基准判定阈值的流程示意图。在本实施例中,根据基准棋盘平均灰度值、黑子的基准灰度值和白子的基准灰度值设置基准判定阈值。具体来说,本实施例的标定方法包括以下步骤:As shown in FIG. 4, FIG. 4 is a schematic flowchart of determining a reference determination threshold in a computer vision-based black and white sub-identification method provided by the present invention. In the present embodiment, the reference determination threshold is set based on the reference checkerboard average gradation value, the reference gradation value of the sunspot, and the reference gradation value of the white matter. Specifically, the calibration method of this embodiment includes the following steps:
步骤S301:在基准光照条件下获取棋盘处于无子状态时的第一基准图像。Step S301: Acquire a first reference image when the board is in a sub-state without under the reference illumination condition.
基准光照条件为使得基准棋盘平均灰度值介于100到150之间,且黑子的基准灰度值小于基准棋盘平均灰度值超过50,白子的基准灰度值大于基准棋盘平均灰度值超过50的光照条件。在实际应用中,基准光照条件下是指自然光照条件下且光线均匀的时候,获取棋盘处于无子状态时的第一基准图像,即一张灰白图像或者彩色图像。The reference illumination condition is such that the reference board average gray value is between 100 and 150, and the reference gray value of the sunspot is less than the reference board average gray value exceeds 50, and the white matter reference gray value is greater than the reference board average gray value exceeds 50 lighting conditions. In practical applications, the reference illumination condition refers to the first reference image when the board is in the sub-state without natural light and the light is uniform, that is, a gray image or a color image.
步骤S302:根据第一基准图像计算棋盘的基准棋盘平均灰度值。Step S302: Calculate a reference chessboard average gray value of the board according to the first reference image.
基准光照条件下是指自然光照条件下且光线均匀的时候,基准棋盘平均灰度值是固定值,以实际得出灰度级或者计算获得灰度级。灰度级指黑白显示器
中显示像素点的亮暗差别,在彩色显示器中表现为颜色的不同,灰度级越多,图像层次越清楚逼真。灰度级取决于每个像素对应的刷新存储单元的位数和显示器本身的性能。当显示器是黑白时,可以直接得出灰度级;当显示器是彩色时,需要计算才能获得灰度级。Under the reference lighting condition, when the light is uniform under normal lighting conditions, the average value of the reference board is a fixed value, and the gray level is actually obtained or calculated. Gray level refers to black and white display
The difference between the brightness and the darkness of the displayed pixel points is different in color display in the color display. The more the gray level, the clearer the image hierarchy is. The gray level depends on the number of bits of the refresh memory cell corresponding to each pixel and the performance of the display itself. When the display is black and white, the gray level can be directly obtained; when the display is colored, calculation is required to obtain the gray level.
其中,任何颜色都由红、绿、蓝三基色组成,将原来某点的颜色为RGB(R,G,B)转换为灰度Gray时,可以通过下面五种方法:Among them, any color is composed of three primary colors of red, green and blue. When converting the color of a certain point to RGB (R, G, B) to grayscale gray, the following five methods can be used:
一、浮点算法:Gray=R*0.3+G*0.59+B*0.11;First, the floating point algorithm: Gray = R * 0.3 + G * 0.59 + B * 0.11;
二、整数方法:Gray=(R*30+G*59+B*11)/100;Second, the integer method: Gray = (R * 30 + G * 59 + B * 11) / 100;
三、移位方法:Gray=(R*77+G*151+B*28)>>8;Third, the shift method: Gray = (R * 77 + G * 151 + B * 28) >> 8;
四、平均值法:Gray=(R+G+B)/3;Fourth, the average method: Gray = (R + G + B) / 3;
五、仅取绿色:Gray=G;5. Only take green: Gray=G;
通过上述任一种方法求得Gray后,将原来的RGB(R,G,B)中的R,G,B统一用Gray替换,一般采用平均值法获得。以实际的应用例说明,基准光照条件下基准棋盘平均灰度值一般介于100到150之间,可选为120、130或者140。当基准光照条件下实际测得的基准棋盘平均灰度值超过100到150之间,设置成使得基准棋盘平均灰度值介于100到150之间。After obtaining Gray by any of the above methods, R, G, and B in the original RGB (R, G, B) are uniformly replaced by Gray, and generally obtained by the average method. In the actual application example, the average gray value of the reference board in the reference lighting condition is generally between 100 and 150, and may be 120, 130 or 140. When the actual measured reference board average gray value exceeds 100 to 150 under the reference illumination condition, it is set such that the reference board average gray value is between 100 and 150.
步骤S303:在基准光照条件下获取棋盘设置有黑子和白子时的第二基准图像。Step S303: Acquire a second reference image when the board is provided with sunspots and whites under the reference illumination condition.
步骤S304:根据第二基准图像计算黑子的基准灰度值和白子的基准灰度值。Step S304: Calculate the reference gray value of the sunspot and the reference gray value of the white matter according to the second reference image.
在基准光照条件下拍摄黑子和白子,分别获得黑子和白子的基准灰度值。具体计算方法参见上文。其中,黑子的基准灰度值小于基准棋盘平均灰度值超过50,白子的基准灰度值大于基准棋盘平均灰度值超过50。换句话说,黑子的基准灰度值范围为0-50,可选为20、30或者40;白子的基准灰度值范围为200-255,可选为210、225或者235。The sunspots and whites were taken under reference lighting conditions to obtain the reference gray values of the sunspots and whites, respectively. See the above for specific calculation methods. Wherein, the reference gray value of the sunspot is less than 50 of the reference board average gray value, and the white matter reference gray value is greater than the reference board average gray value by more than 50. In other words, the reference gray value of the sunspot ranges from 0 to 50, optionally 20, 30 or 40; the reference gray value of the white sub-range ranges from 200 to 255, optionally 210, 225 or 235.
步骤S305:根据基准棋盘平均灰度值、黑子的基准灰度值和白子的基准灰度值设置基准判定阈值。Step S305: The reference determination threshold is set based on the reference checkerboard average gradation value, the reference gradation value of the sunspot, and the reference gradation value of the white matter.
根据基准棋盘平均灰度值、黑子的基准灰度值和白子的基准灰度值设置基准判定阈值,其中,黑子的基准灰度值和白子的基准灰度值的变化不大,主要参考基准棋盘平均灰度值。在本实施例中,所述基准判定阈值为基准棋盘平均灰度值与黑子基准灰度值的差值的二分之一或者白子基准灰度值与基准棋盘平均灰度值的差值的二分之一,此时,依据该基准判定阈值能够较好分别出棋盘
黑子、白子或者无子的状态;其中,两个差值中以小者为准,且差值的二分之一四舍五入为整数。具体举例说明,当黑子的基准灰度值为25,白子的基准灰度值为235,基准棋盘平均灰度值为125时,即基准棋盘平均灰度值125与黑子基准灰度值25的差值100的二分之一或者白子基准灰度值235与基准棋盘平均灰度值125的差值110的二分之一,从而可以确定基准判定阈值为差值100的二分之一,获得基准判定阈值为50。在光照条件较好的情况下,依据上文判定落子状态的计算方式,即灰度值为75以下为黑子,灰度值为175以上为白子,灰度值为75-175之间即为无子状态。当光照条件不好的情况下,基准棋盘平均灰度值为125,实际棋盘平均灰度值为100时,根据公式T=abs(Hb-abs(H-Hb))×Tb/Hb;可以计算得出T=40。即灰度值为60以下为黑子,灰度值为140以上为白子,灰度值为60-140之间即为无子状态。The reference determination threshold is set according to the reference checkerboard average gray value, the reference gray value of the sunspot, and the reference gray value of the white matter, wherein the reference gray value of the sunspot and the reference gray value of the white matter do not change much, and the reference is mainly made to the reference chessboard. Average gray value. In this embodiment, the reference determination threshold is one-half of a difference between a reference chessboard average gray value and a sunspot reference gray value or a difference between a white sub-reference gray value and a reference chessboard average gray value. One of the points, at this time, according to the benchmark decision threshold can better separate the state of the board black, white or no child; wherein the two differences are subject to the smaller, and one-half of the difference is rounded to Integer. For example, when the reference gray value of the sunspot is 25, the reference gray value of the white matter is 235, and the average value of the reference chessboard is 125, that is, the difference between the reference checkerboard average gray value 125 and the sunspot reference gray value 25 One-half of the value 100 or one-half of the difference 110 between the white sub-reference gray value 235 and the reference chessboard average gray value 125, so that the reference determination threshold can be determined to be one-half of the difference 100, and the reference is obtained. The decision threshold is 50. In the case of better illumination conditions, according to the above calculation method for determining the state of the drop, that is, the gray value is 75 or less for the sunspot, the gray value is 175 or more for the white, and the gray value is between 75 and 175. Substate. When the lighting conditions are not good, the average checkerboard gray value is 125, and the actual checkerboard average gray value is 100, according to the formula T=abs(H b -abs(HH b ))×T b /H b ; It can be calculated that T=40. That is, the gray value is 60 or less for the sunspot, the gray value is 140 or more for the white, and the gray value is between 60 and 140 for the no-sub state.
综上所述,在本发明实施例所提供的基于计算机视觉的黑白子识别方法中增加计算基准棋盘平均灰度值和基准判定阈值的步骤,使得判定阀值依据基准棋盘平均灰度值和基准判定阈值设定的,使得该方法进一步适应于自然光的光线条件,进一步减少了由于棋盘的光线因素导致的误检测。In summary, in the computer vision-based black-and-white sub-identification method provided by the embodiment of the present invention, the steps of calculating the reference chessboard average gray value and the reference determination threshold are added, so that the determination threshold is based on the reference chessboard average gray value and the reference. The decision threshold is set such that the method is further adapted to the light conditions of natural light, further reducing false detections due to the light factor of the checkerboard.
如图5所示,图5是本发明提供的基于计算机视觉的黑白子识别方法第四实施方式的部分流程示意图。在本实施例中,实际环境光亮度与基准照明条件下的基准环境光亮度来调整判定阈值。具体来说,本实施例的标定方法包括以下步骤:As shown in FIG. 5, FIG. 5 is a partial flow chart of a fourth embodiment of a computer vision-based black and white sub-identification method provided by the present invention. In the present embodiment, the determination threshold is adjusted by the actual ambient light luminance and the reference ambient light luminance under the reference illumination conditions. Specifically, the calibration method of this embodiment includes the following steps:
本实施例的流程步骤与第二实施例的流程步骤基本相同,在此不再赘述。本实施例与第二实施例的区别之处在于,将步骤S201-步骤S203更换为步骤S401-步骤S402:The process steps in this embodiment are basically the same as the process steps in the second embodiment, and are not described herein again. This embodiment is different from the second embodiment in that step S201 - step S203 is replaced with step S401 - step S402:
步骤S401:获取实际光照条件下的实际环境光亮度。Step S401: Acquire actual ambient light brightness under actual lighting conditions.
计算实际光照条件下的实际环境光亮度。亮度是指发光体表面发光强弱的物理量,亮度的单位是坎德拉/平方米(cd/m2),是人对光的强度的感受。依据实际环境光亮度与基准照明条件下的基准环境光亮度来调整判定阈值是另一种实施方式。Calculate the actual ambient light level under actual lighting conditions. Luminance refers to the physical quantity of the illuminant surface, and the unit of brightness is candela/square meter (cd/m2), which is the human perception of the intensity of light. Adjusting the decision threshold based on the actual ambient light brightness and the reference ambient light level under the reference illumination conditions is another embodiment.
步骤S402:根据实际环境光亮度与基准照明条件下的基准环境光亮度来调整判定阈值,实际环境光亮度与基准环境光亮度的差异越大,判定阈值越小。Step S402: The determination threshold is adjusted according to the actual ambient light brightness and the reference ambient light brightness under the reference illumination condition, and the difference between the actual ambient light brightness and the reference ambient light brightness is larger, and the determination threshold is smaller.
在预设的基准环境光照条件下,所述基准环境光亮度是固定值。假设基准环境光亮度为400cd/m2,基准判定阈值为50,若实际环境光亮度为100cd/m2
时,将光亮度代入上述计算判定阈值的公式T=abs(400-abs(100-400))×50/400,其中,实际棋盘平均灰度值替换为实际环境光亮度,基准棋盘平均灰度值替换为基准环境光亮度,可以计算获得调整判定阈值为12.5,四舍五入后为整数13。其中,实际环境光亮度与基准环境光亮度的差异越大,判定阈值越小。The reference ambient light brightness is a fixed value under preset baseline ambient lighting conditions. Assume that the reference ambient light brightness is 400 cd/m2, and the reference determination threshold is 50. If the actual ambient light brightness is 100 cd/m2.
When the brightness is substituted into the above formula for calculating the determination threshold T=abs(400-abs(100-400))×50/400, wherein the actual board average gray value is replaced with the actual ambient light level, and the reference board average gray level. The value is replaced with the reference ambient light brightness, which can be calculated to obtain an adjustment decision threshold of 12.5, rounded to an integer of 13. The difference between the actual ambient light brightness and the reference ambient light brightness is larger, and the determination threshold is smaller.
如图6所示,图6是本发明提供的基于计算机视觉的黑白子识别方法第五实施方式的流程示意图。在本实施例中,根据实际环境光亮度与基准照明条件下的基准环境光亮度来调整判定阈值。具体来说,本实施例的标定方法包括以下步骤:As shown in FIG. 6, FIG. 6 is a schematic flowchart diagram of a fifth embodiment of a computer vision-based black-and-white sub-identification method provided by the present invention. In the present embodiment, the determination threshold is adjusted in accordance with the actual ambient light luminance and the reference ambient light luminance under the reference illumination conditions. Specifically, the calibration method of this embodiment includes the following steps:
步骤S51-S55与第一实施例的步骤S11-S15基本一致,在此不再赘述。本实施例与第一实施例的区别之处在于,本实施例在步骤S55之后进一步包括:Steps S51-S55 are substantially the same as steps S11-S15 of the first embodiment, and are not described herein again. The difference between this embodiment and the first embodiment is that the embodiment further includes after step S55:
步骤S56:根据所判定的每个网格点的落子状态分别生成对应的字符,进而形成表示所有网格点的落子状态的字符串,其中不同的落子状态由不同的字符进行表示。Step S56: respectively generate corresponding characters according to the determined falling state of each grid point, thereby forming a character string indicating the falling state of all the grid points, wherein different falling sub-states are represented by different characters.
具体的,在待识别图像上设置第一检测区域和第二检测区域是指在棋盘的每个网格点分别设置第一检测区域和第二检测区域,进而对每个网格点的落子状态进行判定,其中,第一检测区域和第二检测区域设置成正方形,且第一检测区域的宽度等于黑子和/或白子的直径,第二检测区域的宽度大于或等于棋盘的两个网格宽度。本实施例中,第二检测区域的宽度大于棋盘的两个网格宽度,包括区域为3*3,当棋子为黑子时,生成对应的字符为b,当棋子为白子时,生成对应的字符为w,当为无子,生成对应的字符为n。包括三个。结果输出前将数据打包,可以由左上角开始,按行依次打包,例如3x3网格打包后结果为字符串nnnbnwnnn,将此字符串向外发送即可。Specifically, setting the first detection area and the second detection area on the image to be identified means that the first detection area and the second detection area are respectively set on each grid point of the board, and then the falling state of each grid point is further Determining, wherein the first detection area and the second detection area are arranged in a square shape, and the width of the first detection area is equal to the diameter of the black and/or white, and the width of the second detection area is greater than or equal to the two grid widths of the board . In this embodiment, the width of the second detection area is greater than the width of the two grids of the board, including the area of 3*3. When the piece is a black box, the corresponding character is generated as b, and when the piece is white, the corresponding character is generated. For w, when there is no child, the corresponding character is generated as n. Includes three. The result is packed before the output, which can be started from the upper left corner and packed in rows, for example, the result of the 3x3 grid is packaged as the string nnnbnwnnn, and the string can be sent out.
请参阅图7,图7是本发明提供的基于计算机视觉的黑白子识别系统第一实施例的结构示意图。Please refer to FIG. 7. FIG. 7 is a schematic structural diagram of a computer vision-based black and white sub-identification system according to a first embodiment of the present invention.
如图7所示,该基于计算机视觉的黑白子识别系统10包括图像采集设备11和图像处理器13,图像采集设备11电连接图像处理器13,其中,图像采集设备11由摄像机和镜头组成,具体为CCD摄像机和CCTV镜头(“Closed Circuit Television”,简称CCTV),CCTV镜头是闭路电视所使用的镜头,也可以叫做监控镜头。CCD摄像机安装于棋盘正上方适当距离,配以适当焦距的CCTV镜头使CCD摄像机能够恰好拍摄好整个棋盘;图像处理器13由视觉工业控制机和视觉处理软件组成。
As shown in FIG. 7, the computer vision-based black and white sub-identification system 10 includes an image acquisition device 11 and an image processor 13, and the image acquisition device 11 is electrically connected to the image processor 13, wherein the image acquisition device 11 is composed of a camera and a lens. Specifically, it is a CCD camera and a CCTV lens ("Closed Circuit Television", CCTV for short). The CCTV lens is a lens used by a closed circuit television, and can also be called a surveillance lens. The CCD camera is mounted at an appropriate distance directly above the board, with a CCTV lens of appropriate focal length to enable the CCD camera to capture the entire board exactly; the image processor 13 is composed of a visual industrial control machine and visual processing software.
本实施例中,图像采集设备11用于在实际光照条件下获取棋盘的待识别图像;图像处理器13用于在待识别图像上设置第一检测区域和第二检测区域,并计算待识别图像在第一检测区域内的第一区域平均灰度值及待识别图像在第二检测区域内的第二区域平均灰度值,其中第二检测区域的面积大于第一检测区域且包围第一检测区域,图像处理器13进一步计算第二区域平均灰度值与判定阈值的差值以及第二区域平均灰度值和判定阈值的求和值,并将第一区域平均灰度值与差值和求和值进行比较,进而判定第一检测区域的落子状态,其中实际光照条件与基准光照条件差异越大,判定阈值越小。In this embodiment, the image capturing device 11 is configured to acquire an image to be recognized of the board under actual lighting conditions; the image processor 13 is configured to set a first detecting area and a second detecting area on the image to be recognized, and calculate an image to be recognized. a first region average gray value in the first detection area and a second region average gray value in the second detection area, wherein the area of the second detection area is larger than the first detection area and surrounds the first detection The image processor 13 further calculates a difference between the average gray value of the second region and the determination threshold, and a sum of the average gray value of the second region and the determination threshold, and compares the average gray value of the first region with the difference The summation value is compared to determine the drop state of the first detection area, wherein the difference between the actual illumination condition and the reference illumination condition is larger, and the determination threshold is smaller.
其中,图像采集设备11进一步用于在实际光照条件下获取棋盘处于无子状态时的调整参考图像、在基准光照条件下获取棋盘处于无子状态时的第一基准图像、以及在基准光照条件下获取棋盘设置有黑子和白子时的第二基准图像。而上述方法实施例中的其他对应步骤均由识别系统10的图像处理器13执行,故在此不对图像处理器13进行赘述,详细请参阅以上对应步骤的说明。The image acquisition device 11 is further configured to: when the actual illumination condition is obtained, obtain an adjustment reference image when the board is in a sub-state, obtain a first reference image when the board is in a sub-state under the reference illumination condition, and under the reference illumination condition Obtain a second reference image when the board is set with sunspots and whites. The other corresponding steps in the foregoing method embodiment are all performed by the image processor 13 of the identification system 10. Therefore, the image processor 13 will not be described here. For details, refer to the description of the corresponding steps above.
请参阅图8,图8是本发明提供的基于计算机视觉的黑白子识别系统第二实施例的结构示意图。Please refer to FIG. 8. FIG. 8 is a schematic structural diagram of a second embodiment of a computer vision based black and white sub-identification system provided by the present invention.
如图8所示,该基于计算机视觉的黑白子识别系统20进一步包括光传感器22,图像采集设备21和光传感器22分别电连接图像处理器23。本实施的光传感器22用于获取实际光照条件下的实际环境光亮度,图像处理器23根据实际环境光亮度与基准照明条件下的基准环境光亮度来确定判定阈值,实际环境光亮度与基准环境光亮度的差异越大,判定阈值越小。光传感器22为自然光传感器,即太阳光传感器。太阳光传感器可识别水平方向和垂直方向各180度,或者指定角度;还可以识别太阳所在的位置以及识别阴天、多云天、半阴天、晴天及晚上白天;还可以进行跟踪方位识别。光传感器22的光亮度测量范围为0-10000cd/m2。在其他实施例中,可以将图像采集设备21和光传感器22合二为一进行使用,还可以进一步增加特定光源,改善光照条件,也可以仅依靠自然光而不加光源。As shown in FIG. 8, the computer vision based black and white sub-identification system 20 further includes a light sensor 22, and the image capture device 21 and the light sensor 22 are electrically coupled to the image processor 23, respectively. The photosensor 22 of the present embodiment is used to obtain the actual ambient light brightness under actual illumination conditions, and the image processor 23 determines the determination threshold according to the actual ambient light brightness and the reference ambient light brightness under the reference illumination condition, the actual ambient light brightness and the reference environment. The greater the difference in brightness, the smaller the decision threshold. The light sensor 22 is a natural light sensor, that is, a solar light sensor. The solar sensor can identify 180 degrees in the horizontal and vertical directions, or specify the angle; it can also identify the location of the sun and identify cloudy, cloudy, semi-cloudy, sunny and evening days; tracking position recognition can also be performed. The lightness measurement range of the photosensor 22 is 0-100 cd/m2. In other embodiments, the image capturing device 21 and the light sensor 22 may be used in combination, and a specific light source may be further added to improve the lighting conditions, or only natural light may be used instead of the light source.
综上所述,本领域技术人员容易理解,在本发明实施例所提供的基于计算机视觉的黑白子识别方法及系统中由于设有判定阀值,根据计算第二区域平均灰度值与预设的判定阈值的差值以及两者求和值,然后将第一区域平均灰度值与差值和求和值进行比较,进而判定第一检测区域的落子状态,因判定阀值是依据实际环境设定的,使得该方法适应于不同的光线条件,减少了由于光线因
素导致的误检测,提高黑白子的识别准确率。In summary, those skilled in the art can easily understand that in the computer vision-based black-and-white sub-identification method and system provided by the embodiments of the present invention, since the determination threshold is provided, the average gray value and the preset value of the second region are calculated. The difference between the decision thresholds and the sum of the two, and then compare the first region average gray value with the difference and the sum value, thereby determining the fall state of the first detection region, because the decision threshold is based on the actual environment Set to adapt the method to different lighting conditions, reducing the cause of light
The false detection caused by the element improves the recognition accuracy of the black and white sub.
以上所述仅为本发明的实施方式,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。
The above is only the embodiment of the present invention, and is not intended to limit the scope of the invention, and the equivalent structure or equivalent process transformations made by the description of the invention and the drawings are directly or indirectly applied to other related technologies. The fields are all included in the scope of patent protection of the present invention.
Claims (20)
- 一种基于计算机视觉的黑白子识别方法,其特征在于,所述方法包括:A black and white sub-identification method based on computer vision, characterized in that the method comprises:在实际光照条件下获取棋盘的待识别图像;Obtaining an image to be recognized of the board under actual lighting conditions;在所述待识别图像上设置第一检测区域和第二检测区域,其中所述第二检测区域的面积大于所述第一检测区域且包围所述第一检测区域;Setting a first detection area and a second detection area on the image to be identified, wherein an area of the second detection area is larger than the first detection area and surrounds the first detection area;计算所述待识别图像在所述第一检测区域内的第一区域平均灰度值及所述待识别图像在所述第二检测区域内的第二区域平均灰度值;Calculating a first region average gray value of the to-be-identified image in the first detection area and a second region average gray value of the to-be-identified image in the second detection area;计算所述第二区域平均灰度值与预设的判定阈值的差值,以及计算所述第二区域平均灰度值和所述预设的判定阈值的求和值;Calculating a difference between the average grayscale value of the second region and a preset determination threshold, and calculating a summation value of the average grayscale value of the second region and the preset determination threshold;将所述第一区域平均灰度值与所述差值以及所述求和值进行比较,进而判定所述第一检测区域的落子状态。Comparing the first region average gray value with the difference value and the summation value to determine a falling state of the first detection region.
- 根据权利要求1所述的基于计算机视觉的黑白子识别方法,其特征在于,所述将所述第一区域平均灰度值与所述差值和所述求和值进行比较,进而判定所述第一检测区域的落子状态的步骤包括:The computer vision-based black and white sub-recognition method according to claim 1, wherein said comparing said first region average gray value with said difference value and said summation value, thereby determining said said The step of the falling state of the first detecting area includes:若所述第一区域平均灰度值小于所述差值,则所述第一检测区域内设置有黑子,若所述第一区域平均灰度值大于所述求和值,则所述第一检测区域内设置有白子,若所述第一区域平均灰度值介于所述差值与所述求和值之间,则所述第一检测区域处于无子状态。If the first region average gray value is smaller than the difference, the first detection region is provided with a black child, and if the first region average gray value is greater than the summation value, the first A white sub is disposed in the detection area, and if the first area average gray value is between the difference and the summation value, the first detection area is in a sub-state.
- 根据权利要求1所述的基于计算机视觉的黑白子识别方法,其特征在于,所述方法进一步包括:The method according to claim 1, wherein the method further comprises:在所述实际光照条件下获取所述棋盘处于无子状态时的调整参考图像;Obtaining an adjustment reference image when the checkerboard is in a sub-state without the actual illumination condition;根据所述调整参考图像计算所述棋盘的实际棋盘平均灰度值;Calculating an actual chessboard average gray value of the chessboard according to the adjusted reference image;根据所述实际棋盘平均灰度值与基准光照条件下的基准棋盘平均灰度值来确定所述判定阈值,其中所述实际棋盘平均灰度值与所述基准棋盘平均灰度值的差异越大,所述判定阈值越小。Determining the determination threshold according to the actual board average gray value and the reference board average gray value under the reference illumination condition, wherein the difference between the actual board average gray value and the reference board average gray value is greater The decision threshold is smaller.
- 根据权利要求3所述的基于计算机视觉的黑白子识别方法,其特征在于,所述判定阈值为基准判定阈值与一百分数的乘积,其中所述实际棋盘平均灰度值与所述基准棋盘平均灰度值的差异越大,所述百分数越小。The computer vision-based black-and-white sub-recognition method according to claim 3, wherein the determination threshold is a product of a reference determination threshold and a one-hund score, wherein the actual checkerboard average grayscale value and the reference checkerboard average grayscale The greater the difference in degrees, the smaller the percentage.
- 根据权利要求4所述的基于计算机视觉的黑白子识别方法,其特征在于,所述判定阈值通过如下公式计算:The computer vision-based black and white sub-recognition method according to claim 4, wherein the determination threshold is calculated by the following formula:T=abs(Hb-abs(H-Hb))×Tb/Hb; T = abs (H b - abs (HH b )) × T b / H b ;其中,T为所述判定阈值,Hb为所述基准棋盘平均灰度值,Tb为所述基准判定阈值,所述H为所述实际棋盘平均灰度值,abs为绝对值函数。Where T is the decision threshold, H b is the reference checkerboard average gray value, T b is the reference decision threshold, H is the actual checkerboard average gray value, and abs is an absolute value function.
- 根据权利要求4所述的基于计算机视觉的黑白子识别方法,其特征在于,确定所述基准判定阈值的方法包括:The computer vision-based black and white sub-identification method according to claim 4, wherein the method for determining the reference determination threshold comprises:在基准光照条件下获取所述棋盘处于无子状态时的第一基准图像;Obtaining, in a reference illumination condition, a first reference image when the checkerboard is in a sub-state;根据所述第一基准图像计算所述棋盘的所述基准棋盘平均灰度值;Calculating the reference chessboard average gray value of the chessboard according to the first reference image;在所述基准光照条件下获取所述棋盘设置有黑子和白子时的第二基准图像;Obtaining, in the reference illumination condition, a second reference image when the chessboard is provided with sunspots and whites;根据所述第二基准图像计算所述黑子的基准灰度值和所述白子的基准灰度值;Calculating a reference gray value of the sunspot and a reference gray value of the white light according to the second reference image;根据所述基准棋盘平均灰度值、所述黑子的基准灰度值和所述白子的基准灰度值设置所述基准判定阈值。The reference determination threshold is set based on the reference checkerboard average grayscale value, the reference grayscale value of the sunspot, and the reference grayscale value of the white matter.
- 根据权利要求6所述的基于计算机视觉的黑白子识别方法,其特征在于,所述基准光照条件为使得所述基准棋盘平均灰度值介于100到150之间,且所述黑子的基准灰度值小于所述基准棋盘平均灰度值超过50,所述白子的基准灰度值大于所述基准棋盘平均灰度值超过50的光照条件。The computer vision-based black and white sub-recognition method according to claim 6, wherein the reference illumination condition is such that the reference checkerboard average gray value is between 100 and 150, and the reference gray of the sunspot The degree value is less than 50 of the reference checkerboard average gray value, and the white matter's reference gray value is greater than the reference board average gray value exceeding 50.
- 根据权利要求1所述的基于计算机视觉的黑白子识别方法,其特征在于,所述方法进一步包括:The method according to claim 1, wherein the method further comprises:获取所述实际光照条件下的实际环境光亮度;Obtaining actual ambient light brightness under the actual lighting conditions;根据所述实际环境光亮度与所述基准照明条件下的基准环境光亮度来调整所述判定阈值,所述实际环境光亮度与基准环境光亮度的差异越大,所述判定阈值越小。The determination threshold is adjusted according to the actual ambient light brightness and the reference ambient light brightness under the reference illumination condition, and the difference between the actual ambient light brightness and the reference ambient light brightness is smaller, and the determination threshold is smaller.
- 根据权利要求1所述的基于计算机视觉的黑白子识别方法,其特征在于,所述在所述待识别图像上设置第一检测区域和第二检测区域的步骤包括:The computer vision-based black and white sub-recognition method according to claim 1, wherein the step of setting the first detection area and the second detection area on the image to be recognized comprises:在所述棋盘的每个网格点分别设置所述第一检测区域和所述第二检测区域,进而对每个网格点的落子状态进行判定,其中所述第一检测区域和所述第二检测区域设置成正方形,且所述第一检测区域的宽度等于所述黑子和/或所述白子的直径,所述第二检测区域的宽度等于所述棋盘的三个网格宽度。Setting the first detection area and the second detection area respectively at each grid point of the checkerboard, and further determining a drop state of each grid point, wherein the first detection area and the first The second detection area is set to a square, and the width of the first detection area is equal to the diameter of the sunspot and/or the white, and the width of the second detection area is equal to three grid widths of the board.
- 根据权利要求9所述的基于计算机视觉的黑白子识别方法,其特征在于,所述方法进一步包括:The method according to claim 9, wherein the method further comprises:根据所判定的每个所述网格点的落子状态分别生成对应的字符,进而形成表示所有所述网格点的落子状态的字符串,其中不同的落子状态由不同的字符 进行表示。Generating corresponding characters according to the determined falling state of each of the grid points, thereby forming a character string representing the falling state of all the grid points, wherein different falling sub-states are different characters Make a representation.
- 一种基于计算机视觉的黑白子识别系统,其特征在于,所述系统包括图像采集设备以及图像处理器,所述图像采集设备用于在实际光照条件下获取棋盘的待识别图像;所述图像处理器用于在所述待识别图像上设置第一检测区域和第二检测区域,并计算所述待识别图像在所述第一检测区域内的第一区域平均灰度值及所述待识别图像在所述第二检测区域内的第二区域平均灰度值,其中所述第二检测区域的面积大于所述第一检测区域且包围所述第一检测区域,所述图像处理器进一步计算所述第二区域平均灰度值与预设的判定阈值的差值以及所述第二区域平均灰度值和所述预设的判定阈值的求和值,并将所述第一区域平均灰度值与所述差值和所述求和值进行比较,进而判定所述第一检测区域的落子状态。A black and white sub-identification system based on computer vision, characterized in that the system comprises an image acquisition device and an image processor, wherein the image acquisition device is configured to acquire an image to be recognized of a chessboard under actual illumination conditions; And configured to set a first detection area and a second detection area on the image to be identified, and calculate an average gray value of the first area of the image to be recognized in the first detection area and the image to be recognized a second region average gray value in the second detection area, wherein an area of the second detection area is larger than the first detection area and surrounding the first detection area, the image processor further calculates the a difference between the second region average gray value and a preset determination threshold, and a summation value of the second region average gray value and the preset determination threshold, and the first region average gray value Comparing the difference with the summed value to determine a falling state of the first detection area.
- 根据权利要求11所述的基于计算机视觉的黑白子识别系统,其特征在于,若所述图像处理器的比较结果为所述第一区域平均灰度值小于所述差值,则判定所述第一检测区域内设置有黑子,若所述图像处理器的比较结果为所述第一区域平均灰度值大于所述求和值,则判定所述第一检测区域内设置有白子,若所述图像处理器的比较结果为所述第一区域平均灰度值介于所述差值与所述求和值之间,则判定所述第一检测区域处于无子状态。The computer vision-based black and white sub-identification system according to claim 11, wherein if the comparison result of the image processor is that the first region average gray value is smaller than the difference, determining the a black spot is disposed in a detection area, and if a comparison result of the image processor is that the first area average gray value is greater than the summation value, determining that the first detection area is provided with a white sub- The comparison result of the image processor is that the first region average gray value is between the difference value and the summation value, and then determining that the first detection region is in a sub-state.
- 根据权利要求11所述的基于计算机视觉的黑白子识别系统,其特征在于,所述图像采集设备进一步用于在所述实际光照条件下获取所述棋盘处于无子状态时的调整参考图像,所述图像处理器根据所述调整参考图像计算所述棋盘的实际棋盘平均灰度值,并根据所述实际棋盘平均灰度值与所述基准光照条件下的基准棋盘平均灰度值来确定所述判定阈值,其中所述实际棋盘平均灰度值与所述基准棋盘平均灰度值的差异越大,所述判定阈值越小。The computer vision-based black and white sub-identification system according to claim 11, wherein the image acquisition device is further configured to acquire an adjustment reference image when the chessboard is in a sub-state without the sub-state under the actual illumination condition. The image processor calculates an actual board average gray value of the board according to the adjusted reference image, and determines the average board value according to the actual board average gray value and the reference board average gray value under the reference lighting condition. A threshold is determined, wherein the greater the difference between the actual checkerboard average grayscale value and the reference checkerboard average grayscale value, the smaller the decision threshold.
- 根据权利要求13所述的基于计算机视觉的黑白子识别系统,其特征在于,所述判定阈值为基准判定阈值与一百分数的乘积,其中所述实际棋盘平均灰度值与所述基准棋盘平均灰度值的差异越大,所述百分数越小。The computer vision-based black-and-white sub-identification system according to claim 13, wherein the determination threshold is a product of a reference determination threshold and a one-hund score, wherein the actual chessboard average gray value and the reference chessboard average gray The greater the difference in degrees, the smaller the percentage.
- 根据权利要求14所述的基于计算机视觉的黑白子识别系统,其特征在于,所述判定阈值通过如下公式计算:The computer vision based black and white sub-identification system according to claim 14, wherein the determination threshold is calculated by the following formula:T=abs(Hb-abs(H-Hb))×Tb/Hb;T = abs (H b - abs (HH b )) × T b / H b ;其中,T为所述判定阈值,Hb为所述基准棋盘平均灰度值,Tb为所述基准判定阈值,所述H为所述实际棋盘平均灰度值,abs为绝对值函数。 Where T is the decision threshold, H b is the reference checkerboard average gray value, T b is the reference decision threshold, H is the actual checkerboard average gray value, and abs is an absolute value function.
- 根据权利要求14所述的基于计算机视觉的黑白子识别系统,其特征在于,所述图像采集设备进一步用于在基准光照条件下获取所述棋盘处于无子状态时的第一基准图像,且在所述基准光照条件下获取所述棋盘设置有黑子和白子时的第二基准图像,所述图像处理器进一步根据所述第一基准图像计算所述棋盘的所述基准棋盘平均灰度值,根据所述第二基准图像计算所述黑子的基准灰度值和所述白子的基准灰度值,并进一步根据所述基准棋盘平均灰度值、所述黑子的基准灰度值和所述白子的基准灰度值设置所述基准判定阈值。The computer vision-based black and white sub-identification system according to claim 14, wherein the image acquisition device is further configured to acquire a first reference image when the checkerboard is in a sub-state without under a reference illumination condition, and Acquiring, in the reference illumination condition, a second reference image when the chessboard is set with black and white, the image processor further calculating, according to the first reference image, the average average gray value of the reference chessboard according to the first reference image, according to The second reference image calculates a reference gradation value of the sunspot and a reference gradation value of the white matter, and further according to the reference checkerboard average gradation value, the reference gradation value of the sunspot, and the white matter The reference gradation value sets the reference determination threshold.
- 根据权利要求16所述的基于计算机视觉的黑白子识别系统,其特征在于,所述基准光照条件为使得所述基准棋盘平均灰度值介于100到150之间,且所述黑子的基准灰度值小于所述基准棋盘平均灰度值超过50,所述白子的基准灰度值大于所述基准棋盘平均灰度值超过50的光照条件。The computer vision-based black and white sub-identification system according to claim 16, wherein the reference illumination condition is such that the reference checkerboard average gray value is between 100 and 150, and the reference gray of the sunspot The degree value is less than 50 of the reference checkerboard average gray value, and the white matter's reference gray value is greater than the reference board average gray value exceeding 50.
- 根据权利要求11所述的基于计算机视觉的黑白子识别系统,其特征在于,所述系统进一步包括光传感器,用于获取所述实际光照条件下的实际环境光亮度,所述图像处理器根据所述实际环境光亮度与所述基准照明条件下的基准环境光亮度来调整所述判定阈值,所述实际环境光亮度与基准环境光亮度的差异越大,所述判定阈值越小。The computer vision-based black and white sub-identification system according to claim 11, wherein the system further comprises a light sensor for acquiring actual ambient light brightness under the actual lighting condition, the image processor according to the The determination threshold is adjusted by the actual ambient light brightness and the reference ambient light brightness under the reference illumination condition, and the difference between the actual ambient light brightness and the reference ambient light brightness is smaller, and the determination threshold is smaller.
- 根据权利要求11所述的基于计算机视觉的黑白子识别系统,其特征在于,所述图像处理器在所述棋盘的每个待检测网格点分别设置所述第一检测区域和所述第二检测区域,进而对每个待检测网格点的落子状态进行判定,其中所述第一检测区域和所述第二检测区域设置成正方形,且所述第一检测区域的宽度等于所述黑子和/或所述白子的直径,所述第二检测区域的宽度等于所述棋盘的三个网格宽度。The computer vision-based black and white sub-identification system according to claim 11, wherein the image processor sets the first detection area and the second respectively at each grid point to be detected of the board Detecting an area, and further determining a falling state of each grid point to be detected, wherein the first detecting area and the second detecting area are arranged in a square, and a width of the first detecting area is equal to the sunspot and / or the diameter of the white, the width of the second detection area is equal to the three grid widths of the board.
- 根据权利要求19所述的基于计算机视觉的黑白子识别系统,其特征在于,所述图像处理器根据所判定的每个所述待检测网格点的落子状态分别生成对应的字符,进而形成表示所有所述待检测网格点的落子状态的字符串,其中不同的落子状态由不同的字符进行表示。 The computer vision-based black and white sub-identification system according to claim 19, wherein the image processor generates corresponding characters according to the determined falling state of each of the detected grid points, thereby forming a representation A string of all the state of the drop of the grid point to be detected, wherein different down states are represented by different characters.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201680026892.XA CN107690658B (en) | 2016-12-30 | 2016-12-30 | Black and white sub-identification method and system based on computer vision |
PCT/CN2016/113678 WO2018120097A1 (en) | 2016-12-30 | 2016-12-30 | Computer vision-based method and system for recognizing black piece and white piece |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2016/113678 WO2018120097A1 (en) | 2016-12-30 | 2016-12-30 | Computer vision-based method and system for recognizing black piece and white piece |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018120097A1 true WO2018120097A1 (en) | 2018-07-05 |
Family
ID=61151118
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2016/113678 WO2018120097A1 (en) | 2016-12-30 | 2016-12-30 | Computer vision-based method and system for recognizing black piece and white piece |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107690658B (en) |
WO (1) | WO2018120097A1 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109044845B (en) * | 2018-09-29 | 2021-11-16 | 河北盛世天昕电子科技有限公司 | Dosage allowance warning method and device |
CN110349139A (en) * | 2019-07-02 | 2019-10-18 | 芜湖启迪睿视信息技术有限公司 | A kind of miscellaneous detection method of packaging based on neural network segmentation |
CN110487801B (en) * | 2019-07-30 | 2022-07-19 | 厦门三安光电有限公司 | Method, device and equipment for identifying high-temperature baking result of graphite plate and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1448884A (en) * | 2003-04-24 | 2003-10-15 | 上海交通大学 | Chessboard identification system based on visual sensation |
CN102184544A (en) * | 2011-05-18 | 2011-09-14 | 北京联合大学生物化学工程学院 | Method for correcting deformity and identifying image of go notation |
CN105205447A (en) * | 2015-08-22 | 2015-12-30 | 周立人 | Go identification method based on go image and go board |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102614655A (en) * | 2012-03-06 | 2012-08-01 | 南京航空航天大学 | Go automatic digital instrument and game winning or losing judgment method applied to same |
US9488736B2 (en) * | 2012-12-28 | 2016-11-08 | Trimble Navigation Limited | Locally measured movement smoothing of GNSS position fixes |
-
2016
- 2016-12-30 CN CN201680026892.XA patent/CN107690658B/en active Active
- 2016-12-30 WO PCT/CN2016/113678 patent/WO2018120097A1/en active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1448884A (en) * | 2003-04-24 | 2003-10-15 | 上海交通大学 | Chessboard identification system based on visual sensation |
CN102184544A (en) * | 2011-05-18 | 2011-09-14 | 北京联合大学生物化学工程学院 | Method for correcting deformity and identifying image of go notation |
CN105205447A (en) * | 2015-08-22 | 2015-12-30 | 周立人 | Go identification method based on go image and go board |
Also Published As
Publication number | Publication date |
---|---|
CN107690658B (en) | 2021-02-26 |
CN107690658A (en) | 2018-02-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107507571B (en) | A kind of couple of AMOLED carries out the method and device of external optical compensation | |
CN101770646B (en) | Edge detection method based on Bayer RGB images | |
CN105306843B (en) | The bad point processing method and system of a kind of imaging sensor | |
KR102346522B1 (en) | Image processing device and auto white balancing metohd thereof | |
US20090021526A1 (en) | Determination method for white-point and correction method of the white balance | |
WO2016150004A1 (en) | Device and method for processing image to be displayed on oled display | |
KR101941801B1 (en) | Image processing method and device for led display screen | |
WO2018120097A1 (en) | Computer vision-based method and system for recognizing black piece and white piece | |
CN104882097B (en) | Method for displaying image and system based on ambient light | |
WO2013135033A1 (en) | Tunnel deformation online monitoring system based on image analysis and application thereof | |
WO2022089082A1 (en) | Method for adjusting display image, terminal device, and computer readable storage medium | |
JP2009171008A (en) | Color reproduction apparatus and color reproduction program | |
CN104318266B (en) | A kind of image intelligent analyzes and processes method for early warning | |
CN110784701B (en) | Display apparatus and image processing method thereof | |
KR102022699B1 (en) | Image Control Display Device and Image Control Method | |
TWI670977B (en) | Defective pixel compensation method and device | |
JP5468914B2 (en) | Control device for large video display device | |
WO2019041664A1 (en) | Measuring method and device for measuring display panel | |
CN102968177B (en) | Gesture method for sensing | |
KR101621201B1 (en) | Wearable projection apparatus and projection method | |
US20080291291A1 (en) | Apparatus and method for detecting flicker noise and computer readable medium stored thereon computer executable instructions for performing the method | |
CN112666178A (en) | Outdoor LED large screen dead pixel online monitoring method | |
US20200029016A1 (en) | Moving object monitoring device and moving object monitoring system | |
TWI465699B (en) | Method of water level measurement | |
TWI698129B (en) | Image processing method and electronic device thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16925757 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 16925757 Country of ref document: EP Kind code of ref document: A1 |