CN112581523A - Method and device for determining ball cake position, electronic equipment and readable storage medium - Google Patents

Method and device for determining ball cake position, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN112581523A
CN112581523A CN202011379277.1A CN202011379277A CN112581523A CN 112581523 A CN112581523 A CN 112581523A CN 202011379277 A CN202011379277 A CN 202011379277A CN 112581523 A CN112581523 A CN 112581523A
Authority
CN
China
Prior art keywords
image
display
determining
ball cake
coordinates
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011379277.1A
Other languages
Chinese (zh)
Inventor
李英发
梁星宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Shiyu Technology Co ltd
Original Assignee
Guangdong Shiyu Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Shiyu Technology Co ltd filed Critical Guangdong Shiyu Technology Co ltd
Priority to CN202011379277.1A priority Critical patent/CN112581523A/en
Publication of CN112581523A publication Critical patent/CN112581523A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10048Infrared image

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

The application provides a method and a device for determining a ball cake position, electronic equipment and a readable storage medium, which are applied to the technical field of image recognition and comprise the following steps: the method comprises the steps of determining the mapping relation between the image coordinates of the four top corners of the display in the raster image and the actual coordinates of the four top corners of the display through a four-point inversion algorithm, and then determining the actual coordinates of the ball cake by combining the determined mapping relation according to the image coordinates of the ball cake determined by the raster image, so that the induction infrared rays do not need to be installed around the display, the position of the ball cake can be effectively determined on the premise of not hindering the movement of the ball cake around the display screen, the cost is low, and the requirement on the performance of a host is low.

Description

