Anchor point display methods, devices, electronic devices, readable storage media, and products

By acquiring and determining anchor point display positions independent of object display positions in panoramic images, the problem of anchor points obscuring other objects is solved, improving user experience and anchor point utilization efficiency.

CN118796324BActive Publication Date: 2025-10-31CHINA MOBILEHANGZHOUINFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410240770.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-04
Publication Date
2025-10-31
Estimated Expiration
2044-03-04

AI Technical Summary

Technical Problem

In panoramic images, anchor points can easily obscure other objects, affecting the user experience.

Method used

By obtaining N candidate anchor point display positions for the first object in the image, the first anchor point display position, independent of the display positions of each object in the image, is determined, and the first anchor point is displayed at the second anchor point display position, ensuring that the anchor point does not obscure other objects.

Benefits of technology

This ensures that anchor points do not obstruct other objects, improving the user experience, reducing the number of anchor points, and increasing the utilization efficiency of anchor points.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796324B_ABST
    Figure CN118796324B_ABST
Patent Text Reader

Abstract

This application discloses an anchor point display method, apparatus, electronic device, readable storage medium, and product. The method includes: acquiring N candidate anchor point display positions for a first object in an image, where N is a positive integer; determining a first anchor point display position based on the N candidate anchor point display positions, wherein the first anchor point display position is independent of the display positions of other objects in the image; and displaying the first anchor point at a second anchor point display position, wherein the first anchor point is used to identify the first object; the second anchor point display position is the first anchor point display position, or the second anchor point display position is determined based on the first anchor point display position. Embodiments of this application enable anchor points not to obscure other objects in the image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image recognition technology, and in particular relates to an anchor point display method, device, electronic device, readable storage medium and product. Background Technology

[0002] With the development of Virtual Reality (VR) technology, VR panoramic image technology can be applied to scenarios such as home viewing and venue tours. A panoramic image contains multiple items, each surrounded by a corresponding anchor point. Users can click on the anchor point to obtain relevant information about the item. For example, if item A exists in a panoramic image, clicking on the anchor point next to item A will pop up an information box on the panoramic image page, displaying a detailed description, image, or link for item A.

[0003] In existing technologies, image recognition technology can be used to identify items in a panoramic image and automatically set corresponding anchor points around those items. Assuming a panoramic image contains multiple items, image recognition identifies these items and sets a corresponding anchor point for each. However, because the items in the panoramic image are densely distributed, when other items are nearby, the anchor point of the target item can easily obscure other items or related information on those items. Therefore, anchor points can easily obscure other items, affecting the user experience. Summary of the Invention

[0004] This application provides a method, apparatus, electronic device, readable storage medium, and product for displaying anchor points, which can solve the problem that anchor points easily obscure other items.

[0005] On one hand, embodiments of this application provide an anchor point display method, the method comprising:

[0006] Obtain N candidate anchor point display positions for the first item in the image, where N is a positive integer;

[0007] Based on N candidate anchor point display positions, the first anchor point display position is determined, wherein the first anchor point display position is independent of the display positions of each object in the image;

[0008] The first anchor point is displayed at the second anchor point display position, wherein the first anchor point is used to identify the first item; the second anchor point display position is the first anchor point display position, or the second anchor point display position is determined based on the first anchor point display position.

[0009] On the other hand, embodiments of this application provide an anchor point display device, the device comprising:

[0010] The acquisition module is used to acquire N candidate anchor point display positions for the first item in the image, where N is a positive integer;

[0011] The determination module is used to determine the first anchor point display position based on N candidate anchor point display positions, wherein the first anchor point display position is independent of the display positions of each object in the image;

[0012] The display module is used to display the first anchor point at the second anchor point display position, wherein the first anchor point is used to identify the first item; the second anchor point display position is the first anchor point display position, or the second anchor point display position is determined based on the first anchor point display position.

[0013] In another aspect, embodiments of this application provide an electronic device, which includes: a processor and a memory storing computer program instructions;

[0014] The processor implements the above-mentioned anchor point display method when executing computer program instructions.

[0015] In another aspect, embodiments of this application provide a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implement the aforementioned anchor point display method.

[0016] In another aspect, embodiments of this application provide a computer program product in which instructions are executed by the processor of an electronic device, enabling the electronic device to perform the aforementioned anchor point display method.

[0017] The anchor point display method, apparatus, electronic device, readable storage medium, and product of this application embodiment are capable of obtaining N candidate anchor point display positions for a first item in an image, and determining a first anchor point display position based on the N candidate anchor point display positions. The first anchor point display position is independent of the display positions of each object in the image. The first anchor point is displayed at a second anchor point display position. The second anchor point display position is the first anchor point display position, or the second anchor point display position is determined based on the first anchor point display position. In the embodiments of this application, a first anchor point display position is selected from a plurality of candidate anchor point display positions for the first item, and the first anchor point display position is independent of the display positions of each object in the image. That is, the first anchor point display position can be in a position that obscures other items or in a position that does not obscure other items. The first anchor point display position is not affected by the display positions of other items. The second anchor point display position is determined based on the first anchor point display position, or the first anchor point display position is used as the second anchor point display position. Therefore, the second display position can be determined by the first anchor point display position, and the first anchor point is displayed at the second anchor point display position to achieve the goal that the first anchor point does not obscure other items. Attached Figure Description

