Method, system and equipment for judging arrow direction of bubble control and medium

Through edge detection and linear detection algorithms, the linear segment length ratio of the bubble control is calculated, which solves the problems of high cost, slow speed and high misjudgment rate in the prior art, and achieves low-cost and high-efficiency judgment of arrow direction.

CN119850663APending Publication Date: 2025-04-18SHENZHEN YISHIHUOLALA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411959891.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

When judging the direction of the arrow of the bubble control, the prior art needs to collect and mark a large number of training samples, which is cost-effective, has a slow recognition speed and a high misjudgment rate.

Method used

By obtaining the image data of the bubble control, using edge detection algorithm and line detection algorithm, calculate and filter out straight line segments in the contour image, and judge the arrow direction based on the length ratio of the line segments.

Benefits of technology

There is no need for a large number of training samples, the implementation cost is low, the recognition speed is fast, the misjudgment rate is low, and the arrow direction of the bubble control can be accurately judged.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119850663A_ABST
    Figure CN119850663A_ABST
Patent Text Reader

Abstract

The invention relates to the field of graphic processing, in particular to a method, a system and equipment for judging the arrow direction of a bubble control and a medium, and the method comprises the following steps: acquiring image data of the bubble control; calculating the image data according to an edge detection algorithm to obtain a contour image of the image data; calculating the contour image according to a straight line detection algorithm to obtain all straight line segments in the contour image; in all the straight line segments, target line segments at the upper end and the lower end in the horizontal direction are obtained through filtering and sequentially serve as a first horizontal line segment and a second horizontal line segment, and target line segments at the left end and the right end in the vertical direction are obtained through filtering and sequentially serve as a first vertical line segment and a second vertical line segment; according to the lengths of the four target line segments, the arrow direction of the bubble control is judged. A large number of training samples are not needed, and the implementation cost is low; meanwhile, the method is directly carried out based on calculation and analysis of image data, so that the recognition speed is high, and the efficiency is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of graphics processing, and in particular to a method, system, device and medium for determining the arrow direction of a bubble control. Background Art

[0002] The bubble control is a common element in the user interface, usually used to provide some additional hints or explanations. Its shape usually consists of a main rectangular area and an arrow pointing to the relevant content. The direction of the arrow not only affects the placement of the control in the user interface, but also determines its layout relative to other controls. Therefore, during the interface transcoding process, it is very important to determine the arrow direction of the bubble control, which will help generate more accurate and readable code.

[0003] Currently, a common method is to use deep learning technology to identify the direction of the arrow in the bubble control, which involves collecting and annotating a large number of training samples, and then training an image classification model to identify the direction of the arrow. Although this method is highly versatile, it has a high implementation cost, requires the collection and annotation of a large number of samples, has a slow recognition speed, and has a certain probability of misjudgment. Summary of the invention

[0004] In order to solve the above problems, the present invention provides a method, system, device and medium for determining the arrow direction of a bubble control.

[0005] The first aspect of the present invention discloses a method for determining the arrow direction of a bubble control, comprising:

[0006] Get the image data of the bubble control;

[0007] Calculating the image data according to an edge detection algorithm to obtain a contour image thereof;

[0008] Calculating the contour image according to a straight line detection algorithm to obtain all straight line segments therein;

[0009] Among all the straight line segments, the target line segments at the upper and lower ends in the horizontal direction are filtered out respectively, and are used as the first horizontal line segment and the second horizontal line segment in sequence. The target line segments at the left and right ends in the vertical direction are filtered out respectively, and are used as the first vertical line segment and the second vertical line segment in sequence.

[0010] The arrow direction of the bubble control is determined according to the length of the first horizontal line segment, the length of the second horizontal line segment, the length of the first vertical line segment, and the length of the second vertical line segment.

[0011] Furthermore, the step of calculating the image data according to the edge detection algorithm to obtain its contour image includes:

[0012] Binarizing the image data to be processed to obtain a binary image;

[0013] Based on the edge detection algorithm, the binary image is processed to obtain its contour image.

[0014] Furthermore, the step of obtaining the image data of the bubble control includes:

