CN108090486B - Image processing method and device in billiard game - Google Patents

Image processing method and device in billiard game Download PDF

Info

Publication number
CN108090486B
CN108090486B CN201711464888.4A CN201711464888A CN108090486B CN 108090486 B CN108090486 B CN 108090486B CN 201711464888 A CN201711464888 A CN 201711464888A CN 108090486 B CN108090486 B CN 108090486B
Authority
CN
China
Prior art keywords
billiards
position information
elliptical
billiard
area
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.)
Active
Application number
CN201711464888.4A
Other languages
Chinese (zh)
Other versions
CN108090486A (en
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.)
Shenzhen Supervisions Technology Co ltd
Original Assignee
Shenzhen Supervisions 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 Shenzhen Supervisions Technology Co ltd filed Critical Shenzhen Supervisions Technology Co ltd
Priority to CN201711464888.4A priority Critical patent/CN108090486B/en
Publication of CN108090486A publication Critical patent/CN108090486A/en
Priority to PCT/CN2018/115386 priority patent/WO2019128504A1/en
Application granted granted Critical
Publication of CN108090486B publication Critical patent/CN108090486B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/24Aligning, centring, orientation detection or correction of the image
    • G06V10/245Aligning, centring, orientation detection or correction of the image by locating a pattern; Special marks for positioning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/07Target detection

Abstract

The invention is suitable for the field of machine vision recognition and provides an image processing method and device in a billiard game and terminal equipment. The method is applied to a system comprising a shooting device and comprises the following steps: the method comprises the steps that video information including a table top of a billiard table and billiards on the table top is collected through a shooting device; analyzing the video information based on the constructed projection model comprising the shooting device and the billiard position to obtain the position information of the billiards; the shape of a frustum in an image contained in the video information is an ellipse. The billiards in the image of the video information are elliptical, and the position information of the billiards in the image of the video information is obtained based on the projection model, so that the accuracy of the position information is improved. In addition, the embodiment of the invention has simple implementation process, and has stronger practicability and usability.

Description

