CN115826825A - Click object detection method and device, computer equipment and storage medium - Google Patents

Click object detection method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN115826825A
CN115826825A CN202211279622.3A CN202211279622A CN115826825A CN 115826825 A CN115826825 A CN 115826825A CN 202211279622 A CN202211279622 A CN 202211279622A CN 115826825 A CN115826825 A CN 115826825A
Authority
CN
China
Prior art keywords
click
position information
area
determining
drawing container
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211279622.3A
Other languages
Chinese (zh)
Inventor
庞少飞
周超
沈小勇
吕江波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Smartmore Technology Co Ltd
Original Assignee
Shenzhen Smartmore Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Smartmore Technology Co Ltd filed Critical Shenzhen Smartmore Technology Co Ltd
Priority to CN202211279622.3A priority Critical patent/CN115826825A/en
Publication of CN115826825A publication Critical patent/CN115826825A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • User Interface Of Digital Computer (AREA)

Abstract

The application relates to a method and a device for detecting a click object, computer equipment and a storage medium, and relates to the technical field of computers. The method comprises the following steps: acquiring click position information of a click position according to the click position corresponding to the click operation instruction aiming at the drawing container; the click position is any position in the drawing container; determining a click area corresponding to the click position from a plurality of areas pre-divided by the drawing container based on the click position information; each region has a corresponding candidate correlation object; and acquiring a candidate associated object corresponding to the click area, and determining the object selected by the click operation instruction according to the candidate associated object corresponding to the click area and the click position information. By adopting the method, the time and the computer computing power consumed in the process of judging all the graphic objects can be reduced.

Description