[0015] Get the original image of the bubble control;

[0016] Determine whether the original image includes a transparent image channel:

[0017] When it is not included, determining that the original image is image data of the bubble control;

[0018] When included, multiple preset pure color background images are superimposed on the original image respectively to obtain corresponding intermediate image data; from all the intermediate image data, the image data with the largest color value variance is filtered out as the image data of the bubble control.

[0019] Furthermore, the steps of filtering out target line segments at upper and lower ends in the horizontal direction and filtering out target line segments at left and right ends in the vertical direction from among all the straight line segments include:

[0020] Among all the straight line segments, filter out the upper and lower ends in the horizontal direction and the left and right ends in the vertical direction, and obtain all the line segments at the four positions as candidate line segments at the corresponding positions;

[0021] For each of said positions:

[0022] Determine the number of corresponding candidate line segments:

[0023] If there is more than one line segment, filter out the line segment with the longest line segment length among all candidate line segments and use it as the target line segment at the position;

[0024] When there is only one candidate line segment, determine the candidate line segment as the target line segment at the position;

[0025] When it is zero, a virtual line segment of a preset length is added to the position as the target line segment of the position.

[0026] Further, the step of determining the arrow direction of the bubble control according to the length of the first horizontal line segment, the length of the second horizontal line segment, the length of the first vertical line segment, and the length of the second vertical line segment includes:

[0027] Calculating a length ratio of the first horizontal line segment to the second horizontal line segment to obtain a first ratio;

[0028] Calculating a ratio of the lengths of the first vertical line segment to the length of the second vertical line segment to obtain a second ratio;

[0029] The arrow direction of the bubble control is determined according to the first ratio and the second ratio.

[0030] Further, the step of determining the arrow direction of the bubble control according to the first ratio and the second ratio includes:

[0031] Comparing the first ratio with a preset first threshold and a preset second threshold, wherein the first threshold is greater than the second threshold;

[0032] When the first ratio is greater than the first threshold, it is determined that the arrow direction is downward;

[0033] When the first ratio is less than the second threshold, it is determined that the direction of the arrow is upward;

[0034] When the second threshold ≤ the first ratio ≤ the first threshold, the arrow direction of the bubble control is determined according to the second ratio.

[0035] Furthermore, the step of determining the arrow direction of the bubble control according to the second ratio includes:

[0036] When the second ratio is greater than the first threshold, it is determined that the direction of the arrow is rightward;

[0037] When the second ratio is less than the second threshold, it is determined that the direction of the arrow is leftward;

[0038] When the second threshold ≤ the second ratio ≤ the first threshold, the bubble control has no arrow direction.

[0039] The second aspect of the present invention discloses a system for determining the arrow direction of a bubble control, comprising:

[0040] An acquisition module, used for acquiring image data of a bubble control;

[0041] A first calculation module, used to calculate the image data according to an edge detection algorithm to obtain a contour image thereof;

[0042] A second calculation module is used to calculate the contour image according to a straight line detection algorithm to obtain all straight line segments therein;

[0043] A filtering module is used to filter out target line segments at upper and lower ends of the horizontal direction from all the straight line segments, and use them as the first horizontal line segment and the second horizontal line segment in sequence, and filter out target line segments at left and right ends of the vertical direction, and use them as the first vertical line segment and the second vertical line segment in sequence;

[0044] A judgment module is used to judge the arrow direction of the bubble control according to the length of the first horizontal line segment, the length of the second horizontal line segment, the length of the first vertical line segment and the length of the second vertical line segment.

[0045] The third aspect of the present invention discloses an electronic 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 when the processor executes the computer program, the processor implements the steps of the method for determining the arrow direction of any bubble control disclosed in the first aspect of the present invention.

[0046] The fourth aspect of the present invention discloses a storage medium storing a computer program, characterized in that when the computer program is executed by a processor, the steps of the method for determining the arrow direction of any bubble control disclosed in the first aspect of the present invention are implemented.

