Seat data acquisition method, device, equipment and computer-readable storage medium
By determining the regional center coordinates of the seat image of the area map type, seat data is automatically acquired, which solves the problem of inefficient manual labeling in traditional systems, and realizes intelligent and accurate seat data statistics.
Patent Information
- Application Number
- CN202111618430.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2041-12-27
AI Technical Summary
Traditional box office statistics systems cannot intelligently obtain seat data based on the seat image of the area map type, and require manual annotation, which is inefficient.
When determining that the display type of the seat image is the area map type, the center coordinates of each area are determined, and the seat data of each area is obtained based on these center coordinates, thereby automatically calculating the total seat data of the seat image.
It realizes intelligently obtaining seat data of area map type seat images, avoiding the steps of manual annotation, and improving statistical efficiency and accuracy.
Smart Images

Figure CN114266762B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method, device, equipment and computer-readable storage medium for acquiring seat data. Background Art
[0002] With the development of smart terminals, online ticketing systems are widely used in all aspects of people's daily lives. For example, people can buy tickets for performances through applications such as Meituan and WeChat. Online shopping systems can facilitate people to buy tickets conveniently, but they also bring challenges to box office statistics. In traditional box office statistics, seat images are obtained through the web application testing tool selenium. When the display type of the seat image is a seat map type, the number of seats displayed in the seat image is directly obtained; when the display type of the seat image is an area map type, the seat data needs to be obtained through manual annotation, and the seat data cannot be obtained intelligently based on the seat image. Summary of the invention
[0003] The main purpose of the present invention is to provide a method, device, equipment and computer-readable storage medium for obtaining seat data, aiming to intelligently count the seat data of a seat image of an area map type.
[0004] To achieve the above object, the present invention provides a method for obtaining seat data, which comprises the following steps:
[0005] Determine the display type of the seat image;
[0006] When the display type of the seat image is an area map type, determining the center coordinates of each area in the seat image;
[0007] Based on the center coordinates of each area, obtaining seat data of each area;
[0008] The seat data of the seat image is acquired according to the seat data of each area.
[0009] In one embodiment, when the display type of the seat image is an area map type, the step of determining the center coordinates of each area in the seat image includes:
[0010] When there are words in the seat image, determining the area contours of each area;
[0011] Obtaining vertex coordinates of the area outline, wherein there are multiple vertex coordinates;
[0012] The center coordinates of each region are determined according to the vertex coordinates of each region.
[0013] In one embodiment, when the display type of the seat image is an area map type, the step of determining the center coordinates of each area in the seat image includes:
[0014] When there is no text in the seat image, obtaining a pixel value corresponding to each fare range;
[0015] respectively obtaining area contours of areas corresponding to the pixel values in the seat image;
[0016] Determining an average pixel coordinate of the pixel coordinates according to the pixel coordinates of the area outline;
[0017] The average pixel coordinates are determined as the center coordinates of each area.
[0018] In one embodiment, the step of determining the display type of the seat image includes:
[0019] Acquire the seat image, and determine the pixel coordinates of the target position of each image block outline in the seat image;
[0020] The display type of the seat image is determined according to the distance between the pixel coordinates.
[0021] In one embodiment, the step of determining the display type of the seat image according to the distance between the pixel coordinates includes:
[0022] When the distances between the pixel coordinates of the reference point of the outline of each image block in the seat image and the pixel coordinates of each vertex are equal, determining that the display type of the seat image is a seat map type;
[0023] When the distances between the reference pixel coordinates of each image block outline and the pixel coordinates of the vertices in the seat image are not equal, the display type of the seat image is determined to be an area map type, wherein the target position includes the reference points and vertices of each image block outline.
[0024] In one embodiment, before the step of determining the pixel coordinates of the target position of each image block outline in the seat image, the method further includes:
[0025] Graying the seat image to obtain the number of square contours of the grayed image;
[0026] When the number of the image block contours is greater than a preset value, performing the step of determining the pixel coordinates of each image block contour in the seat image;
[0027] When the number of the image block outlines is less than or equal to the preset value, it is determined that the display type of the seat image is an area map type.
[0028] In one embodiment, after the step of acquiring the seat data of the seat image according to the seat data of each area, the step further includes:
[0029] Get the number of tickets sold;
[0030] The attendance rate is determined according to the number of tickets sold and the seat data.
[0031] To achieve the above object, the present invention further provides a device for acquiring seat data, the device for acquiring seat data comprising:
[0032] A first determination module, used to determine the display type of the seat image;
[0033] A second determination module, configured to determine the center coordinates of each area in the seat image when the display type of the seat image is an area map type;
[0034] A first acquisition module, used for acquiring seat data of each area based on the center coordinates of each area;
[0035] The second acquisition module is used to acquire the seat data of the seat image according to the seat data of each area.
[0036] To achieve the above-mentioned purpose, the present invention also provides a seat data acquisition device, which includes a memory, a processor, and a seat data acquisition program stored in the memory and executable on the processor. When the seat data acquisition program is executed by the processor, the various steps of the seat data acquisition method described above are implemented.
[0037] To achieve the above objectives, the present invention also provides a computer-readable storage medium, which stores a seat data acquisition program. When the seat data acquisition program is executed by a processor, the various steps of the seat data acquisition method described above are implemented.
[0038] The present invention provides a method, device, equipment and computer-readable storage medium for obtaining seat data. When determining that the display type of a seat image is an area map type, the center coordinates of each area are determined, and the seat data of each area is obtained through the center coordinates of each area, thereby obtaining the seat data of the seat image. The seat data of each area is obtained by means of the center coordinates, and the seat data in the seat image is obtained. There is no need to manually mark each area, and then obtain the corresponding seat data, so as to realize intelligent acquisition of the seat data of the seat image of the area map type. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A schematic diagram of the hardware structure of a seat data acquisition device according to an embodiment of the present invention;
[0040] Figure 2 It is a flowchart of a first embodiment of a method for acquiring seat data of the present invention;
[0041] Figure 3 A seat diagram in which the display type of the seat image of the seat data acquisition method of the present invention is a seat diagram type;
[0042] Figure 4 A schematic diagram of a method for acquiring seat data of the present invention in which the display type of a seat image is an area map type;
[0043] Figure 5 A schematic diagram of determining the seat image type according to the pixel coordinates of the target position in the seat data acquisition method of the present invention;
[0044] Figure 6 Another schematic diagram of the method for acquiring seat data of the present invention, in which the display type of the seat image is an area map type;
[0045] Figure 7 The figure is a schematic diagram of the module structure of the device for acquiring seat data involved in the embodiment of the present invention.
[0046] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0047] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0048] As an implementation scheme, the seat data acquisition device can be as follows: Figure 1 shown.
[0049] The embodiment of the present invention relates to a device for acquiring seat data, which includes: a processor 101, such as a CPU, a memory 102, and a communication bus 103. The communication bus 103 is used to realize connection and communication between these components.
[0050] The memory 102 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. Figure 1 As shown, the memory 102 as a computer-readable storage medium may include a seat data acquisition program; and the processor 101 may be used to call the seat data acquisition program stored in the memory 102 and perform the following operations:
[0051] Determine the display type of the seat image;
[0052] When the display type of the seat image is an area map type, determining the center coordinates of each area in the seat image;
[0053] Based on the center coordinates of each area, obtaining seat data of each area;
[0054] The seat data of the seat image is acquired according to the seat data of each area.
[0055] In one embodiment, the processor 101 may be used to call a seat data acquisition program stored in the memory 102, and perform the following operations:
[0056] When there are words in the seat image, determining the area contours of each area;
[0057] Obtaining vertex coordinates of the area outline, wherein there are multiple vertex coordinates;
[0058] The center coordinates of each region are determined according to the vertex coordinates of each region.
[0059] In one embodiment, the processor 101 may be used to call the music clip selection program stored in the memory 102 and perform the following operations:
[0060] When there is no text in the seat image, obtaining a pixel value corresponding to each fare range;
[0061] respectively obtaining area contours of areas corresponding to the pixel values in the seat image;
[0062] Determining an average pixel coordinate of the pixel coordinates according to the pixel coordinates of the area outline;
[0063] The average pixel coordinates are determined as the center coordinates of each area.
[0064] In one embodiment, the processor 101 may be used to call the music clip selection program stored in the memory 102 and perform the following operations:
[0065] Acquire the seat image, and determine the pixel coordinates of the target position of each image block outline in the seat image;
[0066] The display type of the seat image is determined according to the distance between the pixel coordinates.
[0067] In one embodiment, the processor 101 may be used to call the music clip selection program stored in the memory 102 and perform the following operations:
[0068] When the distances between the pixel coordinates of the reference point of the outline of each image block in the seat image and the pixel coordinates of each vertex are equal, determining that the display type of the seat image is a seat map type;
[0069] When the distances between the reference pixel coordinates of each image block outline and the pixel coordinates of the vertices in the seat image are not equal, the display type of the seat image is determined to be an area map type, wherein the target position includes the reference points and vertices of each image block outline.
[0070] In one embodiment, the processor 101 may be used to call the music clip selection program stored in the memory 102 and perform the following operations:
[0071] Graying the seat image to obtain the number of square contours of the grayed image;
[0072] When the number of the image block contours is greater than a preset value, performing the step of determining the pixel coordinates of each image block contour in the seat image;
[0073] When the number of the image block outlines is less than or equal to the preset value, it is determined that the display type of the seat image is an area map type.
[0074] In one embodiment, the processor 101 may be used to call the music clip selection program stored in the memory 102 and perform the following operations:
[0075] Get the number of tickets sold;
[0076] The attendance rate is determined according to the number of tickets sold and the seat data.
[0077] Based on the hardware architecture of the above-mentioned seat data acquisition device, an embodiment of the seat data acquisition method of the present invention is proposed.
[0078] Reference Figure 2 , Figure 2 This is a first embodiment of the method for obtaining seat data of the present invention, and the method for obtaining seat data comprises the following steps:
[0079] Step S10, determining the display type of the seat image;
[0080] Step S20, when the display type of the seat image is an area map type, determining the center coordinates of each area in the seat image;
[0081] Step S30, acquiring seat data of each area based on the center coordinates of each area;
[0082] Step S40, acquiring the seat data of the seat image according to the seat data of each area.
[0083] The execution subject of the embodiment of the present invention is a device for acquiring seat data.
[0084] The display type is the type of seat displayed in the seat image, which includes the area map type and the seat map type. The center coordinates are the coordinates of the center point of each area in the seat image.
[0085] In this embodiment, the seat image can be obtained through a testing tool (web application testing tool selenium).
[0086] For example, through the chromdriver driver of the selenium framework, the Google Chrome browser is automatically launched, and then the login function is automatically realized through software such as WeChat and the mouse control function of selenium. Then enter the seat selection interface, where the display type of the seat image displayed in the seat selection interface can be as follows Figure 3 The seat map type shown can also be an area map type.
[0087] The seat image contains multiple image blocks. When Selenium captures the seat image, no matter whether the seat image displayed in the seat selection interface is a seat map type or an area map type, the image obtained is composed of multiple image blocks.
[0088] The display types of the seat images obtained by selenium in the present invention include seat map types and area map types. When the display type of the seat image is a seat map type, the specific seat information can be directly viewed in the seat selection interface. For example, after obtaining the seat image, it is directly calculated based on the number of blocks in the seat image that there are 80*11=880 seats in the seat image. However, when the display type of the seat image is an area map type, the center coordinates of each area need to be determined in the seat selection interface, and then the seat image of each area with a display type of a seat map type is obtained through the selenium tool, and the seat data of each area is calculated, and then the seat data of the seat image is obtained.
[0089] For example, refer to Figure 4 The device for acquiring seat data first selects the center coordinates of any area of the stage, controls selenium to acquire the seat image corresponding to the selected center coordinates, and calculates the seat data of the area. For example, there are 30*2+20*3+10*2=140 seats in the selected area. The center coordinates are updated to acquire the seat data of each area, and the seat data of the seat image is obtained by adding them.
[0090] In this embodiment, after the seat data of the seat image is obtained based on the seat data of each area, the number of tickets sold is further captured by tools such as a web crawler, and the attendance rate is determined based on the number of tickets sold and the seat data.
[0091] For example, the seat data in the seat image is determined to be 2680, and then the number of tickets sold is obtained, and the number of tickets sold is 2500. According to the number of tickets sold and the seat data, the attendance rate is calculated to be 93%, wherein the number of tickets sold is the total number of tickets sold. The seat data acquisition device obtains the seat data through the seat image, and obtains the number of tickets sold by means of a web crawler, without manual operation, and realizes intelligent acquisition of the attendance rate.
[0092] In this embodiment, when the display type of the seat image is determined to be an area map type, the center coordinates of each area are determined, and the seat data of each area is obtained through the center coordinates of each area, thereby obtaining the seat data of the seat image. The seat data of each area is obtained by the center coordinate method to obtain the seat data in the seat image, and there is no need to manually mark each area one by one to obtain the corresponding seat data, thereby realizing intelligent acquisition of the seat data of the seat image of the area map type.
[0093] Based on the first embodiment, a second embodiment of the method for acquiring seat data of the present invention is proposed. When the display type of the seat image is an area map type, the step of determining the center coordinates of each area in the seat image includes:
[0094] Step S21, when there are words in the seat image, determining the area contours of each area;
[0095] Step S22, obtaining vertex coordinates of the area outline, wherein there are multiple vertex coordinates;
[0096] Step S23, determining the center coordinates of each area according to the vertex coordinates of each area.
[0097] When it is determined that the display type of the seat image is the area map type, it is determined whether there is text in the seat image. If there is text in the seat image, a binary search operation is performed on the seat image to obtain the center coordinates of each area in the seat image. Figure 6 ,exist Figure 6 The seating images are divided into zones using text descriptions (e.g., West Zone 1, West Zone 2, ... West Zone 8; East Zone 1, East Zone 2, ... East Zone 8).
[0098] For example, first, in the seat image, the coordinate axis of the image block outline is established by recording the vertex of an image block outline as the coordinate origin, and the coordinate origin (0, 0) is used as the scanning origin, wherein the image block outline is the outline of each image block in the seat image. Scan from left to right along the X-axis direction, and the scanning radius is R. Through the text recognition technology, identify whether there is text in the scanning range. If not, change the pixel coordinates of the scanning origin to (R, 0); when text is recognized, obtain the number of texts. When the number of texts is greater than the set number, it is determined that there are multiple areas in the scanned range, and reduce the scanning radius, for example, to R / 2. If the number of words does not change, continue to reduce it to R / 4 until no text can be recognized in the scanning range. At this time, the X-axis of an area can be determined, for example, the coordinate is (R1, 0). Record the pixel coordinates (0, 0), (R1, 0). Then continue scanning, starting from R1, find the next area with text in the same way, and record the starting point at the same time to obtain the points of the horizontal coordinates of each area.
[0099] Similarly, start scanning from top to bottom on the Y axis to obtain the Y axis coordinate of an area, record the pixel coordinates (0, R1), (R1, R1), and then continue scanning, starting from R1, and find the next area with text in the same way. At the same time, record the starting point to obtain the horizontal coordinate points of each area.
[0100] After obtaining the coordinate points of each region, the center coordinates of the region are obtained by taking the middle of the coordinate points of each region, wherein the center coordinates are pixel coordinates. For example, the center coordinates of a region are (a, b), a=(R1+0) / 2, b=(0+R1) / 2.
[0101] In this embodiment, after obtaining the center coordinates of each area, the seat image of each area with a display type of seat map is obtained by controlling Selenium to click on the center coordinates of each area, thereby effectively avoiding the situation where the seat data of other areas is obtained when the seat data of the area is calculated by obtaining the seat image with a display type of seat map through the coordinates of the edge points of the area, thereby improving the accuracy of obtaining the seat data.
[0102] Based on the first embodiment, a third embodiment is proposed, wherein when the display type of the seat image is an area map type, the step of determining the center coordinates of each area in the seat image comprises:
[0103] Step S24, when there is no text in the seat image, obtaining the pixel value corresponding to each fare range;
[0104] Step S25, respectively obtaining the area contours of the areas corresponding to the pixel values in the seat image;
[0105] Step S26, determining the average pixel coordinates of the pixel coordinates according to the pixel coordinates of the area outline;
[0106] Step S27: determining the average pixel coordinates as the center coordinates of each area.
[0107] When there is no text in the seat image, the pixel value of the color of each area of the seat image is determined. Figure 4 ,exist Figure 4 The blue area, yellow area and other fonts represent that the filling colors of the area are blue and yellow respectively. In this embodiment, the fare description area is scanned from top to bottom. If the grayscale value changes from continuous non-255 to 255, the continuous non-255 grayscale value in the middle is the grayscale value of the color of an area. By following this cycle, the grayscale value set of all fare ranges can be found.
[0108] In this embodiment, the color of each fare range is first obtained to determine the pixel value corresponding to the color, and then the area with the same pixel value is determined in the seat image. The average pixel coordinates are calculated based on the pixel coordinates of the outline of each area, and the average pixel coordinates are determined as the center coordinates of each area of the seat image.
[0109] For example, in this embodiment, the red area is scanned first, all the red areas are determined in the seat image, the pixel coordinates of the area outline of each area are obtained, the average pixel coordinates are calculated based on the pixel coordinates of the area outline, and the average pixel coordinates are determined as the center coordinates of each area.
[0110] In this embodiment, after obtaining the center coordinates of the seat image, the seat image of each area with a display type of seat map is obtained by controlling Selenium to click on the center coordinates of each area, thereby effectively avoiding the situation where the seat data of other areas is obtained when the seat data of the area is calculated by obtaining the seat image with a display type of seat map through the coordinates of the edge points of the area, thereby improving the accuracy of obtaining box office data.
[0111] Based on the first embodiment, a fourth embodiment of the present invention is proposed. The step of determining the display type of the seat image comprises:
[0112] Step S11, acquiring the seat image, and determining the pixel coordinates of the target position of each image block outline in the seat image;
[0113] Step S12: determining the display type of the seat image according to the distance between the pixel coordinates.
[0114] When the display type of the seat image is a seat map type, the seat information is directly displayed in the seat image, while when the display type of the seat image is an area map type, the seat data of each area is displayed, and the size and shape of the image blocks displayed in the seat map for each seat are the same, while the size and shape of the image blocks displayed in the seat map for each area are different. Therefore, the display type of the seat map can be determined by the pixel coordinates of the image block outline in the seat image.
[0115] For example, the target position for obtaining the image block outline may be the center point of the image block outline or the midpoint of the side length of the image block outline, wherein four or two midpoints of the side length of the image block outline may be selected. Figure 5In this embodiment, the display type of the seat image is the seat map type. The target position is the center point of the image block contour, the midpoint A of the first side length of the image block contour, and the midpoint B of the second side length, wherein the first side length is set to the width of the image block contour and the second side length is set to the height of the image block contour. Specifically, a pixel coordinate system of the image block contour is constructed with the center point of the image block contour as the coordinate origin, and the pixel coordinates of the midpoint A of the first side length and the midpoint B of the second side length are obtained as (0, 1) and (2, 0), respectively. Then, the distances between the pixel coordinates of the center point of the image block contour and the midpoint A and the midpoint B are 1 and √5, respectively. The distances between the pixel coordinates of the center point of the next image block contour in the seat image and the pixel coordinates of the midpoint A of the first side length and the midpoint B of the second side length are obtained in sequence, and the distances between the pixel coordinates of the center point of the image block contour in the seat image and the pixel coordinates of the midpoint A of the first side length and the midpoint B of the second side length are obtained as 1 and √5, respectively. The distances between the pixel coordinates of the center point of all image block contours in the seat image and the pixel coordinates of the midpoint A of the first side length and the midpoint B of the second side length are obtained. When calculating the distance between the pixel coordinates of the center point of the first image square contour and the pixel coordinates of the center of the first side length, the distance between the pixel coordinates of the center point of the second image square contour and the pixel coordinates of the center of the first side length is equal, the distance between the pixel coordinates of the center point of the third image square contour and the pixel coordinates of the center of the first side length is equal, ..., the distance between the pixel coordinates of the center point of the Nth image square contour and the pixel coordinates of the center of the first side length is equal, where N represents the Nth image square contour in the acquired seat image; and the distance between the pixel coordinates of the center point of the first image square contour and the pixel coordinates of the center of the second side length is equal to the distance between the pixel coordinates of the center point of the second image square contour and the pixel coordinates of the center of the second side length. The distance between the pixel coordinates of the center of the seat image is equal, the distance between the pixel coordinates of the center point of the third image block outline and the pixel coordinates of the center of the second side length is equal, and so on, the distance between the pixel coordinates of the center point of the Nth image block outline and the pixel coordinates of the center of the second side length is equal, that is, the distance between the pixel coordinates of the center point of each image block outline in the seat image and the pixel coordinates of the midpoint of the first side length is correspondingly equal, and the distance between the pixel coordinates of the center point and the pixel coordinates of the midpoint of the second side length is correspondingly equal, then the outline of the image block in the seat image is determined to be the outline of the seat, that is, the display type of the seat image is determined to be the seat map type; if there is a difference, then the display type of the seat image is determined to be the area map type.
[0116] When the distances between the pixel coordinates of the reference points of the image block contours and the pixel coordinates of the vertices in the seat image are equal, determining that the display type of the seat image is a seat map type;
[0117] When the distances between the reference pixel coordinates of each image block outline and the pixel coordinates of the vertices in the seat image are not equal, the display type of the seat image is determined to be an area map type, wherein the target position includes the reference points and vertices of each image block outline.
[0118] In this embodiment, the target position can be set as a reference point and a vertex of the image block outline, wherein the reference point is a point at the upper left of the image block outline.
[0119] Specifically, the reference point of each image block outline in the seat image is obtained, and the pixel coordinate system of each image block outline is constructed with the reference point of each image block outline as the coordinate origin, and the distance between the pixel coordinate of the reference point and the pixel coordinate of each vertex is obtained. For example, after determining that the distance between the coordinate of the reference point in the first image block outline and the pixel coordinate of the first vertex is 1, and the distance between the coordinate of the reference point in the second image block outline and the pixel coordinate of the first vertex is 2, the distance between the coordinate of the reference point in the second image block outline and the pixel coordinate of the first vertex is 1, and the distance between the coordinate of the reference point in the Nth image block outline and the pixel coordinate of the first vertex is 1, and the distance between the coordinate of the reference point in the Nth image block outline and the pixel coordinate of the Nth vertex is 2, it is determined that the distance between the pixel coordinate of each image block outline and the pixel coordinate of the first vertex is equal, and the distance between the pixel coordinate of each image block outline and the pixel coordinate of the second vertex is equal, it can be determined that the display type of the acquired seat image is the seat map type. That is, when the distances between the pixel coordinates of the reference points of each image block outline and the pixel coordinates of each vertex are equal, the display type of the seat image is determined to be a seat map type. Wherein, N represents the Nth image block outline in the acquired seat image, the first vertex is set to the upper right vertex of the image block outline, and the second vertex is set to the lower left vertex of the image block outline.
[0120] As the sizes of the seats in the image are the same, when the distances between the reference pixel coordinates of the outline of each image block in the seat image and the pixel coordinates of the vertices are obtained to be unequal, it can be determined that the display type of the seat image is an area map type.
[0121] In the technical solution of the present embodiment, when the distances between the pixel coordinates of the reference points of the image block outlines in the seat image and the pixel coordinates of the vertices are equal, the display type of the seat image is determined to be a seat map type; when the distances between the reference pixel coordinates of the image block outlines in the seat image and the pixel coordinates of the vertices are not equal, the display type of the seat image is determined to be an area map type. The display type of the seat image is determined by the reference points and the vertices, thereby improving the accuracy of determining the display type of the seat image.
[0122] Furthermore, before the step of determining the pixel coordinates of the target position of each image block outline in the seat image in this embodiment, the method further includes:
[0123] Step S01, graying the seat image, and obtaining the number of all image block contours in the seat image after graying;
[0124] Step S02, when the number of the image block contours is greater than a preset value, executing the step of determining the pixel coordinates of each image block contour in the seat image;
[0125] Step S03, when the number of the image block outlines is less than or equal to the preset value, determining that the display type of the seat image is an area map type.
[0126] After acquiring the seat image, the seat type determination device grayscales the seat image, specifically grayscales the seat image according to the weighted average value of each color. For example, the grayscale value grayscales the image using the weighted average value of three colors: gray = 0.299*R+0.587*G+0.144*B, where RGB is the color value of the three dimensions of the three primary colors of the image.
[0127] The number of image block contours in the grayscale processed seat image is obtained, and when it is determined that the number of image block contours is less than or equal to a preset number, the display type of the seat image is determined to be an area map type, wherein the preset number can be set to 10.
[0128] Specifically, in the present invention, in order to more accurately determine the display type of the seat image, the setting of the preset number can be determined according to the type of event held. For example, for large-scale events (for example, the World Concert, the National Games, etc.), the preset number value can be set to 20, and for small-scale events (for example, the College Games, the school New Year's Eve party), the preset number value can be set to 10.
[0129] In the technical solution of this embodiment, the seat image is grayed, and the number of all image block contours in the grayed seat image is obtained. When the number of image block contours is greater than a preset value, the step of determining the pixel coordinates of each image block contour in the seat image is performed; when the number of image block contours is less than or equal to the preset value, the display type of the seat image is determined to be an area map type. By judging the display type of the seat image by the preset number, it is possible to quickly determine whether the type of the seat image is an area map type according to the number of image block contours in the seat image.
[0130] Reference Figure 7 The present invention also provides a device for acquiring seat data, the device for acquiring seat data comprising:
[0131] A first determination module 10 is used to determine the display type of the seat image;
[0132] A second determination module 20, for determining the center coordinates of each area in the seat image when the display type of the seat image is an area map type;
[0133] A first acquisition module 30, configured to acquire seat data of each area based on the center coordinates of each area;
[0134] The second acquisition module 40 is used to acquire the seat data of the seat image according to the seat data of each area.
[0135] In one embodiment, when the display type of the seat image is an area map type, in terms of determining the center coordinates of each area in the seat image, the second determination module 20 is specifically configured to:
[0136] When there are words in the seat image, determining the area contours of each area;
[0137] Obtaining vertex coordinates of the area outline, wherein there are multiple vertex coordinates;
[0138] The center coordinates of each region are determined according to the vertex coordinates of each region.
[0139] In one embodiment, when the display type of the seat image is an area map type, in terms of determining the center coordinates of each area in the seat image, the second determination module 20 is specifically configured to:
[0140] When there is no text in the seat image, obtaining a pixel value corresponding to each fare range;
[0141] respectively obtaining area contours of areas corresponding to the pixel values in the seat image;
[0142] Determining an average pixel coordinate of the pixel coordinates according to the pixel coordinates of the area outline;
[0143] The average pixel coordinates are determined as the center coordinates of each area.
[0144] In one embodiment, in determining the display type of the seat image, the first determination module 20 is specifically configured to:
[0145] Acquire the seat image, and determine the pixel coordinates of the target position of each image block outline in the seat image;
[0146] The display type of the seat image is determined according to the distance between the pixel coordinates.
[0147] In one embodiment, when determining the display type of the seat image according to the distance between the pixel coordinates, the first determination module 20 is specifically configured to:
[0148] When the distances between the pixel coordinates of the reference point of the outline of each image block in the seat image and the pixel coordinates of each vertex are equal, determining that the display type of the seat image is a seat map type;
[0149] When the distances between the reference pixel coordinates of each image block outline and the pixel coordinates of the vertices in the seat image are not equal, the display type of the seat image is determined to be an area map type, wherein the target position includes the reference points and vertices of each image block outline.
[0150] In one embodiment, before determining the pixel coordinates of the target position of each image block outline in the seat image, the first determination module 20 is specifically used to:
[0151] Graying the seat image to obtain the number of square contours of the grayed image;
[0152] When the number of the image block contours is greater than a preset value, performing the step of determining the pixel coordinates of each image block contour in the seat image;
[0153] When the number of the image block outlines is less than or equal to the preset value, it is determined that the display type of the seat image is an area map type.
[0154] In one embodiment, after acquiring the seat data of the seat image according to the seat data of each area, the second acquisition module 40 is specifically used to:
[0155] Get the number of tickets sold;
[0156] The attendance rate is determined according to the number of tickets sold and the seat data.
[0157] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0158] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, system, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, system, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, system, article or device including the element.
[0159] Through the description of the above implementation methods, technicians in this field can clearly understand that the above-mentioned embodiment system can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a computer-readable storage medium (such as ROM / RAM, disk, CD) as described above, including a number of instructions for a terminal device (which can be a mobile phone, computer, parking management equipment, air conditioner, or network equipment, etc.) to execute the system described in each embodiment of the present invention.
[0160] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for acquiring seat data, characterized in that: The method for obtaining seat data comprises: Determine the display type of the seat image; When there are words in the seat image, determine the area contour of each area in the seat image; obtain the vertex coordinates of the area contour, wherein there are multiple vertex coordinates; determine the center coordinates of each area according to the vertex coordinates of each area; or, when there are no words in the seat image, obtain the pixel value corresponding to each fare range; obtain the area contours of the areas corresponding to the pixel values in the seat image respectively; determine the average pixel coordinates of the pixel coordinates according to the pixel coordinates of the area contour; and determine the average pixel coordinates as the center coordinates of each area; Based on the center coordinates of each area, obtaining seat data of each area; The seat data of the seat image is acquired according to the seat data of each area.
2. The method for obtaining seat data according to claim 1, characterized in that: The step of determining the display type of the seat image comprises: Acquire the seat image, and determine the pixel coordinates of the target position of each image block outline in the seat image; The display type of the seat image is determined according to the distance between the pixel coordinates.
3. The method for acquiring seat data according to claim 2, characterized in that: The step of determining the display type of the seat image according to the distance between the pixel coordinates comprises: When the distances between the pixel coordinates of the reference point of the outline of each image block in the seat image and the pixel coordinates of each vertex are equal, determining that the display type of the seat image is a seat map type; When the distances between the reference pixel coordinates of each image block outline and the pixel coordinates of the vertices in the seat image are not equal, the display type of the seat image is determined to be an area map type, wherein the target position includes the reference points and vertices of each image block outline.
4. The method for acquiring seat data according to claim 2, characterized in that: Before the step of determining the pixel coordinates of the target position of each image block outline in the seat image, the method further comprises: Graying the seat image to obtain the number of square contours of the grayed image; When the number of the image block contours is greater than a preset value, performing the step of determining the pixel coordinates of each image block contour in the seat image; When the number of the image block outlines is less than or equal to the preset value, it is determined that the display type of the seat image is an area map type.
5. The method for acquiring seat data according to claim 1, characterized in that: After the step of acquiring the seat data of the seat image according to the seat data of each area, the method further includes: Get the number of tickets sold; The attendance rate is determined according to the number of tickets sold and the seat data.
6. A device for acquiring seat data, characterized in that: The seat data acquisition device comprises: A first determination module, used to determine the display type of the seat image; The second determination module is used to determine the regional contour of each area in the seat image when there are words in the seat image; obtain the vertex coordinates of the regional contour, wherein there are multiple vertex coordinates; determine the center coordinates of each area according to the vertex coordinates of each area; or, when there are no words in the seat image, obtain the pixel value corresponding to each fare range; obtain the regional contours of the areas corresponding to the pixel values in the seat image; determine the average pixel coordinates of the pixel coordinates according to the pixel coordinates of the regional contour; and determine the average pixel coordinates as the center coordinates of each area; A first acquisition module, used for acquiring seat data of each area based on the center coordinates of each area; The second acquisition module is used to acquire the seat data of the seat image according to the seat data of each area.
7. A device for acquiring seat data, characterized in that: The seat data acquisition device includes a memory, a processor, and a seat data acquisition program stored in the memory and executable on the processor. When the seat data acquisition program is executed by the processor, the various steps of the seat data acquisition method as described in any one of claims 1-5 are implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a seat data acquisition program, and when the seat data acquisition program is executed by a processor, each step of the seat data acquisition method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Cinema attendance statistical method and system
CN105550663A
Seat map display processing method and device and online seat selection system
CN110232454A