A method, apparatus, device, and program product for displaying annotations.

By adjusting the rotation angle between the center point of the text annotation area and the center point of the image file when the image file is rotated, the problem of mismatched annotation text direction is solved, and automatic adjustment of text orientation is achieved, thus improving the user experience.

CN116012231BActive Publication Date: 2026-11-17SHENZHEN HONGHE INNOVATION INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211722551.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2026-11-17
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

When an image file rotates, the text content in the annotation rotates along with the image file, resulting in a mismatch in text orientation and affecting the user experience.

Method used

By defining the text annotation area and non-text annotation area of ​​the image file, and rotating them with the center point of the image file and the center point of the text annotation area respectively, the orientation of the text in the text annotation area is adjusted to keep the text content in the same direction before and after the rotation or to face the specified direction.

Benefits of technology

It enables automatic adjustment of the text orientation in the text annotation area during image file rotation, maintaining consistent text orientation or pointing towards a specified direction, thus improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116012231B_ABST
    Figure CN116012231B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, device, and program product for displaying annotations, relating to the field of image processing technology. A method for displaying annotations includes: determining a text annotation area and a non-text annotation area of ​​an image file; rotating the image file at a first angle with its center point as the center; rotating the text annotation area at a second angle in the opposite direction to the rotation direction of the image file, with its center point as the center, to adjust the text orientation of the text content in the text annotation area; displaying the text content; and displaying the content of the non-text annotation area. According to embodiments of this application, the text annotation content in an image file can be automatically adjusted during image file rotation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and more specifically, to an annotation display method, apparatus, device, and program product. Background Technology

[0002] Currently, when users annotate courseware, images, and other image files, they often need to rotate both the image file and its annotations. When the image file is rotated, the text in the annotations rotates along with it, resulting in a mismatch in the orientation of the text before and after rotation.

[0003] The inventors of this application discovered that if the text content in the annotation changes with the rotation of the image file, it will make it inconvenient for users to display or view the image file, resulting in a poor user experience. Summary of the Invention

[0004] According to one aspect of this application, a method for displaying annotations is provided, comprising: determining a text annotation area and a non-text annotation area of ​​an image file; rotating the image file at a first angle with the center point of the image file as the center; rotating the text annotation area at a second angle in the opposite direction of the rotation direction of the image file with the center point of the text annotation area as the center, so as to adjust the text orientation of the text content in the text annotation area; displaying the text content; and displaying the content of the non-text annotation area.

[0005] According to some embodiments, rotating the text annotation area around its center point at a second angle in the opposite direction of the image file's rotation direction to adjust the text orientation of the text content in the text annotation area includes: obtaining first position information of a first writing point under the first angle of rotation of the image file, wherein the first writing point is any point within the text annotation area, and the first angle is an angle formed when the image file has been rotated but not completed k revolutions, where k is an integer; calculating second position information of the first writing point relative to the text annotation area under the second angle of rotation in the opposite direction of the image file's rotation direction based on the first angle and the first position information; and obtaining the final position information of the first writing point relative to the image file by performing coordinate transformation on the second position information, for displaying the text content of the text annotation area according to the final position information.

[0006] According to some embodiments, obtaining the first position information of the first writing point under the first rotation angle of the image file includes: determining the position of the center point of the image file; rotating the image file by the first angle with the center point of the image file as the center; and obtaining the first position information of the first writing point under the first rotation angle of the image file.

[0007] According to some embodiments, calculating the second position information of the first writing point relative to the text annotation area when the text annotation area is rotated by a second angle in the opposite direction of the rotation direction of the image file, based on the first angle and the first position information, includes: determining the position of the center point of the text annotation area; obtaining the internal offset of the first writing point relative to the center point of the text annotation area based on the first position information and the distance between the center point of the text annotation area and the origin of the coordinate system; rotating the text annotation area with the center point of the text annotation area as the center and in the opposite direction of the rotation direction of the image file by the second angle; and calculating the second position information of the first writing point relative to the text annotation area when the text annotation area is rotated by a second angle in the opposite direction of the rotation direction of the image file, based on the internal offset of the first writing point relative to the center point of the text annotation area, the first angle, and the second angle.

[0008] According to some embodiments, obtaining the final position information of the first writing point relative to the image file by performing coordinate transformation on the second position information includes: performing coordinate transformation on the second position information based on the position information of the center point of the image file, the first angle, and the second angle to obtain the final position information relative to the image file.