Image processing method and device in billiard game
Technical Field
The invention belongs to the technical field of machine vision recognition, and particularly relates to an image processing method and device in a billiard game.
Background
Machine vision has recently begun to be applied to the electronic scales of billiard games. The existing implementation is as follows: the video of the billiard game is collected through the shooting device, then the position information of the billiards on the billiard table surface is obtained through the established model, and then the electronic scoring is realized through the follow-up operation. Therefore, obtaining the position information of the billiards on the billiard table surface is a key step. However, in the existing model, the billiards are regarded as a circle, and then the billiards are positioned to obtain the position information of the billiards. Furthermore, since the height of the imaging device from the table surface of the billiard table is limited, the shape of the ball (unless located at a position directly opposite to the center) viewed by the imaging device is not circular, and thus, considering the billiards as circular inevitably causes a large error or error in the acquired billiard position information.
Therefore, it is necessary to provide a solution to the above problems.
Disclosure of Invention
In view of this, embodiments of the present invention provide an image processing method and an image processing device in a billiard game, so as to solve the problems of the image processing method in the billiard game in the prior art.
The first aspect of the embodiment of the invention provides an image processing method in a billiards game, which is applied to a system comprising a shooting device, and the image processing method comprises the following steps:
the method comprises the steps that video information including a table top of a billiard table and billiards on the table top is collected through a shooting device;
analyzing the video information based on the constructed projection model comprising the shooting device and the billiard position to obtain the position information of the billiards; the shape of a frustum in an image contained in the video information is an ellipse.
Optionally, the video information includes distribution information of the elliptical areas corresponding to the billiards on the table top;
analyzing the video information based on the constructed projection model comprising the shooting device and the billiard position, and obtaining the position information of the billiard comprises the following steps:
detecting an elliptical region conforming to the projection model from the distribution information;
and calculating the position information of the billiards to which the elliptical area belongs based on the position information of the elliptical area conforming to the projection model according to the space geometric position relationship of the photographing device, the billiards and the elliptical area corresponding to the billiards in the distribution information in the projection model.
Optionally, analyzing the video information based on a constructed projection model including the shooting device and the position of the billiards, and obtaining the position information of the billiards includes:
dividing the video information into a plurality of frames;
based on the projection model, segmenting an elliptical region and a table top region corresponding to the billiards in each of the plurality of frames;
dividing the set of elliptical regions into a plurality of connected regions;
and acquiring the position information of the communication areas, and taking the position information of each elliptical area in the plurality of communication areas as the position information of the billiards corresponding to each elliptical area.
Optionally, the obtaining the position information of the connected region, and taking the position information of each elliptical region in the plurality of connected regions as the position information of the billiards corresponding to each elliptical region respectively includes:
dividing the connected area into independent areas, acquiring the position information of each independent area, and taking the position information of each independent area as the position information of the billiards corresponding to the independent area.
Optionally, the obtaining the position information of the connected region, and taking the position information of each elliptical region in the plurality of connected regions as the position information of the billiards corresponding to each elliptical region respectively includes:
acquiring the area of a communication area;
matching the area with a preset threshold value to obtain a matching result;
extracting a plurality of non-overlapping circles from the connected region based on the matching result, wherein each circle corresponds to a circumscribed ellipse which accords with the projection model and is circumscribed to the circle, and the union of the occupied regions of the circumscribed ellipses is the connected region.
A second aspect of an embodiment of the present invention provides an image processing apparatus in a billiards game, including:
the acquisition module is used for acquiring video information including the table top of the billiard table and billiards on the table top through the shooting device;
the analysis module is used for analyzing the video information based on the constructed projection model comprising the shooting device and the billiard position to obtain the billiard position information; the shape of a frustum in an image contained in the video information is an ellipse.
Optionally, the video information includes distribution information of the elliptical areas corresponding to the billiards on the table top;
the analysis module includes:
a detection unit configured to detect an elliptical region conforming to the projection model from the distribution information;
and the calculating unit is used for calculating and obtaining the position information of the billiards to which the elliptical area belongs based on the position information of the elliptical area conforming to the projection model according to the space geometric position relation of the photographing device, the billiards and the elliptical area corresponding to the billiards in the distribution information in the projection model.
Optionally, the analysis module comprises:
a first dividing unit for dividing the video information into a plurality of frames;
a dividing unit, configured to divide an elliptical region and a table top region corresponding to a billiard ball in each of the plurality of frames based on the projection model;
a second dividing unit configured to divide the set of elliptical regions into a plurality of connected regions;
and the acquisition unit is used for acquiring the position information of the communication areas and respectively taking the position information of each elliptical area in the plurality of communication areas as the position information of the billiards corresponding to each elliptical area.
Optionally, the obtaining unit includes:
and the dividing subunit is used for dividing the connected area into independent areas, acquiring the position information of each independent area, and taking the position information of each independent area as the position information of the billiards corresponding to the independent area.
Optionally, the obtaining unit includes:
the acquisition subunit is used for acquiring the area size of the communication area;
the matching subunit is used for matching the area size with a preset threshold value to obtain a matching result;
the extracting subunit is used for extracting a plurality of non-overlapping circles from the connected region based on the matching result, each circle corresponds to a circumscribed ellipse which accords with the projection model and is circumscribed to the circle, and the union set of the occupied regions of the circumscribed ellipses is the connected region; and converting the position information of the circles which do not overlap with each other into the position information of the billiards.
A third aspect of embodiments of the present invention provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and is characterized in that the processor implements the steps of the method in the first aspect when executing the computer program.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium, which stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method of the first aspect.
In the embodiment of the invention, video information including the table top of the billiard table and billiards on the table top is collected through a shooting device; analyzing the video information based on the constructed projection model comprising the shooting device and the billiard position to obtain the position information of the billiard, wherein the shape of the billiard in the image contained in the video information is an ellipse. The billiards in the image of the video information are elliptical in shape, and the position information of the billiards in the image of the video information is obtained based on the projection model, so that the accuracy of the position information is improved. In addition, the embodiment of the invention has simple implementation process, and has stronger practicability and usability.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flow chart illustrating an implementation of an image processing method in a billiard game according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a projection model of an image processing method in a billiards game provided by an embodiment of the present invention;
fig. 3 is a flowchart illustrating an implementation of step S102 according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of another specific implementation of step S102 according to an embodiment of the present invention;
FIG. 5-A is a schematic view of a connected region formed by overlapping three elliptical regions in accordance with an embodiment of the present invention;
FIG. 5-B is a schematic view of a connected region formed by an elliptical region in accordance with an embodiment of the present invention;
FIG. 5-C is a diagram illustrating the extraction result of a connected region formed by overlapping three elliptical regions according to an embodiment of the present invention;
FIG. 5-D is a schematic diagram of an intermediate process of extraction of a connected region formed by overlapping three elliptical regions according to an embodiment of the present invention;
fig. 6 is a schematic flowchart illustrating an implementation of step S304 in the embodiment of the present invention;
fig. 7 is a block diagram of a terminal device according to a fourth embodiment of the present invention;
fig. 8 is a schematic diagram of an image processing apparatus in a billiards game according to a fifth embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when … …" or "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
In order to explain the technical means of the present invention, the following description will be given by way of specific examples. It should be noted that the following embodiments are applied to a system including a camera.
Example one
Fig. 1 is a schematic flow chart illustrating an implementation of an image processing method in a billiard game according to an embodiment of the present invention. As shown in fig. 1, the image processing method in the billiard game may specifically include the following steps:
step S101: the video information of the billiard table surface and the billiards on the billiard table surface is collected through the shooting device.
The shooting device can be a camera, the camera generally refers to equipment capable of collecting videos or image sequences, and can be an industrial camera, a network camera, a monitoring camera, a camera equipped in a computer and the like.
Step S102: analyzing the video information based on the constructed projection model comprising the shooting device and the billiard position to obtain the position information of the billiards; the shape of a frustum in an image contained in the video information is an ellipse.
The projection model is shown in fig. 2, and a cone with the optical center of the camera as the vertex and tangent to the ball is constructed, and the section of the cone, which is cut by the plane of the table (namely the projection of the billiard ball on the plane), is an ellipse, which is exactly the shape of the ball in the image. It is a clear prerequisite that the physical dimensions of the billiard ball are fixed and that the position of the billiard ball and the vertical projection of the centre of the ball on the playing surface are mutually determined, since normally the ball is always tangent to the plane of the playing surface. At this time, when the position of the billiard ball is known, the ellipse position (i.e., the ellipse center position) and the ellipse shape (including the major axis length, the minor axis length, and the major axis direction) can be calculated; conversely, with the known position of the ellipse, the position information and the ellipse shape of the cue ball can be derived. The position and length may be based on table physical coordinates, image coordinates, or normalized coordinates, etc. It should be noted that fig. 2 shows an ideal case where the main optical axis of the camera is perpendicular to the table top, and in fact, even if the main optical axis is not perpendicular to the table top, the ball still has an ellipse in the image, and the above parameters can still be derived from each other.
As mentioned previously, knowing the location of the ellipse (i.e., the ellipse center point location), the location of the table ball and the ellipse shape (including major axis length, minor axis length, major axis direction) can be derived. One embodiment is:
a coordinate system is established by taking the center of the table top as an original point, the table top is a plane with the Z being 0, the long side direction of the table top is the X-axis direction, and the wide side direction of the table top is the Y-axis direction. And if the optical center of the camera is positioned right above the center of the table top and is away from the table top by h, the coordinates are (0,0, h). Assuming that the position of the table ball is (x, y), its radius is known as r, and the default placement on the table is given by the center coordinates of the table ball as (x, y, r). The vertex is (0,0, h), a cone tangent to a sphere with the sphere center (x, y, r) and the radius r is made to intersect with a plane where Z is 0, and the obtained ellipse is a projection ellipse, and the center is (x ', y'), the length of the long axis is a, the length of the short axis is b, and the direction of the long axis is theta.
The forward process of billiard projection is as follows: knowing h, x, y, r, find x ', y', a, b, θ. This is easily done by building conic equations and solving the joint equations of the conic and the plane. In turn, the actual requirement is that h, x ', y', r, x, y, a, b, θ are known. This requires x, y to be quantified, and also a cone equation is established and a joint equation of cone and plane is solved, which can be used to solve x, y in reverse. The above is one implementation way of comparative specifications, and actually, there are many alternative ways, not to list one by one.
As a preferred embodiment of this embodiment, the video information includes distribution information of the elliptical areas corresponding to the billiards on the table top;
as shown in fig. 3, analyzing the video information based on the constructed projection model including the shooting device and the position of the billiards to obtain the position information of the billiards includes the following steps:
step S201: an elliptical region conforming to the projection model is detected from the distribution information.
The distribution information may be a distribution condition of the elliptical area on the table top, and may be: there is no overlapping area between all the elliptical areas, i.e. all the elliptical areas are independent; it can also be: at least one elliptical area is independent, and two or more elliptical areas are overlapped; the method can also be as follows: all elliptical areas are not independent, i.e. for any one ellipse, at least overlap with its neighboring elliptical areas. Wherein the overlapping regions generally indicate partial overlap. The ellipse region conforming to the projection model may be detected from the distribution information, or the ellipse contour conforming to the projection model may be detected, for example, by directly applying Hough Transform (Hough Transform) or random sample consensus (RANSAC) method, and by directly detecting all ellipses conforming to the (x ', y', a, b, θ) constraint from the distribution information.
It should be noted that the elliptical area is solid (area surrounded by curve), the elliptical outline is hollow (closed curve), and if referring to "ellipse" includes both the elliptical area and the elliptical outline, it can be understood according to the context. It can be understood that the elliptical area includes an elliptical contour of the elliptical area, so the implementation method of the detection may also be to detect the elliptical area first, and then further detect the elliptical contour conforming to the projection model; alternatively, the elliptical contour of the elliptical region is detected first, and then the elliptical region conforming to the projection model is further detected, which does not limit the protection scope of the embodiment of the present invention.
Step S202: and calculating the position information of the billiards to which the elliptical area belongs based on the position information of the elliptical area conforming to the projection model according to the space geometric position relationship of the photographing device, the billiards and the elliptical area corresponding to the billiards in the distribution information in the projection model.
As another preferred embodiment of this embodiment, as shown in fig. 4, the step of analyzing the video information based on the constructed projection model including the shooting device and the position of the billiards to obtain the position information of the billiards includes the following steps:
step S301: the video information is divided into a plurality of frames.
The frame is a single image picture of the minimum unit in the video information, one frame is a still picture, and continuous frames form animation. The video information is divided into frames, i.e. into pictures, each picture constituting an image.
Step S302: based on the projection model, dividing an elliptical region and a table top region corresponding to the billiards in each of the plurality of frames.
It can be understood that the elliptical area corresponding to the billiards is projected on the plane where the table top is located, wherein, since the table top is basically kept unchanged, the elliptical area corresponding to the billiards and the table top area in each of the plurality of frames can be segmented based on the projection model to obtain all the elliptical areas.
Step S303: the set of elliptical regions is divided into a plurality of connected regions.
The region shown in fig. 5-a is a connected region formed by overlapping three elliptical regions. It will be appreciated that the region shown in fig. 5-B is a connected region formed by an elliptical region.
Step S304: and acquiring the position information of the communication areas, and taking the position information of each elliptical area in the plurality of communication areas as the position information of the billiards corresponding to each elliptical area.
Step S304 includes two cases:
in the first case, the overlapped areas in the connected areas need to be divided into independent areas;
in the second case, the blurring process can be performed without dividing the overlapped region in the connected region.
Wherein, the first case can be realized as follows. Acquiring the position information of the connected area, and taking the position information of each elliptical area in the plurality of connected areas as the position information of the billiards corresponding to each elliptical area respectively, wherein the position information of each elliptical area comprises the following steps:
dividing the connected area into independent areas, acquiring the position information of each independent area, and taking the position information of each independent area as the position information of the billiards corresponding to the independent area.
The elliptical area is divided into non-overlapping areas, and the result of extracting the connected areas shown in fig. 5-a is shown in fig. 5-C, for example. For example, the following implementations: the image in the video information is converted into a gray scale image, and the image is binarized by a fixed threshold (such as 200) or an adaptive threshold (if the table top is known to have n balls by using the tracking result in the past, the gray scale value ranked at the 20n th bit from the high to the low of all pixel gray scales is used as a threshold), so that the image is divided into an elliptical area and a table top area, wherein each connected area of the elliptical area corresponds to one billiard ball. The feature that the billiards of any color have the highlight region at the center position is utilized, and the highlight regions of the adjacent billiards do not overlap.
In the second case, based on the above-mentioned connected region, there may be a connected region formed by overlapping two elliptical regions, or a connected region formed by overlapping three elliptical regions, or even a connected region formed by overlapping three or more elliptical regions. In other words, each connected area is an oval area of a single billiard ball or is formed by bonding a plurality of adjacent oval areas. The shape parameter of an elliptical region is related to the position of the ellipse, but is approximately considered constant within a connected region. And establishing a projection model by taking the central position of the connected region as an elliptical position, pixelating the obtained elliptical shape, performing morphological corrosion on the connected region by taking the pixelation model as a template to obtain a plurality of small connected regions, wherein each small connected region corresponds to one billiard ball, and the position information of each small connected region is taken as the position information of the corresponding billiard ball. It should be noted that, in this embodiment, it is not necessary to divide and then perform processing on the connected regions where the elliptical regions overlap, and thus the processing efficiency is high.
As another example of the second scenario, further, as shown in fig. 6, acquiring the position information of the connected region, and regarding the position information of each elliptical region in the plurality of connected regions as the position information of the billiard ball corresponding to the each elliptical region may include:
step S401: and acquiring the area size of the communication area.
Step S402: and matching the area with a preset threshold value to obtain a matching result.
Step S403: extracting a plurality of non-overlapping circles from the connected region based on the matching result, wherein each circle corresponds to a circumscribed ellipse which accords with the projection model and is circumscribed to the circle, and the union of occupied regions of the circumscribed ellipses is the connected region; and converting the position information of the circles which do not overlap with each other into the position information of the billiards.
For steps S402 and S403, exemplarily, establishing an ellipse model with the center position of the connected region as the ellipse position, i.e. determining the shape parameter, calculating the number m of ellipses in the connected region, and then calculating the center positions of m ellipses in the connected region, thereby determining m ellipses of the shape parameter, and it is required that the union set of the m ellipse coverage regions is exactly the whole connected region, and inscribed circles of the m ellipses do not overlap each other. If the number m and the m central positions cannot be calculated, all the possible central positions can be enumerated, and then the matching result meeting the requirement is selected from the central positions.
Illustratively, the result of extracting the connected component shown in FIG. 5-A is shown in FIG. 5-D.
In the preferred embodiment, the connected region with the overlapped region is divided into a plurality of circles which are not overlapped with each other, and the position information of each independent region is acquired, that is, coordinates obtained by performing coordinate conversion on the center position of the inscribed circle are used as the coordinates of the vertical projection point of the billiard ball. It should be noted that in this embodiment, the relative position before the billiards is focused rather than the absolute position of each billiard, so that the accuracy of the billiard position information is not affected by the approximation processing, the processing efficiency is improved, and the algorithm is optimized.
In the embodiment of the invention, video information including the table top of the billiard table and billiards on the table top is collected through a shooting device; analyzing the video information based on the constructed projection model comprising the shooting device and the billiard position to obtain the position information of the billiard, wherein the shape of the billiard in the image contained in the video information is an ellipse. The billiards in the image of the video information are elliptical in shape, and the position information of the billiards in the image of the video information is obtained based on the projection model, so that the accuracy of the position information is improved. In addition, the embodiment of the invention has simple implementation process, and has stronger practicability and usability.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Example two
Referring to fig. 7, a block diagram of an image processing apparatus for a billiards game according to a second embodiment of the present invention is shown. The image processing device 70 in a billiard game includes: an acquisition module 71 and an analysis module 72. The specific functions of each module are as follows:
the acquisition module 71 is used for acquiring video information including the table top of the billiard table and billiards on the table top through the shooting device;
the analysis module 72 is configured to analyze the video information based on the constructed projection model including the shooting device and the position of the billiards, so as to obtain position information of the billiards; the shape of a frustum in an image contained in the video information is an ellipse.
Optionally, the video information includes distribution information of the elliptical areas corresponding to the billiards on the table top;
the analysis module 72 includes:
a detection unit configured to detect an elliptical region conforming to the projection model from the distribution information;
and the calculating unit is used for calculating and obtaining the position information of the billiards to which the elliptical area belongs based on the position information of the elliptical area conforming to the projection model according to the space geometric position relation of the photographing device, the billiards and the elliptical area corresponding to the billiards in the distribution information in the projection model.
Optionally, the analysis module 72 comprises:
a first dividing unit for dividing the video information into a plurality of frames;
a dividing unit, configured to divide an elliptical region and a table top region corresponding to a billiard ball in each of the plurality of frames based on the projection model;
a second dividing unit configured to divide the set of elliptical regions into a plurality of connected regions;
and the acquisition unit is used for acquiring the position information of the communication areas and respectively taking the position information of each elliptical area in the plurality of communication areas as the position information of the billiards corresponding to each elliptical area.
Optionally, the obtaining unit includes:
and the dividing subunit is used for dividing the connected area into independent areas, acquiring the position information of each independent area, and taking the position information of each independent area as the position information of the billiards corresponding to the independent area.
Optionally, the dividing the sub-unit includes:
the acquisition subunit is used for acquiring the area size of the communication area;
the matching subunit is used for matching the area size with a preset threshold value to obtain a matching result;
the extracting subunit is used for extracting a plurality of non-overlapping circles from the connected region based on the matching result, each circle corresponds to a circumscribed ellipse which accords with the projection model and is circumscribed to the circle, and the union set of the occupied regions of the circumscribed ellipses is the connected region; and converting the position information of the circles which do not overlap with each other into the position information of the billiards.
In the embodiment of the invention, video information including the table top of the billiard table and billiards on the table top is collected through a shooting device; analyzing the video information based on the constructed projection model comprising the shooting device and the billiard position to obtain the position information of the billiard, wherein the shape of the billiard in the image contained in the video information is an ellipse. The billiards in the image of the video information are elliptical in shape, and the position information of the billiards in the image of the video information is obtained based on the projection model, so that the accuracy of the position information is improved. In addition, the embodiment of the invention has simple implementation process, and has stronger practicability and usability.
EXAMPLE III
Fig. 8 is a schematic diagram of a terminal device according to a third embodiment of the present invention. As shown in fig. 8, the terminal device 8 of this embodiment includes: a processor 80, a memory 81 and a computer program 82 stored in said memory 81 and executable on said processor 80, such as a program of an image processing method in a billiards game. The processor 80, when executing the computer program 82, implements the steps in the above-described embodiments of the image processing method in each billiard game, such as steps S101 to S102 shown in fig. 1. Alternatively, the processor 80, when executing the computer program 82, implements the functions of the modules in the device embodiments, such as the functions of the modules 81 to 82 shown in fig. 8.
Illustratively, the computer program 82 may be partitioned into one or more modules/units that are stored in the memory 81 and executed by the processor 80 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 82 in the terminal device 8. For example, the computer program 82 may be divided into an acquisition module and an analysis module, and the specific functions of each module are as follows:
the acquisition module is used for acquiring video information including the table top of the billiard table and billiards on the table top through the shooting device;
the analysis module is used for analyzing the video information based on the constructed projection model comprising the shooting device and the billiard position to obtain the billiard position information; the shape of a frustum in an image contained in the video information is an ellipse.
The terminal device 8 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 80, a memory 81. Those skilled in the art will appreciate that fig. 8 is merely an example of a terminal device and is not limiting and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the terminal device may also include input output devices, network access devices, buses, etc.
The Processor 80 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 81 may be an internal storage unit of the terminal device 8, such as a hard disk or a memory of the terminal device 8. The memory 81 may also be an external storage device of the terminal device 8, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 8. Further, the memory 81 may also include both an internal storage unit and an external storage device of the terminal device 8. The memory 81 is used for storing the computer program and other programs and data required by the terminal device. The memory 81 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units converted into the separate component descriptions may or may not be physically separated, and the components converted into the unit displays may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and converted for sale or use as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (8)