Method and device for determining ball cake position, electronic equipment and readable storage medium
Technical Field
The application relates to the technical field of image recognition, in particular to a method and a device for determining a ball cake position, an electronic device and a readable storage medium.
Background
The traditional positioning technology comprises an infrared frame, a camera and a radar. In all aspects of infrared frame detection, a circle of sensing infrared is required to be arranged around a display, so that the movement of an object around a screen can be hindered, and a lot of limitations can be brought when the infrared frame detection method is applied to projects. Radar positioning is expensive, detection of objects too close to the opposite surface is inaccurate, and detection omission is caused due to the generally low frame rate. The camera positioning scheme in the current market consumes too much hardware performance of the running host, and is not suitable for the running scene of the project. Therefore, how to determine the position of the ball cake in the air-cushion ball game becomes a problem.
Disclosure of Invention
The application provides a method and a device for determining the position of a ball cake, an electronic device and a readable storage medium, which can effectively determine the position of the ball cake on the premise of not hindering the movement of the ball cake around a display screen, and have low cost and low requirement on the performance of a host. The technical scheme adopted by the application is as follows:
in a first aspect, the present application provides a method for determining a location of a ball cake, including:
acquiring a grating image of a ball cake on a display, which is shot by an infrared camera provided with an infrared filter;
determining image coordinates of four vertex angles of a display in the raster image, and identifying and determining image coordinates of a ball cake in the raster image;
determining the mapping relation between the image coordinates of the four vertex angles of the display in the raster image and the actual coordinates of the four vertex angles of the display based on a four-point inversion algorithm;
and determining the actual coordinates of the ball cake based on the image coordinates of the ball cake in the identified raster image and the determined mapping relation.
Optionally, identifying and determining image coordinates of a ball cake in the raster image includes:
determining an image area to be identified based on image coordinates of four vertex angles of a display in a raster image;
identifying and determining pixel points with brightness values exceeding a threshold value in an image area to be identified;
and performing accumulation average calculation based on the determined image coordinate values of all the pixel points with the brightness values exceeding the threshold in the region to be identified, and taking the obtained accumulation average calculation value as the image coordinate of the ball cake.
Optionally, the accumulated average calculation is performed based on the image coordinate values of the pixels whose brightness values exceed the threshold in the determined region to be identified, and the method includes:
screening the pixel points with the brightness values exceeding the threshold value in the determined image area to be identified based on the size of the preset ball cake light spot to obtain the screened pixel points;
the method comprises the following steps of performing accumulation average calculation based on the image coordinate values of all pixel points of which the brightness values exceed the threshold value in the determined region to be identified, and taking the obtained accumulation average calculation value as the image coordinate of the ball cake, wherein the method comprises the following steps:
and performing accumulation average calculation based on the image coordinate values of the screened pixel points, and taking the obtained accumulation average calculation value as the image coordinate of the ball cake.
Optionally, determining image coordinates of four corners of the display in the raster image comprises:
and determining the image coordinates of four top corners of the display by a manual method based on the historical raster image.
Optionally, determining an image area to be identified based on image coordinates of four corners of a display in the raster image includes:
determining a maximum row and column value and a minimum row and column value of traversal based on the image coordinates of the four vertex angles, and determining a traversal pixel range based on the maximum row and column value and the minimum row and column value;
identifying and determining pixel points with brightness values exceeding a threshold value in an image area to be identified, comprising:
determining a binary mask of the grating image based on image coordinates of four vertex angles, wherein the mask in a quadrilateral region determined by the four vertex angles is 1, and the mask outside the quadrilateral region is 0;
and traversing the pixels based on the determined traversal pixel range, and traversing the pixels at the left and right positions and the upper and lower positions of a certain pixel by taking the certain pixel as a reference when the mask corresponding to the certain pixel is 1 and the brightness is greater than the threshold value to obtain a plurality of pixels of which the masks are 1 and the brightness is greater than the threshold value.
Optionally, the method further comprises:
and comparing the actual coordinates of the ball cake with the guide coordinates in the display to determine the game result.
In a second aspect, there is provided a ball cake position determining apparatus comprising:
the acquisition module is used for acquiring a grating image of the ball cake on the display, which is shot by an infrared camera provided with an infrared filter;
the first determining module is used for determining the image coordinates of four vertex angles of a display in the raster image and identifying and determining the image coordinates of a ball cake in the raster image;
the second determination module is used for determining the mapping relation between the image coordinates of the four vertex angles of the display in the raster image and the actual coordinates of the four vertex angles of the display based on a four-point inversion algorithm;
and the third determining module is used for determining the actual coordinates of the ball cake based on the image coordinates of the ball cake in the identified raster image and the determined mapping relation.
Optionally, the first determining module includes:
the first determining unit is used for determining an image area to be identified based on image coordinates of four vertex angles of a display in a raster image;
the identification determining unit is used for identifying and determining pixel points with brightness values exceeding a threshold value in an image area to be identified;
and the unit is used for performing accumulation average calculation based on the image coordinate values of all the pixel points with the brightness values exceeding the threshold value in the determined region to be identified, and taking the obtained accumulation average calculation value as the image coordinate of the ball cake.
Optionally, the first determining module further includes:
the screening unit is used for screening the pixel points with the brightness values exceeding the threshold value in the determined image area to be identified based on the size of the preset ball cake light spot to obtain the screened pixel points;
and as a unit, specifically, the method is further configured to perform accumulation average calculation based on the image coordinate values of the screened pixel points, and use the obtained accumulation average calculation value as the image coordinate of the ball cake.
Optionally, determining image coordinates of four corners of the display in the raster image comprises:
image coordinates of four corners of the display are determined by manual means based on the historical raster image.
Optionally, the first determining unit is further specifically configured to determine a maximum row and column value and a minimum row and column value of the traversal based on the image coordinates of the four vertex angles, and determine a traversal pixel range based on the maximum row and column value and the minimum row and column value;
the identification determining unit is specifically further configured to determine a binary mask of the grating image based on image coordinates of the four vertex angles, where the mask in a quadrilateral region determined by the four vertex angles is 1, and the mask outside the quadrilateral region is 0; and traversing the pixels based on the determined traversal pixel range, and traversing the pixels at the left and right positions and the upper and lower positions of a certain pixel by taking the certain pixel as a reference when the mask corresponding to the certain pixel is 1 and the brightness is greater than the threshold value to obtain a plurality of pixels of which the masks are 1 and the brightness is greater than the threshold value.
Optionally, the apparatus further comprises:
and the fourth determining module is used for comparing the actual coordinates of the ball cake with the guide coordinates in the display to determine the game result.
In a third aspect, an electronic device is provided, which includes:
one or more processors;
a memory;
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to: the method of determining a location of a ball cake shown in the first aspect is performed.
In a fourth aspect, there is provided a computer-readable storage medium for storing computer instructions which, when run on a computer, cause the computer to perform the method for determining a location of a ball patty of the first aspect.
The application provides a method and a device for determining a ball cake position, electronic equipment and a readable storage medium, and the method comprises the following steps: acquiring a grating image of a ball cake on a display, which is shot by an infrared camera provided with an infrared filter; determining image coordinates of four vertex angles of a display in the raster image, and identifying and determining image coordinates of a ball cake in the raster image; determining the mapping relation between the image coordinates of the four vertex angles of the display in the raster image and the actual coordinates of the four vertex angles of the display based on a four-point inversion algorithm; and determining the actual coordinates of the ball cake based on the image coordinates of the ball cake in the identified raster image and the determined mapping relation. The method comprises the steps of determining the mapping relation between the image coordinates of the four top corners of the display in the raster image and the actual coordinates of the four top corners of the display based on a four-point inversion algorithm, then determining the image coordinates of the ball cake according to the raster image, and determining the actual coordinates of the ball cake by combining the determined mapping relation, so that the induction infrared rays do not need to be installed around the display, the position of the ball cake can be effectively determined on the premise that the movement of the ball cake around the display screen is not hindered, the cost is low, and the requirement on the performance of a host is low.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is an exemplary illustration of a three-dimensional configuration of a gaming machine according to the present application;
FIG. 2 is a side view of a gaming machine of the present application;
FIG. 3 is a schematic view of a ball cake passing display of the present application;
FIG. 4 is an enlarged partial view of the arcuate chute of the present application;
FIG. 5 is a side view of yet another gaming machine of the present application;
FIG. 6 is an exemplary diagram of a display of the present application showing a pointing location;
FIG. 7 is an exemplary diagram of an image taken by an infrared camera of the present application;
FIG. 8 is an exemplary diagram of a manual determination of four corners of a display in a raster image;
FIG. 9 is a flowchart illustrating a method for determining a location of a ball cake according to the present application;
FIG. 10 is a schematic structural diagram of a ball cake position determining apparatus according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of electronic identification implemented in the present application.
The notation in the figure is:
1: a slideway; 101: a first slideway; 102: a second slideway; 2: a slideway briquetting; 3: fixing a metal plate by the slideway; 4: a blower; 5: a display; 6: a display metal plate; 7: a game machine body; 8: a vent hole; 9: an infrared camera; 10: an infrared grating transmitter; 11: a processor; 12: and (7) making a ball cake.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is further described in detail below with reference to the accompanying drawings in combination with the detailed description. It should be understood that the description is intended to be exemplary only, and is not intended to limit the scope of the present application. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present application.
Embodiments of the present application are described in detail below with reference to the accompanying drawings:
example one
Fig. 1, 2, 4, and 5 show exemplary configurations of gaming machines, and as shown in fig. 1, 2, 4, and 5, a gaming machine body 7 is provided with: the device comprises a slideway 1, a display 5, a processor 11 and a ball cake information acquisition component;
the slideway 1 is connected with the display 5, the slideway 1 and the display 5 respectively form a certain angle with the horizontal plane, so that a ball cake can slide down along the slideway due to the action of gravity after being struck and ejected out to a certain height along the slideway, the arrow direction of fig. 2 shows a schematic diagram of upward movement of the ball cake after being struck, fig. 3 shows a schematic diagram of upward movement of the ball cake onto the display and a schematic diagram of downward sliding due to the action of gravity after moving to the highest point; the surface of the slideway 1 is provided with a plurality of vent holes 8, the vent holes 8 are used for enabling air current generated by a blower to pass so as to reduce the friction force between the ball cake and the slideway or enable the ball cake to suspend, wherein the blower can be arranged below the slideway and positioned in the game machine body, and the wind power of the blower can be set according to specific application scenes so as to control the height of the ball cake suspended by the air current of the vent holes; in addition, the game machine body 7 is further provided with a cavity assembly for forming a cavity by matching with the slide way, so that the tightness of air flow generated by the air blower is improved, and the generated air flow is effectively utilized.
The display 5 is configured to display the guide positions to be passed by the ball cake 12; illustratively, the position of the square frame marker in fig. 6 is a guiding position for guiding the user to hit the ball cake and pass the ball cake through the position, thereby playing the game.
The processor 11 is configured to determine the location of the ball cake 12 based on the ball cake information (i.e., the image of the ball cake as it passes the display) collected by the ball cake information collection assembly, and compare the location of the ball cake with the guide location to which the ball cake is to be passed as displayed by the display.
Wherein, ball cake information acquisition device can be ordinary camera, the image analysis can be carried out to the image of the ball cake of ordinary camera shooting through the display to confirm the position of ball cake in the display, then compare the position of ball cake in the display with the guide position that the ball cake needs to pass through, if the position is the same or within a certain threshold value range at the deviation of position, then explain once effectually hitting to the ball cake, can formulate corresponding game rule respectively according to the difference of recreation. The position of the ball cake information acquisition device is not particularly limited as long as the position of the ball cake information acquisition device can effectively cover the area where the display is located.
In addition, optionally, the ball cake information acquisition component can also be an infrared camera and an infrared grating transmitter which are provided with an infrared filter; the infrared camera is configured to form an included angle of 50-90 degrees with the display and is electrically connected with the processor, so that the area where the display is located can be effectively shot; the infrared grating transmitter is located 5-15 mm above the display, and light beams generated by the infrared grating transmitter are parallel to the display. The infrared camera provided with the infrared filter can effectively filter the influence caused by light for displaying images in the screen, prevent the images displayed in the display from being shot by the images shot by the common camera, and further prevent the images displayed in the display from having images similar to the ball cake to influence the analysis of the position of the ball cake; illustratively, the image of the ball cake moving to the display, which is captured by the infrared camera equipped with the infrared filter in cooperation with the grating transmitter, is shown in fig. 7, and it should be noted that fig. 7 captures images of two displays, where there is a ball cake passing (i.e., a circular bright area in the image) in the left display and no ball cake passing in the right display.
Optionally, the slide way 1 includes a first slide way 101 and an arc-shaped slide way 102, and the first slide way 101 is engaged with the display 5 through the arc-shaped slide way 102. Optionally, the first slide way 101 forms an included angle of 3-6 degrees with the horizontal plane, and preferably, the first slide way 101 forms an included angle of 4 degrees with the horizontal plane; the display 5 and the horizontal plane form an included angle of 40-65 degrees. The design of the arc-shaped slide way can enable the ball cake to smoothly move upwards to pass through the display and smoothly slide to the slide way from the display.
Optionally, the radius of the arc-shaped slideway is determined based on the diameter of the ball cake and the height of the ball cake suspended by the airflow passing through the vent hole, and the radius of the arc-shaped slideway is designed to enable the ball cake to smoothly go up along the slideway and down along the slideway after being hit.
Optionally, the ball cake 12 is a round ball cake, the diameter of the ball cake is 72 mm-80 mm, the suspension height of the ball cake is 2mm, and the radius of the arc-shaped slideway is 350 mm-437 mm. For example, fig. 4 shows a schematic diagram of a ball cake passing through an arc-shaped slideway, the radius of the arc-shaped slideway can be set according to the size and the suspension height of the ball cake, and the ball cake is prevented from sliding upwards from the slideway to the display or downwards from the display to the slideway.
Optionally, the game machine body is further provided with a slide pressing block 2 and a slide fixing metal plate 3 for fixing the slide, and a display metal plate 6 for fixing the display.
Optionally, the processor is electrically connected to a display for receiving the location of the patty determined by the processor and displaying a counterpart of the patty (e.g., a virtual patty) at a location corresponding to the game environment interface displayed by the display.
The application provides a method for determining a ball cake position, which is applied to the game machine and comprises the following steps:
step S901, acquiring a raster image of a ball cake on a display, which is captured by an infrared camera equipped with an infrared filter; the grating image can be obtained by an infrared camera and a grating transmitter which are provided with an infrared filter, wherein the grating transmitter is positioned above the screen, specifically, 5-15 mm above the display, the generated light is parallel to the screen of the display, and when the light is hit on the ball cake, the light can generate diffuse reflection. The infrared filter can filter light sources below 808nm and is arranged in front of a camera lens, namely, the camera can only receive the light sources above the wavelength and filter light brought by a display or a projector.
Step S902, determining image coordinates of four vertex angles of a display in a raster image, and identifying and determining image coordinates of a ball cake in the raster image;
the image coordinates of the four corners of the display in the raster image are determined automatically by an image recognition method, namely the four corners of the display are automatically recognized by the corresponding image recognition method; the raster image shot by the infrared camera as shown in fig. 8 can also be determined manually, wherein the raster image only has two displays, wherein the ball cake exists in the left display, and the ball cake does not exist in the right display. The four corners of the display (i.e. the boxes corresponding to 1, 2, 3, 4) can be determined by human observation, wherein the four corners correspond to image coordinates which can be taken as the coordinates of the corresponding pixels, and the image coordinates are divided into (x1, y1), (x2, y2), (x3, y3), (x4, y4) by taking the coordinates of the four corners of the left display as an example.
Step S903, determining the mapping relation between the image coordinates of the four vertex angles of the display in the raster image and the actual coordinates of the four vertex angles of the display based on a four-point inversion algorithm; illustratively, the actual coordinates of the four corners of the display are (a1, b1), (a2, b2), (a3, b3), (a4, b4), respectively.
Specifically, the transformation formula of the four-point inversion algorithm is:
a=(Ax+By+C)/(Gx+Hy+1)
b=(Dx+Ey+F)/(Gx+Hy+1)
the transformation from (x, y) to (a, b) can be obtained by the above equation. At this point 8 parameters a-H are determined. The modification of the above formula is:
Ax+By+C-axG-ayH=a
Dx+Ey+F-bxG-byH=b
knowing the correspondence of four points to four points, substituting them (the coordinates of the corresponding points) into the above equation yields 8 equations from which 8 unknowns can be solved (optionally using a principal elimination solution of Gaussian columns). Substituting the points into the equation:
Figure BDA0002808939040000101
Figure BDA0002808939040000111
conversion to an augmented matrix:
Figure BDA0002808939040000112
A-H can be solved by a column main elimination method. And finally, substituting the coordinates into the transformation formula A-H to obtain the corrected coordinate points.
a=(Ax+By+C)/(Gx+Hy+1)
b=(Dx+Ey+F)/(Gx+Hy+1)
The formula after solving the parameters A-H is the mapping relation between the image coordinates of the four vertex angles of the display in the raster image and the actual coordinates of the four vertex angles of the display.
Step S904, determining the actual coordinates of the ball cake based on the image coordinates of the ball cake in the identified raster image and the determined mapping relationship.
Specifically, the image coordinates of the ball cake are substituted into the above formula, and the actual coordinates of the ball cake can be obtained.
Optionally, identifying and determining image coordinates of a ball cake in the raster image includes:
determining an image area to be identified based on image coordinates of four vertex angles of a display in a raster image;
identifying and determining pixel points with brightness values exceeding a threshold value in an image area to be identified;
and performing accumulation average calculation based on the determined image coordinate values of all the pixel points with the brightness values exceeding the threshold in the region to be identified, and taking the obtained accumulation average calculation value as the image coordinate of the ball cake.
Optionally, the accumulated average calculation is performed based on the image coordinate values of the pixels whose brightness values exceed the threshold in the determined region to be identified, and the method includes:
screening the pixel points with the brightness values exceeding the threshold value in the determined image area to be identified based on the size of the preset ball cake light spot to obtain the screened pixel points;
the method comprises the following steps of performing accumulation average calculation based on the image coordinate values of all pixel points of which the brightness values exceed the threshold value in the determined region to be identified, and taking the obtained accumulation average calculation value as the image coordinate of the ball cake, wherein the method comprises the following steps:
and performing accumulation average calculation based on the image coordinate values of the screened pixel points, and taking the obtained accumulation average calculation value as the image coordinate of the ball cake.
Optionally, determining image coordinates of four corners of the display in the raster image comprises:
and determining the image coordinates of four top corners of the display by a manual method based on the historical raster image.
Optionally, determining an image area to be identified based on image coordinates of four corners of a display in the raster image includes:
determining a maximum row and column value and a minimum row and column value of traversal based on the image coordinates of the four vertex angles, and determining a traversal pixel range based on the maximum row and column value and the minimum row and column value; the range of the traversal pixel range is determined based on the maximum row and column value and the minimum row and column value, so that the range of image recognition can be reduced, and the data processing amount is reduced.
Identifying and determining pixel points with brightness values exceeding a threshold value in an image area to be identified, comprising:
determining a binary mask of the grating image based on image coordinates of four vertex angles, wherein the mask in a quadrilateral region determined by the four vertex angles is 1, and the mask outside the quadrilateral region is 0;
and traversing the pixels based on the determined traversal pixel range, and traversing the pixels at the left and right positions and the upper and lower positions of a certain pixel by taking the certain pixel as a reference when the mask corresponding to the certain pixel is 1 and the brightness is greater than the threshold value to obtain a plurality of pixels of which the masks are 1 and the brightness is greater than the threshold value.
By adding the mask, when the mask value of the pixel value is zero, the luminance value of the pixel is not detected, and when the mask value is 1, the luminance value of the pixel is detected, so that the data processing amount can be further reduced on the basis of reducing the data processing amount by determining the traversal pixel range, and the detection speed is improved.
Optionally, the method further comprises:
and comparing the actual coordinates of the ball cake with the guide coordinates in the display to determine the game result. Illustratively, as shown in fig. 6, the determined position (i.e., actual coordinates) of the ball patty is compared with the position of the square marked area in the figure, and if the positions are consistent (same or within a predetermined threshold), it is indicated that the patty hits the position, and a valid stroke is completed.
The application provides a method for determining a ball cake position, which comprises the following steps: acquiring a grating image of a ball cake on a display, which is shot by an infrared camera provided with an infrared filter; determining image coordinates of four vertex angles of a display in the raster image, and identifying and determining image coordinates of a ball cake in the raster image; determining the mapping relation between the image coordinates of the four vertex angles of the display in the raster image and the actual coordinates of the four vertex angles of the display based on a four-point inversion algorithm; and determining the actual coordinates of the ball cake based on the image coordinates of the ball cake in the identified raster image and the determined mapping relation. The method comprises the steps of determining the mapping relation between the image coordinates of the four top corners of the display in the raster image and the actual coordinates of the four top corners of the display based on a four-point inversion algorithm, then determining the image coordinates of the ball cake according to the raster image, and determining the actual coordinates of the ball cake by combining the determined mapping relation, so that the induction infrared rays do not need to be installed around the display, the position of the ball cake can be effectively determined on the premise that the movement of the ball cake around the display screen is not hindered, the cost is low, and the requirement on the performance of a host is low.
Example two
The embodiment of the present application provides a ball cake position determining apparatus 20, which includes:
an obtaining module 201, configured to obtain a grating image of a ball cake on a display, which is captured by an infrared camera configured with an infrared filter;
the first determining module 202 is used for determining image coordinates of four vertex angles of a display in a raster image and identifying and determining image coordinates of a ball cake in the raster image;
the second determining module 203 is configured to determine a mapping relationship between image coordinates of four vertex angles of the display in the raster image and actual coordinates of the four vertex angles of the display based on a four-point inversion algorithm;
and a third determining module 204, configured to determine actual coordinates of the ball cake based on the image coordinates and the determined mapping relationship for identifying the ball cake in the determined raster image.
Optionally, the first determining module includes:
the first determining unit is used for determining an image area to be identified based on image coordinates of four vertex angles of a display in a raster image;
the identification determining unit is used for identifying and determining pixel points with brightness values exceeding a threshold value in an image area to be identified;
and the unit is used for performing accumulation average calculation based on the image coordinate values of all the pixel points with the brightness values exceeding the threshold value in the determined region to be identified, and taking the obtained accumulation average calculation value as the image coordinate of the ball cake.
Optionally, the first determining module further includes:
the screening unit is used for screening the pixel points with the brightness values exceeding the threshold value in the determined image area to be identified based on the size of the preset ball cake light spot to obtain the screened pixel points;
and as a unit, specifically, the method is further configured to perform accumulation average calculation based on the image coordinate values of the screened pixel points, and use the obtained accumulation average calculation value as the image coordinate of the ball cake.
Optionally, determining image coordinates of four corners of the display in the raster image comprises:
image coordinates of four corners of the display are determined by manual means based on the historical raster image.
Optionally, the first determining unit is further specifically configured to determine a maximum row and column value and a minimum row and column value of the traversal based on the image coordinates of the four vertex angles, and determine a traversal pixel range based on the maximum row and column value and the minimum row and column value;
the identification determining unit is specifically further configured to determine a binary mask of the grating image based on image coordinates of the four vertex angles, where the mask in a quadrilateral region determined by the four vertex angles is 1, and the mask outside the quadrilateral region is 0; and traversing the pixels based on the determined traversal pixel range, and traversing the pixels at the left and right positions and the upper and lower positions of a certain pixel by taking the certain pixel as a reference when the mask corresponding to the certain pixel is 1 and the brightness is greater than the threshold value to obtain a plurality of pixels of which the masks are 1 and the brightness is greater than the threshold value.
Optionally, the apparatus further comprises:
and the fourth determining module is used for comparing the actual coordinates of the ball cake with the guide coordinates in the display to determine the game result.
EXAMPLE III
An embodiment of the present application provides an electronic device, as shown in fig. 11, an electronic device 40 shown in fig. 11 includes: a processor 401 and a memory 403. Wherein the processor 401 is coupled to the memory 403, such as via a bus 402. Further, the electronic device 40 may also include a transceiver 404. It should be noted that the transceiver 404 is not limited to one in practical applications, and the structure of the electronic device 40 is not limited to the embodiment of the present application. The processor 401 is applied in the embodiment of the present application, and is used to implement the functions of the modules shown in fig. 10. The transceiver 404 includes a receiver and a transmitter.
The processor 401 may be a CPU, general purpose processor, DSP, ASIC, FPGA or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 401 may also be a combination of computing functions, e.g., comprising one or more microprocessors, a combination of a DSP and a microprocessor, or the like.
Bus 402 may include a path that transfers information between the above components. The bus 402 may be a PCI bus or an EISA bus, etc. The bus 402 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 11, but this is not intended to represent only one bus or type of bus.
The memory 403 may be, but is not limited to, a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, an EEPROM, a CD-ROM or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
The memory 403 is used for storing application program codes for executing the scheme of the application, and the execution is controlled by the processor 401. The processor 401 is configured to execute application program code stored in the memory 403 to implement the functions of the apparatus provided by the embodiment shown in fig. 10.
The embodiment of the present application provides an electronic device suitable for the above method embodiment, and specific implementation manners and technical effects are not described herein again.
Example four
An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the method for determining a position of a ball cake shown in the above embodiment.
The embodiment of the present application provides a computer-readable storage medium suitable for the above method embodiment, and specific implementation manners and technical effects are not described herein again.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present application, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present application, and these modifications and decorations should also be regarded as the protection scope of the present application.

