Image control method and apparatus
Patent Information
- Application Number
- CN202410268727.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-08
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2044-03-08
AI Technical Summary
[0005]本申请提供了一种图像控制方法及装置,以至少解决现有技术中由于对于较大的图像不能充分显示导致的图像查看效率低的技术问题
[0016] In this application, a method is adopted to transform the display coordinate system corresponding to the image. The image on the display screen is adjusted based on the center point of the display screen, and the adjusted image is used as the first image. The adjustment operation rotates the image around the center point by a preset angle while ensuring that the relative positions of each pixel in the image remain unchanged. Then, the scale of the first image in different directions is adjusted according to the length and height of the display screen, and the adjusted first image is used as the second image. The visible area of the second image on the display screen is larger than that of the first image. Finally, the coordinates of each pixel in the second image are restored to the target coordinate system corresponding to the image, and each pixel is rendered based on its coordinates in the target coordinate system to generate the target image. The amount of image information displayed on the display screen when displaying the target image is greater than the amount of image information displayed when displaying the image.
Smart Images

Figure CN117935758B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing, and more specifically, to an image control method and apparatus. Background Technology
[0002] In current technology, computer screens are primarily rectangular, inherently limiting display space to only one dimension, while the other dimension receives a relatively smaller display area. Modern monitors have gradually transitioned from an early 4:3 aspect ratio to a 16:9 ratio, and software toolbars and status bars occupy the top and bottom of the screen respectively, further distorting the aspect ratio of the visible area. In reality, the aspect ratio of the actual displayable content is closer to 2:1.
[0003] However, some images often have width and depth in both the horizontal and vertical directions. Since the display space of the screen is relatively narrow in the vertical direction, the image content in this direction usually cannot be fully displayed on the entire screen. It is necessary to scroll back and forth or drag the image to display it, which is very inconvenient and time-consuming.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This application provides an image control method and apparatus to at least solve the technical problem of low image viewing efficiency caused by the inability to fully display large images in the prior art.
[0006] According to one aspect of this application, an image control method is provided, comprising: adjusting an image on a display screen based on the center point of the display screen, and using the adjusted image as a first image, wherein the adjustment operation is used to rotate the image around the center point by a preset angle while ensuring that the relative positions of each pixel in the image remain unchanged; adjusting the scale of the first image in different directions according to the length and height of the display screen, and using the adjusted first image as a second image, wherein the visible range of the second image on the display screen is greater than the visible range of the first image on the display screen; restoring the coordinates of each pixel in the second image to the target coordinate system corresponding to the image, and rendering each pixel based on the coordinates of each pixel in the target coordinate system to generate a target image, wherein the amount of image information displayed on the display screen when displaying the target image is greater than the amount of image information displayed on the display screen when displaying the image.
[0007] Optionally, the image control method includes: acquiring the coordinates of each pixel in the image in the target coordinate system and the coordinates of the center point of the display screen in the target coordinate system; establishing a first coordinate system with the center point as the origin; determining the coordinate points of each pixel in the first coordinate system based on the coordinates of each pixel in the image in the target coordinate system and the coordinates of the center point in the target coordinate system; determining the first coordinate point of each pixel in the first coordinate system after rotating it around the center point by a preset angle in the first coordinate system based on a preset angle and the coordinate points of each pixel in the first coordinate system; and adjusting the image to a first image based on the first coordinate points of each pixel in the first coordinate system.
[0008] Optionally, the image control method includes: calculating the rotation radian based on a preset angle and a first function, wherein the first function is a function that calculates the radian corresponding to the angle based on the angle; calculating the cosine and sine values of the rotation radian; and determining the first coordinate point corresponding to each pixel in the first coordinate system based on the cosine and sine values of the rotation radian and the coordinate points of each pixel in the first coordinate system.
[0009] Optionally, the image control method includes: using the difference between the x-coordinate of each pixel in the target coordinate system and the x-coordinate of the center point in the target coordinate system as a first value corresponding to each pixel; using the difference between the y-coordinate of each pixel in the target coordinate system and the y-coordinate of the center point in the target coordinate system as a second value corresponding to each pixel; and determining the coordinates of each pixel in the first coordinate system based on the first and second values corresponding to each pixel, wherein the first and second values corresponding to each pixel are the x-coordinate and y-coordinate of the coordinates of that pixel in the first coordinate system, respectively.
[0010] Optionally, the image control method includes: using the product of the x-coordinate of each pixel in the first coordinate system and the cosine of the rotation radians as the third value corresponding to each pixel; using the product of the y-coordinate of each pixel in the first coordinate system and the sine of the rotation radians as the fourth value corresponding to each pixel; using the product of the x-coordinate of each pixel in the first coordinate system and the sine of the rotation radians as the fifth value corresponding to each pixel; using the product of the y-coordinate of each pixel in the first coordinate system and the cosine of the rotation radians as the sixth value corresponding to each pixel; and determining the first coordinate point corresponding to each pixel in the first coordinate system based on the third, fourth, fifth, and sixth values, wherein the x-coordinate of the first coordinate point corresponding to each pixel is the difference between the third and fourth values corresponding to that pixel, and the y-coordinate of the first coordinate point corresponding to each pixel is the difference between the fifth and sixth values corresponding to that pixel.
[0011] Optionally, the image control method includes: calculating the ratio of length to height; determining the second coordinate point corresponding to each pixel point based on the first coordinate point corresponding to each pixel point in a first coordinate system with the center point as the origin and the ratio, wherein each coordinate axis of the coordinate system formed by the second coordinate points corresponding to each pixel point is parallel to a diagonal of the display screen, and the density between the second coordinate points corresponding to each pixel point is the same as the density between each pixel point in the image; and adjusting the first image to a second image based on the second coordinate points corresponding to each pixel point.
[0012] Optionally, the image control method includes: determining a seventh value corresponding to each pixel based on the abscissa and ratio of the first coordinate point corresponding to each pixel; determining an eighth value corresponding to each pixel based on the ordinate and ratio of the first coordinate point corresponding to each pixel; and determining a second coordinate point corresponding to each pixel based on the seventh and eighth values, wherein the seventh and eighth values corresponding to each pixel are the abscissa and ordinate of the second coordinate point corresponding to that pixel, respectively.
[0013] Optionally, the image control method includes: using the sum of the abscissa of each pixel in the second image and the abscissa of the center point in the target coordinate system as the ninth value corresponding to each pixel; using the sum of the ordinate of each pixel in the second image and the ordinate of the center point in the target coordinate system as the tenth value corresponding to each pixel; and restoring the coordinates of each pixel in the second image to the target coordinate system based on the ninth and tenth values corresponding to each pixel, wherein the abscissa of each pixel in the second image restored to the target coordinate system is the ninth value corresponding to that pixel, and the ordinate of each pixel in the second image restored to the target coordinate system is the tenth value corresponding to that pixel.
[0014] Optionally, the image control method includes: after generating the target image, obtaining the coordinates of the touch point corresponding to the target image in the target coordinate system; converting the coordinates of the touch point in the target coordinate system into a first coordinate system with the center point as the origin; performing a reverse adjustment of the scale in different directions on the first coordinate to obtain a second coordinate corresponding to the touch point; performing a reverse adjustment operation on the second coordinate to obtain a third coordinate corresponding to the touch point; and restoring the third coordinate to the target coordinate system corresponding to the image to obtain a fourth coordinate corresponding to the touch point in the target coordinate system.
[0015] According to another aspect of this application, an image control device is also provided, comprising: a first processing unit, configured to adjust an image on a display screen based on the center point of the display screen, and use the adjusted image as a first image, wherein the adjustment operation is configured to rotate the image around the center point by a preset angle while ensuring that the relative positions of each pixel in the image remain unchanged; a second processing unit, configured to adjust the scale of the first image in different directions according to the length and height of the display screen, and use the adjusted first image as a second image, wherein the visible range of the second image on the display screen is greater than the visible range of the first image on the display screen; and a third processing unit, configured to restore the coordinates of each pixel in the second image to the target coordinate system corresponding to the image, and render each pixel based on the coordinates of each pixel in the target coordinate system to generate a target image, wherein the amount of image information displayed on the display screen when displaying the target image is greater than the amount of image information displayed on the display screen when displaying the image.
[0016] In this application, a method is adopted to transform the display coordinate system corresponding to the image. The image on the display screen is adjusted based on the center point of the display screen, and the adjusted image is used as the first image. The adjustment operation rotates the image around the center point by a preset angle while ensuring that the relative positions of each pixel in the image remain unchanged. Then, the scale of the first image in different directions is adjusted according to the length and height of the display screen, and the adjusted first image is used as the second image. The visible area of the second image on the display screen is larger than that of the first image. Finally, the coordinates of each pixel in the second image are restored to the target coordinate system corresponding to the image, and each pixel is rendered based on its coordinates in the target coordinate system to generate the target image. The amount of image information displayed on the display screen when displaying the target image is greater than the amount of image information displayed when displaying the image.
[0017] As described above, by adjusting the image on the display screen based on the center point of the display screen, and using the adjusted image as the first image, and by adjusting the proportion of the first image in different directions according to the length and height of the display screen, and using the adjusted first image as the second image, the technical effect of expanding the visible range of the image on the display screen through the transformation of the pixel coordinates is achieved. Finally, the coordinates of each pixel in the second image are restored to the target coordinate system corresponding to the image, and each pixel is rendered according to the coordinates of each pixel in the target coordinate system to generate the target image. Since the amount of image information displayed when the display screen displays the target image is greater than the amount of image information displayed when the display screen displays the image, more image information can be displayed when the display screen displays the target image, thus solving the problem of low image viewing efficiency caused by the inability to fully display large images in the prior art. Attached Figure Description
[0018] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0019] Figure 1 This is a schematic diagram of a threat attribution map displayed on a screen based on existing technology;
[0020] Figure 2 This is a flowchart of an optional image control method according to an embodiment of this application;
[0021] Figure 3 This is a schematic diagram of an optional UI front-end structure according to an embodiment of this application;
[0022] Figure 4 This is a schematic diagram of an optional image control system according to an embodiment of this application;
[0023] Figure 5 This is a schematic diagram of an optional target coordinate system according to an embodiment of this application;
[0024] Figure 6 This is a schematic diagram of an optional first coordinate system according to an embodiment of this application;
[0025] Figure 7 This is a schematic diagram of an optional rotated first coordinate system according to an embodiment of this application;
[0026] Figure 8 This is a schematic diagram of an optional coordinate system with adjusted aspect ratio according to an embodiment of this application;
[0027] Figure 9This is a schematic diagram of an optional target image according to an embodiment of this application;
[0028] Figure 10 This is a schematic diagram of an optional image control device according to an embodiment of this application. Detailed Implementation
[0029] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0030] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. 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 comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0031] It should also be noted that all information and data involved in this application are authorized by the user or fully authorized by all parties. For example, this system has an interface with the relevant user or organization. Before obtaining relevant information, it needs to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving consent from the aforementioned user or organization.
[0032] Among existing technologies, EDR (Endpoint Detection and Response) is the most important endpoint security function after virus detection technology. EDR collects behavioral data from endpoints, performs centralized big data correlation analysis, and reports suspicious events to security administrators. Based on the relevant information from these suspicious events, security administrators make the final threat assessment and response, effectively discovering and handling unknown threats and improving the security of the enterprise endpoint environment.
[0033] In addition, security operations personnel analyze and judge the reported threat events in the EDR response process. Furthermore, they need to conduct a detailed analysis of each step of the attack source in order to eliminate all security risks. Both of these steps require tracing the threat events to find the attack entry point, jump site, etc., and finally judge and handle all threat events.
[0034] It's important to note that the above process requires the use of big data technology to perform correlation queries and analysis on massive amounts of data, connecting the causes and consequences of each step in the attack activity. This is threat attribution. Presenting the attribution results graphically is what we call a threat attribution map. The threat attribution map is the most important tool that the EDR system provides for security administrators in terms of handling and analysis.
[0035] It should also be noted that threat attribution diagrams are typically displayed in a tree structure, with horizontal lines representing parallel sibling relationships (such as processes creating multiple files) and vertical lines representing parent-child relationships (such as a process creating a child process, a child process creating a grandchild process, etc.). Because complex attack activities involve numerous steps and generate a large amount of data, the resulting threat attribution diagrams are highly complex. Figure 1 Generally, they have a large horizontal range and a deep vertical hierarchy. For example... Figure 1 As shown, an optional threat attribution map may include a maximum of 6 nodes vertically, namely: node 1, node 2, node 7, node 11, node 13, and node 12; and a maximum of 5 nodes horizontally, namely: node 2, node 3, node 1, node 4, and node 5. Alternatively, it may include node 7, node 8, node 1, node 9, and node 10.
[0036] However, computer screens are primarily rectangular, inherently limiting display space to only one dimension, while the other receives a relatively smaller display area. Furthermore, software toolbars and status bars occupy the top and bottom of the screen respectively, further distorting the aspect ratio of the visible area. In practice, the aspect ratio of the actual displayable content is close to 2:1. Given this, threat attribution maps, which often have width and depth both horizontally and vertically, suffer from limited vertical display space. Therefore, image content in this direction typically cannot be fully displayed on the screen, requiring scrolling or dragging to access it, which is inconvenient and time-consuming.
[0037] To address the aforementioned problems, an embodiment of an image control method is provided according to an embodiment of this application. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0038] Figure 2 This is a flowchart of an optional image control method according to an embodiment of this application, such as... Figure 2 As shown, the method includes the following steps:
[0039] Step S201: Adjust the image on the display screen according to the center point of the display screen, and use the adjusted image as the first image.
[0040] In step S201, the adjustment operation is used to rotate the image around the center point by a preset angle while ensuring that the relative positions of each pixel in the image do not change.
[0041] In an optional embodiment, an image control system can serve as the execution subject of an optional image control method in this application embodiment. The image control system can be a software system or an embedded system combining software and hardware.
[0042] Optionally, the aforementioned display screen can be the screen of various electronic display devices with display functions, such as smartphones, laptops, desktop computers, and LED screens.
[0043] Alternatively, the images displayed on the screen can be various images, such as the threat tracing diagram above.
[0044] It should be noted that, as Figure 3 As shown, in the UI (user interface) design of a display screen, the front-end architecture of the UI generally consists of three modules: Model, View, and Controller. The Model is the business model, used to encapsulate data related to the application's business logic and methods for processing that data. The View is the user interface, primarily responsible for displaying data on the page. The Controller is the link between the Model and the View, responsible for handling user interaction logic; generally, it reflects user intent in the View by changing the Model data.
[0045] Optionally, such as Figure 4 As shown in the embodiments of this application, the image control system includes at least two components: a transformation layer in the view (which can be simply referred to as the view transformation layer) and a transformation layer in the controller (which can be simply referred to as the controller transformation layer). The view transformation layer is used to rotate the node coordinates of the original tree diagram to diagonal coordinates, and the controller transformation layer is used to transform the coordinates of the user input event back to the original coordinates.
[0046] Optionally, the view transition layer is used to adjust the image on the display screen according to the center point of the display screen, and use the adjusted image as the first image. The adjustment operation is used to rotate the image around the center point by a preset angle while ensuring that the relative positions of each pixel in the image do not change.
[0047] Optionally, the preset angle can be customized, for example, 45 degrees counterclockwise.
[0048] Step S202: Adjust the scale of the first image in different directions according to the length and height of the display screen, and use the adjusted first image as the second image.
[0049] In step S202, the visible area of the second image on the display screen is greater than the visible area of the first image on the display screen.
[0050] Optionally, the proportions in the different directions mentioned above can represent the proportions in the horizontal and vertical directions, i.e., the aspect ratio of the first image. It should be noted that the purpose of adjusting the aspect ratio of the first image is to make the adjusted first image have a larger viewing range. In addition, during the adjustment process, it is necessary to ensure that the density of the pixels in the first image is consistent with the original image before and after the adjustment, and that the parallel lines in the image remain parallel to each other.
[0051] Step S203: Restore the coordinates of each pixel in the second image to the target coordinate system corresponding to the image, and render each pixel according to the coordinates of each pixel in the target coordinate system to generate the target image.
[0052] In step S203, the amount of image information displayed on the display screen when displaying the target image is greater than the amount of image information displayed on the display screen when displaying the image.
[0053] Optionally, the target coordinate system is the HTML Canvas coordinate system, which is a coordinate system with the top left corner as the origin (0, 0), the rightward axis as the X-axis, and the downward axis as the Y-axis.
[0054] Based on the above steps S201 to S203, it is clear that in this application, the display coordinate system corresponding to the image is transformed. The image on the display screen is adjusted based on the center point of the display screen, and the adjusted image is used as the first image. The adjustment operation rotates the image around the center point by a preset angle while ensuring that the relative positions of each pixel in the image remain unchanged. Then, the proportions of the first image in different directions are adjusted according to the length and height of the display screen, and the adjusted first image is used as the second image. The visible range of the second image on the display screen is greater than that of the first image. Finally, the coordinates of each pixel in the second image are restored to the target coordinate system corresponding to the image, and each pixel is rendered based on its coordinates in the target coordinate system to generate the target image. The amount of image information displayed on the display screen when displaying the target image is greater than the amount of image information displayed when displaying the image.
[0055] As described above, by adjusting the image on the display screen based on the center point of the display screen, and using the adjusted image as the first image, and by adjusting the proportion of the first image in different directions according to the length and height of the display screen, and using the adjusted first image as the second image, the technical effect of expanding the visible range of the image on the display screen through the transformation of the pixel coordinates is achieved. Finally, the coordinates of each pixel in the second image are restored to the target coordinate system corresponding to the image, and each pixel is rendered according to the coordinates of each pixel in the target coordinate system to generate the target image. Since the amount of image information displayed when the display screen displays the target image is greater than the amount of image information displayed when the display screen displays the image, more image information can be displayed when the display screen displays the target image, thus solving the problem of low image viewing efficiency caused by the inability to fully display large images in the prior art.
[0056] In one optional embodiment, during the adjustment operation of the image on the display screen, the view transition layer first obtains the coordinates of each pixel in the image under the target coordinate system and the coordinates of the center point of the display screen under the target coordinate system. Then, it establishes a first coordinate system with the center point as the origin and determines the coordinate points of each pixel in the first coordinate system based on the coordinates of each pixel in the image under the target coordinate system and the coordinates of the center point under the target coordinate system. Subsequently, the view transition layer determines the first coordinate point of each pixel in the first coordinate system after rotating it around the center point by a preset angle in a first direction according to a preset angle and the coordinate points of each pixel in the first coordinate system. Finally, the view transition layer adjusts the image to a first image based on the first coordinate points of each pixel in the first coordinate system.
[0057] Optionally, taking the image on the display screen as the original tree diagram as an example, the coordinate marking method is taken from the coordinate marking method of the HTML Canvas coordinate system (i.e., the target coordinate system mentioned above), such as... Figure 5 As shown, the top left corner is the origin (0, 0), the right side is the X-axis, and the bottom side is the Y-axis. Assume that the width and height of the display screen are width and height, respectively.
[0058] Optionally, let's assume any pixel in the original tree diagram is denoted as point P, and its coordinates in the HTML Canvas coordinate system are (x, y). To ensure that the result after the adjustment operation basically overlaps with the original visible area, the origin of the coordinate system is transformed to the center point of the screen, and rotations or other changes are performed around the center point of the display screen. The coordinates of the center point of the display screen are (mid_x, mid_y), where mid_x = width / 2 and mid_y = height / 2.
[0059] Optionally, such as Figure 6 As shown, a new coordinate system (i.e., the first coordinate system) is established with the center point coordinates (mid_x, mid_y) as the origin. In the first coordinate system, the new coordinates of point P are (x1, y1), where x1 = x - mid_x and y1 = y - mid_y.
[0060] Optionally, assuming the first direction is counter-clockwise and the preset angle is 45 degrees, the view transition layer needs to calculate the first coordinate point in the first coordinate system corresponding to the new coordinate point (x1, y1) of point P after rotating counter-clockwise by 45 degrees around the center point (mid_x, mid_y). It should be noted that the above example of a counter-clockwise first direction and a preset angle of 45 degrees is merely one example. In practical applications, other rotation directions can be chosen as the first direction, and (45±n*90)° can be chosen as the preset angle, where n is any integer.
[0061] Finally, the view transformation layer adjusts the image to the first image based on the first coordinate point corresponding to each pixel in the first coordinate system.
[0062] It should also be noted that the images in the embodiments of this application can be two-dimensional images or three-dimensional images. For ease of description, the embodiments of this application use two-dimensional images as an example for scheme description. Therefore, the coordinate calculations involved are all two-dimensional coordinate calculations. In practical applications, if three-dimensional images are involved, the three-dimensional coordinates can be calculated based on the same scheme implementation idea.
[0063] In one optional embodiment, to determine the first coordinate point in the first coordinate system corresponding to each pixel after rotating it around the center point by a preset angle in a first coordinate system based on a preset angle and the coordinate points of each pixel in the first coordinate system, the view transition layer can first calculate the rotation radian based on the preset angle and a first function, wherein the first function is a function that calculates the radian corresponding to the angle based on the angle. Then, the view transition layer calculates the cosine and sine values of the rotation radian, and determines the first coordinate point corresponding to each pixel in the first coordinate system based on the cosine and sine values of the rotation radian and the coordinate points of each pixel in the first coordinate system.
[0064] Alternatively, assuming the rotation radius is denoted as angle, the rotation angle can be calculated using the following formula (1).
[0065] angle = (-45) * π / 180 (1)
[0066] In formula (1), (-45) represents 45 degrees of counterclockwise rotation.
[0067] Optionally, the cosine value of the rotation radian, cos(angle), and the sine value of the rotation radian, sin(angle), can be calculated. The view transformation layer can then determine the first coordinate point (x2, y2) corresponding to the pixel in the first coordinate system based on the cosine value of the rotation radian, the sine value of the rotation radian, and the coordinate point (x1, y1) of the pixel in the first coordinate system.
[0068] In one optional embodiment, the view transition layer can use the difference between the x-coordinate of each pixel in the target coordinate system and the x-coordinate of the center point in the target coordinate system as the first value corresponding to each pixel; and the difference between the y-coordinate of each pixel in the target coordinate system and the y-coordinate of the center point in the target coordinate system as the second value corresponding to each pixel. Then, the view transition layer determines the coordinates of each pixel in the first coordinate system based on the first and second values corresponding to each pixel, wherein the first and second values corresponding to each pixel are the x-coordinate and y-coordinate of the pixel's coordinates in the first coordinate system, respectively.
[0069] Optionally, taking point P as an example, the first value is x1 = x – mid_x, the second value is y1 = y – mid_y, and the coordinates of point P in the first coordinate system are (x1, x2).
[0070] In one optional embodiment, the view transition layer can use the product of the x-coordinate of each pixel in the first coordinate system and the cosine of the rotation in radians as the third value for each pixel; the product of the y-coordinate of each pixel in the first coordinate system and the sine of the rotation in radians as the fourth value for each pixel; the product of the x-coordinate of each pixel in the first coordinate system and the sine of the rotation in radians as the fifth value for each pixel; and the product of the y-coordinate of each pixel in the first coordinate system and the cosine of the rotation in radians as the sixth value for each pixel. Finally, the view transition layer determines the first coordinate point corresponding to each pixel in the first coordinate system based on the third, fourth, fifth, and sixth values, wherein the x-coordinate of the first coordinate point corresponding to each pixel is the difference between the third and fourth values, and the y-coordinate of the first coordinate point corresponding to each pixel is the difference between the fifth and sixth values.
[0071] Optionally, according to the rotation axis formula, the first coordinate point corresponding to point P in the first coordinate system after rotation is (x2, y2), where the horizontal coordinate x2 is calculated by the following formula (2):
[0072] x2 = x1 *cos(angle) – y1 * Math.sin(angle) (2)
[0073] In formula (2), x1*cos(angle) is the third value corresponding to point P, and y1*Math.sin(angle) is the fourth value corresponding to point P.
[0074] Alternatively, the ordinate y2 can be calculated using the following formula (3):
[0075] y2 = x1 * Math.sin(angle) + y1 * Math.cos(angle) (3)
[0076] In formula (3), x1*Math.sin(angle) is the fifth value corresponding to point P, and y1*Math.cos(angle) is the sixth value corresponding to point P.
[0077] It should be noted that, as Figure 7 As shown in the example above, after rotating 45 degrees counterclockwise, the vertical and horizontal relative relationships of the original image remain unchanged, preserving the structural information of the original image and not affecting its semantics.
[0078] In one optional embodiment, the view transition layer can calculate the ratio of length to height, and then determine the second coordinate point corresponding to each pixel based on the first coordinate point corresponding to each pixel in a first coordinate system with the center point as the origin and the ratio. Each axis of the coordinate system formed by the second coordinate points corresponding to each pixel is parallel to a diagonal of the display screen, and the density between the second coordinate points corresponding to each pixel is the same as the density between pixels in the image. Finally, the view transition layer adjusts the first image to a second image based on the second coordinate points corresponding to each pixel.
[0079] Optionally, the view transition layer can determine the seventh value corresponding to each pixel based on the x-coordinate and ratio of the first coordinate point corresponding to each pixel; and determine the eighth value corresponding to each pixel based on the y-coordinate and ratio of the first coordinate point corresponding to each pixel. Finally, the view transition layer determines the second coordinate point corresponding to each pixel based on the seventh and eighth values, where the seventh and eighth values for each pixel are the x-coordinate and y-coordinate of the second coordinate point corresponding to that pixel, respectively.
[0080] Optionally, by adjusting the aspect ratio of the first image, making its X and Y axes parallel to the screen diagonal, a larger viewing area can be obtained while ensuring that the pixel density is consistent with the original. Figure 1 And parallel lines remain parallel. Taking the adjustment of the coordinates of the first coordinate point (x2, y2) corresponding to point P as an example, the first coordinate point (x2, y2) is adjusted to the second coordinate point (x3, y3), and the specific formulas are formulas (4) and (5):
[0081]
[0082]
[0083] The derivation process of formulas (4) and (5) above is as follows:
[0084] To achieve the goal of making the X and Y axes parallel to the screen diagonal, the current X and Y axes need to be scaled by a certain ratio. Therefore, we can make the following assumptions: x3 = x2 * xRatio and y3 = y2 * yRatio.
[0085] To achieve the goal of making the X-axis and Y-axis parallel to the diagonal, we can determine: y3 / x3 = height / width = (y2*yRatio) / (x2*xRatio).
[0086] Furthermore, since the points on the coordinate axes satisfy y² / x² = 1 when the original coordinate axes are rotated by 45 degrees, we can obtain yRatio / xRatio = height / width.
[0087] Secondly, because it is necessary to ensure that the density of pixels is consistent with the original... Figure 1 If the area occupied by each element within the visible area is the same as before, then we can get x3*y3=(x2*xRatio)*(y2*yRatio)=x2*y2, and finally determine that xRatio*yRatio=1.
[0088] In summary, we can obtain formulas (6) and (7).
[0089] yRatio / xRatio = height / width (6)
[0090] xRatio * yRatio = 1 (7)
[0091] Therefore, the final adjustment ratio can be calculated as follows: as well as
[0092] That is, the final coordinate adjustment formulas are the above formulas (4) and (5).
[0093] It should be noted that adjusting the aspect ratio of the first image according to the coordinate adjustment ratio obtained above ensures that the following functionalities are achieved:
[0094] 1. The original graphic's X and Y axes are parallel to the screen diagonal, resulting in a wider field of view;
[0095] 2. The density of the graphics and the original Figure 1 Therefore, the area occupied by each element within the visible area remains unchanged;
[0096] 3. Parallel lines remain parallel, and the structural relationships in the diagram remain unchanged.
[0097] The specific proof process is as follows:
[0098] Assuming the original parallel lines are (M1, M2) and (N1, N2), then their slopes must be equal, therefore (x M1 -x M2 ) / (y M1 -y M2 )=(x N1 -x N2 ) / (y N1 -y N2 ). Assumption Substituting the latest coordinate formula into the calculation, we get:
[0099] (x M1 / Ratio-x M2 / Ratio) / (y M1 *Ratio-y M2 *Ratio)=(x M1 -x M2 ) / (y M1 -y M2 ) / Ratio. and (x N1 / Ratio-x N2 / Ratio) / (y N1 *Ratio-y N2 *Ratio)=(x N1 -x N2 ) / (y N1 -y N2 ) / Ratio.
[0100] Therefore, the equation still holds true:
[0101] (x M1 / Ratio-x M2 / Ratio) / (y M1 *Ratio-y M2 *Ratio)=(x N1 / Ratio-x N2 / Ratio) / (y N1 *Ratio-y N2 *Ratio), meaning that after adjusting the ratio, the slopes of lines M and N remain equal, and parallel lines remain parallel.
[0102] In an optional embodiment, the view transition layer may further use the sum of the x-coordinate of each pixel in the second image and the x-coordinate of the center point in the target coordinate system as the ninth value corresponding to each pixel, and the sum of the y-coordinate of each pixel in the second image and the y-coordinate of the center point in the target coordinate system as the tenth value corresponding to each pixel. Finally, the view transition layer restores the coordinates of each pixel in the second image to the target coordinate system based on the ninth and tenth values corresponding to each pixel. Specifically, the x-coordinate of each pixel in the second image restored to the target coordinate system corresponds to the ninth value corresponding to that pixel, and the y-coordinate of each pixel in the second image restored to the target coordinate system corresponds to the tenth value corresponding to that pixel.
[0103] Optionally, after obtaining the second coordinate point (x3, y3) corresponding to point P, the view transformation layer restores the second coordinate point (x3, y3) to the HTML Canvas coordinate system, where x3 is restored to the x4 coordinate in the HTML Canvas coordinate system and y4 is restored to the y4 coordinate in the HTML Canvas coordinate system.
[0104] Among them, x4=x3+mid_x; y4=y3+mid_y.
[0105] Finally, the view transformation layer renders the drawing coordinates (x4, y4) through the view module. It should be noted that after the coordinates of each pixel in the second image are restored to the target coordinate system, the view transformation layer, through the view module, can render each pixel based on its coordinates in the target coordinate system to generate the target image. Figure 8 Is Figure 7 A schematic diagram of the coordinate system after adjusting the aspect ratio.
[0106] In one optional embodiment, after generating the target image, the image control system can obtain the coordinates of the touch point corresponding to the target image in the target coordinate system through the controller conversion layer, and convert the coordinates of the touch point in the target coordinate system into the first coordinates in the first coordinate system with the center point as the origin. Then, the controller conversion layer performs a reverse adjustment of the vertical and horizontal scale of the first coordinates to obtain the second coordinates corresponding to the touch point, and performs a reverse adjustment operation on the second coordinates to obtain the third coordinates corresponding to the touch point. Finally, the controller conversion layer restores the third coordinates to the target coordinate system corresponding to the image to obtain the fourth coordinates corresponding to the touch point in the target coordinate system.
[0107] Optionally, the controller transformation layer can be used to convert the coordinates of user input events (such as mouse click events) back to their original coordinates and map them onto the original graph. For example, in the original tree diagram, the coordinate marking method is taken from the HTMLCanvas coordinate marking method, with the top left corner as the origin (0, 0). Assume the user input event is in the form of (event, x4...). , y4 , ), event refers to an event, such as a mouse click, (x4) , y4 , ) represents the clicked location, assuming the clicked location is point Q (i.e., the touch point corresponding to the target object).
[0108] First, when a touch operation occurs involving point Q, the browser still uses the coordinates reported by the HTML Canvas. Therefore, it needs to be converted to the first coordinate system with the center point (mid_x, mid_y) as the origin for calculation. In the first coordinate system, the coordinates of point Q become the first coordinate (x3...)., y3 , ), where x3 , =x4 , -mid_x;y3 , =y4 , -mid_y.
[0109] Subsequently, the first coordinate was adjusted in reverse to obtain the second coordinate (x2) corresponding to the touch point. , y2 , ),in,
[0110] Secondly, by performing the reverse operation of adjusting the second coordinate, the third coordinate (x1) corresponding to the touch point is obtained. , y1 , This means rotating the second coordinate in the opposite direction (clockwise) by 45 degrees.
[0111] Wherein, the rotation angle1 = (45)*π / 180; x1 , =x2 , *cos(angle1)–y2 , *sin(angle1); y1 , =x2 , *sin(angle1)+y2 , *cos(angle1)
[0112] Finally, the third coordinate is restored to the HTML Canvas coordinate system corresponding to the image to obtain the fourth coordinate (x, y) of the touch point in the target coordinate system. , y , ), where x , =x1 , +mid_x;y , =y1 , +mid_y. The controller transition layer will handle events (event, x) , y , Submit it to the controller module for processing.
[0113] In one alternative embodiment, Figure 9 This is a schematic diagram of an optional target image according to an embodiment of this application, such as... Figure 9 As shown, with Figure 1 Correspondingly, the solution in this application embodiment can be used for the optimized display of threat attribution maps. Because threat attribution maps are characterized by large data volume and complexity, the final threat attribution map... Figure 1Generally, images have a large horizontal range and deep vertical layers. After image conversion using the technical solution of this application embodiment, a larger field of view can be obtained in both the horizontal and vertical directions, thereby displaying more image content.
[0114] Therefore, it can be seen that the source tracing diagram display implemented through the technical solution of this application embodiment can greatly improve the user experience in threat source tracing diagram scenarios, making it convenient for users to view the overall picture. The technical solution of this application embodiment can bring at least the following technical effects:
[0115] 1. Coordinate transformation can be directly implemented on the basis of the original horizontal and vertical tree diagrams, reducing code changes and time investment, and making it convenient to use;
[0116] 2. Solve the problem of insufficient field of view in the Y-axis direction, and provide users with a larger viewing area in both the X and Y axes;
[0117] 3. Retain the relative positions and structural attributes of all nodes in the original graphic, and keep the meaning of the graphic unchanged to ensure that the conversion does not affect the understanding of the business.
[0118] 4. Ensure the aesthetics of the converted graphic, keeping the original parallel lines parallel and maintaining the same density as the original graphic.
[0119] According to an embodiment of this application, an embodiment of an image control device is also provided. Figure 10 This is a schematic diagram of an optional image control device according to an embodiment of this application, such as... Figure 10 As shown, the image control device includes: a first processing unit 1001, a second processing unit 1002, and a third processing unit 1003.
[0120] The first processing unit 1001 is used to adjust the image on the display screen according to the center point of the display screen, and use the adjusted image as the first image. The adjustment operation is used to rotate the image around the center point by a preset angle while ensuring that the relative positions of each pixel in the image do not change. The second processing unit 1002 is used to adjust the proportion of the first image in different directions according to the length and height of the display screen, and use the adjusted first image as the second image. The visible range of the second image on the display screen is greater than that of the first image. The third processing unit 1003 is used to restore the coordinates of each pixel in the second image to the target coordinate system corresponding to the image, and render each pixel according to the coordinates of each pixel in the target coordinate system to generate a target image. The amount of image information displayed on the display screen when displaying the target image is greater than the amount of image information displayed on the display screen when displaying the image.
[0121] Optionally, the first processing unit 1001 includes: a first acquisition subunit, a first processing subunit, a first determination subunit, a second determination subunit, and an adjustment subunit. The first acquisition subunit is used to acquire the coordinates of each pixel in the image under target coordinates and the coordinates of the center point of the display screen under the target coordinate system; the first processing subunit is used to establish a first coordinate system with the center point as the origin; the first determination subunit is used to determine the coordinates of each pixel in the first coordinate system based on the coordinates of each pixel in the image under the target coordinates and the coordinates of the center point under the target coordinate system; the second determination subunit is used to determine the first coordinates of each pixel after rotating it around the center point by a preset angle in a first direction under the first coordinate system based on a preset angle and the coordinates of each pixel under the first coordinate system; the adjustment subunit is used to adjust the image to a first image based on the first coordinates of each pixel under the first coordinate system.
[0122] Optionally, the second determining subunit includes: a first calculation module, a second calculation module, and a determining module. The first calculation module is used to calculate the rotation radian based on a preset angle and a first function, wherein the first function is a function that calculates the radian corresponding to the angle; the second calculation module is used to calculate the cosine and sine values of the rotation radian; and the determining module is used to determine the first coordinate point corresponding to each pixel in the first coordinate system based on the cosine and sine values of the rotation radian and the coordinate points of each pixel in the first coordinate system.
[0123] Optionally, the first determining subunit includes: a first processing module, a second processing module, and a first determining module. The first processing module is used to take the difference between the x-coordinate of each pixel in the target coordinate system and the x-coordinate of the center point in the target coordinate system as the first value corresponding to each pixel; the second processing module is used to take the difference between the y-coordinate of each pixel in the target coordinate system and the y-coordinate of the center point in the target coordinate system as the second value corresponding to each pixel; the first determining module is used to determine the coordinates of each pixel in the first coordinate system based on the first and second values corresponding to each pixel, wherein the first and second values corresponding to each pixel are respectively the x-coordinate and y-coordinate of the pixel's coordinates in the first coordinate system.
[0124] Optionally, the defined modules include: a first processing submodule, a second processing submodule, a third processing submodule, a fourth processing submodule, and a fifth processing submodule. The first processing submodule is used to take the product of the x-coordinate of each pixel in the first coordinate system and the cosine of the rotation radian as the third value corresponding to each pixel; the second processing submodule is used to take the product of the y-coordinate of each pixel in the first coordinate system and the sine of the rotation radian as the fourth value corresponding to each pixel; the third processing submodule is used to take the product of the x-coordinate of each pixel in the first coordinate system and the sine of the rotation radian as the fifth value corresponding to each pixel; the fourth processing submodule is used to take the product of the y-coordinate of each pixel in the first coordinate system and the cosine of the rotation radian as the sixth value corresponding to each pixel; and the fifth processing submodule is used to determine the first coordinate point corresponding to each pixel in the first coordinate system based on the third, fourth, fifth, and sixth values corresponding to each pixel, wherein the x-coordinate of the first coordinate point corresponding to each pixel is the difference between the third and fourth values corresponding to that pixel, and the y-coordinate of the first coordinate point corresponding to each pixel is the difference between the fifth and sixth values corresponding to that pixel.
[0125] Optionally, the second processing unit 1002 includes: a calculation subunit, a third determination subunit, and a first adjustment subunit. The calculation subunit is used to calculate the ratio of length to height; the third determination subunit is used to determine the second coordinate points corresponding to each pixel based on the first coordinate points of each pixel in a first coordinate system with the center point as the origin and the ratio, wherein each coordinate axis of the coordinate system formed by the second coordinate points of each pixel is parallel to a diagonal of the display screen, and the density between the second coordinate points of each pixel is the same as the density between pixels in the image; the first adjustment subunit is used to adjust the first image into a second image based on the second coordinate points corresponding to each pixel.
[0126] Optionally, the third determining subunit includes: a second determining module, a third determining module, and a fourth determining module. The second determining module is used to determine a seventh value corresponding to each pixel based on the ratio of the abscissa of the first coordinate point corresponding to each pixel; the third determining module is used to determine an eighth value corresponding to each pixel based on the ratio of the ordinate of the first coordinate point corresponding to each pixel; the fourth determining module is used to determine a second coordinate point corresponding to each pixel based on the seventh and eighth values, wherein the seventh and eighth values corresponding to each pixel are respectively the abscissa and ordinate of the second coordinate point corresponding to that pixel.
[0127] Optionally, the third processing unit 1003 includes: a second processing subunit, a third processing subunit, and a fourth processing subunit. The second processing subunit is used to take the sum of the abscissa of each pixel in the second image and the abscissa of the center point in the target coordinate system as the ninth value corresponding to each pixel; the third processing subunit is used to take the sum of the ordinate of each pixel in the second image and the ordinate of the center point in the target coordinate system as the tenth value corresponding to each pixel; the fourth processing subunit is used to restore the coordinates of each pixel in the second image to the target coordinate system based on the ninth and tenth values corresponding to each pixel, wherein the abscissa of each pixel in the second image restored to the target coordinate system is the ninth value corresponding to that pixel, and the ordinate of each pixel in the second image restored to the target coordinate system is the tenth value corresponding to that pixel.
[0128] Optionally, the image control device further includes: an acquisition unit, a conversion unit, a reverse adjustment unit, a reverse operation unit, and a restoration unit. The acquisition unit acquires the coordinates of the touch point corresponding to the target image in the target coordinate system; the conversion unit converts the coordinates of the touch point in the target coordinate system into first coordinates in a first coordinate system with the center point as the origin; the reverse adjustment unit performs a reverse adjustment on the first coordinates in different directions to obtain the second coordinates corresponding to the touch point; the reverse operation unit performs a reverse operation on the second coordinates to obtain the third coordinates corresponding to the touch point; and the restoration unit restores the third coordinates to the target coordinate system corresponding to the image to obtain the fourth coordinates corresponding to the touch point in the target coordinate system.
[0129] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein, when the computer program is running, it controls the device where the computer-readable storage medium is located to execute the image control method of any one of the above.
[0130] According to another aspect of the embodiments of this application, an electronic device is also provided, including: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the image control method of any one of the above via executing the executable instructions.
[0131] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0132] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0133] The embodiments or examples disclosed herein are not exhaustive, but merely illustrative of some embodiments or examples, and are not intended to limit the scope of protection of this disclosure. Unless otherwise specified, each step in a particular embodiment or example can be implemented as an independent embodiment, and the steps can be arbitrarily combined. For example, a solution after removing some steps in a particular embodiment or example can also be implemented as an independent embodiment, and the order of the steps in a particular embodiment or example can be arbitrarily interchanged. Furthermore, optional methods or examples in a particular embodiment or example can be arbitrarily combined; moreover, embodiments or examples can be arbitrarily combined, for example, some or all steps of different embodiments or examples can be arbitrarily combined, and a particular embodiment or example can be arbitrarily combined with optional methods or examples of other embodiments or examples.
[0134] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0135] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0136] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0137] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0138] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. An image control method characterized by, include: The image on the display screen is adjusted based on the center point of the display screen, and the adjusted image is used as the first image. The adjustment operation is used to rotate the image around the center point by a preset angle while ensuring that the relative positions of each pixel in the image do not change. The scale of the first image is adjusted in different directions according to the length and height of the display screen, and the adjusted first image is used as the second image, wherein the visible range of the second image on the display screen is greater than the visible range of the first image on the display screen; The coordinates of each pixel in the second image are restored to the target coordinate system corresponding to the image, and each pixel is rendered according to the coordinates of each pixel in the target coordinate system to generate the target image. The amount of image information displayed by the display screen when displaying the target image is greater than the amount of image information displayed by the display screen when displaying the image.
2. The image control method according to claim 1, characterized by, Adjusting the image on the display screen based on the center point of the display screen, and using the adjusted image as the first image, includes: Obtain the coordinates of each pixel in the image under the target coordinate system and the coordinates of the center point of the display screen under the target coordinate system; A first coordinate system is established with the center point as the origin. Based on the coordinates of each pixel in the image under the target coordinates and the coordinates of the center point under the target coordinate system, determine the coordinates of each pixel under the first coordinate system; Based on the preset angle and the coordinates of each pixel in the first coordinate system, determine the first coordinate point of each pixel in the first coordinate system after rotating it around the center point by a preset angle in the first direction; The image is adjusted to the first image based on the first coordinate point corresponding to each pixel in the first coordinate system.
3. The image control method according to claim 2, characterized by, Based on the preset angle and the coordinates of each pixel in the first coordinate system, determine the first coordinate point of each pixel in the first coordinate system after rotating it around the center point by a preset angle in a first direction, including: The rotation radian is calculated based on the preset angle and the first function, wherein the first function is a function that calculates the radian corresponding to the angle based on the angle; Calculate the cosine and sine values of the rotation in radians; Based on the cosine and sine values of the rotation radian and the coordinates of each pixel in the first coordinate system, the first coordinate point corresponding to each pixel in the first coordinate system is determined.
4. The image control method according to claim 2, characterized in that, When the coordinates of each pixel include both horizontal and vertical coordinates, determining the coordinates of each pixel in the first coordinate system based on the coordinates of each pixel in the target coordinate system and the coordinates of the center point in the target coordinate system includes: The difference between the horizontal coordinate of each pixel in the target coordinate system and the horizontal coordinate of the center point in the target coordinate system is taken as the first value corresponding to each pixel. The difference between the ordinate of each pixel in the target coordinate system and the ordinate of the center point in the target coordinate system is used as the second value corresponding to each pixel. The coordinates of each pixel in the first coordinate system are determined based on the first and second values corresponding to each pixel, wherein the first and second values corresponding to each pixel are the x-coordinate and y-coordinate of the pixel in the first coordinate system, respectively.
5. The image control method according to claim 3, characterized in that, When the coordinates of each pixel include both horizontal and vertical coordinates, the first coordinate point corresponding to each pixel in the first coordinate system is determined based on the cosine and sine values of the rotation radians and the coordinates of each pixel in the first coordinate system, including: The product of the x-coordinate of each pixel in the first coordinate system and the cosine of the rotation radian is used as the third value corresponding to each pixel. The product of the ordinate of each pixel in the first coordinate system and the sine of the rotation radian is used as the fourth value corresponding to each pixel. The product of the x-coordinate of each pixel in the first coordinate system and the sine of the rotation radian is taken as the fifth value corresponding to each pixel. The product of the ordinate of each pixel in the first coordinate system and the cosine of the rotation radian is taken as the sixth value corresponding to each pixel. The first coordinate point corresponding to each pixel in the first coordinate system is determined based on the third, fourth, fifth and sixth values corresponding to each pixel. The horizontal coordinate of the first coordinate point corresponding to each pixel is the difference between the third and fourth values corresponding to that pixel, and the vertical coordinate of the first coordinate point corresponding to each pixel is the difference between the fifth and sixth values corresponding to that pixel.
6. The image control method according to claim 1, characterized in that, Adjusting the scale of the first image in different directions according to the length and height of the display screen, and using the adjusted first image as the second image, includes: Calculate the ratio of the length to the height; The second coordinate point corresponding to each pixel is determined based on the first coordinate point corresponding to each pixel in the first coordinate system with the center point as the origin and the ratio. Each coordinate axis of the coordinate system formed by the second coordinate points corresponding to each pixel is parallel to a diagonal of the display screen, and the density between the second coordinate points corresponding to each pixel is the same as the density between each pixel in the image. The first image is adjusted to the second image based on the second coordinate points corresponding to each pixel.
7. The image control method according to claim 6, characterized in that, When the coordinates of each pixel include both horizontal and vertical coordinates, determining the second coordinate point corresponding to each pixel based on the first coordinate point in the first coordinate system and the ratio includes: The seventh value corresponding to each pixel is determined based on the x-coordinate of the first coordinate point corresponding to each pixel and the ratio; The eighth value corresponding to each pixel is determined based on the ordinate of the first coordinate point corresponding to each pixel and the ratio; The second coordinate point corresponding to each pixel is determined based on the seventh and eighth values corresponding to each pixel, wherein the seventh and eighth values corresponding to each pixel are the horizontal and vertical coordinates of the second coordinate point corresponding to that pixel, respectively.
8. The image control method according to claim 1, characterized in that, When the coordinates of each pixel include both horizontal and vertical coordinates, restoring the coordinates of each pixel in the second image to the target coordinate system corresponding to the image includes: The sum of the x-coordinate of each pixel in the second image and the x-coordinate of the center point in the target coordinate system is taken as the ninth value corresponding to each pixel. The sum of the ordinate of each pixel in the second image and the ordinate of the center point in the target coordinate system is taken as the tenth value corresponding to each pixel. Based on the ninth and tenth values corresponding to each pixel, the coordinates of each pixel in the second image are restored to the target coordinate system. The horizontal coordinate of each pixel in the second image restored to the target coordinate system is the ninth value corresponding to that pixel, and the vertical coordinate of each pixel in the second image restored to the target coordinate system is the tenth value corresponding to that pixel.
9. The image control method according to any one of claims 1 to 8, characterized in that, After generating the target image, the image control method further includes: Obtain the coordinates of the touch point corresponding to the target image in the target coordinate system; The coordinates of the touch point in the target coordinate system are converted to the first coordinates in the first coordinate system with the center point as the origin. The first coordinate is adjusted in reverse proportion in different directions to obtain the second coordinate corresponding to the touch point; Perform the reverse operation of the adjustment operation on the second coordinate to obtain the third coordinate corresponding to the touch point; The third coordinate is restored to the target coordinate system corresponding to the image to obtain the fourth coordinate of the touch point in the target coordinate system.
10. An image control device, characterized in that, include: The first processing unit is used to perform an adjustment operation on the image in the display screen based on the center point of the display screen, and to use the adjusted image as the first image. The adjustment operation is used to rotate the image around the center point by a preset angle while ensuring that the relative positions of each pixel in the image do not change. The second processing unit is configured to adjust the scale of the first image in different directions according to the length and height of the display screen, and use the adjusted first image as the second image, wherein the visible range of the second image on the display screen is greater than the visible range of the first image on the display screen; The third processing unit is used to restore the coordinates of each pixel in the second image to the target coordinate system corresponding to the image, and to render each pixel according to the coordinates of each pixel in the target coordinate system to generate a target image, wherein the amount of image information displayed by the display screen when displaying the target image is greater than the amount of image information displayed by the display screen when displaying the image.
Citation Information
Patent Citations
Graph / image high-fidelity scaling method adopting rotary matching network
CN102147914A
Display control method and display equipment
CN104881263A