1. An image processing method in a billiard game is applied to a system comprising a shooting device, and the image processing method comprises the following steps:
the method comprises the steps that video information including a table top of a billiard table and billiards on the table top is collected through a shooting device;
analyzing the video information based on the constructed projection model comprising the shooting device and the billiard position to obtain the position information of the billiards; the shape of a frustum in an image contained in the video information is an ellipse; the video information comprises distribution information of the elliptical areas corresponding to the billiards on the table top;
analyzing the video information based on the constructed projection model comprising the shooting device and the billiard position to obtain the billiard position information comprises the following steps:
detecting an elliptical region conforming to the projection model from the distribution information;
and calculating the position information of the billiards to which the elliptical area belongs based on the position information of the elliptical area conforming to the projection model according to the space geometric position relationship of the photographing device, the billiards and the elliptical area corresponding to the billiards in the distribution information in the projection model.
2. An image processing method in a billiards game according to claim 1, wherein analyzing the video information based on the constructed projection model including the shooting device and the position of the billiards, and obtaining the position information of the billiards comprises:
dividing the video information into a plurality of frames;
based on the projection model, segmenting an elliptical region and a table top region corresponding to the billiards in each of the plurality of frames;
dividing the set of elliptical regions into a plurality of connected regions;
and acquiring the position information of the communication areas, and taking the position information of each elliptical area in the plurality of communication areas as the position information of the billiards corresponding to each elliptical area.
3. The image processing method in a billiard game according to claim 2, wherein obtaining the position information of the connected region, and using the position information of each elliptical region in the plurality of connected regions as the position information of the billiard ball corresponding to the each elliptical region respectively comprises:
dividing the connected area into independent areas, acquiring the position information of each independent area, and taking the position information of each independent area as the position information of the billiards corresponding to the independent area.
4. The image processing method in a billiard game as set forth in claim 2, wherein the acquiring of the position information of the connected area and the using of the position information of each elliptical area in the plurality of connected areas as the position information of the billiard ball corresponding to the each elliptical area respectively comprises:
acquiring the area of a communication area;
matching the area with a preset threshold value to obtain a matching result;
extracting a plurality of non-overlapping circles from the connected region based on the matching result, wherein each circle corresponds to a circumscribed ellipse which accords with the projection model and is circumscribed to the circle, and the union of occupied regions of the circumscribed ellipses is the connected region; and converting the position information of the circles which do not overlap with each other into the position information of the billiards.
5. An image processing apparatus in a billiard game, comprising:
the acquisition module is used for acquiring video information including the table top of the billiard table and billiards on the table top through the shooting device;
the analysis module is used for analyzing the video information based on the constructed projection model comprising the shooting device and the billiard position to obtain the billiard position information; the shape of a frustum in an image contained in the video information is an ellipse; the video information comprises distribution information of the elliptical areas corresponding to the billiards on the table top;
wherein the analysis module comprises:
a detection unit configured to detect an elliptical region conforming to the projection model from the distribution information;
and the calculating unit is used for calculating and obtaining the position information of the billiards to which the elliptical area belongs based on the position information of the elliptical area conforming to the projection model according to the space geometric position relation of the photographing device, the billiards and the elliptical area corresponding to the billiards in the distribution information in the projection model.
6. An image processing apparatus in a billiard game according to claim 5, wherein the analysis module includes:
a first dividing unit for dividing the video information into a plurality of frames;
a dividing unit, configured to divide an elliptical region and a table top region corresponding to a billiard ball in each of the plurality of frames based on the projection model;
a second dividing unit configured to divide the set of elliptical regions into a plurality of connected regions;
and the acquisition unit is used for acquiring the position information of the communication areas and respectively taking the position information of each elliptical area in the plurality of communication areas as the position information of the billiards corresponding to each elliptical area.
7. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 4 when executing the computer program.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.
CN201711464888.4A 2017-12-28 2017-12-28 Image processing method and device in billiard game Active CN108090486B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201711464888.4A CN108090486B (en) 2017-12-28 2017-12-28 Image processing method and device in billiard game
PCT/CN2018/115386 WO2019128504A1 (en) 2017-12-28 2018-11-14 Method and apparatus for image processing in billiards game, and terminal device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711464888.4A CN108090486B (en) 2017-12-28 2017-12-28 Image processing method and device in billiard game