Click object detection method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a computer device, a storage medium, and a computer program product for detecting a click object.
Background
With the widespread use of HTML5 technology, canvas, an added element of HTML5, is also more well known. However, the Canvas element is only a drawing container, and a graphic event for the Canvas element can only be added to the Canvas element itself and cannot be added to a graphic object in the Canvas element. Therefore, if the graphical object in the Canvas element is required to respond to the operation of the user, the check of the graphical object needs to be performed.
In the conventional technology, when click detection is performed on a large number of graphic objects in Canvas, all the graphic objects need to be traversed in sequence, then a mathematical method of cross number or surrounding number is used for calculating coordinates, the calculation consumes a large amount of CPU resources, and the click detection is serious on terminal equipment.
Disclosure of Invention
The application provides a click object detection method, a click object detection device, computer equipment, a computer readable storage medium and a computer program product.
In a first aspect, the present application provides a click object detection method. The method comprises the following steps:
acquiring click position information of a click position according to the click position corresponding to the click operation instruction aiming at the drawing container; the click position is any position in the drawing container;
determining a click area corresponding to the click position from a plurality of areas pre-divided by the drawing container based on the click position information; each region has a corresponding candidate associated object;
and acquiring a candidate associated object corresponding to the click area, and determining an object selected by the click operation instruction according to the candidate associated object corresponding to the click area and the click position information.
In one of the embodiments, the first and second electrodes are,
the determining, based on the click position information, a click area corresponding to the click position from a plurality of areas pre-partitioned by the drawing container includes:
acquiring region position information of each region;
determining the area range of each area according to the area position information;
and determining a target area range containing the click position information from each area range, and determining an area corresponding to the target area range as a click area.
In one of the embodiments, the first and second electrodes are,
the determining the object selected by the click operation instruction according to the candidate associated object corresponding to the click area and the click position information includes:
acquiring object position information of the candidate associated object;
determining the coverage range of the candidate associated object in the drawing container according to the object position information;
and determining the candidate associated object corresponding to the target coverage range containing the click position information as the object selected by the click operation instruction.
In one embodiment, the determining, as the object selected by the click operation instruction, the candidate associated object corresponding to the target coverage area containing the click position information includes:
if at least two candidate associated objects corresponding to the target coverage range containing the click position information exist, acquiring the drawing time of the candidate associated objects corresponding to the target coverage range containing the click position information;
and repeating the click operation instruction, traversing and selecting the candidate associated object corresponding to the target coverage range containing the click position information according to the drawing time sequence, and determining the object selected by the click operation instruction.
In one embodiment, the method comprises:
and determining the target coverage range from the coverage range of the candidate associated object in the drawing container by a surrounding number method or a cross number method.
In one embodiment, before determining, according to the click position information, a click area corresponding to the click position from a plurality of areas included in the drawing container, the method further includes:
acquiring size information of the drawing container;
and performing area segmentation on the drawing container based on the size information to obtain the plurality of areas.
In one embodiment, after performing region segmentation on the drawing container based on the size information to obtain the plurality of regions, the method further includes:
acquiring graph position information of a graph object in a drawing container; the graphic object is drawn in the drawing container in advance;
obtaining the intersection condition of the graphic object and each region according to the graphic position information and the region position information of each region;
and determining the candidate associated object corresponding to each region according to the intersection condition.
In a second aspect, the application further provides a click object detection device. The device comprises:
the click detection module is used for acquiring click position information of a click position according to the click position corresponding to the click operation instruction aiming at the drawing container; the click position is any position in the drawing container;
the object mapping module is used for determining a click area corresponding to the click position from a plurality of areas pre-divided by the drawing container based on the click position information; each region has a corresponding candidate correlation object;
and the selection judgment module is used for acquiring the candidate associated object corresponding to the click area and determining the object selected by the click operation instruction according to the candidate associated object corresponding to the click area and the click position information.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the following steps when executing the computer program:
acquiring click position information of a click position according to the click position corresponding to the click operation instruction aiming at the drawing container; the click position is any position in the drawing container;
determining a click area corresponding to the click position from a plurality of areas pre-divided by the drawing container based on the click position information; each region has a corresponding candidate associated object;
and acquiring a candidate associated object corresponding to the click area, and determining the object selected by the click operation instruction according to the candidate associated object corresponding to the click area and the click position information.
In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
acquiring click position information of a click position according to the click position corresponding to the click operation instruction aiming at the drawing container; the click position is any position in the drawing container;
determining a click area corresponding to the click position from a plurality of areas pre-divided by the drawing container based on the click position information; each region has a corresponding candidate correlation object;
and acquiring a candidate associated object corresponding to the click area, and determining the object selected by the click operation instruction according to the candidate associated object corresponding to the click area and the click position information.
In a fifth aspect, the present application further provides a computer program product. The computer program product comprising a computer program which when executed by a processor performs the steps of:
acquiring click position information of a click position according to the click position corresponding to the click operation instruction aiming at the drawing container; the click position is any position in the drawing container;
determining a click area corresponding to the click position from a plurality of areas pre-divided by the drawing container based on the click position information; each region has a corresponding candidate associated object;
and acquiring a candidate associated object corresponding to the click area, and determining the object selected by the click operation instruction according to the candidate associated object corresponding to the click area and the click position information.
According to the click object detection method, the click object detection device, the computer equipment, the storage medium and the computer program product, the area of the drawing container is divided, and after the click operation instruction is triggered, only the graphic object corresponding to the divided area triggered by the click operation instruction needs to be judged, so that the time consumed in the process of judging all the graphic objects and the computer computing power are reduced.
Drawings
FIG. 1 is a flowchart illustrating a method for detecting a hit object according to an embodiment;
FIG. 2 is a flowchart illustrating a method for detecting a clicked object in another embodiment;
FIG. 3 is a flowchart illustrating a click event initiation step in one embodiment;
FIG. 4 is a flowchart illustrating the click event processing steps in one embodiment;
FIG. 5 is a flowchart illustrating the step of creating a segmented mesh system in one embodiment;
FIG. 6 is a flowchart illustrating the steps of the graphical object binding segmentation grid system in one embodiment;
FIG. 7 is a diagram illustrating an application of the hit object detection method in one embodiment;
FIG. 8 is a block diagram showing the structure of a click object detection apparatus according to an embodiment;
FIG. 9 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In an embodiment, as shown in fig. 1, a click object detection method is provided, and this embodiment is illustrated by applying the method to a terminal, and it is to be understood that the method may also be applied to a server, and may also be applied to a system including a terminal and a server, and is implemented by interaction between the terminal and the server. In this embodiment, the method includes the steps of:
step 101, acquiring click position information of a click position according to the click position corresponding to a click operation instruction aiming at a drawing container; the click position is any position in the drawing container.
The drawing container may be a Canvas (a label in HTML 5), and is mainly used for drawing the graphic object in the container.
The click operation instruction can be sent by a mouse terminal or a terminal with a touch screen.
The position information may be obtained by establishing a rectangular coordinate system or a polar coordinate system, or may be obtained based on a pixel grid of the drawing container.
In the specific implementation, after the terminal acquires the click operation instruction, click position information is acquired according to the position triggered by the click operation instruction, and the click position information is temporarily stored in the memory.
102, determining a click area corresponding to the click position from a plurality of areas pre-divided by the drawing container based on the click position information; each region has a corresponding candidate associated object.
The multiple regions of the drawing container may be obtained by dividing the same geometric figure or by dividing different geometric figures, and the geometric figures may be regular figures (such as rectangles, triangles, etc.) or irregular figures.
In the specific implementation, a plurality of areas pre-divided into the drawing container are recorded in the memory of the terminal, and the click position is judged within the range of which area according to the click position information of the click operation instruction, so as to obtain the corresponding click area. And establishing a mapping relation between each click area and the corresponding candidate associated object in advance, and recording the mapping relation in a terminal memory.
Step 103, obtaining the candidate associated object corresponding to the click area, and determining the object selected by the click operation instruction according to the candidate associated object corresponding to the click area and the click position information.
In specific implementation, according to the click area, the mapping relation in the memory is queried to obtain a candidate associated object corresponding to the click area. And judging the range of the candidate associated object in which the click position is located according to the coverage range and the click position information of the candidate associated object, and further obtaining the object selected by the click operation instruction.
In the click object detection method, the area of the drawing container is divided, and after the click operation instruction is triggered, only the graphic object corresponding to the divided area triggered by the click operation instruction needs to be judged, so that the time and the computer computing power consumed in the process of judging all the graphic objects are reduced.
In one embodiment, before determining, in step 102, a click region corresponding to the click position from a plurality of regions included in the drawing container according to the click position information, the method specifically includes the following steps:
step 1021, obtaining size information of the drawing container;
in step 1022, the drawing container is divided into a plurality of regions based on the size information.
Where the size information is determined based on the shape of the drawing container, for example, where the shape of the drawing container is a rectangle, the size information may be the length and width of the rectangle.
In a specific implementation, since the drawing container needs to be completely covered by the divided area, the size information of the drawing container needs to be acquired, and the area division is performed based on the size information, so that each area is not overlapped and the drawing container is completely covered.
In this embodiment, according to the size information of the drawing container, the drawing container is subjected to region segmentation, and preparation is made for establishing a mapping relationship between a subsequent graphic object and a region.
In one embodiment, after the step 1022 of performing area segmentation on the drawing container based on the size information to obtain a plurality of areas, the method specifically includes the following steps:
step 1022A, acquiring the graphic position information of the graphic object in the drawing container; the graphic object is drawn in a drawing container in advance;
step 1022B, obtaining the intersection condition of the graphic object and each region according to the graphic position information and the region position information of each region;
and step 1022C, according to the intersection condition, determining the graphic object having an overlapping part with the region as a candidate associated object corresponding to the region.
In a specific implementation, the graph position information of the graph object can be obtained through the established rectangular coordinate system; judging the intersection condition according to the graph position information and the area position information, and if the graph object intersects with the area, namely the graph object comprises the area, the area comprises the graph object or the graph object only intersects with the area, establishing a mapping relation; if the graphic object and the region are completely disjoint, that is, the graphic object and the region do not have any overlapped part, the graphic object and the region do not establish a mapping relationship.
In the embodiment, the corresponding mapping relation is established according to the position information established by the graphic object and the region, so that the object range required to be judged by the subsequent click operation instruction is reduced.
In one embodiment, the step 102 of determining, based on the click position information, a click area corresponding to the click position from a plurality of areas pre-partitioned by the drawing container may specifically be implemented by the following steps:
step 1023, obtaining area position information of each area;
step 1024, determining the area range of each area according to the area position information;
step 1025, determining a target area range containing the click position information from each area range, and determining an area corresponding to the target area range as a click area.
In a specific implementation, the coordinate information of each region can be obtained through the established rectangular coordinate system, and the coordinate information comprises vertex coordinate information of a polygon or dot coordinate information of an arc; determining the coverage area of each area according to the coordinate information; and judging the coverage range of the coordinate information in which area according to the click position information, namely the coordinate information of the click position, and further determining the click area.
In the embodiment, the corresponding area triggered by the click operation instruction is determined, so that the area range of the click operation instruction needing to be judged is narrowed, and the time and the computer computing power consumed in the judging process are reduced.
In one embodiment, the step 103 determines the object selected by the click operation instruction according to the candidate associated object corresponding to the click area and the click position information, and may specifically be implemented by the following steps:
step 1031, acquiring object position information of the candidate correlation object;
step 1032, determining the coverage range of the candidate associated object in the drawing container according to the object position information;
and 1033, determining the candidate associated object corresponding to the target coverage range containing the click position information as the object selected by the click operation instruction.
In a specific implementation, the coordinate information of each candidate associated object may be obtained through the established rectangular coordinate system, including vertex coordinate information of a polygon or dot coordinate information of an arc; determining the coverage range of each candidate associated object according to the coordinate information; and judging whether the coordinate information is in the coverage range of the candidate associated object according to the click position information, namely the coordinate information of the click position, and further determining the object selected by the click operation instruction.
In the embodiment, the corresponding candidate associated objects are obtained by dividing the area, so that the number of objects needing to be judged by clicking the operation instruction is reduced, and the time and the computer computing power consumed in the judgment process are reduced.
In an embodiment, the step 1033 determines the candidate associated object corresponding to the target coverage range containing the click position information as the object selected by the click operation instruction, and may specifically be implemented by the following steps:
step 1033A, if there are at least two candidate associated objects corresponding to the target coverage area containing the click position information, obtaining the drawing time of the candidate associated object corresponding to the target coverage area containing the click position information;
and 1033B, repeating the click operation instruction, traversing and selecting the candidate associated object corresponding to the target coverage range containing the click position information according to the sequence of the drawing time, and determining the object selected by the click operation instruction.
In the specific implementation, candidate associated objects corresponding to all target coverage areas containing click position information are recorded in a memory, the candidate associated objects recorded in the memory are sequentially selected according to a drawing sequence through repeated click operation instructions, and meanwhile, the current candidate associated objects are removed from the memory, so that the graphic object required by a user is determined.
In this embodiment, the selected graphical object is specifically determined by traversing the selected candidate associated object, and the desired graphical object can be effectively selected from the stacked graphical objects.
In one embodiment, the method further comprises:
and determining a target coverage range from the coverage ranges of the candidate associated objects in the drawing container by a surrounding number method or a cross number method.
In a specific implementation, since the graphic object may be a self-intersecting graphic, if a simple coordinate is adopted, the judgment will be inaccurate, and therefore some geometric methods are required for the judgment. The coverage range of the candidate associated object may be obtained through the established rectangular coordinate system, and whether the coverage range of the candidate associated object includes the click position is determined by using the selected geometric method, so as to determine the object selected by the click operation instruction.
More specifically, the geometric method may be a cross-number method. By making a ray emitted to any one edge of the graphic object at the clicking position, when the number of times of intersection of the ray and the edge of the graphic object is an odd number, the clicking position is in the graphic object; when the number of times the ray intersects an edge of the graphical object is even, then the click position is outside the graphical object.
Further, the geometric method may be a number of turns method. By making a horizontal ray to the right at the click position, if a certain edge of the graphic object passes through the ray from bottom to top, the number of the surrounding is increased by one; if one side of the graph object passes through the ray from top to bottom, the number of the surrounding is reduced by one; and when the final number of the surrounding is not 0, the clicking position is inside the graphic object, and when the final number of the surrounding is 0, the clicking position is outside the graphic object.
In this embodiment, the inclusion relationship between the graphical object and the click position is determined by applying a geometric method, so that a more accurate result can be obtained, and the graphical object selected by the click operation instruction is determined. In another embodiment, as shown in fig. 2, a method for detecting a click object is provided, which includes the following steps:
step 201, obtaining size information of a drawing container; based on the size information, the drawing container is subjected to region division to obtain a plurality of regions.
Step 202, obtaining the graph position information of the graph object in the drawing container; the graphic object is a graphic drawn in a drawing container; obtaining the intersection condition of the graphic object and each region according to the graphic position information and the region position information of each region; and determining candidate associated objects corresponding to each region according to the intersection condition.
Step 203, acquiring click position information of a click position according to the click position corresponding to the click operation instruction aiming at the drawing container; the click location is any location in the drawing container.
Step 204, acquiring area position information of each area; determining the area range of each area according to the area position information; and determining a target area range containing click position information from the area ranges, and determining an area corresponding to the target area range as a click area.
Step 205, acquiring object position information of the candidate associated object; and determining the coverage range of the candidate associated object in the drawing container according to the object position information.
And step 206, determining a target coverage range from the coverage ranges of the candidate associated objects in the drawing container by a surrounding number method or a cross number method. And determining the candidate associated object corresponding to the target coverage range containing the click position information as the object selected by the click operation instruction.
In specific implementation, the position information can be accurately expressed by establishing a rectangular coordinate system, and the position can be conveniently and subsequently judged. Meanwhile, in order to match the expression mode of the rectangular coordinate system, the plurality of regions can be obtained by uniformly dividing a plurality of rectangles. If the click position is on the boundary of the adjacent region, a rule can be set to specifically determine the selected click region; for example, the click position is on the vertical boundary of the adjacent rectangular area, and the rectangular area on the right side of the selected boundary is set but the rectangular area on the left side of the selected boundary is not selected; for another example, the click position is located on the horizontal boundary of the adjacent rectangular region, and the rectangular region below the selected boundary is set, but the rectangular region above the selected boundary is not selected; for another example, the click position is located at the boundary intersection of four adjacent rectangular areas, and the rectangular area at the lower right side of the four adjacent rectangular areas is set and selected.
In the embodiment, by performing region segmentation on the drawing container, after the click operation instruction is triggered, only the graphic object corresponding to the segmented region triggered by the click operation instruction needs to be judged, so that the time and the computer computing power consumed in the process of judging all the graphic objects are reduced.
To facilitate understanding of the embodiments of the present application by those skilled in the art, a Canvas will be taken as an example of a drawing container, and the present application will be described with reference to specific examples of the drawings, which mainly include two steps: an initialization process and an event handling process.
Referring to fig. 3, the initialization process specifically includes the following steps:
step 301, creating a Canvas;
step 302, creating a segmentation grid system;
step 303, binding a segmentation grid system by the graphic object;
step 304, drawing the graphic object.
In a specific implementation, the sequence of step 303 and step 304 is not strictly limited. The method specifically comprises the steps of firstly binding the segmentation grids according to the information of the graphic object to be drawn, and then drawing the graphic object on a Canvas; or drawing the graphic object on a Canvas first, and then binding the segmentation grids according to the information of the graphic object drawn in the drawing container.
Referring to fig. 4, the event processing process specifically includes the following steps:
step 401, obtaining a click operation coordinate;
step 402, calculating a segmentation grid corresponding to a click operation coordinate;
step 403, acquiring coordinates of all graphic objects under the segmentation grid;
step 404, traversing all objects under the segmentation grid by using a wrap around method;
in step 405, the selected object is determined.
Referring to fig. 5, step 302 specifically includes the following steps:
step 501, acquiring the width and the height of a Canvas;
step 502, creating a rectangular coordinate system and a grid;
step 503, calculating coordinates of four points of each grid.
Referring to fig. 6, step 303 specifically includes the following steps:
601, acquiring coordinates of all points of a graphic object;
step 602, a certain edge of the current graphic object passes through the range of four vertexes of the grid;
step 603, establishing a mapping relation between the current graphic object and the corresponding grid.
Specifically, for example, referring to fig. 7, a Canvas is first created, a grid region is then mapped based on the Canvas, and a rectangular coordinate system is created with the upper left vertex of the grid region as the origin of coordinates, the horizontal right direction as the X-axis direction, and the vertical downward direction as the Y-axis direction; according to the width W and the height H of the Canvas, dividing the width of the Canvas into M parts and dividing the height of the Canvas into N parts to obtain an N x M grid area; calculating the vertex coordinates of each mesh, as shown in the figure, the coordinates of four points of mesh N are: the top left corner (0,H/N (N-1)), the top right corner (W/M, H/N (N-1)), the bottom left corner (0,H/N), the bottom right corner (W/M, H/N); when a graphic object needs to be drawn, calculating the coordinates of each point of the graphic object according to the drawing position information of the graphic object, and establishing a mapping relation between the current graphic object and a corresponding grid according to the condition that a certain edge of the current graphic object passes through the range of four vertexes of the grid; simultaneously drawing a graphic object on a Canvas; when the click operation instruction is triggered on the Canvas, finding the corresponding grid in the grid area according to the click coordinate, finding the corresponding graphic object according to the mapping relation of the grid, traversing the corresponding graphic object by using a surrounding number method, and determining the selected graphic object according to the result of the surrounding number method.
In the embodiment, by performing region segmentation on the drawing container, after the click operation instruction is triggered, only the graphic object corresponding to the segmented region triggered by the click operation instruction needs to be judged, so that the time and the computer computing power consumed in the process of judging all the graphic objects are reduced.
It should be understood that, although the steps in the flowcharts related to the embodiments as described above are sequentially displayed as indicated by arrows, the steps are not necessarily performed sequentially as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be rotated or alternated with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the application also provides a click object detection device for realizing the click object detection method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so that specific limitations in one or more embodiments of the click object detection device provided below can be referred to the limitations on the click object detection method in the above description, and details are not repeated herein.
In one embodiment, as shown in fig. 8, there is provided a click object detection apparatus including: click detection module, object mapping module and select the judgement module, wherein:
the click detection module 801 is configured to obtain click position information of a click position according to the click position corresponding to the click operation instruction for the drawing container; the click location is any location in the drawing container.
An object mapping module 802, configured to determine, based on the click position information, a click region corresponding to a click position from a plurality of regions pre-partitioned by the drawing container; each region has a corresponding candidate correlation object.
And the selection judgment module 803 is configured to acquire a candidate associated object corresponding to the click area, and determine an object selected by the click operation instruction according to the candidate associated object corresponding to the click area and the click position information.
In an embodiment, the object mapping module 802 is further configured to obtain area location information of each area; determining the area range of each area according to the area position information; and determining a target area range containing click position information from the area ranges, and determining an area corresponding to the target area range as a click area.
In an embodiment, the selecting and determining module 803 is further configured to obtain object location information of the candidate associated object; determining the coverage range of the candidate associated object in the drawing container according to the object position information; and determining the candidate associated object corresponding to the target coverage range containing the click position information as the object selected by the click operation instruction.
In an embodiment, the selection determining module 803 is further configured to, if there are at least two candidate associated objects corresponding to the target coverage area containing the click position information, obtain the drawing time of the candidate associated object corresponding to the target coverage area containing the click position information; and repeating the click operation instruction, traversing and selecting the candidate associated object corresponding to the target coverage range containing the click position information according to the sequence of the drawing time, and determining the object selected by the click operation instruction.
In an embodiment, the selection determining module 803 is further configured to determine a target coverage from the coverage of the candidate related object in the drawing container by a round-robin or cross-robin method.
In one embodiment, the object mapping module 802 is further configured to obtain size information of the drawing container; based on the size information, the drawing container is subjected to region division to obtain a plurality of regions.
In an embodiment, the object mapping module 802 is further configured to obtain graphic position information of a graphic object in the drawing container; the graphic object is drawn in a drawing container in advance; obtaining the intersection condition of the graphic object and each region according to the graphic position information and the region position information of each region; and determining candidate associated objects corresponding to each region according to the intersection condition.
All or part of the modules in the click object detection device can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 9. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a click object detection method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the configuration shown in fig. 9 is a block diagram of only a portion of the configuration associated with the present application, and is not intended to limit the computing device to which the present application may be applied, and that a particular computing device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
In an embodiment, a computer program product is provided, comprising a computer program which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) referred to in the present application are information and data authorized by the user or sufficiently authorized by each party.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by hardware instructions of a computer program, which may be stored in a non-volatile computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high-density embedded nonvolatile Memory, resistive Random Access Memory (ReRAM), magnetic Random Access Memory (MRAM), ferroelectric Random Access Memory (FRAM), phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (10)