Claims (10)

1. A method for determining a location of a ball cake, comprising:
acquiring a grating image of a ball cake on a display, which is shot by an infrared camera provided with an infrared filter;
determining image coordinates of four vertex angles of a display in the raster image, and identifying and determining image coordinates of a ball cake in the raster image;
determining the mapping relation between the image coordinates of the four vertex angles of the display in the grating image and the actual coordinates of the four vertex angles of the display based on a four-point inversion algorithm;
and determining the actual coordinates of the ball cake based on the image coordinates of the ball cake in the identified raster image and the determined mapping relation.
2. The method of claim 1, wherein the identifying determines image coordinates of a ball pie in the raster image, comprising:
determining an image area to be identified based on image coordinates of four vertex angles of a display in the raster image;
identifying and determining pixel points of which the brightness values exceed a threshold value in the image area to be identified;
and performing accumulation average calculation based on the determined image coordinate values of all the pixel points with the brightness values exceeding the threshold value in the area to be identified, and taking the obtained accumulation average calculation value as the image coordinate of the ball cake.
3. The method according to claim 2, wherein the performing the cumulative average calculation based on the determined image coordinate values of the pixels in the region to be recognized, whose brightness values exceed the threshold value, comprises:
screening the determined pixel points with the brightness values exceeding the threshold value in the image area to be identified based on the size of the preset ball cake light spot to obtain the screened pixel points;
the accumulating average calculation is performed based on the determined image coordinate values of the pixel points of which the brightness values exceed the threshold value in the area to be identified, and the obtained accumulating average calculation value is used as the image coordinate of the ball cake, and the method comprises the following steps:
and performing accumulation average calculation based on the image coordinate values of the screened pixel points, and taking the obtained accumulation average calculation value as the image coordinate of the ball cake.
4. The method of claim 1, wherein determining image coordinates of four corners of a display in the raster image comprises:
and determining the image coordinates of four top corners of the display by a manual method based on the historical raster image.
5. The method of claim 2, wherein the determining the image area to be identified based on the image coordinates of the four corners of the display in the raster image comprises:
determining a maximum row and column value and a minimum row and column value of traversal based on the image coordinates of the four vertex angles, and determining a traversal pixel range based on the maximum row and column value and the minimum row and column value;
the identifying and determining the pixel points of which the brightness values exceed the threshold value in the image area to be identified comprises the following steps:
determining a binary mask of the grating image based on the image coordinates of the four vertex angles, wherein the mask in a quadrilateral region determined by the four vertex angles is 1, and the mask outside the quadrilateral region is 0;
and traversing pixels based on the determined traversal pixel range, and traversing pixels at the left and right positions and the upper and lower positions of a certain pixel by taking the certain pixel as a reference when the mask corresponding to the certain pixel is 1 and the brightness is greater than the threshold value to obtain a plurality of pixels of which the masks are 1 and the brightness is greater than the threshold value.
6. The method according to any one of claims 1-5, further comprising:
and comparing the actual coordinates of the ball cake with the guide coordinates in the display to determine a game result.
7. The method according to claim 6, wherein the method is applied to a game machine, and a game machine body is provided with: the device comprises a slideway, a display, a processor and a ball cake information acquisition device; wherein the content of the first and second substances,
the slideway is connected with the display, and the slideway and the display respectively form a certain angle with the horizontal plane; the surface of the slideway is provided with a plurality of vent holes, and the vent holes are used for enabling air flow generated by the blower to pass so as to reduce the friction force between the ball cake and the slideway or enable the ball cake to suspend;
the display is configured to display a guide position to be passed by the ball cake;
the processor is configured to determine the position of the ball cake based on ball cake information acquired by the ball cake information acquisition assembly, and compare the position of the ball cake with a guide position through which the ball cake displayed by the display needs to pass, and the ball cake information acquisition device comprises an infrared camera provided with an infrared filter and an infrared grating transmitter; the infrared camera is configured to be 50 ~ 90 degrees contained angles and is connected with the treater electricity with the display, the echelette grating transmitter is located 5 ~ 15mm above the display.
8. A ball cake position determining apparatus, comprising:
the acquisition module is used for acquiring a grating image of the ball cake on the display, which is shot by an infrared camera provided with an infrared filter;
the first determining module is used for determining image coordinates of four vertex angles of a display in the raster image and identifying and determining image coordinates of a ball cake in the raster image;
the second determination module is used for determining the mapping relation between the image coordinates of the four vertex angles of the display in the raster image and the actual coordinates of the four vertex angles of the display based on a four-point inversion algorithm;
and the third determining module is used for determining the actual coordinates of the ball cake based on the image coordinates of the ball cake in the identified raster image and the determined mapping relation.
9. An electronic device, comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to: -performing a ball-cake position determination method according to any of claims 1 to 7.
10. A computer-readable storage medium for storing computer instructions which, when run on a computer, cause the computer to perform the method of determining a position of a ball patty according to any one of claims 1 to 7.
CN202011379277.1A 2020-12-01 2020-12-01 Method and device for determining ball cake position, electronic equipment and readable storage medium Pending CN112581523A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011379277.1A CN112581523A (en) 2020-12-01 2020-12-01 Method and device for determining ball cake position, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011379277.1A CN112581523A (en) 2020-12-01 2020-12-01 Method and device for determining ball cake position, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN112581523A true CN112581523A (en) 2021-03-30