[0047] The present invention can accurately determine the direction of the arrow by calculating and analyzing the straight line segments in the contour image of the bubble control. Compared with the deep learning method, the present invention does not require a large number of training samples and has a low implementation cost; at the same time, because it is directly based on the calculation and analysis of image data, the recognition speed is fast and the efficiency is high. In addition, the error rate of this method is relatively low because it is based on the geometric characteristics of the bubble prompt control, which are stable and reliable in most cases. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0049] Figure 1 It is a bubble control with an arrow pointing upwards disclosed in an embodiment of the present invention;

[0050] Figure 2 It is a bubble control with an arrow pointing downwards disclosed in an embodiment of the present invention;

[0051] Figure 3 It is a bubble control with an arrow pointing to the left disclosed in the embodiment of the present invention;

[0052] Figure 4 It is a bubble control without arrows disclosed in an embodiment of the present invention;

[0053] Figure 5 It is a flowchart of a method for determining the arrow direction of a bubble control disclosed in an embodiment of the present invention;

[0054] Figure 6 It is a structural schematic diagram of a system for determining the arrow direction of a bubble control disclosed in an embodiment of the present invention;

[0055] Figure 7 It is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0056] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0057] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, or product end including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products, or ends.

[0058] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0059] like Figure 1-Figure 4 As shown, a bubble control may or may not have an arrow (such as Figure 4 As shown), the bubble space with arrows may be pointing upward (such as Figure 1 as shown), downward (as shown Figure 2 ), to the left (as shown), Figure 3 As shown), downward. Interface transcoding refers to the process of converting user interface design into code, which can automatically convert the user interface design created by a graphical user interface designer into the code required for front-end development, thereby speeding up the development process and reducing the workload of manual code writing. The present invention provides a method for determining the arrow direction of a bubble control, which helps to generate more accurate code for the bubble control during interface transcoding.

[0060] See also Figure 5 As shown, Figure 5 1 is a flow chart of a method for determining the arrow direction of a bubble control disclosed in an embodiment of the present invention. Figure 5 As shown, the method for determining the direction of the arrow of the bubble control may include the following operations:

[0061] S501, obtaining image data of a bubble control;

[0062] In an optional embodiment, the step of obtaining image data of the bubble control includes:

[0063] Get the original image of the bubble control;

[0064] Determine whether the original image includes a transparent image channel:

[0065] When it is not included, determining that the original image is image data of the bubble control;

[0066] When included, multiple preset pure color background images are superimposed on the original image respectively to obtain corresponding intermediate image data; from all the intermediate image data, the image data with the largest color value variance is filtered out as the image data of the bubble control.

[0067] In this optional embodiment, the transparent image channel, also called the Alpha channel, is a channel of an image, used to represent the transparency information of the image, such as the transparency channel of a PNG image.

[0068] The colors of the various preset solid color background images should contrast with the main color of the bubble control. Common solid color backgrounds can be white, black, red, green, blue, etc. In this embodiment, black and white solid color background images are selected.

[0069] Overlaying a solid color background image with the original image means replacing the transparent part of the original image with a preset specific solid color.

[0070] The color value variance of an image is one of the statistics that measures the degree of variation or distribution of color values ​​in an image. The color value variance indicates the degree of dispersion or difference between pixel color values ​​in an image. If the color value variance of an image is small, it means that the colors in the image are relatively concentrated and the tones are relatively consistent; if the color value variance is large, it means that the colors in the image are widely distributed and the color variations are relatively rich.

[0071] The method for calculating the color value variance of the intermediate image data is as follows: for each color channel, the average color value of all its pixels is calculated; for each color channel of each pixel, the square of the difference between its color value and the corresponding channel average value is calculated; the squares of all the differences corresponding to each color channel are summed, and then divided by the total number of pixels to obtain the variance of each color channel; the variance of each color channel is summed or averaged as the color value variance.

[0072] S502, calculating the image data according to an edge detection algorithm to obtain a contour image thereof;

[0073] In an optional embodiment, the step of calculating the image data according to an edge detection algorithm to obtain its contour image includes:

[0074] Binarizing the image data to be processed to obtain a binary image;

[0075] Based on the edge detection algorithm, the binary image is processed to obtain its contour image.