[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a schematic diagram of the structure of an anchor point display method provided in an embodiment of this application;

[0020] Figure 2 This is a flowchart illustrating an embodiment of the anchor point display method provided in this application;

[0021] Figure 3 This is an overlapping schematic diagram provided in an embodiment of this application;

[0022] Figure 4 This is an overlapping schematic diagram provided in another embodiment of this application;

[0023] Figure 5 This is a schematic diagram of the intersection of two line segments provided in an embodiment of this application;

[0024] Figure 6 This is a schematic image provided in an embodiment of this application;

[0025] Figure 7 This is a schematic diagram of the structure of an anchor point display device provided in an embodiment of this application;

[0026] Figure 8 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0027] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.

[0028] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0029] The acquisition, storage, use, and processing of data in this application all comply with the relevant provisions of national laws and regulations.

[0030] To address the problems of the prior art, embodiments of this application provide an anchor point display method, apparatus, electronic device, readable storage medium, and product. Figure 1 This invention provides a schematic diagram of the structure of an anchor point display method according to an embodiment of the present application. Figure 1 As shown, in some embodiments of this application, a client and a server are provided. The server is mainly used to provide image-related services and image recognition services, while the client is mainly used to provide image editing and image display services. When a user arranges anchor points in an image using the client, the server's image recognition service can automatically identify the location information of each item in the image. The client will obtain the location information of each item in the image through interaction with the server, and automatically configure the anchor points corresponding to different items using the anchor point display method of this application. After configuration, overlapping anchor points are automatically merged. Users can also manually modify or select the anchor point positions in the image through the client's image editing service to finally complete the configuration of image navigation information. The image in this application can be a panoramic image.

[0031] For example, a user can take a picture using an electronic device with a camera function, obtain an image, and upload the image to a server via a client. The server will then identify the objects in the image. The image recognition process can be as follows: An image recognition algorithm is used to identify the objects in the image. Before the server identifies the objects, it trains the image recognition algorithm using several images. This allows the algorithm to identify objects in the image based on their feature information. Therefore, in the image recognition process, the feature information of the objects in the image is first obtained, and then this feature information is matched against a pre-defined object feature database. In this database, the feature information of each object corresponds to the information of that object, such as its name. By matching with the object feature database, the objects in the image and their locations within the image are identified. The objects identified in the image can be one or more.

[0032] For example, the process of identifying the location of an object in an image can be as follows: Establish a coordinate system for the image based on pixels, and obtain the coordinates of the identified object in the image. Then, obtain the coordinate set of all objects in the image, and sort the objects in the image based on this coordinate set. Determine the anchor point display position for each object in the image according to the sorting order, and ensure that the anchor point for each object does not obscure other objects using an anchor point display method. The process of obtaining the object coordinate set can be as follows: During image recognition, after identifying an object in the image, the display area containing the object can be enclosed. For example, a rectangle can be used to enclose the area containing the object, and the coordinates of the four corners of the rectangle and the coordinates of the center point of the rectangle can be determined using the image's coordinate system. The coordinates of the center point are then used as the coordinates of the object. Similarly, obtain the coordinates of the center points of all objects in the image to form the object coordinate set. First, sort the set of item coordinates from largest to smallest according to the y-axis, and then sort them from smallest to largest according to the x-axis. For example, if there are items a, b, and c with coordinates (3, 4), (1, 4), and (3, 7) respectively, then the order of these three items is: item c, item b, item a. Then, determine the anchor point display position for each item in the image in turn.

[0033] The anchor point display method provided in the embodiments of this application will be described below.

[0034] Figure 2 This document illustrates a flowchart of an anchor point display method provided in an embodiment of this application. Figure 2 As shown, the method includes the following steps:

[0035] S201: Obtain N candidate anchor point display positions for the first item in the image, where N is a positive integer.

[0036] In some embodiments of this application, N anchor point candidate display positions are set around the first item, and the anchor point candidate display positions are selected in a clockwise order of top, left, bottom, and right. Assuming there are four anchor point candidate display positions, respectively set above, below, to the left, and to the right of the first item, the anchor points are set at these four anchor point candidate display positions in a clockwise order. The first anchor point candidate display position is located above the first item, the second anchor point candidate display position is located to the left of the first item, the third anchor point candidate display position is located below the first item, and the fourth anchor point candidate display position is located to the right of the first item.

[0037] S202: Determine the first anchor point display position based on the N candidate anchor point display positions, wherein the first anchor point display position is independent of the display positions of each object in the image.

[0038] In some embodiments of this application, an anchor point candidate display position is selected from a plurality of anchor point candidate display positions, and this anchor point candidate display position is used as the first anchor point display position.

[0039] S203: Display the first anchor point at the second anchor point display position, wherein the first anchor point is used to identify the first item; the second anchor point display position is the first anchor point display position, or the second anchor point display position is determined based on the first anchor point display position.

[0040] In some embodiments of this application, determining the second anchor point display position based on the first anchor point display position means: when the item obscured by the first anchor point display position is of the same type as the first item, the anchor point display position of the item obscured by the first anchor point display position is used as the second anchor point display position, so that the first item is identified by the anchor point displayed at the second anchor point display position. Conversely, when the first anchor point display position does not obscure any other items in the image, the first anchor point display position is used as the second anchor point display position, so that the first item is identified by the anchor point displayed at the second anchor point display position.

[0041] In embodiments of this application, N candidate anchor point display positions for a first item in an image are obtained, and a first anchor point display position is determined based on these N candidate anchor point display positions. The first anchor point display position is independent of the display positions of other objects in the image. The first anchor point is displayed at a second anchor point display position, where the second anchor point display position is either the first anchor point display position or determined based on the first anchor point display position. In embodiments of this application, a first anchor point display position is selected from multiple candidate anchor point display positions for the first item, and this first anchor point display position is independent of the display positions of other objects in the image. That is, the first anchor point display position can be in a position that obscures other items or in a position that does not obscure other items. The first anchor point display position is not affected by the display positions of other items. The second anchor point display position is determined based on the first anchor point display position, or the first anchor point display position is used as the second anchor point display position. Therefore, the second display position can be determined from the first anchor point display position, and the first anchor point is displayed at the second anchor point display position to ensure that the first anchor point does not obscure other items.

[0042] In some embodiments of this application, determining the display position of the first anchor point based on N candidate anchor point display positions includes:

[0043] Determine whether the i-th anchor point candidate display position among N anchor point candidate display positions occludes an item in the image, where i is a positive integer;

[0044] If the i-th anchor point candidate display position does not obscure any items in the image, the i-th anchor point candidate display position is determined as the first anchor point display position;

[0045] If the second item in the image is obscured by the candidate display position of the i-th anchor point, the display position of the first anchor point is determined according to the item type of the second item and the first item.

[0046] In this embodiment, since the anchor point can be represented in the image as an anchor point icon or the like, its display position may consist of several pixels. The display position of the anchor point can be regarded as an anchor point display area, and the center point of the display area is taken as the anchor point. Then, the anchor point display position of the first item is set at the anchor point candidate display position directly above the first item. It is determined whether the current anchor point display position occludes the display area of ​​other items in the image. If it does not occlude other items in the image, the first anchor point candidate display position is taken as the display position of the first anchor point of the first item.

[0047] Understandably, in this embodiment, if the i-th anchor point candidate display position does not obscure any items in the image, the i-th anchor point candidate display position is determined as the first anchor point display position. This ensures that the first anchor point does not obscure other items in the image when it is located at the i-th anchor point candidate display position, thus achieving the goal that the first anchor point of the first item does not obscure other items.

[0048] In other embodiments of this application, determining the display position of the first anchor point based on the item types of the second item and the first item includes:

[0049] If the second item and the first item are of the same type, the anchor point display position of the second item will be determined as the first anchor point display position.

[0050] If the second item and the first item have different item types, and if i is less than N, then i+1 is updated to i, and the process returns to determine whether the i-th anchor point candidate display position among the N anchor point candidate display positions occludes the item in the image; if i is equal to N, the display position selected by the user is determined as the first anchor point display position.

[0051] In this embodiment, the second item refers specifically to other items that are obscured by the first anchor point when it is located at the first anchor point candidate display position. If the first anchor point obscures the second item in the image when it is located at the first anchor point candidate display position, it is determined whether the item type of the first item and the item type of the second item are the same type of item. For example, if the first item is a fruit knife and the second item is fruit, then the item types are different. If the item types of the first item and the second item are the same type of item, then the current anchor point candidate display position is taken as the first anchor point display position, and the anchor point display position of the second item is taken as the second anchor point display position, so as to identify the first item through the anchor point of the second item. For example, suppose there are four candidate anchor point display positions, set directly above, below, to the left, and to the right of the first item. The anchor point is placed in these four candidate positions in a clockwise order: the first candidate anchor point is directly above the first item, the second to the left, the third directly below, and the fourth to the right. Since the first anchor point would obscure other items in the image when it is in its first candidate position, and the type of those items is different from the first item, the first anchor point is then moved to the second candidate position. The system then re-evaluates whether the first anchor point's current position obscures the display area of ​​other items in the image, and if it does, whether the type of the obscured item is the same as the first item's type. This process continues until the first anchor point is found among the four candidate anchor point positions for the first item. If the first anchor point cannot be found among the candidate anchor point locations for the first item, the user selects a location in the image, and that location is used as the first anchor point.

[0052] Understandably, in this embodiment, it is determined whether the item type of the first item and the item type of the occluded item are the same type of item. If the item type of the first item and the item type of the occluded item are the same type of item, then the current anchor point candidate display position is used as the first anchor point display position, and the anchor point display position of the occluded item is used as the second anchor point display position. The first item is identified by the anchor point of the occluded item, so that the anchor point of the first item does not obscure other items, and the number of anchor points in the image is reduced, thus improving the anchor point utilization efficiency. If the item type of the first item and the item type of the occluded item are not the same type of item, then the first anchor point display position is set at the (i+1)th anchor point candidate display position, and it is re-determined whether the (i+1)th anchor point candidate display position obscures the display area of ​​other items in the image, until the display position of the first anchor point is found among the anchor point candidate display positions of the first item, so that the anchor point of the first item does not obscure other items.

[0053] In other embodiments of this application, after determining the first anchor point display position based on N candidate anchor point display positions, and before displaying the first anchor point at the second anchor point display position, the method further includes:

[0054] Determine whether the display position of the first anchor point obscures the display positions of other anchor points in the image;

[0055] If the first anchor point display position does not obstruct other anchor point display positions in the image, the first anchor point display position is determined as the second anchor point display position;