[0009] According to some embodiments, displaying the content of the non-text annotation area includes: obtaining the initial position information of a second writing point when the image file is rotated by a first angle around the center point of the image file, wherein the second writing point is any point within the non-text annotation area; calculating the final position information of the second writing point based on the initial position information of the second writing point, the position information of the center point of the image file, the first angle, and the sum of the rotation angles after multiple rotations of the image file around the center point of the image file; and displaying the content of the non-text annotation area based on the final position information of the second writing point.

[0010] According to one aspect of this application, an annotation display device is provided, comprising: an annotation recognition module for determining text annotation areas and non-text annotation areas in an image file; an adjustment processing module for rotating the image file at a first angle with the center point of the image file as the center; rotating the text annotation area at a second angle in the opposite direction of the rotation direction of the image file with the center point of the text annotation area as the center, so as to adjust the text orientation of the text content in the text annotation area; and an annotation display module for displaying the text content of the text annotation area and the content of the non-text annotation area.

[0011] According to one aspect of this application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs; and, when the one or more programs are executed by the one or more processors, causing the one or more processors to perform the method as described above.

[0012] According to one aspect of this application, a computer program product is provided, including a computer program or instructions that, when executed by a processor, implement the method as described above.

[0013] According to one aspect of this application, an intelligent interactive display device is provided for displaying an image file processed by the aforementioned method.

[0014] According to embodiments of this application, the orientation of the text in the text annotation area can be automatically adjusted during the rotation of the image file, so that the text in the text annotation area can be displayed in the same direction before and after rotation, or in a specified direction after rotation, without affecting other areas of the image file.

[0015] It should be understood that the above general description and the following detailed description are merely exemplary and do not limit this application. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application.

[0017] Figure 1 A flowchart illustrating a method for displaying annotations according to an example embodiment of this application is shown.

[0018] Figure 2 A flowchart illustrating the text content of an annotation area in an image file according to an example embodiment of this application.

[0019] Figure 3A , Figure 3BA schematic diagram illustrating the effect of adjusting the text content of the text annotation area of ​​an image file according to an example embodiment of this application.

[0020] Figure 4 A block diagram of an annotation display device according to an example embodiment of this application is shown.

[0021] Figure 5 A block diagram of an electronic device according to an example embodiment of this application is shown. Detailed Implementation

[0022] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, they are provided so that this application will be thorough and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted.

[0023] The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced without one or more of these specific details, or other methods, components, materials, apparatus, or operations may be employed. In these cases, well-known structures, methods, apparatuses, implementations, materials, or operations will not be shown or described in detail.

[0024] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0025] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0026] This application provides a method, apparatus, device, and program product for displaying annotations, which can automatically adjust the text annotation content in an image file to the text orientation when the image file is rotated or to a specified text orientation, without affecting other areas of the image file.

[0027] The following will describe in detail, with reference to the accompanying drawings, a method, apparatus, device, and program product for displaying annotations according to embodiments of this application.

[0028] Figure 1 A flowchart illustrating a method for displaying annotations according to an example embodiment of this application is shown.

[0029] like Figure 1 As shown, in step S110, the annotation display device determines the text annotation area and non-text annotation area of ​​the image file.

[0030] For example, in step S110, the annotation display device scans the image file using a text recognition algorithm to identify whether the image file contains text content.

[0031] When text content is detected in an image file, the annotation display device uses a character recognition algorithm to obtain several points corresponding to the text content. Based on these points, the annotation display device determines the text annotation area of ​​the image file. The area in the image file other than the text annotation area is the non-text annotation area, which includes non-text annotation content such as drawing annotations.

[0032] Alternatively, the text recognition algorithm may employ OCR, shape context, or other algorithms.

[0033] In step S120, the annotation display device rotates the image file at a first angle with the center point of the image file as the center.

[0034] For example, in step S120, when it is recognized that the image file contains text content, the annotation display device obtains the center point position of the image file and rotates the image file by a first angle with the center point of the image file as the rotation center.

[0035] When the first angle is k times 360°, where k is an integer, the annotation display device does not adjust the text orientation of the text content in the text annotation area. That is, when the image file has not been rotated or has been rotated a full k revolutions, where k is an integer, the annotation display device does not adjust the text orientation of the text content in the text annotation area.

[0036] If the image file has been rotated but not for a full k revolutions (where k is an integer), the annotation display device selects any point within the text annotation area of ​​the image file, i.e., the first writing point, and obtains the first position information of the first writing point at this time.