[0076] In this optional embodiment, a binary image refers to an image containing only two pixel values, black and white. In a binary image, each pixel is either black (usually represented by 0) or white (usually represented by 1), and no other grayscale values ​​exist. Binarization is the process of converting a grayscale image or a color image into a binary image. The image data to be processed can be binarized using an adaptive threshold method, a global threshold method, a Bernsen algorithm, etc. This embodiment uses the maximum inter-class variance method to binarize the image data to be processed.

[0077] Edge detection algorithm is a kind of image processing method used to extract the edge of objects in images. Its basic principle is to identify the boundary of objects by detecting the sudden change of grayscale or color in the image. In the image, the edge is usually manifested as a sharp change of grayscale value or color value, showing obvious gradient characteristics. The edge detection algorithm uses this gradient information to locate and extract the edge in the image, such as Canny Edge Detection Algorithm, Sobel Edge Detection Algorithm, and Prewitt Edge Detection Algorithm. The Canny algorithm smoothes the image through Gaussian filtering, calculates the gradient amplitude and direction, performs non-maximum suppression, and uses the double threshold method to connect the edges, and finally obtains a clear and coherent edge map. The Sobel algorithm is a classic edge detection algorithm based on the first-order derivative. It uses two convolution kernels that detect horizontal and vertical edges respectively to convolve the image to obtain horizontal and vertical gradient maps, and then merges the two gradient maps to obtain the final edge map. The Sobel algorithm has a certain suppression effect on noise. The Prewitt algorithm is similar to the Sobel algorithm and is also an edge detection algorithm based on the first-order derivative. It uses two convolution kernels to detect horizontal and vertical edges respectively to convolve the image and obtain an edge map. Unlike the Sobel algorithm, the convolution kernel coefficients of the Prewitt algorithm only contain three values: -1, 0, and 1, so the calculation amount is small.

[0078] S503, calculating the contour image according to a straight line detection algorithm to obtain all straight line segments therein;

[0079] Line detection algorithms are a type of algorithms used in the field of image processing and computer vision to identify and extract straight lines in images. These algorithms are usually based on edge detection, with the goal of extracting complete straight line segments from images containing noise and discontinuous edges. Line detection algorithms play an important role in applications such as lane line recognition, building contour extraction, and industrial visual inspection.

[0080] For example, the Hough transform line detection algorithm, as one of the most classic and widely used line detection algorithms, is based on the principle of Hough transform and realizes line detection and parameter estimation through a voting mechanism from image space to parameter space.

[0081] S504, filtering out target line segments at upper and lower ends of the horizontal direction from among all the straight line segments, and taking them as the first horizontal line segment and the second horizontal line segment in sequence, and filtering out target line segments at left and right ends of the vertical direction, and taking them as the first vertical line segment and the second vertical line segment in sequence;

[0082] In this optional embodiment, all line segments whose slopes differ from 0 less than a preset horizontal threshold are found. Then, the intercepts of these line segments are compared, and the line segment with the smallest intercept is selected as the first horizontal line segment, and the line segment with the largest intercept is selected as the second horizontal line segment. All line segments whose slopes are greater than the vertical threshold are found, and the x coordinates of these line segments in computer image coordinates are compared, and the line segment with the smallest x coordinate is selected as the first vertical line segment, and the line segment with the largest x coordinate is selected as the second vertical line segment. Computer image coordinates are two-dimensional rectangular coordinates, with the origin located at the upper left corner of the image, the y coordinate increases downward, and the x coordinate increases to the right.

[0083] In an optional embodiment, the step of filtering out target line segments at upper and lower ends in the horizontal direction and filtering out target line segments at left and right ends in the vertical direction from among all straight line segments comprises:

[0084] Among all the straight line segments, filter out the upper and lower ends in the horizontal direction and the left and right ends in the vertical direction, and obtain all the line segments at the four positions as candidate line segments at the corresponding positions;

[0085] For each of said positions:

[0086] Determine the number of corresponding candidate line segments:

[0087] If there is more than one line segment, filter out the line segment with the longest line segment length among all candidate line segments and use it as the target line segment at the position;