Family

ID=75126819

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011379277.1A Pending CN112581523A (en) 2020-12-01 2020-12-01 Method and device for determining ball cake position, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN112581523A (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201298220Y (en) * 2008-11-26 2009-08-26 陈伟山 Infrared reflection multipoint touching device based on LCD liquid crystal display screen
CN102164274A (en) * 2011-04-26 2011-08-24 石黎 Vehicle-mounted virtual panoramic system with variable field of view
CN102265303A (en) * 2008-11-26 2011-11-30 集特科公司 image processing method for curvature correction
CN202795304U (en) * 2012-07-04 2013-03-13 福州锐达数码科技有限公司 Front image multi-touch device based on infrared lasers
CN103076928A (en) * 2012-12-28 2013-05-01 上海易视计算机科技有限公司 Method and device for identifying light spots of electronic whiteboard based on optical film combined image sensor
CN103905865A (en) * 2013-05-16 2014-07-02 青岛海信电器股份有限公司 Touchable intelligent television and method for achieving touching
CN105354796A (en) * 2015-10-12 2016-02-24 北京鑫洋泉电子科技有限公司 Image processing method and system used for driving assistance
CN107392848A (en) * 2017-06-14 2017-11-24 江西科技师范大学 Panoramic image display method and device
CN110404246A (en) * 2019-08-13 2019-11-05 武汉需要智能技术有限公司 Gas hangs shuffle ball device on a kind of table
CN111724444A (en) * 2020-06-16 2020-09-29 中国联合网络通信集团有限公司 Method and device for determining grabbing point of target object and grabbing system
CN111775154A (en) * 2020-07-20 2020-10-16 广东拓斯达科技股份有限公司 Robot vision system

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201298220Y (en) * 2008-11-26 2009-08-26 陈伟山 Infrared reflection multipoint touching device based on LCD liquid crystal display screen
CN102265303A (en) * 2008-11-26 2011-11-30 集特科公司 image processing method for curvature correction
CN102164274A (en) * 2011-04-26 2011-08-24 石黎 Vehicle-mounted virtual panoramic system with variable field of view
CN202795304U (en) * 2012-07-04 2013-03-13 福州锐达数码科技有限公司 Front image multi-touch device based on infrared lasers
CN103076928A (en) * 2012-12-28 2013-05-01 上海易视计算机科技有限公司 Method and device for identifying light spots of electronic whiteboard based on optical film combined image sensor
CN103905865A (en) * 2013-05-16 2014-07-02 青岛海信电器股份有限公司 Touchable intelligent television and method for achieving touching
CN105354796A (en) * 2015-10-12 2016-02-24 北京鑫洋泉电子科技有限公司 Image processing method and system used for driving assistance
CN107392848A (en) * 2017-06-14 2017-11-24 江西科技师范大学 Panoramic image display method and device
CN110404246A (en) * 2019-08-13 2019-11-05 武汉需要智能技术有限公司 Gas hangs shuffle ball device on a kind of table
CN111724444A (en) * 2020-06-16 2020-09-29 中国联合网络通信集团有限公司 Method and device for determining grabbing point of target object and grabbing system
CN111775154A (en) * 2020-07-20 2020-10-16 广东拓斯达科技股份有限公司 Robot vision system

Similar Documents

Publication Publication Date Title
JP6259928B2 (en) Lane data processing method, apparatus, storage medium and equipment
CN108009531B (en) Multi-strategy anti-fraud face recognition method
CN108257146B (en) Motion trail display method and device
CN109145708B (en) Pedestrian flow statistical method based on RGB and D information fusion
WO2017054314A1 (en) Building height calculation method and apparatus, and storage medium
CN107543530B (en) Method, system, and non-transitory computer-readable recording medium for measuring rotation of ball
US20180182088A1 (en) Automatic Detection, Counting, and Measurement of Lumber Boards Using a Handheld Device
WO2016148247A1 (en) Device for measuring rotation of spherical body, measurement method, and program
CN109086724A (en) A kind of method for detecting human face and storage medium of acceleration
CN106127205A (en) A kind of recognition methods of the digital instrument image being applicable to indoor track machine people
CN111228821B (en) Method, device and equipment for intelligently detecting wall-penetrating plug-in and storage medium thereof
JP6317725B2 (en) System and method for determining clutter in acquired images
TW202009871A (en) Image tracking method
EP2410467A1 (en) System and method for identifying image locations showing the same person in different images
CN111243003A (en) Vehicle-mounted binocular camera and method and device for detecting road height limiting rod
TW201432624A (en) Method and apparatus for sensing moving ball, and image processing method of ball image for calculation of spin of moving ball
JP5367244B2 (en) Target detection apparatus and target detection method
CN111723656A (en) Smoke detection method and device based on YOLO v3 and self-optimization
JP2011165170A (en) Object detection device and program
CN114067172A (en) Simulation image generation method, simulation image generation device and electronic equipment
CN114299137A (en) Laser spot center positioning method and test system
CN103949054A (en) Infrared light gun positioning method and system
CN107194954B (en) Player tracking method and device of multi-view video
JP2022070648A (en) Information processing device and information processing method
CN112581523A (en) Method and device for determining ball cake position, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20210330

RJ01 Rejection of invention patent application after publication