[0037] Similarly, after rotating the image file at the first angle, the annotation display device selects any point in the non-text annotation area of ​​the image file, i.e., the second writing point, and obtains the initial position information of the second writing point at this time.

[0038] In step S130, the annotation display device rotates the text annotation area at a second angle in the opposite direction to the rotation direction of the image file, with the center point of the text annotation area as the center, so as to adjust the text orientation of the text content in the text annotation area.

[0039] For example, in step S130, after the image file is rotated by a first angle, the annotation display device obtains the center point position of the text annotation area of ​​the image file. The annotation display device calculates the internal offset of the first writing point relative to the center point of the text annotation area based on the first position information of the first writing point and the distance between the center point of the text annotation area and the origin of the coordinate system.

[0040] The annotation display device rotates the text annotation area around its center point, at a second angle, in the opposite direction to the image file's rotation direction. Based on the internal offset of the first writing point relative to the center point of the text annotation area, the first angle, and the second angle, the annotation display device calculates the second position information of the first writing point relative to the text annotation area at the second angle.

[0041] According to some embodiments, the second angle may be the same as or different from the first angle. When the second angle is the same as the first angle, the annotation display device can adjust the text orientation of the annotation content in the text annotation area to the text orientation before the image file is rotated. When the second angle is different from the first angle, the annotation display device can adjust the text orientation of the annotation content at any second angle during the image file rotation.

[0042] After the image file is rotated, the annotation display device performs coordinate transformation on the second position information of the first writing point relative to the text annotation area at the second angle, based on the position information of the center point of the image file and the first angle. After the coordinate transformation, the final position information of the first writing point relative to the image file can be obtained.

[0043] After the non-text annotation area of ​​the image file is rotated to its final position along with the image file, the annotation display device calculates the final position information of the second writing point based on the initial position information of the second writing point, the position information of the center point of the image file, the first angle, and the sum of the rotation angles after the image file has rotated multiple times around the center point of the image file.

[0044] The final coordinates (P, Q) of the second writing point can be calculated using the following coordinate transformation formula:

[0045] P=(p0-x0)*cos(RA0-RA1)+(q0-y0)*sin(RA0-RA1)+x0;

[0046] Q=-(p0-x0)*sin(RA0-RA1)+(q0-y0)*cos(RA0-RA1)+y0;

[0047] Where (p0, q0) are the initial position coordinates of the second writing point, (x0, y0) are the position coordinates of the center point of the image file, RA0 is the value of the first angle, and RA1 is the sum of the rotation angles after the image file has been rotated multiple times around the center point of the image file.

[0048] In step S140, the annotation display device displays the text content.

[0049] For example, in step S140, the annotation display device displays the text content corresponding to the text annotation area based on the final position information of the first writing point.

[0050] In step S150, the annotation display device displays the content of the non-text annotation area.

[0051] For example, in step S150, the annotation display device displays the content corresponding to the non-text annotation area according to the final position information of the second writing point.

[0052] According to an embodiment of this application, as the annotations of an image file change with the rotation of the image file, the text annotation content is adjusted in real time so that the text annotation content maintains the text orientation before the image file is rotated, or the text orientation of the text annotation content can be adjusted in a specified direction.

[0053] Figure 2 A flowchart illustrating the text content of an annotation area in an image file according to an example embodiment of this application.

[0054] like Figure 2 As shown, in step S210, when the image file is rotated by a first angle, the annotation display device obtains the first position information of the first writing point.

[0055] For example, in step S210, the annotation display device constructs a Cartesian coordinate system with the top-left corner of the image file as the origin. The annotation display device determines the position (x0, y0) of the center point of the image file in the coordinate system.

[0056] The annotation display device rotates the image file around its center point by a first angle RA0. The annotation display device then acquires the first position information (x, y) of the first writing point at that moment.

[0057] In step S220, after the text annotation area is rotated by a second angle in the opposite direction to the rotation direction of the image file, the annotation display device calculates the second position information of the first writing point relative to the text annotation area.

[0058] For example, in step S220, the annotation display device determines the center point position (rx0, ry0) of the text annotation area (i.e., the distance between the center point of the text annotation area and the origin of the coordinate system), and calculates the internal offset coordinates (m, n) of the first writing point relative to the center point of the text annotation area, where (m, n) is the internal offset of the first writing point relative to the center point of the text annotation area, m = x - rx0, n = y - ry0.

[0059] The annotation display device rotates the text annotation area around its center point, at a second angle RA, in the opposite direction to the image file's rotation direction. The annotation display device obtains the second position information (x1, y1) of the first writing point relative to the text annotation area based on the internal offset coordinates of the first writing point relative to the center point of the text annotation area, the first angle, and the second angle. Here, x1 and y1 are calculated using the following coordinate transformation formulas:

[0060] x1=m*cos(RA0-RA)+n*sin(RA0-RA)+rx0;

[0061] y1=-m*sin(RA0-RA)+n*cos(RA0-RA)+ry0.

[0062] In step S230, the annotation display device calculates the final position information of the first writing point relative to the image file after the rotation of the image file is completed.

[0063] For example, in step S230, the rotation of the image file ends after the annotation display device rotates the text annotation area at a second angle in the opposite direction to the rotation direction of the image file.

[0064] The annotation display device performs coordinate transformation on the second position information of the first writing point relative to the text annotation area based on the position information of the center point of the image file, the first angle, and the second angle. The final position information (M, N) of the first writing point relative to the image file is obtained through coordinate transformation formulas, where M and N are calculated using the following coordinate transformation formulas:

[0065] M=(x1-x0)*cos(RA-RA0)+(y1-y0)*sin(RA-RA0)+x0;

[0066] N=-(x1-x0)*sin(RA-RA0)+(y1-y0)*cos(RA-RA0)+y0.

[0067] The annotation display device displays the text content of the text annotation area of ​​the image file based on the final position information (M, N) of the first writing point.

[0068] According to an embodiment of this application, by adjusting the rotation of the image file and the text annotation area, the orientation of the text content in the text annotation area can be adjusted in real time during the rotation of the image file.

[0069] Figure 3A , Figure 3B A schematic diagram illustrating the effect of adjusting the text content of the text annotation area of ​​an image file according to an example embodiment of this application.

[0070] like Figure 3A As shown, the image file 20 includes a text annotation area 210, a non-text annotation area 220, and an image file center point 230. The text annotation area 210 includes a text annotation area center point 211 and text annotation content 212, and the non-text annotation area 220 includes non-text annotation content 221.

[0071] The annotation display device constructs a Cartesian coordinate system with the top left corner of image file 20 as the origin.

[0072] like Figure 3A The image file 20 shown is in an unrotated state.

[0073] like Figure 3B As shown, the annotation display device rotates the image file 20 counterclockwise at a first angle with the center point 230 of the image file as the rotation center, and obtains the first position coordinates of the first writing point in the text annotation area 210 and the initial position coordinates of the second writing point in the non-text annotation area 220.

[0074] After the image file 20 is rotated counterclockwise at the first angle, the annotation display device rotates the text annotation area 210 at the second angle in a clockwise direction opposite to the rotation direction of the image file 20, with the center point 211 of the text annotation area as the rotation center. The device also calculates the second position coordinates of the first writing point relative to the text annotation area 210 based on the first position coordinates of the first writing point, the position coordinates of the center point 211 of the text annotation area, the first angle, and the second angle.

[0075] In an example embodiment of this application, the annotation display device sets the second angle to be the same as the first angle.

[0076] The annotation display device displays the text annotation content 212 in the rotated text annotation area 210 according to the second position coordinates of the first writing point, and displays the non-text annotation content 221 in the rotated non-text annotation area 220 according to the initial position coordinates of the second writing point.

[0077] The annotation display device calculates the final position coordinates of the first writing point relative to the image file 20 based on the second position coordinates of the first writing point relative to the text annotation area 210, the position coordinates of the center point 230 of the image file, the first angle, and the second angle.

[0078] The annotation display device calculates the final position coordinates of the second writing point based on the initial position information of the second writing point, the position coordinates of the center point 230 of the image file, the first angle, and the sum of the rotation angles after the image file has been rotated multiple times around the center point of the image file.

[0079] The annotation display device displays the text annotation content 212 in the text annotation area 210 after the image file 20 has been rotated to its final position, based on the coordinates of the first writing point relative to the final position of the image file 20. Since the annotation display device sets the second angle to be the same as the first angle, the text orientation of the text annotation content 212 is the same as the first angle after the image file 20 has been rotated to its final position. Figure 3A When the image file 20 is in an unrotated state, the text orientation of the text annotation content 212 is consistent.