[0088] When there is only one candidate line segment, determine the candidate line segment as the target line segment at the position;

[0089] When it is zero, a virtual line segment of a preset length is added to the position as the target line segment of the position.

[0090] In this optional embodiment, the preset length of the virtual line segment refers to a constant preset to prevent division by zero errors, and the value of the constant is at least two orders of magnitude smaller than the length of the target line segment at other positions. For example, the length of the target line segment at other positions is 5, and the preset length is less than 0.05.

[0091] S505. Determine the arrow direction of the bubble control according to the length of the first horizontal line segment, the length of the second horizontal line segment, the length of the first vertical line segment, and the length of the second vertical line segment.

[0092] In an optional embodiment, the step of determining the arrow direction of the bubble control according to the length of the first horizontal line segment, the length of the second horizontal line segment, the length of the first vertical line segment, and the length of the second vertical line segment includes:

[0093] Calculating a length ratio of the first horizontal line segment to the second horizontal line segment to obtain a first ratio;

[0094] Calculating a ratio of the lengths of the first vertical line segment to the length of the second vertical line segment to obtain a second ratio;

[0095] The arrow direction of the bubble control is determined according to the first ratio and the second ratio.

[0096] In a further optional embodiment, the step of determining the arrow direction of the bubble control according to the first ratio and the second ratio includes:

[0097] Comparing the first ratio with a preset first threshold and a preset second threshold, wherein the first threshold is greater than the second threshold;

[0098] When the first ratio is greater than the first threshold, it is determined that the arrow direction is downward;

[0099] When the first ratio is less than the second threshold, it is determined that the direction of the arrow is upward;

[0100] When the second threshold ≤ the first ratio ≤ the first threshold, the arrow direction of the bubble control is determined according to the second ratio.

[0101] In this optional embodiment, the first threshold is greater than 1, and the second threshold is less than 1.

[0102] For example, the first threshold is 1.1, and the second threshold is 0.9. When the length of the first horizontal line segment is 5, the length of the second horizontal line segment is 10, the first ratio is 0.5, the first ratio is < the second threshold 0.9, and the direction of the arrow of the bubble control is upward. When the length of the first horizontal line segment is 12, the length of the second horizontal line segment is 10, the first ratio is 1.2, the first ratio is > the first threshold 1.1, and the direction of the arrow of the bubble control is downward. When the length of the first horizontal line segment is 10.5, the length of the second horizontal line segment is 10, the first ratio is 1.05, the second threshold 0.9≤first ratio≤first threshold 1.1, and the direction of the arrow of the bubble control is determined according to the second ratio.

[0103] In a further optional embodiment, the step of determining the arrow direction of the bubble control according to the second ratio includes:

[0104] When the second ratio is greater than the first threshold, it is determined that the direction of the arrow is rightward;

[0105] When the second ratio is less than the second threshold, it is determined that the direction of the arrow is leftward;

[0106] When the second threshold ≤ the second ratio ≤ the first threshold, the bubble control has no arrow direction.

[0107] For example, the first threshold is 1.1, and the second threshold is 0.9. When the length of the first vertical line segment is 5, the length of the second vertical line segment is 10, the second ratio is 0.5, the second ratio is < the second threshold 0.9, and the arrow direction of the bubble control is to the left. When the length of the first vertical line segment is 12, the length of the second vertical line segment is 10, the second ratio is 1.2, the second ratio is > the first threshold 1.1, and the arrow direction of the bubble control is to the right. When the length of the first vertical line segment is 10.5, the length of the second vertical line segment is 10, the second ratio is 1.05, the second threshold 0.9≤second ratio≤first threshold 1.1, then the bubble control has no arrow direction.

[0108] See also Figure 6 As shown, Figure 6 Schematic diagram of a system for determining the arrow direction of a bubble control disclosed in an embodiment of the present invention. Figure 6 As shown, the judgment system of the arrow direction of the bubble control may include:

[0109] An acquisition module 601 is used to acquire image data of a bubble control;

[0110] A first calculation module 602 is used to calculate the image data according to an edge detection algorithm to obtain a contour image thereof;

[0111] A second calculation module 603 is used to calculate the contour image according to a straight line detection algorithm to obtain all straight line segments therein;

[0112] The filtering module 604 is used to filter out the target line segments at the upper and lower ends of the horizontal direction from all the straight line segments, and use them as the first horizontal line segment and the second horizontal line segment in sequence, and filter out the target line segments at the left and right ends of the vertical direction, and use them as the first vertical line segment and the second vertical line segment in sequence;

[0113] The judgment module 605 is used to judge the arrow direction of the bubble control according to the length of the first horizontal line segment, the length of the second horizontal line segment, the length of the first vertical line segment and the length of the second vertical line segment.

[0114] For the specific limitations of the system for determining the direction of the arrow of the bubble control, please refer to the limitations of the method for determining the direction of the arrow of the bubble control above, which will not be repeated here. Each module in the above-mentioned system for determining the direction of the arrow of the bubble control can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the electronic device in hardware format, or can be stored in the memory of the electronic device in software format, so that the processor can call the operations corresponding to the above modules.

[0115] It should be noted that, in order to highlight the innovative part of the present invention, the present embodiment does not introduce modules that are not closely related to solving the technical problem proposed by the present invention, but this does not mean that there are no other modules in the present embodiment.

[0116] like Figure 7 As described above, the electronic device 1 provided by the present invention may include a memory 12, a processor 13 and a bus, and may also include a computer program stored in the memory 12 and executable on the processor 13, such as a program for determining the arrow direction of a bubble control.

[0117] Among them, the memory 12 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. The memory 12 can be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1. The memory 12 can also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 12 can also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 12 can not only be used to store application software and various types of data installed in the electronic device 1, such as the code for judging the arrow direction of the bubble control, etc., but also can be used to temporarily store data that has been output or is to be output.

[0118] In some embodiments, the processor 13 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and a combination of various control chips. The processor 13 is the control core (Control Unit) of the electronic device 1, and uses various interfaces and lines to connect the various components of the entire electronic device 1, and executes or executes the programs or modules stored in the memory 12 (such as the judgment program of the arrow direction of the bubble control, etc.), and calls the data stored in the memory 12 to execute various functions of the electronic device 1 and process data.

[0119] The processor 13 executes the operating system and various installed applications of the electronic device 1. The processor 13 executes the applications to implement the steps in the method for determining the arrow direction of the bubble control.

[0120] Exemplarily, the computer program may be divided into one or more modules, which are stored in the memory 12 and executed by the processor 13 to complete the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the electronic device 1. For example, the computer program may be divided into an acquisition module 601, a first calculation module 602, a second calculation module 603, a filtering module 604, and a judgment module 605.

[0121] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium, and the storage medium can be non-volatile or volatile. The above-mentioned software function module is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a processor to perform part of the functions of the method for determining the arrow direction of the bubble control described in each embodiment of the present application.

[0122] In one embodiment, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps implemented when the processor executes the computer program can also be implemented.

[0123] In summary, the method, system, device and medium for judging the arrow direction of a bubble control disclosed in the present invention do not require a large number of training samples and have low implementation costs; at the same time, since it is directly based on the calculation and analysis of image data, the recognition speed is fast and the efficiency is high. Therefore, the present invention effectively overcomes various shortcomings in the prior art and has a high industrial utilization value.

[0124] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. A method for determining the direction of an arrow of a bubble control, characterized in that: The method comprises: Get the image data of the bubble control; Calculating the image data according to an edge detection algorithm to obtain a contour image thereof; Calculating the contour image according to a straight line detection algorithm to obtain all straight line segments therein; Among all the straight line segments, the target line segments at the upper and lower ends in the horizontal direction are filtered out respectively, and are used as the first horizontal line segment and the second horizontal line segment in sequence. The target line segments at the left and right ends in the vertical direction are filtered out respectively, and are used as the first vertical line segment and the second vertical line segment in sequence. The arrow direction of the bubble control is determined according to the length of the first horizontal line segment, the length of the second horizontal line segment, the length of the first vertical line segment, and the length of the second vertical line segment.