1. A click object detection method, the method comprising:
acquiring click position information of a click position according to the click position corresponding to the click operation instruction aiming at the drawing container; the click position is any position in the drawing container;
determining a click area corresponding to the click position from a plurality of areas pre-divided by the drawing container based on the click position information; each region has a corresponding candidate correlation object;
and acquiring a candidate associated object corresponding to the click area, and determining the object selected by the click operation instruction according to the candidate associated object corresponding to the click area and the click position information.
2. The method according to claim 1, wherein the determining, based on the click position information, a click region corresponding to the click position from a plurality of regions pre-partitioned by the drawing container comprises:
acquiring region position information of each region;
determining the area range of each area according to the area position information;
and determining a target area range containing the click position information from each area range, and determining an area corresponding to the target area range as a click area.
3. The method according to claim 1, wherein the determining the object selected by the click operation instruction according to the candidate associated object corresponding to the click area and the click position information includes:
acquiring object position information of the candidate associated object;
determining the coverage range of the candidate associated object in the drawing container according to the object position information;
and determining the candidate associated object corresponding to the target coverage range containing the click position information as the object selected by the click operation instruction.
4. The method according to claim 3, wherein the determining the candidate associated object corresponding to the target coverage area containing the click position information as the object selected by the click operation instruction comprises:
if at least two candidate associated objects corresponding to the target coverage range containing the click position information exist, obtaining drawing time of the candidate associated objects corresponding to the target coverage range containing the click position information;
and repeating the click operation instruction, traversing and selecting the candidate associated object corresponding to the target coverage range containing the click position information according to the drawing time sequence, and determining the object selected by the click operation instruction.
5. The method of claim 3, further comprising:
and determining the target coverage range from the coverage range of the candidate associated object in the drawing container by a surrounding number method or a cross number method.
6. The method according to claim 1, before determining, according to the click position information, a click region corresponding to the click position from a plurality of regions included in the drawing container, further comprising:
acquiring size information of the drawing container;
and performing area segmentation on the drawing container based on the size information to obtain the plurality of areas.
7. The method according to claim 5, further comprising, after performing region segmentation on the drawing container based on the size information to obtain the plurality of regions:
acquiring graph position information of a graph object in a drawing container; the graphic object is drawn in the drawing container in advance;
obtaining the intersection condition of the graphic object and each region according to the graphic position information and the region position information of each region;
and according to the intersection condition, determining the graphic object which has an overlapped part with the region as a candidate associated object corresponding to the region.
8. A click object detection apparatus, characterized in that the apparatus comprises:
the click detection module is used for acquiring click position information of a click position according to the click position corresponding to the click operation instruction aiming at the drawing container; the click position is any position in the drawing container;
the object mapping module is used for determining a click area corresponding to the click position from a plurality of areas pre-divided by the drawing container based on the click position information; each region has a corresponding candidate correlation object;
and the selection judgment module is used for acquiring the candidate associated object corresponding to the click area and determining the object selected by the click operation instruction according to the candidate associated object corresponding to the click area and the click position information.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202211279622.3A 2022-10-19 2022-10-19 Click object detection method and device, computer equipment and storage medium Pending CN115826825A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211279622.3A CN115826825A (en) 2022-10-19 2022-10-19 Click object detection method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211279622.3A CN115826825A (en) 2022-10-19 2022-10-19 Click object detection method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115826825A true CN115826825A (en) 2023-03-21