[0080] The annotation display device also displays the non-text annotation content 221 of the non-text annotation area 220 after the image file 20 has been rotated to its final position, based on the final position coordinates of the second writing point.

[0081] According to embodiments of this application, the annotation display device can distinguish between text annotation areas and non-text annotation areas when the image file is rotated, so that the display direction of the text annotation content in the text annotation area is consistent before and after rotation, or the text orientation of the text annotation content can be adjusted according to a specified direction.

[0082] Figure 4A block diagram of an annotation display device according to an example embodiment of this application is shown.

[0083] like Figure 4 As shown, the annotation display device includes an annotation recognition module 310, an adjustment processing module 320, and an annotation display module 330.

[0084] The annotation recognition module 310 is used to scan image files using a text recognition algorithm and recognize the annotation content in the image files to determine whether the annotation content is text.

[0085] When the annotation content is text, the annotation recognition module 310 obtains several points corresponding to the text annotation content and uses them to form the smallest text annotation area. The annotation recognition module 310 determines the area in the image file other than the text annotation area as the non-text annotation area of ​​the image file.

[0086] The adjustment processing module 320 is used to control the image file to rotate at a preset angle with the center point of the image file as the rotation center, and during the rotation of the image file, it controls the text annotation area to rotate at a second angle with the center point of the text annotation area as the rotation center in the opposite direction of the image file rotation, so as to adjust the text orientation of the text annotation content in the text annotation area.

[0087] The adjustment processing module 320 calculates the position information of any point in the text annotation area after the image file has finished rotating, based on the position information of any point in the text annotation area, the center point position of the image file, and the center point position of the text annotation area, combined with the rotation angle of the image file and the rotation angle of the text annotation area in the opposite direction of the rotation direction of the image file.

[0088] The adjustment processing module 320 also calculates the position information of any point in the non-text annotation area after the rotation of the image file is completed, based on the position information of any point in the non-text annotation area and the position of the center point of the image file, combined with the rotation angle of the image file and the sum of the rotation angles after multiple rotations of the image file around the center point of the image file.

[0089] The annotation display module 330 displays the text content of the text annotation area and the content of the non-text annotation area of ​​the image file respectively, based on the position information of any point in the text annotation area and any point in the non-text annotation area after the rotation of the image file is completed.

[0090] Figure 5 A block diagram of an electronic device according to an example embodiment of this application is shown.

[0091] like Figure 5As shown, the electronic device 600 is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0092] like Figure 5 As shown, the electronic device 600 is manifested in the form of a general-purpose computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610), a display unit 640, etc. The storage unit stores program code, which can be executed by the processing unit 610, causing the processing unit 610 to perform the methods described in this specification according to the various exemplary embodiments of this application. For example, the processing unit 610 can perform, for example... Figure 1 The method shown.

[0093] Storage unit 620 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 6201 and / or cache memory 6202, and may further include a read-only memory (ROM) 6203.

[0094] Storage unit 620 may also include a program / utility 6204 having a set (at least one) program module 6205, such program module 6205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0095] Bus 630 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0096] Electronic device 600 can also communicate with one or more external devices 700 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 600, and / or with any device that enables electronic device 600 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 650. Furthermore, electronic device 600 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 660. Network adapter 660 can communicate with other modules of electronic device 600 via bus 630. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0097] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. The technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the methods according to the embodiments of this application.

[0098] Software products may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example,, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0099] Computer-readable storage media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable storage medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0100] Program code for performing the operations of this application can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0101] The aforementioned computer-readable medium carries one or more programs, which, when executed by a device, cause the computer-readable medium to perform the aforementioned functions.

[0102] Those skilled in the art will understand that the above modules can be distributed in the device as described in the embodiments, or they can be modified accordingly and placed in one or more devices that are unique to this embodiment. The modules in the above embodiments can be combined into one module, or they can be further divided into multiple sub-modules.

[0103] According to some embodiments of this application, the technical solution of this application can make the text orientation of the text annotation content on the image file adjust in real time during the rotation of the image file. It can keep the text annotation displayed in the same direction before the image file is rotated, or make the text annotation displayed in a specified direction, thereby improving the smoothness of the workflow and the user experience.