2. A method for determining the direction of an arrow of a bubble control according to claim 1, characterized in that: The step of calculating the image data according to the edge detection algorithm to obtain its contour image comprises: Binarizing the image data to be processed to obtain a binary image; Based on the edge detection algorithm, the binary image is processed to obtain its contour image.

3. The method for determining the arrow direction of a bubble control according to claim 1, characterized in that: The steps to obtain the image data of the bubble control include: Get the original image of the bubble control; Determine whether the original image includes a transparent image channel: When it is not included, determining that the original image is image data of the bubble control; When included, multiple preset pure color background images are superimposed on the original image respectively to obtain corresponding intermediate image data; from all the intermediate image data, the image data with the largest color value variance is filtered out as the image data of the bubble control.

4. The method for determining the arrow direction of a bubble control according to claim 1, characterized in that: The steps of filtering out target line segments at upper and lower ends of the horizontal direction and filtering out target line segments at left and right ends of the vertical direction from among all the straight line segments include: Among all the straight line segments, filter out the upper and lower ends in the horizontal direction and the left and right ends in the vertical direction, and obtain all the line segments at the four positions as candidate line segments at the corresponding positions; For each of said positions: Determine the number of corresponding candidate line segments: If there is more than one line segment, filter out the line segment with the longest line segment length among all candidate line segments and use it as the target line segment at the position; When there is only one candidate line segment, determine the candidate line segment as the target line segment at the position; When it is zero, a virtual line segment of a preset length is added to the position as the target line segment of the position.

5. The method for determining the arrow direction of a bubble control according to claim 1, characterized in that: The step of determining the arrow direction of the bubble control according to the length of the first horizontal line segment, the length of the second horizontal line segment, the length of the first vertical line segment, and the length of the second vertical line segment comprises: Calculating a length ratio of the first horizontal line segment to the second horizontal line segment to obtain a first ratio; Calculating a ratio of the lengths of the first vertical line segment to the length of the second vertical line segment to obtain a second ratio; The arrow direction of the bubble control is determined according to the first ratio and the second ratio.

6. A method for determining the direction of an arrow of a bubble control according to claim 5, characterized in that: The step of determining the arrow direction of the bubble control according to the first ratio and the second ratio includes: Comparing the first ratio with a preset first threshold and a preset second threshold, wherein the first threshold is greater than the second threshold; When the first ratio is greater than the first threshold, it is determined that the direction of the arrow is downward; When the first ratio is less than the second threshold, it is determined that the direction of the arrow is upward; When the second threshold ≤ the first ratio ≤ the first threshold, the arrow direction of the bubble control is determined according to the second ratio.

7. A method for determining the arrow direction of a bubble control according to claim 6, characterized in that: The step of determining the arrow direction of the bubble control according to the second ratio includes: When the second ratio is greater than the first threshold, it is determined that the direction of the arrow is rightward; When the second ratio is less than the second threshold, it is determined that the direction of the arrow is leftward; When the second threshold ≤ the second ratio ≤ the first threshold, the bubble control has no arrow direction.

8. A system for determining the direction of an arrow of a bubble control, characterized in that: include: An acquisition module, used for acquiring image data of a bubble control; A first calculation module, used to calculate the image data according to an edge detection algorithm to obtain a contour image thereof; A second calculation module is used to calculate the contour image according to a straight line detection algorithm to obtain all straight line segments therein; A filtering module is used to filter out target line segments at upper and lower ends of the horizontal direction from all the straight line segments, and use them as the first horizontal line segment and the second horizontal line segment in sequence, and filter out target line segments at left and right ends of the vertical direction, and use them as the first vertical line segment and the second vertical line segment in sequence; A judgment module is used to judge the arrow direction of the bubble control according to the length of the first horizontal line segment, the length of the second horizontal line segment, the length of the first vertical line segment and the length of the second vertical line segment.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method for determining the arrow direction of the bubble control as described in any one of claims 1 to 7 are implemented.

10. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for determining the arrow direction of the bubble control as described in any one of claims 1 to 7 are implemented.