Family

ID=85524968

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211279622.3A Pending CN115826825A (en) 2022-10-19 2022-10-19 Click object detection method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115826825A (en)

Similar Documents

Publication Publication Date Title
CN110647608B (en) Map-based mass data aggregation display method, system, equipment and medium
CN109658509B (en) Long and narrow pattern spot partitioning method and device, computer equipment and storage medium
CN111369657A (en) Three-dimensional thermodynamic diagram generation method and device, computer equipment and storage medium
US10565751B2 (en) Method and apparatus for spatial data visualization
CN112346725B (en) Page design method, device, equipment and storage medium
CN114387289B (en) Semantic segmentation method and device for three-dimensional point cloud of power transmission and distribution overhead line
CN114596423A (en) Model rendering method and device based on virtual scene gridding and computer equipment
CN113538623B (en) Method, device, electronic equipment and storage medium for determining target image
CN114675925A (en) Configuration image processing method and device, computer equipment and storage medium
CN115826825A (en) Click object detection method and device, computer equipment and storage medium
CN111744181A (en) In-game information display method and device, game client and medium
CN114022518B (en) Method, device, equipment and medium for acquiring optical flow information of image
CN113867862B (en) List page layout method and computing device
CN115588019A (en) Method and device for determining frame selection object, computer equipment and storage medium
CN111797192B (en) GIS point data rendering method and device, computer equipment and storage medium
CN114327395A (en) Webpage design method, device, computer equipment, storage medium and product
CN114311682A (en) Model generation method, device, equipment and storage medium
CN116883563B (en) Method, device, computer equipment and storage medium for rendering annotation points
CN115686706B (en) Terminal view configuration method, device, computer equipment and storage medium
CN117744187B (en) CAD drawing method, device, computer equipment and storage medium
CN114237440A (en) Icon layout apparatus, method, and computer-readable storage medium
CN114218903A (en) Table data processing method and device, computer equipment and storage medium
CN114547508A (en) Data processing method, data processing device, computer equipment and storage medium
CN114255278A (en) Graph click detection method and device, computer equipment and storage medium
CN117312653A (en) Service policy determination method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination