Anchor point display method and device, electronic equipment, readable storage medium and product
By obtaining and determining the anchor point display position in the panorama that is independent of the display position of each object, the problem of anchor points being easily blocked is solved, ensuring that anchor points do not block other items, and improving user experience and anchor point utilization efficiency.
Patent Information
- Application Number
- CN202410240770.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-04
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-03-04
AI Technical Summary
In the panorama, the anchor point of the target item is easily blocked by other items, which affects the user experience, especially when the items are densely distributed.
By obtaining the anchor point candidate display position of the item in the image, determine the anchor point display position that is independent of the display position of each object, and display the first anchor point at the second anchor point display position to ensure that the anchor point does not block other items.
It realizes that the anchor point does not block the display of other items, improves the user experience, and improves the utilization efficiency of the anchor point.
Smart Images

Figure CN118796324A_ABST
Abstract
Description
Technical Field
[0001] The present 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 Art
[0002] With the development of virtual reality (VR) technology, VR panorama technology can be applied to home viewing, venue tours and other scenes. There are multiple objects in the panorama, and each object is surrounded by a corresponding anchor point. Users can click on the anchor point to obtain relevant information about the corresponding object. For example, there is object A in a panorama. After the user clicks the anchor point next to object A, an information box can pop up on the panorama page to display a detailed description, picture or link of object A.
[0003] In the prior art, an object in a panoramic image can be identified by image recognition technology, and a corresponding anchor point can be automatically set around the object. Assuming that there are multiple objects in a panoramic image, after image recognition, multiple objects are identified, and a corresponding anchor point is set for each object. However, since the objects in the panoramic image are densely distributed, when there are other objects around the target object and the distance to other objects is close, the anchor point of the target object is likely to block other objects or related information on other objects. Therefore, the anchor point is likely to block other objects, affecting the user experience. Summary of the invention
[0004] The embodiments of the present application provide a method, device, electronic device, readable storage medium and product for displaying at an anchor point, which can solve the problem that the anchor point easily blocks other objects.
[0005] On the one hand, an embodiment of the present application provides an anchor point display method, the method comprising:
[0006] Get N anchor point candidate display positions of the first object in the image, where N is a positive integer;
[0007] Determine a first anchor point display position according to the N anchor point candidate display positions, wherein the first anchor point display position is independent of display positions of various objects 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 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.
[0009] On the other hand, an embodiment of the present application provides an anchor point display device, the device comprising:
[0010] An acquisition module, used to acquire N anchor point candidate display positions of the first object in the image, where N is a positive integer;
[0011] A determination module, configured to determine a first anchor point display position according to the N anchor point candidate display positions, wherein the first anchor point display position is independent of display positions of various objects in the image;
[0012] The display module 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 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.
[0013] In another aspect, an embodiment of the present application provides an electronic device, the electronic device comprising: a processor and a memory storing computer program instructions;
[0014] The processor implements the above-mentioned anchor point display method when executing the computer program instructions.
[0015] On the other hand, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the above-mentioned anchor point display method is implemented.
[0016] On the other hand, an embodiment of the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device can execute the above-mentioned anchor point display method.
[0017] The anchor point display method, device, electronic device, readable storage medium and product of the embodiments of the present application can obtain N anchor point candidate display positions of the first object in the image, and determine the first anchor point display position based on the N anchor point candidate display positions, wherein the first anchor point display position is independent of the display positions of each object in the image, and display the first anchor point at the second anchor point display position, wherein 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 an embodiment of the present application, a first anchor point display position is selected from multiple anchor point candidate display positions of the first object, and the first anchor point display position is independent of the display positions of objects in the image, that is, the first anchor point display position can be in a position that blocks other objects, or in a position that does not block other objects, and the first anchor point display position is not affected by the display positions of other objects. 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 can be displayed at the second anchor point display position, so as to achieve the goal that the first anchor point does not block other objects. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0019] Figure 1 is a structural diagram of an anchor point display method provided by an embodiment of the present application;
[0020] Figure 2 is a flowchart of an anchor point display method provided by an embodiment of the present application;
[0021] Figure 3 It is an overlapping schematic diagram provided by an embodiment of the present application;
[0022] Figure 4 is an overlapping schematic diagram provided by another embodiment of the present application;
[0023] Figure 5 is a schematic diagram of the intersection of two line segments provided by an embodiment of the present application;
[0024] Figure 6 is an image schematic diagram provided by an embodiment of the present application;
[0025] Figure 7 is a structural schematic diagram of an anchor point display device provided in an embodiment of the present application;
[0026] Figure 8 It is a schematic diagram of the hardware structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0027] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0028] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0029] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0030] In order to solve the problems of the prior art, the embodiments of the present application provide an anchor point display method, device, electronic device, readable storage medium and product. Figure 1 A schematic diagram showing the structure of an anchor point display method provided by an embodiment of the present application is shown as follows: Figure 1 As shown, in some embodiments of the present application, a client and a server are provided, the server is mainly used to provide image-related services and image recognition services, and the client is mainly used to provide image editing and image display services. When the user uses the client to arrange the anchor points in the image, the image recognition service of the server can automatically identify the location information of each object in the image. The client will obtain the location information of each object in the image through the interaction with the server, and automatically configure the anchor points corresponding to different objects through the anchor point display method of the present application, and automatically merge the overlapping anchor points after the configuration is completed. The user can also manually modify or select the anchor point position in the image through the image editing service of the client, and finally complete the configuration of the image navigation information. Among them, the image in the present application can be a panoramic view.
[0031] In one example, a user can take a picture through an electronic device with a shooting function to obtain an image, and upload the image to the server through the client. The server will identify the object in the image. The image recognition process can be: using an image recognition algorithm to identify the object in the image. Before the server identifies the object in the image, the image recognition algorithm is trained with a number of images so that the image recognition algorithm can identify the object in the image based on the feature information of the object in the image. Therefore, in the image recognition process, the feature information of the object in the image is first obtained, and then the feature information of the object is matched with a preset object feature library. The feature information of each object in the object feature library corresponds to the information of the object, such as the name of the object. By matching with the object feature library, the object in the image and the position of the identified object in the image are identified. Among them, the object identified by the image can be one or more.
[0032] In one example, the process of identifying the position of an object in an image may be: establishing a coordinate system of the image based on the pixel points, and obtaining the coordinates of the identified object in the image. Subsequently, a coordinate set of all objects in the image is obtained, and the objects in the image are sorted based on the object coordinate set, and the anchor point display position corresponding to each object in the image is determined in sequence according to the arrangement order, and the anchor point display method is used to ensure that the anchor point corresponding to each object in the image does not block other objects. The process of obtaining the object coordinate set may be: in the process of image recognition, after the object in the image is identified, the display area where the object is located can be framed, for example: a rectangular frame can be used to frame the area where the object is located, and the coordinate values of the four corners of the rectangular frame and the coordinate value of the center point of the rectangular frame can be determined by the coordinate system of the image, and the coordinate value of the center point of the rectangular frame is used as the coordinate of the object. Similarly, the coordinate value of the center point of all objects in the image is obtained to form an object coordinate set. First, sort the item coordinate set from large to small along the y-axis, and then sort it from small to large along the x-axis. For example, there are item a, item b, and item c, and their coordinate values are (3, 4), (1, 4), and (3, 7), respectively. Then the arrangement order of these three items is: item c, item b, item a, and the anchor point display position corresponding to each item in the image is determined in turn.
[0033] The following first introduces the anchor point display method provided in the embodiment of the present application.
[0034] Figure 2 A schematic diagram showing a flow chart of an anchor point display method provided by an embodiment of the present application is shown as follows: Figure 2 As shown, the method includes the following process:
[0035] S201: Obtain N candidate anchor point display positions of the first object in the image, where N is a positive integer.
[0036] In some embodiments of the present application, N anchor point candidate display positions are arranged around the first object, and the anchor point candidate display positions are selected in sequence in a clockwise order of up, left, down, and right. Assuming that there are four anchor point candidate display positions, which are respectively arranged directly above, directly below, to the left, and to the right of the first object, 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 directly above the first object, the second anchor point candidate display position is located to the left of the first object, the third anchor point candidate display position is located directly below the first object, and the fourth anchor point candidate display position is located to the right of the first object.
[0037] S202: Determine a first anchor point display position according to the N anchor point candidate display positions, wherein the first anchor point display position is independent of display positions of various objects in the image.
[0038] In some embodiments of the present application, one anchor point candidate display position is selected from a plurality of anchor point candidate display positions, and the anchor point candidate display position is used as the first anchor point display position.
[0039] S203: Displaying a first anchor point at a second anchor point display position, wherein the first anchor point is used to identify a 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.
[0040] In some embodiments of the present application, determining the second anchor point display position based on the first anchor point display position means: when the object blocked by the first anchor point display position and the first object are of the same type, the anchor point display position of the object blocked by the first anchor point display position is used as the second anchor point display position, so as to identify the first object through the displayed anchor point on the second anchor point display position. If the first anchor point display position does not block other objects in the image, the first anchor point display position is used as the second anchor point display position, so as to identify the first object through the displayed anchor point on the second anchor point display position.
[0041] In an embodiment of the present application, by acquiring N anchor point candidate display positions of a first object in an image, and determining a first anchor point display position according to the N anchor point candidate display positions, wherein the first anchor point display position is independent of the display positions of the objects in the image, and displaying the first anchor point at the second anchor point display position, wherein 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 an embodiment of the present application, the first anchor point display position is selected from a plurality of anchor point candidate display positions of the first object, and the first anchor point display position is independent of the display positions of the objects in the image, that is, the first anchor point display position can be at a position that blocks other objects, or can be at a position that does not block other objects, and the first anchor point display position is not affected by the display positions of other objects, and 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, so that the first anchor point does not block other objects.
[0042] In some embodiments of the present application, determining the first anchor point display position according to the N anchor point candidate display positions includes:
[0043] Determine whether the i-th anchor point candidate display position among the N anchor point candidate display positions occludes an object in the image, where i is a positive integer;
[0044] In the case where the i-th anchor point candidate display position does not block an object in the image, determining the i-th anchor point candidate display position as the first anchor point display position;
[0045] In the case where the i-th anchor point candidate display position blocks the second object in the image, the first anchor point display position is determined according to the object types of the second object and the first object.
[0046] In this embodiment, since the anchor point in the image can be expressed in the form of an anchor icon or the like, the display position of the anchor point may be composed of several pixels. The display position of the anchor point can be regarded as a display area of the anchor point, and the center point of the display area is used as the anchor point. Subsequently, the anchor point display position of the first object is set at the anchor point candidate display position directly above the first object, and it is determined whether the display position of the current anchor point blocks the display area of other objects in the image. If other objects in the image are not blocked, the first anchor point candidate display position is used as the display position of the first anchor point of the first object.
[0047] It can be understood that in this embodiment, when the i-th anchor point candidate display position does not block the objects in the image, the i-th anchor point candidate display position is determined as the first anchor point display position, which can ensure that the first anchor point does not block other objects in the image when it is located at the i-th anchor point candidate display position, thereby achieving the goal that the first anchor point of the first object does not block other objects.
[0048] In some other embodiments of the present application, determining the first anchor point display position according to the item types of the second item and the first item includes:
[0049] In the case where the second item and the first item are of the same item type, determining the anchor point display position of the second item as the first anchor point display position;
[0050] When the second object is of a different type from the first object, if i is less than N, 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 obscures the object 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 object is a specific reference to other objects occluded by the first anchor point when it is located at the first anchor point candidate display position. If the first anchor point occludes the second object 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 object and the item type of the second object are the same type of items. For example, if the first object is a fruit knife and the second object is fruit, the item types are different. If the item type of the first object and the item type of the second object are the same type of items, the current anchor point candidate display position is used as the first anchor point display position, and the anchor point display position of the second object is used as the second anchor point display position, so as to identify the first object through the anchor point of the second object. In one example, assuming that there are four anchor point candidate display positions, which are respectively set above, below, to the left, and to the right of the first object, the anchor points are set at the four anchor point candidate display positions in clockwise order. The first anchor point candidate display position is located above the first object, the second anchor point candidate display position is located to the left of the first object, the third anchor point candidate display position is located below the first object, and the fourth anchor point candidate display position is located to the right of the first object. When the first anchor point is located at the first anchor point candidate display position, the first anchor point will block other objects in the image, and the object type is different from the object type of the first object. Therefore, the display position of the first anchor point is set at the second anchor point candidate display position, and it is re-determined whether the display position of the first anchor point blocks the display area of other objects in the image. If other objects are blocked, it is determined whether the object type blocked is the same as the object type of the first object, until the first anchor point display position is found among the four anchor point candidate display positions of the first object. If the first anchor point display position cannot be found among the anchor point candidate display positions of the first object, a position is selected by the user in the image and the position is used as the first anchor point display position.
[0052] It can be understood that in this embodiment, it is determined whether the item type of the first object and the item type of the obscured object are the same type of items. If the item type of the first object and the item type of the obscured object are the same type of items, the current anchor point candidate display position is used as the first anchor point display position, and the anchor point display position of the obscured object is used as the second anchor point display position. The first object is identified by the anchor point of the obscured object to ensure that the anchor point of the first object does not obstruct other objects, and the number of anchor points in the image is reduced, thereby improving the utilization efficiency of the anchor points. If the item type of the first object and the item type of the obscured object are not the same type of items, the first anchor point display position is set at the i+1th anchor point candidate display position, and it is re-determined whether the i+1th anchor point candidate display position obscures the display area of other objects in the image until the display position of the first anchor point is found among the anchor point candidate display positions of the first object, so that the anchor point of the first object does not obstruct other objects.
[0053] In some other embodiments of the present application, after determining the first anchor point display position according to the N anchor point candidate display positions and before displaying the first anchor point at the second anchor point display position, the method further includes:
[0054] Determining whether the first anchor point display position obstructs other anchor point display positions in the image;
[0055] In the case where the first anchor point display position does not block other anchor point display positions in the image, determining the first anchor point display position as the second anchor point display position;
[0056] In the case where the first anchor point display position blocks 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.
[0057] In this embodiment, when at least two objects are identified in the image, the objects are sorted based on the object coordinate set, and the anchor point display position of each object is determined in turn to ensure that the anchor point of each object does not block other objects, and a set of all anchor points in the image is obtained. Then, it is determined whether each anchor point display position in the image blocks the display position of other anchor points. If not, the current anchor point display position of the object 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 blocked, 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 object, and the anchor point is displayed at the second anchor point display position in the image.
[0058] It can be understood that in this embodiment, it is determined whether the anchor point display position of a certain object in the image blocks the display positions of other anchor points. If not, the current first anchor point display position of the certain object is used as the second anchor point display position. If blocked, 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 certain object. This ensures that anchor points do not block each other, reduces the number of anchor points in the image, and improves the utilization efficiency of anchor points.
[0059] In some other embodiments of the present application, determining the second anchor point display position according to the third anchor point display position and the first anchor point display position includes:
[0060] Determining whether the first item and the third item are of the same item type, wherein the third item is an item with a third anchor point identifier displayed at a third anchor point display position;
[0061] In the case that the first item and the third item are of the same item type, the third anchor point display position and the first anchor point display position are merged to obtain the second anchor point display position.
[0062] In this embodiment, the third anchor point is a specific reference to other anchor points blocked by the first anchor point display position, 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 blocked by the first anchor point display position 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 may be: if the first anchor point display position and the third anchor point display position are basically the same, the display position may be used as the second anchor point display position, and an anchor point may be displayed at the second anchor point display position to identify the first item and the third item, wherein the anchor point displayed at the second anchor point display position may 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 may also be: if the first anchor point display position and the third anchor point display position are not completely consistent, for example: the display area of the first anchor point and the display area of the third anchor point partially overlap, then the second anchor point display position is re-determined based on the first anchor point display position and the third anchor point display position, for example: a center point is determined in the first anchor point display area and the third anchor point display area, the center point is 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. Subsequently, the anchor points corresponding to the first item and the third item are deleted from the set of all anchor points, and it is determined again whether a certain anchor point in the set blocks other anchor points.
[0063] It can be understood that in this embodiment, when the item type of the third object corresponding to the anchor point displayed at the third anchor point display position blocked by the first anchor point display position is the same as the item type of the first object corresponding to the first anchor point, the first anchor point display position and the third anchor point display position are merged to prevent mutual occlusion between anchor points, reduce the number of anchor points in the image, and improve the utilization efficiency of the anchor points.
[0064] In some other embodiments of the present application, when the first object and the third object are of different object 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 the item type of the first item, the user selects two positions in the image and uses the two positions as the anchor point display position of the first item and the anchor point display position of the third item, respectively. Subsequently, the anchor points corresponding to the first item and the third item are deleted from the set of all anchor points, and it is determined again whether a certain anchor point in the set blocks other anchor points.
[0066] It can be understood that in this embodiment, when the item type of the third item is different from the item type of the first item, the anchor point display positions of the third item and the first item can be decided by the user, but when the item type of the third item is the same as the item type 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, which can improve the degree of automation and reduce user operations.
[0067] In some other embodiments of the present application, when the i-th anchor point candidate display position blocks the second object in the image, determining the first anchor point display position according to the object types of the second object and the first object includes:
[0068] Establish a coordinate system of the image with pixels as the unit;
[0069] Determine the first central pixel point of the i-th anchor point candidate display position;
[0070] Obtaining the coordinate values of the first pixel point, the second pixel point, the third pixel point, and the fourth pixel point in the i-th anchor point candidate display position, wherein the first pixel point is located at the upper left of the first central pixel point, the second pixel point is located at the lower left of the first central pixel point, the third pixel point is located at the upper right of the first central pixel point, and the fourth pixel point is located at the lower right of the first central pixel point, the distances between the first pixel point, the second pixel point, the third pixel point, and the fourth pixel point and the first central pixel point are the first preset distances, and the angles between the lines connecting the first pixel point, the second pixel point, the third pixel point, and the fourth pixel point and the first central pixel point and the vertical line are the first preset angles;
[0071] Determining a second central pixel point of a display area of a second object;
[0072] Obtaining coordinate values of a fifth pixel point, a sixth pixel point, a seventh pixel point, and an eighth pixel point in the display area of the second item, wherein the fifth pixel point is located at the upper left of the second central pixel point, the sixth pixel point is located at the lower left of the second central pixel point, the seventh pixel point is located at the upper right of the second central pixel point, and the eighth pixel point is located at the lower right of the second central pixel point, the distances between the fifth pixel point, the sixth pixel point, the seventh pixel point, and the eighth pixel point and the second central pixel point are the second preset distances, and the angles between the lines connecting the fifth pixel point, the sixth pixel point, the seventh pixel point, and the eighth pixel point and the second central pixel point and the vertical line are the second preset angles;
[0073] When the coordinate value of the first target pixel point is within the coordinate range of the display area of the second object, or the coordinate value of the second target pixel point is within the coordinate range of the i-th anchor point candidate display position, the i-th anchor point candidate display position obscures the second object, wherein the first target pixel point includes: at least one of the first pixel point, the second pixel point, the third pixel point and the fourth pixel point, and the second target pixel point includes: at least one of the fifth pixel point, the sixth pixel point, the seventh pixel point and the eighth pixel point.
[0074] In this embodiment, a multi-edge overlap algorithm may be used to determine whether the first anchor point will block other objects when it is located at a candidate anchor point display position of the first object. Specifically, Figure 3 FIG. 1 shows an overlapping schematic diagram provided by an embodiment of the present application, such as Figure 3As shown, it is possible to determine whether there is an overlapping area between the display area of the first anchor point and the display areas of other items through a point and polygon overlap 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, the items can be framed with a polygon, such as a rectangle, to determine whether the display area of the anchor point icon overlaps with the display areas of other items. The process can be as follows: Determine whether the angles forming the polygon fall below the line segments of another polygon. Establish a coordinate system in the image. Assume that the shapes of the anchor point icon and the rectangle framing the display area of other items are both rectangles. First, determine the coordinate values of the four right-angle points of the rectangle frame where the anchor point icon is located in the coordinate system, and the coordinate values of the four right-angle points of the rectangle frame framing the display area of other items in the coordinate system. Assume that the coordinate values of two of the right-angle points of the rectangle frame 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 frame framing 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 as follows: Calculate 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 between (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 frame of the anchor point icon. If (x0, y0) is below the line connecting any two right-angle points in the rectangle frame 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, one of the right-angle points (x0, y0) of the rectangle frame framing the display area of other items is within the rectangle frame 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, one of the right-angle points (x0, y0) of the rectangle frame framing the display area of other items is not within the rectangle frame of the anchor point icon. Then, similarly, determine whether the other right-angle point of the rectangle frame framing the display area of other items is within the rectangle frame of the anchor point icon. When there is one right-angle point of the rectangle frame framing the display area of other items within the rectangle frame 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 is also possible to determine whether the display area of the first anchor point overlaps the display area of other items by determining whether the rectangular frame of the anchor point icon has a right angle in the rectangular frame that frames the display area of other items. Similarly, this embodiment can also be used to determine whether the anchor points block each other.
[0075] It can be understood that in this embodiment, by judging whether there is a right angle point in the rectangular frame of the anchor icon in the display area of other objects, or by judging whether there is a right angle point in the rectangular frame of the anchor icon in the display area of other objects, it is determined whether there is an overlapping area between the display position of the first anchor point and the display position of other objects to determine whether the anchor point obscures other objects.
[0076] In some other embodiments of the present application, when the i-th anchor point candidate display position blocks the second object in the image, determining the first anchor point display position according to the object types of the second object and the first object includes:
[0077] Establish a coordinate system of the image with pixels as the unit;
[0078] Determine the first central pixel point of the i-th anchor point candidate display position;
[0079] Obtaining the coordinate values of the first pixel point, the second pixel point, the third pixel point, and the fourth pixel point in the i-th anchor point candidate display position, wherein the first pixel point is located at the upper left of the first central pixel point, the second pixel point is located at the lower left of the first central pixel point, the third pixel point is located at the upper right of the first central pixel point, and the fourth pixel point is located at the lower right of the first central pixel point, the distances between the first pixel point, the second pixel point, the third pixel point, and the fourth pixel point and the first central pixel point are the first preset distances, and the angles between the lines connecting the first pixel point, the second pixel point, the third pixel point, and the fourth pixel point and the first central pixel point and the vertical line are the first preset angles;
[0080] Determining a second central pixel point of the display area of the second object;
[0081] Obtaining coordinate values of a fifth pixel point, a sixth pixel point, a seventh pixel point, and an eighth pixel point in the display area of the second item, wherein the fifth pixel point is located at the upper left of the second central pixel point, the sixth pixel point is located at the lower left of the second central pixel point, the seventh pixel point is located at the upper right of the second central pixel point, and the eighth pixel point is located at the lower right of the second central pixel point, the distances between the fifth pixel point, the sixth pixel point, the seventh pixel point, and the eighth pixel point and the second central pixel point are the second preset distances, and the angles between the lines connecting the fifth pixel point, the sixth pixel point, the seventh pixel point, and the eighth pixel point and the second central pixel point and the vertical line are the second preset angles;
[0082] Calculate the coordinate value of the intersection point between the first line segment and the second line segment, wherein the first line segment is a line connecting any two pixel points among the first pixel point, the second pixel point, the third pixel point, and the fourth pixel point, and the second line segment is a line connecting any two pixel points among the fifth pixel point, the sixth pixel point, the seventh pixel point, and the eighth pixel point;
[0083] When the coordinate value of the intersection point is within the range of the coordinate values of the two endpoints of the first line segment and the coordinate value of the intersection point is within the range of the coordinate values of the two endpoints of the second line segment, the i-th anchor point candidate display position obstructs the second object.
[0084] In this embodiment, Figure 4 FIG. 2 shows an overlapping schematic diagram provided by another embodiment of the present application, such as Figure 4 As shown, when the intersection of two sides of a polygon does not exist and does not fall into other polygons, the polygon line segment intersection algorithm can be used to determine whether the line segments intersect to determine whether the polygons overlap. As an example, a coordinate system is established in an image. Assume that the shapes of the anchor icon and the display area that frames other items are both rectangular. First, determine the coordinate values of the four right-angled points of the rectangular box where the anchor icon is located in the coordinate system, as well as the coordinate values of the four right-angled points of the rectangular box that frames the display area of other items. Assume that the coordinate system values of the two right-angled points of the rectangular box of the anchor icon are (x1, y1) and (x2, y2), and the coordinate values of the two right-angled points of the rectangular box that frames the display area of other items are (x3, y3) and (x4, y4). Figure 5 A schematic diagram showing the intersection of two line segments provided by an embodiment of the present application is shown, Figure 5As shown, in the first case on the right, if 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 can be 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, such as Figure 6As shown, all objects in the image are first identified, and a coordinate system is established on the image. The center point of each object display area is used as the object coordinate. The order is from large to small on the y axis and from small to large on the x axis. Therefore, the order is object b, object a, and object a in the first row, object b, object a, and object a in the second row, and object a, object a, and object b in the third row. The anchor point display position of object b in the first row and first column is first determined. Its anchor point candidate display positions are set around object b, and the anchor point candidate display positions are selected in turn in a clockwise order. The anchor point candidate display position directly above object b is first used as the first anchor point display position. At this time, the An anchor point display position does not block other items, so the first anchor point display position is used as the second anchor point display position, and the first anchor point is displayed at the second anchor point display position. Similarly, the anchor point display positions of the remaining two items a in the first row are determined, and then the anchor point display position of item b in the first column of the second row is determined. The anchor point candidate display position directly above item b is first used as the first anchor point display position. At this time, the first anchor point display position blocks other items, and the blocked item is also item b, and its item type is the same as that of item b in the first column of the second row. Therefore, item b in the first column of the second row is identified by the anchor point of item b in the first column of the first row. Similarly, item a in the second column of the second row can also be identified by the anchor point of item a in the second column of the first row, and so on, until the anchor point display positions of all items in the image are determined. Among them, if the second row and second column is item c, the item type of item c is different from the surrounding items a and b, and the candidate display positions of the anchor point of item c will block item a or item b. At this time, the user will select the anchor point display position of item c.
[0087] It should be noted that the various optional embodiments introduced in the embodiments of the present application can be implemented in combination with each other or can be implemented separately if they do not conflict with each other, and the embodiments of the present application are not limited to this.
[0088] Figure 7 A schematic diagram showing the structure of an anchor point display device provided by an embodiment of the present application is shown as follows: Figure 7 As shown, the device comprises:
[0089] An acquisition module 701 is used to acquire N anchor point candidate display positions of a first object in an image, where N is a positive integer;
[0090] A determination module 702, configured to determine a first anchor point display position according to the N anchor point candidate display positions, wherein the first anchor point display position is independent of display positions of various objects in the image;
[0091] The display module 703 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 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.
[0092] In an embodiment of the present application, N anchor point candidate display positions of the first object in the image are acquired by the acquisition module 701, and the determination module 702 determines the first anchor point display position based on the N anchor point candidate display positions, wherein the first anchor point display position is independent of the display positions of the objects in the image, and the display module 703 is provided to display the first anchor point at the second anchor point display position, wherein 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 an embodiment of the present application, a first anchor point display position is selected from multiple anchor point candidate display positions of the first object, and the first anchor point display position is independent of the display positions of objects in the image, that is, the first anchor point display position can be in a position that blocks other objects, or in a position that does not block other objects, and the first anchor point display position is not affected by the display positions of other objects. 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 can be displayed at the second anchor point display position, so as to achieve the goal that the first anchor point does not block other objects.
[0093] Figure 8 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.
[0094] The 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), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0096] The memory 802 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 802 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 802 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 802 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 802 is a non-volatile solid-state memory.
[0097] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the 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 method according to an aspect of the present disclosure.
[0098] The processor 801 implements any one of the anchor point display methods in the above embodiments by reading and executing computer program instructions stored in the memory 802 .
[0099] In one example, the electronic device may further include a communication interface 803 and a bus 810. Figure 8 As shown, the processor 801, the memory 802, and the communication interface 803 are connected via a bus 810 and communicate with each other.
[0100] The communication interface 803 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0101] Bus 810 includes hardware, software or both, and the parts of electronic equipment are coupled to each other.For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 810 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.
[0102] In addition, in combination with the anchor point display method in the above embodiment, the embodiment of the present application can provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the anchor point display methods in the above embodiment is implemented.
[0103] The present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device can execute the above-mentioned anchor point display method.
[0104] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present 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, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in 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, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0106] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. 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 embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0107] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram 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 device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. 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 can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0108] The above are only specific implementation methods of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. An anchor point display method, characterized in that: include: Get N anchor point candidate display positions of the first object in the image, where N is a positive integer; Determining a first anchor point display position according to the N anchor point candidate display positions, wherein the first anchor point display position is independent of display positions of objects 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 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.
2. The method according to claim 1, characterized in that The determining the first anchor point display position according to the N anchor point candidate display positions includes: Determine whether the i-th anchor point candidate display position among the N anchor point candidate display positions blocks the object in the image, where i is a positive integer; In a case where the i-th anchor point candidate display position does not block an object in the image, determining the i-th anchor point candidate display position as the first anchor point display position; In the case where the i-th anchor point candidate display position blocks a second object in the image, the first anchor point display position is determined according to the object types of the second object and the first object.
3. The method according to claim 2, characterized in that The determining the first anchor point display position according to the item types of the second item and the first item includes: In the case where the second item and the first item are of the same item type, determining the anchor point display position of the second item as the first anchor point display position; In the case where the second object and the first object are of different object types, if i is less than N, i+1 is updated to i, and the process of determining whether the i-th anchor point candidate display position among the N anchor point candidate display positions obscures the object in the image is returned; 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 any one of claims 1 to 3, characterized in that After determining the first anchor point display position according to the N anchor point candidate display positions and before displaying the first anchor point at the second anchor point display position, the method further includes: determining whether the first anchor point display position obstructs other anchor point display positions in the image; In a case where the first anchor point display position does not block the other anchor point display positions in the image, determining the first anchor point display position as the second anchor point display position; In the case where the first anchor point display position blocks the third anchor point display position in the image, a second anchor point display position is determined according to the third anchor point display position and the first anchor point display position.
5. The method according to claim 4, characterized in that The determining the second anchor point display position according to the third anchor point display position and the first anchor point display position includes: Determining whether the first item and the third item are of 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; In the case that the first item and the third item are of the same item type, the third anchor point display position and the first anchor point display position are merged to obtain the second anchor point display position.
6. The method according to claim 5, characterized in that The method further comprises: In a case where the first article and the third article are of different article types, the display position selected by the user is determined as the second anchor point display position.
7. The method according to claim 2, characterized in that In a case where the i-th anchor point candidate display position blocks a second object in the image, determining the first anchor point display position according to the object types of the second object and the first object, comprises: Establishing a coordinate system of the image with pixels as units; Determine a first central pixel point of the i-th anchor point candidate display position; Obtaining coordinate values of a first pixel point, a second pixel point, a third pixel point, and a fourth pixel point in the i-th anchor point candidate display position, wherein the first pixel point is located at the upper left of the first center pixel point, the second pixel point is located at the lower left of the first center pixel point, the third pixel point is located at the upper right of the first center pixel point, and the fourth pixel point is located at the lower right of the first center pixel point, the distances between the first pixel point, the second pixel point, the third pixel point, and the fourth pixel point and the first center pixel point are a first preset distance, and the angles between the lines connecting the first pixel point, the second pixel point, the third pixel point, and the fourth pixel point and the first center pixel point and a vertical line are a first preset angle; Determining a second central pixel point of the display area of the second object; Obtaining coordinate values of a fifth pixel point, a sixth pixel point, a seventh pixel point, and an eighth pixel point in the display area of the second object, wherein the fifth pixel point is located at the upper left of the second central pixel point, the sixth pixel point is located at the lower left of the second central pixel point, the seventh pixel point is located at the upper right of the second central pixel point, and the eighth pixel point is located at the lower right of the second central pixel point, the distances between the fifth pixel point, the sixth pixel point, the seventh pixel point, and the eighth pixel point and the second central pixel point are second preset distances, and the angles between the lines connecting the fifth pixel point, the sixth pixel point, the seventh pixel point, and the eighth pixel point and the second central pixel point and the vertical line are second preset angles; When the coordinate value of the first target pixel point is within the coordinate range of the display area of the second object, or the coordinate value of the second target pixel point is within the coordinate range of the i-th anchor point candidate display position, the i-th anchor point candidate display position occludes the second object, wherein the first target pixel point includes: at least one of the first pixel point, the second pixel point, the third pixel point and the fourth pixel point, and the second target pixel point includes: at least one of the fifth pixel point, the sixth pixel point, the seventh pixel point and the eighth pixel point.
8. The method according to claim 2, characterized in that: In a case where the i-th anchor point candidate display position blocks a second object in the image, determining the first anchor point display position according to the object types of the second object and the first object, comprises: Establishing a coordinate system of the image with pixels as units; Determine a first central pixel point of the i-th anchor point candidate display position; Obtaining coordinate values of a first pixel point, a second pixel point, a third pixel point, and a fourth pixel point in the i-th anchor point candidate display position, wherein the first pixel point is located at the upper left of the first center pixel point, the second pixel point is located at the lower left of the first center pixel point, the third pixel point is located at the upper right of the first center pixel point, and the fourth pixel point is located at the lower right of the first center pixel point, the distances between the first pixel point, the second pixel point, the third pixel point, and the fourth pixel point and the first center pixel point are a first preset distance, and the angles between the lines connecting the first pixel point, the second pixel point, the third pixel point, and the fourth pixel point and the first center pixel point and a vertical line are a first preset angle; Determining a second central pixel point of the display area of the second object; Obtaining coordinate values of a fifth pixel point, a sixth pixel point, a seventh pixel point, and an eighth pixel point in the display area of the second object, wherein the fifth pixel point is located at the upper left of the second central pixel point, the sixth pixel point is located at the lower left of the second central pixel point, the seventh pixel point is located at the upper right of the second central pixel point, and the eighth pixel point is located at the lower right of the second central pixel point, the distances between the fifth pixel point, the sixth pixel point, the seventh pixel point, and the eighth pixel point and the second central pixel point are second preset distances, and the angles between the lines connecting the fifth pixel point, the sixth pixel point, the seventh pixel point, and the eighth pixel point and the second central pixel point and the vertical line are second preset angles; Calculate the coordinate value of the intersection point between a first line segment and a second line segment, wherein the first line segment is a line connecting any two pixel points among the first pixel point, the second pixel point, the third pixel point, and the fourth pixel point, and the second line segment is a line connecting any two pixel points among the fifth pixel point, the sixth pixel point, the seventh pixel point, and the eighth pixel point; When the coordinate value of the intersection point is within the range of the coordinate values of the two endpoints of the first line segment, and the coordinate value of the intersection point is within the range of the coordinate values of the two endpoints of the second line segment, the i-th anchor point candidate display position obscures the second object.
9. An anchor point display device, characterized in that: include: An acquisition module, used to acquire N anchor point candidate display positions of the first object in the image, where N is a positive integer; a determination module, configured to determine a first anchor point display position according to the N anchor point candidate display positions, wherein the first anchor point display position is independent of display positions of objects in the image; A display module is used to display a 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.
10. An electronic device, characterized in that: The electronic device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the anchor point display method according to any one of claims 1 to 8 is implemented.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the anchor point display method according to any one of claims 1 to 8 is implemented.
12. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device is enabled to execute the anchor point display method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Icon display method, device, server, and storage medium
CN109032744A
Picture processing method and device
CN112508785A
Information display method and device, equipment and storage medium
CN115576634A
Positioning method, positioning system, electronic equipment and computer readable storage medium
CN116506796A
Vehicle feature recognition description method, description system, description equipment and readable storage medium
CN117037036A