Publications (2)

Publication Number Publication Date
CN108090486A CN108090486A (en) 2018-05-29
CN108090486B true CN108090486B (en) 2020-06-09

Family

ID=62180422

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711464888.4A Active CN108090486B (en) 2017-12-28 2017-12-28 Image processing method and device in billiard game

Country Status (2)

Country Link
CN (1) CN108090486B (en)
WO (1) WO2019128504A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108090486B (en) * 2017-12-28 2020-06-09 深圳市超级视觉科技有限公司 Image processing method and device in billiard game
CN108960098B (en) * 2018-06-22 2022-04-01 梁栋 Billiard collision relation recognition method and billiard game scoring system
CN109011534B (en) * 2018-08-08 2020-08-04 Oppo广东移动通信有限公司 Billiard ball hitting assisting method and device, storage medium and electronic equipment
WO2020105973A1 (en) * 2018-11-23 2020-05-28 김현철 Billiard hall auxiliary system and server thereof
CN110334617B (en) * 2019-06-20 2021-04-27 梁栋 Method for judging collision of billiards with pool edges and billiard game scoring system
CN110443859B (en) * 2019-07-30 2023-05-30 佛山科学技术学院 Computer vision-based billiard foul judging method and system
CN112891909A (en) * 2019-11-19 2021-06-04 杨清平 Snooker scoring device

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8992315B2 (en) * 2009-07-27 2015-03-31 Obscura Digital, Inc. Automated enhancements for billiards and the like
CN102252661B (en) * 2011-04-02 2013-04-10 华南理工大学 Globoid three-dimensional positioning method for machine vision
CN103955693B (en) * 2013-05-06 2016-04-27 北京瑞盖科技有限公司 A kind of computer aided detection recognition methods of nine balls
CN104740866A (en) * 2013-12-27 2015-07-01 唐方旭 Precise positioning device for resetting balls in snooker
CN104954750A (en) * 2015-06-18 2015-09-30 北京共创普惠科技有限公司 Data processing method and device for billiard system
CN105261048B (en) * 2015-09-11 2018-02-06 中国人民解放军信息工程大学 A kind of accurate positioning method of center of pellet cone beam projection position
CN105107190A (en) * 2015-09-15 2015-12-02 清华大学 Image collecting and processing system applied to Chinese billiards and image processing method
KR101757788B1 (en) * 2015-12-17 2017-07-14 연세대학교 산학협력단 Method and Apparatus of Scoring Pool
CN106952307B (en) * 2017-03-22 2020-01-07 广东工业大学 Method and system for positioning sphere in image
CN107270812A (en) * 2017-06-26 2017-10-20 江苏密斯欧智能科技有限公司 Target ball recognition methods in a kind of automatic assembling
CN108090486B (en) * 2017-12-28 2020-06-09 深圳市超级视觉科技有限公司 Image processing method and device in billiard game
CN108079565B (en) * 2017-12-28 2019-11-08 深圳市超级视觉科技有限公司 A kind of game of billiards scoring system

Also Published As

Publication number Publication date
CN108090486A (en) 2018-05-29
WO2019128504A1 (en) 2019-07-04

Similar Documents

Publication Publication Date Title
CN108090486B (en) Image processing method and device in billiard game
CN111598091A (en) Image recognition method and device, electronic equipment and computer readable storage medium
CN109117773B (en) Image feature point detection method, terminal device and storage medium
CN109479082B (en) Image processing method and apparatus
CN111815754A (en) Three-dimensional information determination method, three-dimensional information determination device and terminal equipment
CN109215037B (en) Target image segmentation method and device and terminal equipment
CN112348765A (en) Data enhancement method and device, computer readable storage medium and terminal equipment
CN109461133B (en) Bridge bolt falling detection method and terminal equipment
CN113627428A (en) Document image correction method and device, storage medium and intelligent terminal device
CN114638294A (en) Data enhancement method and device, terminal equipment and storage medium
CN108960012B (en) Feature point detection method and device and electronic equipment
CN111199169A (en) Image processing method and device
CN112634235A (en) Product image boundary detection method and electronic equipment
CN114187333A (en) Image alignment method, image alignment device and terminal equipment
CN108805838B (en) Image processing method, mobile terminal and computer readable storage medium
WO2024012463A1 (en) Positioning method and apparatus
CN108629219B (en) Method and device for identifying one-dimensional code
CN112102391A (en) Measuring method and device, electronic device and storage medium
CN108564571B (en) Image area selection method and terminal equipment
CN108776959B (en) Image processing method and device and terminal equipment
CN108495125B (en) Camera module testing method, device and medium
CN111489433A (en) Vehicle damage positioning method and device, electronic equipment and readable storage medium
CN114708239A (en) Glue width detection method and device, electronic equipment and storage medium
CN110619597A (en) Semitransparent watermark removing method and device, electronic equipment and storage medium
EP3352136A1 (en) Crossing point detector, camera calibration system, crossing point detection method, camera calibration method, and recording 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
GR01 Patent grant
GR01 Patent grant