[0104] The embodiments of this application have been described in detail above. These descriptions are solely for the purpose of helping to understand the method and core ideas of this application. Furthermore, any changes or modifications made by those skilled in the art based on the ideas of this application, its specific implementation methods, and its application scope, are all within the scope of protection of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A display method of a comment, characterized by, include: Determine the text annotation areas and non-text annotation areas of the image file; Rotate the image file around its center point by a first angle; Rotate the text annotation area in the opposite direction of the image file rotation direction at a second angle, with the center point of the text annotation area as the center. The first angle and the second angle can be the same or different, so as to adjust the text orientation of the text content in the text annotation area. Display the text content; as well as Display the content of the non-text annotation area; Specifically, the text annotation area is rotated at a second angle in the opposite direction to the rotation direction of the image file, with the center point of the text annotation area as the center. The first angle and the second angle can be the same or different, to adjust the text orientation of the text content in the text annotation area, including: Obtain the first position information of the first writing point under the first rotation angle of the image file, wherein the first writing point is any point within the text annotation area, and the first angle is the angle formed when the image file has been rotated but not completely rotated k times, where k is an integer; Based on the first angle and the first position information, calculate the second position information of the first writing point relative to the text annotation area when the first writing point is rotated by the second angle in the opposite direction of the rotation direction of the image file; The final position information of the first writing point relative to the image file is obtained by performing coordinate transformation on the second position information, so as to display the text content of the text annotation area according to the final position information.

2. The method of claim 1, wherein, Obtaining the first position information of the first writing point under the first rotation angle of the image file includes: Determine the position of the center point of the image file; Rotate the image file by the first angle, with the center point of the image file as the center; Obtain the first position information of the first writing point when the image file is rotated by the first angle.

3. The method of claim 1, wherein, Based on the first angle and the first position information, calculate the second position information of the first writing point relative to the text annotation area when the first writing point is rotated by the second angle in the opposite direction of the image file rotation direction, including: Determine the position of the center point of the text annotation area; Based on the first position information and the distance between the center point of the text annotation area and the origin of the coordinate system, the internal offset of the first writing point relative to the center point of the text annotation area is obtained. Centered on the center point of the text annotation area, rotate the text annotation area in the opposite direction of the rotation direction of the image file at the second angle; Based on the internal offset of the first writing point relative to the center point of the text annotation area, the first angle, and the second angle, calculate the second position information of the first writing point relative to the text annotation area when the text annotation area is rotated by the second angle in the opposite direction of the rotation direction of the image file.

4. The method of claim 1, wherein, The final position information of the first writing point relative to the image file is obtained by performing coordinate transformation on the second position information, including: Based on the position information of the center point of the image file, the first angle, and the second angle, the second position information is transformed into coordinates to obtain the final position information relative to the image file.

5. The method of claim 1, wherein, Displaying the content of the non-text annotation area includes: Obtain the initial position information of the second writing point when the image file is rotated by a first angle with the center point of the image file as the center, wherein the second writing point is any point in the non-text annotation area; The final position information of the second writing point is calculated based on the initial position information of the second writing point, the position information of the center point of the image file, the first angle, and the sum of the rotation angles after the image file is rotated multiple times around the center point of the image file. The content of the non-text annotation area is displayed based on the final position information of the second writing point.

6. A display device for annotations, characterized in that include: The annotation recognition module is used to identify text annotation areas and non-text annotation areas in image files; The adjustment processing module is used to rotate the image file at a first angle with the center point of the image file as the center; and to rotate the text annotation area at a second angle in the opposite direction of the rotation direction of the image file with the center point of the text annotation area as the center. The first angle and the second angle can be the same or different, so as to adjust the text orientation of the text content in the text annotation area. The annotation display module displays the text content of the text annotation area and the content of the non-text annotation area; The adjustment processing module is also used for Obtain the first position information of the first writing point under the first rotation angle of the image file, wherein the first writing point is any point within the text annotation area, and the first angle is the angle formed when the image file has been rotated but not completely rotated k times, where k is an integer; Based on the first angle and the first position information, calculate the second position information of the first writing point relative to the text annotation area when the first writing point is rotated by the second angle in the opposite direction of the rotation direction of the image file; The final position information of the first writing point relative to the image file is obtained by performing coordinate transformation on the second position information, so as to display the text content of the text annotation area according to the final position information.

7. An electronic device, comprising: include: One or more processors; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-5.

8. A computer program product comprising computer programs or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the method as described in any one of claims 1-5.

9. An intelligent interactive display device, characterized by Used to display image files processed by the method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Image tilt correction method and device, electronic equipment and storage medium

    CN111260569A

  • Character line detection method and device, electronic equipment and storage medium

    CN115346217A