[0056] If the display position of the first anchor point occludes the display position of the third anchor point in the image, the display position of the second anchor point is determined based on the display position of the third anchor point and the display position of the first anchor point.

[0057] In this embodiment, when at least two items are identified in the image, the items are sorted based on the set of item coordinates. The anchor point display position of each item is determined sequentially, ensuring that the anchor point of each item does not obscure other items. This results in a set of all anchor points in the image. Then, it is determined whether the display position of each anchor point in the image obscures the display positions of other anchor points. If there is no obstruction, the current anchor point display position of the item is used as the second anchor point display position, and the anchor point is displayed at the second anchor point display position in the image. If there is obstruction, the second anchor point display position is determined based on the display positions of other anchor points and the current anchor point display position of the item, and the anchor point is displayed at the second anchor point display position in the image.

[0058] Understandably, in this embodiment, it is determined whether the display position of the anchor point of an item in the image obscures the display positions of other anchor points. If there is no obstruction, the current first anchor point display position of the item is used as the second anchor point display position. If there is obstruction, the second anchor point display position is determined based on the display positions of other anchor points and the current anchor point display position of the item. This ensures that anchor points do not obstruct each other, reduces the number of anchor points in the image, and improves anchor point utilization efficiency.

[0059] In other embodiments of this application, determining the display position of the second anchor point based on the display position of the third anchor point and the display position of the first anchor point includes:

[0060] Determine whether the first item and the third item have the same item type, where the third item is the item identified by the third anchor point displayed at the third anchor point display position;

[0061] If the first and third items are of the same type, merge the third anchor point display position and the first anchor point display position to obtain the second anchor point display position.

[0062] In this embodiment, the third anchor point specifically refers to other anchor points obscured by the display position of the first anchor point, and the third anchor point is used to identify the third item. It is determined whether the item type of the third item corresponding to the anchor point displayed at the third anchor point display position obscured by the first anchor point is the same as the item type of the first item corresponding to the first anchor point. If they are the same, the first anchor point display position and the third anchor point display position are merged. The merging process can be as follows: if the first anchor point display position and the third anchor point display position are substantially the same, then this display position can be used as the second anchor point display position, and the anchor point is displayed at the second anchor point display position to identify the first item and the third item. The anchor point displayed at the second anchor point display position can be one of the first anchor point and the third anchor point of the first item, or a newly generated anchor point after deleting the first anchor point and the third anchor point. The merging process can also be as follows: If the display positions of the first and third anchor points are not completely consistent, for example, if the display areas of the first and third anchor points partially overlap, then the display position of the second anchor point is redefined based on the display positions of the first and third anchor points. For example, a center point is determined in the display areas of the first and third anchor points, and this center point is used as the display position of the second anchor point. The anchor point is then displayed at the second anchor point to identify the first and third items. Subsequently, the anchor points corresponding to the first and third items are removed from the set of all anchor points, and it is determined again whether an anchor point in the set obscures other anchor points.

[0063] Understandably, in this embodiment, when the item type of the third item corresponding to the anchor point displayed at the third anchor point display position which is obscured by the first anchor point display position is the same as the item type of the first item corresponding to the first anchor point, the first anchor point display position and the third anchor point display position are merged to prevent anchor points from obscuring each other, and to reduce the number of anchor points in the image, thereby improving the efficiency of anchor point utilization.

[0064] In some other embodiments of this application, when the first item and the third item are of different item types, the display position selected by the user is determined as the second anchor point display position.

[0065] In this embodiment, if the item type of the third item is different from that of the first item, the user selects two locations in the image, and these two locations are used as the anchor point display positions for the first item and the third item, respectively. Subsequently, the anchor points corresponding to the first and third items are removed from the set of all anchor points, and it is determined again whether an anchor point in the set obscures other anchor points.

[0066] Understandably, in this embodiment, when the item type of the third item is different from that of the first item, the anchor point display positions of the third item and the first item can be determined by the user. However, when the item type of the third item is the same as that of the first item, the second anchor point display position is determined based on the first anchor point display position and the third anchor point display position. This can improve the degree of automation and reduce user operations.

[0067] In other embodiments of this application, when the candidate display position of the i-th anchor point occludes a second item in the image, determining the display position of the first anchor point based on the item type of the second item and the first item includes:

[0068] Establish a coordinate system for the image using pixels as the unit;

[0069] Determine the first center pixel of the candidate display position for the i-th anchor point;

[0070] Obtain the coordinates of the first pixel, the second pixel, the third pixel, and the fourth pixel in the candidate display position of the i-th anchor point. The first pixel is located to the upper left of the first center pixel, the second pixel is located to the lower left of the first center pixel, the third pixel is located to the upper right of the first center pixel, and the fourth pixel is located to the lower right of the first center pixel. The distance between the first pixel, the second pixel, the third pixel, and the fourth pixel and the first center pixel is a first preset distance, and the angle between the line connecting the first pixel, the second pixel, the third pixel, and the fourth pixel and the first center pixel and the vertical line is a first preset angle.

[0071] Determine the second center pixel of the display area for the second item;

[0072] Obtain the coordinates of the fifth, sixth, seventh, and eighth pixels in the display area of ​​the second item. The fifth pixel is located to the upper left of the second center pixel, the sixth pixel is located to the lower left of the second center pixel, the seventh pixel is located to the upper right of the second center pixel, and the eighth pixel is located to the lower right of the second center pixel. The distance between the fifth, sixth, seventh, and eighth pixels and the second center pixel is a second preset distance, and the angle between the line connecting the fifth, sixth, seventh, and eighth pixels and the second center pixel and the vertical line is a second preset angle.

[0073] If the coordinates of the first target pixel are within the coordinate range of the display area of ​​the second item, or if the coordinates of the second target pixel are within the coordinate range of the i-th anchor point candidate display position, the i-th anchor point candidate display position occludes the second item. The first target pixel includes at least one of the following: a first pixel, a second pixel, a third pixel, and a fourth pixel. The second target pixel includes at least one of the following: a fifth pixel, a sixth pixel, a seventh pixel, and an eighth pixel.

[0074] In this embodiment, a multi-sided overlap algorithm can be used to determine whether the first anchor point, when located at a candidate display position of a certain anchor point of the first item, will obscure other items. Specifically, Figure 3 An overlapping schematic diagram provided in an embodiment of this application is shown, as follows: Figure 3As shown, it can be determined whether there is an overlapping area between the display area of the first anchor point and the display areas of other items through the point and polygon overlapping algorithm. In one example, the first anchor point can be displayed in the image through an anchor point icon, and the anchor point icon can be a polygon, such as a rectangle. At the same time, after the image recognition algorithm recognizes the items in the image, a polygon can be used to enclose the item, such as a rectangle, and determine whether the anchor point icon overlaps with the display areas of other items. The process can be: determining whether the angles forming the polygon fall below the line segment of another polygon. Establish a coordinate system in the image. Assume that the shapes of the anchor point icon and the rectangle enclosing the display area of other items are both rectangles. First, determine the coordinate values of the four right-angle points of the rectangle where the anchor point icon is located in the coordinate system, and the coordinate values of the four right-angle points of the rectangle enclosing the display area of other items in the coordinate system. Assume that the coordinate system values of two of the right-angle points of the rectangle of the anchor point icon are (x1, y1) and (x2, y2), and the coordinate value of one of the right-angle points of the rectangle enclosing the display area of other items is (x0, y0). First, determine whether (x0, y0) is between x1 and x2. When (x0, y0) satisfies: x1 < x0 ≤ x2 or x2 < x0 ≤ x1, determine whether (x0, y0) is below the line connecting (x1, y1) and (x2, y2). The process can be: calculating the slope between (x1, y1) and (x2, y2). The slope formula: k = (y2 - y1) / (x2 - x1). When (x0, y0) is below the oblique line, it is necessary to ensure that the slope from (x0, y0) to (x1, y1) is less than the slope of (x1, y1) and (x2, y2). The formula is as follows: (y0 - y1) / (x0 - x1) ≤ k. After transformation, the following equation is obtained: y0 ≤ k×(x0 - x1) + y1. Assume that y0 satisfies the above formula, then (x0, y0) is below the line connecting (x1, y1) and (x2, y2). Determine in turn whether (x0, y0) is below the line connecting any two right-angle points in the rectangle of the anchor point icon. If (x0, y0) is below the line connecting any two right-angle points in the rectangle of the anchor point icon, the counter is incremented by 1. The initial value of the counter is 0. Finally, determine whether the counter is odd. If it is odd, then one of the right-angle points (x0, y0) of the rectangle enclosing the display area of other items is in the rectangle of the anchor point icon, and there is an overlapping area between the display area of the first anchor point and the display areas of other items. If it is not odd, then one of the right-angle points (x0, y0) of the rectangle enclosing the display area of other items is not in the rectangle of the anchor point icon. Then, similarly, determine whether the other right-angle point of the rectangle enclosing the display area of other items is in the rectangle of the anchor point icon. When there is one right-angle point of the rectangle enclosing the display area of other items in the rectangle of the anchor point icon, it can be determined that there is an overlapping area between the display area of the first anchor point and the display areas of other items.Similarly, it can be determined whether the display area of ​​the first anchor point overlaps with the display areas of other items by checking if a right angle of the rectangle containing the anchor point icon lies within the rectangle that encloses the display area of ​​other items. This embodiment can also be used to determine whether anchor points obscure each other.

[0075] Understandably, in this embodiment, by determining whether the rectangular frame of the display area enclosing other items has a right angle point within the rectangular frame of the anchor icon, or by determining whether the rectangular frame of the anchor icon has a right angle point within the rectangular frame of the display area enclosing other items, it is determined whether the display position of the first anchor point overlaps with the display position of other items, so as to determine whether the anchor point obscures other items.

[0076] In other embodiments of this application, when the candidate display position of the i-th anchor point occludes a second item in the image, determining the display position of the first anchor point based on the item type of the second item and the first item includes:

[0077] Establish a coordinate system for the image using pixels as the unit;

[0078] Determine the first center pixel of the candidate display position for the i-th anchor point;

[0079] Obtain the coordinates of the first pixel, the second pixel, the third pixel, and the fourth pixel in the candidate display position of the i-th anchor point. The first pixel is located to the upper left of the first center pixel, the second pixel is located to the lower left of the first center pixel, the third pixel is located to the upper right of the first center pixel, and the fourth pixel is located to the lower right of the first center pixel. The distance between the first pixel, the second pixel, the third pixel, and the fourth pixel and the first center pixel is a first preset distance, and the angle between the line connecting the first pixel, the second pixel, the third pixel, and the fourth pixel and the first center pixel and the vertical line is a first preset angle.

[0080] Determine the second center pixel of the display area for the second item;

[0081] Obtain the coordinates of the fifth, sixth, seventh, and eighth pixels in the display area of ​​the second item. The fifth pixel is located to the upper left of the second center pixel, the sixth pixel is located to the lower left of the second center pixel, the seventh pixel is located to the upper right of the second center pixel, and the eighth pixel is located to the lower right of the second center pixel. The distance between the fifth, sixth, seventh, and eighth pixels and the second center pixel is a second preset distance, and the angle between the line connecting the fifth, sixth, seventh, and eighth pixels and the second center pixel and the vertical line is a second preset angle.

[0082] Calculate the coordinates of the intersection point between the first line segment and the second line segment, where the first line segment is the line connecting any two pixels among the first, second, third, and fourth pixels, and the second line segment is the line connecting any two pixels among the fifth, sixth, seventh, and eighth pixels.

[0083] If the coordinates of the intersection point are within the range of the coordinates of the two endpoints of the first line segment, and the coordinates of the intersection point are within the range of the coordinates of the two endpoints of the second line segment, the candidate display position of the i-th anchor point obscures the second item.

[0084] In this embodiment, Figure 4 An overlapping schematic diagram provided in another embodiment of this application is shown, such as... Figure 4 As shown, when neither of the intersection points of two sides of a polygon falls into another polygon, the polygon segment intersection algorithm can be used to determine whether the line segments intersect, thus determining whether the polygons overlap. For example, establish a coordinate system in the image. Assume that the anchor icon and the display area enclosing other items are both rectangular. First, determine the coordinates of the four right-angle points of the rectangle containing the anchor icon and the four right-angle points of the rectangle enclosing the other items. For instance, assume the coordinates of the two right-angle points of the anchor icon's rectangle are (x1, y1) and (x2, y2), and the coordinates of the two right-angle points of the rectangle enclosing the other items are (x3, y3) and (x4, y4). Figure 5 This illustration shows a schematic diagram of the intersection of two line segments according to an embodiment of this application, such as... Figure 5As shown, in the first case on the right, when x1 < x3 < x2 and y2 < y2 < y4, it can be determined whether the line segment between the two rectangular frames intersects; in the second case on the left, the following method can be used to determine whether the line segment between the two rectangular frames intersects: Calculate the intersection point of the line segment connecting (x1, y1) and (x2, y2) and the line segment connecting (x3, y3) and (x4, y4), and two formulas can be obtained: (y - y1) / (x - x1) = (y2 - y1) / (x2 - x1), (y4 - y3) / (x4 - x3) = (y - y3) / (x - x3). According to these two formulas, the value of the intersection point (x, y) between the two line segments is obtained. When (x, y) satisfies x1 < x < x2, y1 < y < y2, x3 < x < x4, and y3 < y < y4, the two line segments intersect. When the two line segments intersect and the coordinate values of the intersection point are between the coordinate values of the endpoints of the two line segments, the two rectangles overlap, that is: the first anchor point obscures other objects. Similarly, it can be determined whether the anchor points obscure each other through this embodiment.

[0085] It can be understood that in the embodiment of the present application, the intersection point of the two line segments is calculated, and by determining whether the intersection point is between the endpoints of the two line segments, it is determined whether the display positions of the first anchor point and other objects obscure each other, so as to prevent the first anchor point from obscuring other objects.

[0086] Figure 6 Show an image schematic diagram provided by an embodiment of the present application, as Figure 6As shown, first, all items in the image are identified, and a coordinate system is established on the image. The center point of each item's display area is used as the item's coordinates. Following the order of y-axis from largest to smallest and x-axis from smallest to largest, the items are sorted as follows: Item b, Item a, Item a in the first row; Item b, Item a, Item a in the second row; Item a, Item a, Item a in the third row. The anchor point display position of item b in the first row and first column is determined first. The candidate anchor point display positions are set around item b, and selected sequentially in a clockwise order. The candidate anchor point display position directly above item b is first selected as the first anchor point display position. At this point, the... If an anchor point does not obscure other items, its position is used as the second anchor point. The first anchor point is then displayed at the second anchor point. Similarly, the anchor point positions for the remaining two items 'a' in the first row are determined. Next, the anchor point position for item 'b' in the second row and first column is determined. The candidate anchor point position directly above item 'b' is initially chosen as the first anchor point. This first anchor point obscures other items, including item 'b', whose type is the same as item 'b' in the second row and first column. Therefore, item 'b' in the second row and first column is identified by the anchor point of item 'b' in the first row and first column. Similarly, item 'a' in the second row and second column can also be identified by the anchor point of item 'a' in the first row and second column, and so on, until the anchor point positions for all items in the image are determined. If the item in the second row and second column is item c, and the item type of item c is different from that of the surrounding items a and b, and displaying the anchor point candidate positions of item c will obscure items a or b, then the user will select the anchor point display position of item c.

[0087] It should be noted that the various optional embodiments described in this application can be combined with each other or implemented individually without conflict, and this application does not limit the implementation of these embodiments.

[0088] Figure 7 This invention provides a schematic diagram of the structure of an anchor point display device according to an embodiment of the present application. Figure 7 As shown, the device includes:

[0089] The acquisition module 701 is used to acquire N candidate anchor point display positions of the first item in the image, where N is a positive integer;

[0090] The determining module 702 is used to determine the first anchor point display position based on N candidate anchor point display positions, wherein the first anchor point display position is independent of the display positions of each object in the image;

[0091] Display module 703 is used to display a first anchor point at a second anchor point display position, wherein the first anchor point is used to identify a first item; the second anchor point display position is the first anchor point display position, or the second anchor point display position is determined based on the first anchor point display position.

[0092] In the embodiments of this application, the acquisition module 701 acquires N candidate anchor point display positions of the first item in the image, and the determination module 702 determines the first anchor point display position based on the N candidate anchor point display positions. The first anchor point display position is independent of the display positions of each object in the image. The display module 703 displays the first anchor point at the second anchor point display position. The second anchor point display position is the first anchor point display position, or the second anchor point display position is determined based on the first anchor point display position. In the embodiments of this application, a first anchor point display position is selected from a plurality of candidate anchor point display positions for the first item, and the first anchor point display position is independent of the display positions of each object in the image. That is, the first anchor point display position can be in a position that obscures other items or in a position that does not obscure other items. The first anchor point display position is not affected by the display positions of other items. The second anchor point display position is determined based on the first anchor point display position, or the first anchor point display position is used as the second anchor point display position. Therefore, the second display position can be determined by the first anchor point display position, and the first anchor point is displayed at the second anchor point display position to achieve the goal that the first anchor point does not obscure other items.

[0093] Figure 8 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application is shown.

[0094] An electronic device may include a processor 801 and a memory 802 storing computer program instructions.

[0095] Specifically, the processor 801 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0096] Memory 802 may include mass storage for data or instructions. For example, and not limitingly, memory 802 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 802 may include removable or non-removable (or fixed) media. Where appropriate, memory 802 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 802 is non-volatile solid-state memory.

[0097] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the methods according to one aspect of this disclosure.

[0098] The processor 801 reads and executes computer program instructions stored in the memory 802 to implement any of the anchor point display methods in the above embodiments.

[0099] In one example, the electronic device may also include a communication interface 803 and a bus 810. For example, Figure 8 As shown, the processor 801, memory 802, and communication interface 803 are connected through bus 810 and complete communication with each other.

[0100] The communication interface 803 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0101] Bus 810 includes hardware, software, or both, that couples components of an electronic device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 810 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, this application contemplates any suitable bus or interconnect.

[0102] Furthermore, in conjunction with the anchor point display methods in the above embodiments, this application embodiment can provide a computer-readable storage medium for implementation. This computer-readable storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the anchor point display methods in the above embodiments.

[0103] This application provides a computer program product in which the instructions are executed by the processor of an electronic device, enabling the electronic device to perform the above-described anchor point display method.

[0104] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0105] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0106] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0107] The aspects of this disclosure have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by special-purpose hardware performing the specified functions or actions, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0108] The above are merely specific embodiments of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A method for displaying anchor points, characterized in that, include: Obtain N candidate anchor point display positions for the first item in the image, where N is a positive integer; Based on the N candidate anchor point display positions, a first anchor point display position is determined, wherein the first anchor point display position is independent of the display positions of each object in the image; The first anchor point is displayed at the second anchor point display position, wherein the first anchor point is used to identify the first item; the second anchor point display position is the first anchor point display position, or the second anchor point display position is determined based on the first anchor point display position; After determining the first anchor point display position based on the N candidate anchor point display positions, and before displaying the first anchor point at the second anchor point display position, the method further includes: Determine whether the display position of the first anchor point obscures the display positions of other anchor points in the image; If the first anchor point display position does not obscure the other anchor point display positions in the image, the first anchor point display position is determined as the second anchor point display position; If the first anchor point display position obscures the third anchor point display position in the image, the second anchor point display position is determined based on the third anchor point display position and the first anchor point display position. Determining the second anchor point display position based on the third anchor point display position and the first anchor point display position includes: Determine whether the first item and the third item have the same item type, wherein the third item is the item identified by the third anchor point displayed at the third anchor point display position; If the first item and the third item are of the same type, the third anchor point display position and the first anchor point display position are merged to obtain the second anchor point display position.

2. The method according to claim 1, characterized in that, The step of determining the first anchor point display position based on the N candidate anchor point display positions includes: Determine whether the i-th anchor point candidate display position among the N anchor point candidate display positions occludes an item in the image, where i is a positive integer; If the i-th anchor point candidate display position does not obscure any items in the image, the i-th anchor point candidate display position is determined as the first anchor point display position; If the i-th anchor point candidate display position obscures the second item in the image, the first anchor point display position is determined according to the item type of the second item and the first item.

3. The method according to claim 2, characterized in that, Determining the first anchor point display position based on the item types of the second item and the first item includes: If the second item and the first item are of the same type, the anchor point display position of the second item is determined as the first anchor point display position; If the second item and the first item have different item types, and if i is less than N, then i+1 is updated to i, and the process returns to determine whether the i-th anchor point candidate display position among the N anchor point candidate display positions occludes the item in the image; if i is equal to N, the display position selected by the user is determined as the first anchor point display position.

4. The method according to claim 1, characterized in that, The method further includes: If the first item and the third item are of different types, the display position selected by the user will be determined as the second anchor point display position.

5. The method according to claim 2, characterized in that, When the second item in the image is obscured at the candidate display position of the i-th anchor point, determining the display position of the first anchor point based on the item type of the second item and the first item includes: Establish a coordinate system for the image in pixels; Determine the first center pixel of the i-th anchor point candidate display position; Obtain the coordinates of the first pixel, the second pixel, the third pixel, and the fourth pixel in the i-th anchor point candidate display position. The first pixel is located to the upper left of the first center pixel, the second pixel is located to the lower left of the first center pixel, the third pixel is located to the upper right of the first center pixel, and the fourth pixel is located to the lower right of the first center pixel. The distances between the first pixel, the second pixel, the third pixel, and the fourth pixel and the first center pixel are a first preset distance, and the angle between the line connecting the first pixel, the second pixel, the third pixel, and the fourth pixel and the first center pixel and the vertical line is a first preset angle. Determine the second center pixel of the display area of ​​the second item; Obtain the coordinates of the fifth, sixth, seventh, and eighth pixels in the display area of ​​the second item. The fifth pixel is located to the upper left of the second center pixel, the sixth pixel is located to the lower left of the second center pixel, the seventh pixel is located to the upper right of the second center pixel, and the eighth pixel is located to the lower right of the second center pixel. The distances between the fifth, sixth, seventh, and eighth pixels and the second center pixel are a second preset distance, and the angle between the line connecting the fifth, sixth, seventh, and eighth pixels and the second center pixel and the vertical line is a second preset angle. If the coordinates of the first target pixel are within the coordinate range of the display area of ​​the second item, or if the coordinates of the second target pixel are within the coordinate range of the i-th anchor point candidate display position, the i-th anchor point candidate display position occludes the second item. The first target pixel includes at least one of the first pixel, the second pixel, the third pixel, and the fourth pixel. The second target pixel includes at least one of the fifth pixel, the sixth pixel, the seventh pixel, and the eighth pixel.

6. The method according to claim 2, characterized in that, When the second item in the image is obscured at the candidate display position of the i-th anchor point, determining the display position of the first anchor point based on the item type of the second item and the first item includes: Establish a coordinate system for the image in pixels; Determine the first center pixel of the i-th anchor point candidate display position; Obtain the coordinates of the first pixel, the second pixel, the third pixel, and the fourth pixel in the i-th anchor point candidate display position. The first pixel is located to the upper left of the first center pixel, the second pixel is located to the lower left of the first center pixel, the third pixel is located to the upper right of the first center pixel, and the fourth pixel is located to the lower right of the first center pixel. The distances between the first pixel, the second pixel, the third pixel, and the fourth pixel and the first center pixel are a first preset distance, and the angle between the line connecting the first pixel, the second pixel, the third pixel, and the fourth pixel and the first center pixel and the vertical line is a first preset angle. Determine the second center pixel of the display area of ​​the second item; Obtain the coordinates of the fifth, sixth, seventh, and eighth pixels in the display area of ​​the second item. The fifth pixel is located to the upper left of the second center pixel, the sixth pixel is located to the lower left of the second center pixel, the seventh pixel is located to the upper right of the second center pixel, and the eighth pixel is located to the lower right of the second center pixel. The distances between the fifth, sixth, seventh, and eighth pixels and the second center pixel are a second preset distance, and the angle between the line connecting the fifth, sixth, seventh, and eighth pixels and the second center pixel and the vertical line is a second preset angle. Calculate the coordinates of the intersection point between the first line segment and the second line segment, wherein the first line segment is the line connecting any two pixels among the first pixel, the second pixel, the third pixel, and the fourth pixel, and the second line segment is the line connecting any two pixels among the fifth pixel, the sixth pixel, the seventh pixel, and the eighth pixel; If the coordinates of the intersection point are within the range of the coordinates of the two endpoints of the first line segment, and the coordinates of the intersection point are within the range of the coordinates of the two endpoints of the second line segment, then the i-th anchor point candidate display position obscures the second item.

7. An anchor point display device, characterized in that, include: The acquisition module is used to acquire N candidate anchor point display positions for the first item in the image, where N is a positive integer; The determining module is used to determine the first anchor point display position based on the N candidate anchor point display positions, wherein the first anchor point display position is independent of the display positions of each object in the image; The display module is configured to display a first anchor point at a second anchor point display position, wherein the first anchor point is used to identify the first item; the second anchor point display position is the first anchor point display position, or the second anchor point display position is determined based on the first anchor point display position; The determining module is further configured to determine whether the first anchor point display position obscures other anchor point display positions in the image; if the first anchor point display position does not obscure other anchor point display positions in the image, the first anchor point display position is determined as the second anchor point display position; if the first anchor point display position obscures a third anchor point display position in the image, the second anchor point display position is determined based on the third anchor point display position and the first anchor point display position; determining the second anchor point display position based on the third anchor point display position and the first anchor point display position includes: determining whether the item types of the first item and the third item are the same, wherein the third item is the item identified by the third anchor point displayed at the third anchor point display position; if the item types of the first item and the third item are the same, the third anchor point display position and the first anchor point display position are merged to obtain the second anchor point display position.

8. An electronic device, characterized in that, The electronic device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the anchor point display method as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the anchor point display method as described in any one of claims 1-6.

10. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device is able to perform the anchor point display method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Icon display method, device, server, and storage medium

    CN109032744A

  • Picture processing method and device

    CN112508785A