Intelligent perspective method and device

By using an intelligent perspective method to read the target quadrilateral and perform parameter search, the problem of shapes or images in PPT not being able to achieve 3D perspective is solved, realizing a realistic 3D perspective effect and improving the visual presentation of PPT.

CN121904255APending Publication Date: 2026-04-21BEIJING BISCUIT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-26
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In existing technologies, WPS/Office does not support 3D perspective correction and deformation fitting for PPT shapes or images, resulting in the inability to achieve realistic visual effects.

Method used

A smart perspective method is provided, which reads the target quadrilateral, performs parameter search, determines the optimal parameter combination between the preset rectangle to be fitted after projection and the target quadrilateral, and applies it to the picture or shape in PowerPoint to achieve a three-dimensional perspective effect.

Benefits of technology

It achieves realistic 3D perspective effects for shapes or images in PowerPoint, automatically adjusts parameters to ensure visual consistency, and improves the visual presentation quality of PPT.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121904255A_ABST
    Figure CN121904255A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent perspective method and device. The method comprises the following steps: reading a target quadrangle; searching in a preset parameter search space according to a specified search strategy to determine a parameter combination with the highest fitting degree between the projected preset to-be-fitted rectangle and the target quadrangle; and applying the parameter combination to the picture or the shape in the PowerPoint. The parameters, the shape and the size of the three-dimensional camera closest to the projection of the quadrilateral are automatically and reversely solved through the editable quadrilateral and are applied to the selected shape through one key, and the false perspective effect with consistent vision is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of PPT information processing technology, specifically to an intelligent perspective method and device. Background Technology

[0002] In related technologies, WPS / Office does not natively support 3D perspective correction and deformation fitting for PPT shapes or images. Summary of the Invention

[0003] The main objective of this invention is to provide an intelligent perspective method and apparatus to address the shortcomings of related technologies.

[0004] To achieve the above objectives, according to a first aspect of the present invention, an intelligent perspective method is provided, comprising: reading a target quadrilateral, wherein the target quadrilateral is obtained based on a quadrilateral inserted by a terminal interface or selected from a preset graphic; searching within a preset parameter search space according to a specified search strategy to determine the parameter combination that best fits the projected preset rectangle to be fitted to the target quadrilateral; and applying the parameter combination to an image or shape in PowerPoint.

[0005] Optionally, when defining the parameter space, the method includes: calculating the target bounding box of the target quadrilateral, and adaptively correcting the target bounding box according to the aspect ratio r of the preset rectangle to be fitted, so as to determine the reference width B of the target bounding box; defining the width search interval as [0.3B, 1.1B] and defining the width search step size, wherein the preset rectangle to be fitted is an unprojected two-dimensional rectangle centered at the origin (0,0,0) in three-dimensional space, with the coordinates of its four vertices being (±W / 2, ±H / 2, 0), and its aspect ratio r=W / H is consistent with the aspect ratio of the image or shape in PowerPoint; defining the range of the X, Y, and Z axis rotation angles in the three-dimensional camera parameters as [0°, 360°), and setting the initial search step size K1; defining the search interval of the perspective field of view as [0°, 120°], and setting the search step size K2.

[0006] Optionally, the search within the preset parameter search space according to the specified search strategy includes: performing a coarse grid search with the search step size; based on the results of the coarse grid search, halving the search step size of the angle and the search step size of the width, and repeating the iteration until the angle step size < 0.1° and the width step size < 0.01°.

[0007] Optionally, during the search, Parallel.ForEach is used to perform an outer traversal of W, with inner nested traversals of the three-axis rotation angle and perspective field of view.

[0008] Optionally, during the search process, the fit of each parameter combination is evaluated through a cost function: the parameter combination is determined based on the magnitude of the cost function E=E_pts+λ˙E_edge, where E_pts is the squared error of the projection points of the preset rectangle to be fitted to the target quadrilateral points, and E_edge is the side length consistency error.

[0009] Optionally, before applying the parameter combination to an image or shape in PowerPoint, the method includes verifying the effect of the determined parameter combination; selecting the optimal parameter combination after verification; wherein, the verification method includes transforming the four vertices of the rectangle to be fitted to a three-dimensional space based on each determined parameter combination; calling a custom projection function to perform perspective mapping on the pose of the three-dimensional space according to the FOV of the determined parameter combination to obtain the preset final projection point set {p0,p1,p2,p3} of the rectangle to be fitted; and subtracting the mean of the vertex coordinates of {p0,p1,p2,p3} from the vertex set {t0,t1,t2,t3} of the target quadrilateral.

[0010] Optionally, applying the parameter combination to an image or shape in PowerPoint includes: assigning the optimal parameter combination to the ThreeD and size attributes of the selected shape or image in PowerPoint; and centering the shape or image after applying the optimal parameter combination with the target quadrilateral.

[0011] According to a second aspect of the present invention, an intelligent perspective device is provided, comprising: a reading unit for reading a target quadrilateral, wherein the target quadrilateral is obtained based on a quadrilateral inserted by a terminal interface or selected from a preset graphic; a parameter determination unit for searching within a preset parameter search space according to a specified search strategy to determine the parameter combination that best fits the projected preset rectangle to be fitted to the target quadrilateral; and a perspective unit for applying the parameter combination to an image or shape in PowerPoint.

[0012] According to a third aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing the computer to perform the method described in any one of the first aspects.

[0013] According to a fourth aspect of the present invention, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to cause the at least one processor to perform the method described in any implementation of the first aspect.

[0014] This embodiment of the intelligent perspective method and apparatus includes the following steps: reading a target quadrilateral; searching within a preset parameter search space according to a specified search strategy to determine the parameter combination that best matches the projected preset rectangle to be fitted with the target quadrilateral; and applying the parameter combination to an image or shape in PowerPoint. The method automatically calculates the 3D camera parameters and shape dimensions that best approximate the quadrilateral's projection using an editable quadrilateral, and applies them to the selected shape with a single click, resulting in a visually consistent false perspective effect. Attached Figure Description

[0015] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0016] Figure 1 This is a flowchart of the intelligent perspective method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0017] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0018] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention 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 for the embodiments of the invention 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.

[0019] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0020] According to embodiments of the present invention, a method is provided, such as Figure 1 As shown, steps 101 to 103 are included below: Step 101: Read the target quadrilateral, wherein the target quadrilateral is obtained based on a quadrilateral inserted by the terminal interface or selected from a preset graphic.

[0021] In this step, the target quadrilateral is the straight-line segment quadrilateral formed by the user inserting or selecting a rectangle named AiShapeEditor in PowerPoint and entering "Edit Vertex" mode to adjust its four corners. The computer reads the four vertices of this quadrilateral and extracts the straight-line segment nodes in a fixed order: "top left t0 → top right t1 → bottom right t2 → bottom left t3," excluding free curve nodes. The read vertex coordinates are converted from the point unit of the PowerPoint page to inches (coordinate value ÷ 72, since 1 inch = 72pt). Step 102: Search within the preset parameter search space according to the specified search strategy to determine the parameter combination that best matches the projected preset rectangle to be fitted with the target quadrilateral.

[0022] In this step, the core of the search is to find the parameter combination that allows the rectangle to be fitted to accurately fit the target quadrilateral after projection. The rectangle to be fitted is a 2D rectangle before projection, with a width W and a height H, and an aspect ratio equal to the selected shape's shape.Width / shape.Height. In the implementation, the center is set to (0,0,0), and the four vertices are set to (+ / - W / 2, + / - H / 2,0).

[0023] As an optional implementation of this embodiment, when defining the parameter space, the method includes: calculating the target bounding box of the target quadrilateral, and adaptively correcting the target bounding box according to the aspect ratio r of the preset rectangle to be fitted, so as to determine the reference width B of the target bounding box; defining the width search interval as [0.3B, 1.1B] and defining the width search step size, wherein the preset rectangle to be fitted is an unprojected two-dimensional rectangle centered at the origin (0,0,0) in three-dimensional space, with the coordinates of its four vertices being (±W / 2, ±H / 2, 0), and its aspect ratio r=W / H is consistent with the aspect ratio of the image or shape in PowerPoint; defining the range of the X, Y, and Z axis rotation angles in the three-dimensional camera parameters as [0°, 360°), and setting the initial search step size K1; defining the search interval of the perspective field of view as [0°, 120°], and setting the search step size K2.

[0024] In this optional implementation, the target bounding box (width Wb, height Hb) of the target quadrilateral is calculated, and the target bounding box is adaptively corrected according to the aspect ratio r to obtain the reference width B.

[0025] The nodes are straight-line nodes from editorShape.Nodes. The coordinates are converted to inches by moving from top left to top right to bottom right to bottom left. An adaptive approach is used to determine the baseline width B based on the bounding box and aspect ratio, ensuring that W ∈ [0.3B, 1.1B], thus guaranteeing a reasonable search scale and improving convergence. (Correction rule: If Wb / r < Hb, then B = Hb × r; otherwise, B = Wb); Simultaneously, the X / Y / Z rotation angles to be searched are uniformly normalized to the interval [0°, 360°); the width W interval is [0.3B, 1.1B], where B is the target bounding box width corrected according to the aspect ratio. Angles X / Y / Z: interval [0°, 360°), initial step size 30°.

[0026] The perspective angle, or FOV, corresponds to shape.ThreeD.FieldOfView. A larger θ indicates stronger perspective; θ approaches 0, resulting in approximately orthogonal views. Differences can be observed by changing θ within the same (X,Y,Z) coordinate system. The FOV range is [0°, 120°], with an initial step size of 30°.

[0027] As an optional implementation of this embodiment, the search in the preset parameter search space according to the specified search strategy includes: performing a coarse grid search with the search step size; based on the results of the coarse grid search, halving the search step size of the angle and the search step size of the width, and repeating the iteration until the angle step size < 0.1° and the width step size < 0.01°.

[0028] In this optional implementation, the coarse search phase quickly traverses the entire range of parameters with an initial step size, eliminating a large number of invalid combinations and locating the approximate range of the optimal solution (based on the characteristics of strong nonlinearity and multimodality of projective geometry, to avoid getting trapped in local optima); in the fine search phase, the angle step size and width step size are halved in each round, and the range is narrowed around the optimal value of the previous round until the angle step size < 0.1° and the width step size < 0.01° (balancing search efficiency and accuracy).

[0029] As an optional implementation in this embodiment, Parallel.ForEach is used to perform outer traversal of W during the search, while inner nested traversal of the three-axis rotation angle and perspective field of view angle.

[0030] Parallel optimization employs Parallel.ForEach to perform an outer-layer parallel traversal of the candidate width W, while the inner-layer nested traversal of the three-axis rotation angle and FOV reduces the search complexity of the high-dimensional parameter space (the complexity is approximately O(Nw×Nx×Ny×Nz×Nf), and the total time is controllable through the hierarchical strategy).

[0031] As an optional implementation method in this embodiment, during the search process, the fit of each parameter combination is evaluated by the cost function: the parameter combination is determined based on the size of the cost function E=E_pts+λ˙E_edge, where E_pts is the square error of the projection point of the preset rectangle to be fitted to the target quadrilateral point, and E_edge is the side length consistency error.

[0032] In this optional implementation, each parameter combination needs to be evaluated for its fit through a cost function in order to select the optimal solution.

[0033] Cost function Iterate through all parameter combinations obtained from parallel searches and use a function to filter out the parameter combination with the smallest total error E. If there are multiple combinations with similar errors, the smaller point-to-point error E_pts can be used as the priority criterion (prioritizing vertex alignment to meet the core requirement of visual consistency).

[0034] The sum of the squared point-to-point errors between the projected points after removing the mean and the target points (to ensure precise vertex alignment).

[0035] Side length consistency error and (suppressing degeneracy and improving geometric rationality).

[0036] Because the search phase uses Parallel.ForEach to iterate through the width parameter in parallel, a thread-safe lock mechanism is required. The global optimal solution is only updated when the error E of the current parameter combination is better than the stored global optimal error, ensuring the determinism of the final output result. The parameters are checked to ensure they conform to the constraints: W∈[0.3B,1.1B], X / Y / Z∈[0°,360°), FOV∈[0°,120°]. If any parameter exceeds the range, the suboptimal parameter combination from the previous round is returned to ensure the subsequent process can be executed.

[0037] As an optional implementation of this embodiment, before applying the parameter combination to an image or shape in PowerPoint, the method includes verifying the effect of the determined parameter combination; after verification, selecting the optimal parameter combination; wherein, the verification method includes transforming the four vertices of the rectangle to be fitted to a three-dimensional space based on each determined parameter combination; calling a custom projection function to perform perspective mapping on the pose of the three-dimensional space according to the FOV of the determined parameter combination to obtain the preset final projection point set {p0,p1,p2,p3} of the rectangle to be fitted; and subtracting the mean of the vertex coordinates of {p0,p1,p2,p3} from the vertex set {t0,t1,t2,t3} of the target quadrilateral.

[0038] In this optional implementation, the final projection effect of the rectangle to be fitted is accurately calculated by determining the parameter combination, providing a geometric basis for subsequent attribute mapping.

[0039] According to the agreed rotation order, such as the right multiplication order: RotateZ(-Z)→RotateX(-Y)→RotateY(-X), constructing a 4×4 homogeneous transformation matrix. Substitute the four vertices of the rectangle to be fitted (with the origin as the center, coordinates (±W / 2, ±H / 2, 0)) into the matrix to complete the three-dimensional spatial attitude transformation. Multiply the origin by RotateZ(-Z), RotateX(-Y), and RotateY(-X) in sequence.

[0040] The vertices after 3D transformation are points in 3D space and cannot be directly compared with the user-defined 2D target quadrilateral for error analysis. To simulate the perspective principle of camera shooting, a custom projection function, `TransformationMatrix.Project(angleOfViewRadians)`, is used, with FOV as the perspective intensity parameter, to map the 3D coordinates (x, y, z) to 2D planar coordinates (x', y').

[0041] , A numerically stable approximation is used in the implementation. Time degradation processing avoids division by zero. The output is a two-dimensional projection point set {p0,p1,p2,p3} with the same dimensions as the target quadrilateral. This point set carries visual information about the three-dimensional pose and perspective intensity (e.g., the larger the FOV, the more obvious the near-large and far-small effect). It can be directly used for subsequent error calculation with the target quadrilateral.

[0042] The projection point set and the target quadrilateral vertex set {t0,t1,t2,t3} are respectively translated and mean-removed to eliminate the overall translational degree of freedom.

[0043] As an optional implementation of this embodiment, applying the parameter combination to an image or shape in PowerPoint includes: assigning the optimal parameter combination to the ThreeD and size attributes of the selected shape or image in PowerPoint; and centering the shape or image after applying the optimal parameter combination with the target quadrilateral.

[0044] In this optional implementation, the optimal parameters are assigned to the ThreeD and size properties of the PPT shape / image to which the effect is to be applied, for example: shape.ThreeD.SetPresetCamera(msoCameraPerspectiveLeft) shape.ThreeD.RotationX = 360 - X shape.ThreeD.RotationY = Y shape.ThreeD.RotationZ = 360 - Z shape.ThreeD.FieldOfView = FOV The values ​​of shape.Width = W * 72 and shape.Height = H * 72 are used to perform a 360° subtraction on X / Z to compensate for the difference in coordinates and orientation, ensuring visual consistency.

[0045] The shape after applying parameters is centered and aligned with the target quadrilateral to avoid the visual deviation of "correct parameters but misaligned position". When calculating the center reference of the target quadrilateral, take the intersection point c (coordinates in inches) of the two diagonals (t0-t2 and t1-t3) of the target quadrilateral; calculate the coordinates of the top left corner of the shape: determine the position of the shape on the PPT page (unit: point) according to the following formulas: shape.Left = cx × 72 - (W_opt × 72) / 2; shape.Top = cy × 72 - (H_opt × 72) / 2 (cx×72 and cy×72 convert inch coordinates to points to keep consistent with the shape size unit and ensure centering accuracy).

[0046] The PowerPoint presentation automatically refreshes the properties of the selected shape, presenting a pseudo-perspective effect that matches the visual appearance of the target quadrilateral. The shape possesses both the perspective effect of near objects appearing larger and distant objects appearing smaller, and perfectly matches the user-defined quadrilateral outline. If the two diagonals of the target quadrilateral are parallel or collinear (without intersection point c), an error message is returned (such as "Please re-frame the target quadrilateral to ensure it is a non-degenerate quadrilateral"), guiding the user to adjust the reference frame. If numerical anomalies occur after projection (such as shape distortion caused by extreme parameters), the presentation automatically reverts to the previous suboptimal parameter combination and re-executes the mapping and positioning steps to ensure uninterrupted workflow.

[0047] This embodiment uses intelligent perspective to quickly generate natural and realistic visual effects.

[0048] 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, and 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.

[0049] According to an embodiment of the present invention, an intelligent perspective device is also provided, including a reading unit for reading a target quadrilateral, wherein the target quadrilateral is obtained based on a quadrilateral inserted by a terminal interface or selected from a preset graphic; a parameter determination unit for searching within a preset parameter search space according to a specified search strategy to determine the parameter combination that best fits the projected preset rectangle to be fitted to the target quadrilateral; and a perspective unit for applying the parameter combination to an image or shape in PowerPoint.

[0050] When defining the parameter space, the target bounding box of the target quadrilateral is calculated, and the target bounding box is adaptively corrected according to the aspect ratio r of the preset rectangle to be fitted, so as to determine the reference width B of the target bounding box; the width search interval is defined as [0.3B, 1.1B], and the width search step size is defined, wherein the preset rectangle to be fitted is an unprojected two-dimensional rectangle centered at the origin (0,0,0) in three-dimensional space, with the coordinates of its four vertices being (±W / 2, ±H / 2, 0), and its aspect ratio r=W / H is consistent with the aspect ratio of the image or shape in PowerPoint; the range of the X, Y, and Z axis rotation angles in the three-dimensional camera parameters is defined as [0°, 360°), and the initial search step size K1 is set; the search interval of the perspective field of view is defined as [0°, 120°], and the search step size K2 is set.

[0051] The search within the preset parameter search space according to the specified search strategy includes: performing a coarse grid search with the search step size; based on the results of the coarse grid search, halving the search step size of the angle and the search step size of the width, and repeating the iteration until the angle step size < 0.1° and the width step size < 0.01°.

[0052] During the search, Parallel.ForEach is used to perform an outer traversal of W, and an inner nested traversal of the three-axis rotation angle and perspective field of view angle.

[0053] During the search process, the fit of each parameter combination is evaluated by the cost function: the parameter combination is determined based on the magnitude of the cost function E=E_pts+λ˙E_edge, where E_pts is the squared error of the projection points of the preset rectangle to be fitted to the target quadrilateral points, and E_edge is the side length consistency error.

[0054] Before applying the parameter combination to an image or shape in PowerPoint, the method includes verifying the effect of the determined parameter combination; selecting the optimal parameter combination after verification; wherein, the verification method includes transforming the four vertices of the rectangle to be fitted to a three-dimensional space based on each determined parameter combination; calling a custom projection function to perform perspective mapping on the pose of the three-dimensional space according to the FOV of the determined parameter combination to obtain the preset final projection point set {p0,p1,p2,p3} of the rectangle to be fitted; and subtracting the mean of the vertex coordinates of {p0,p1,p2,p3} from the vertex set {t0,t1,t2,t3} of the target quadrilateral.

[0055] Applying the parameter combination to an image or shape in PowerPoint includes: assigning the optimal parameter combination to the ThreeD and size attributes of the selected shape or image in PowerPoint; and centering the shape or image after applying the optimal parameter combination with the target quadrilateral.

[0056] According to embodiments of the present invention, the present invention also provides an electronic device, the electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to implement the methods described in any of the above embodiments.

[0057] According to embodiments of the present invention, the present invention also provides a readable storage medium storing computer instructions that enable a computer to perform the methods described in any of the above embodiments when executed.

[0058] According to embodiments of the present invention, the present invention also provides a computer program product that, when executed by a processor, can implement the methods described in any of the above embodiments.

[0059] Figure 2 A schematic block diagram of an example electronic device 300 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices.

[0060] like Figure 2 As shown, the electronic device 300 includes a computing unit 301, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 302 or a computer program loaded from a storage unit 308 into a random access memory (RAM) 303. The RAM 303 may also store various programs and data required for the operation of the electronic device 300. The computing unit 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0061] Multiple components in electronic device 300 are connected to I / O interface 305, including: input unit 306, such as keyboard, mouse, etc.; output unit 307, such as various types of displays, speakers, etc.; storage unit 308, such as disk, optical disk, etc.; and communication unit 309, such as network card, modem, wireless transceiver, etc. Communication unit 309 allows electronic device 300 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0062] The computing unit 301 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 301 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 301 performs the various methods and processes described above, such as the object matching method. For example, in some embodiments, the object matching method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 308. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 300 via ROM 302 and / or communication unit 309. When the computer program is loaded into RAM 303 and executed by the computing unit 301, one or more steps of the methods described above may be performed.

[0063] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0064] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0065] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

Claims

1. An intelligent perspective method, characterized in that, include: Read the target quadrilateral, wherein the target quadrilateral is obtained based on a quadrilateral inserted by the terminal interface or selected from a preset graphic; Search within the preset parameter search space according to the specified search strategy to determine the parameter combination that best fits the projected preset rectangle to be fitted to the target quadrilateral. Apply the parameter combination to images or shapes in PowerPoint.

2. The intelligent perspective method according to claim 1, characterized in that, When defining the parameter space, the method includes: Calculate the target bounding box of the target quadrilateral, and adaptively correct the target bounding box according to the aspect ratio r of the preset rectangle to be fitted, so as to determine the reference width B of the target bounding box; define the width search interval as [0.3B, 1.1B], and define the width search step size, wherein the preset rectangle to be fitted is an unprojected two-dimensional rectangle centered at the origin (0,0,0) in three-dimensional space, with the coordinates of its four vertices being (±W / 2, ±H / 2, 0), and its aspect ratio r=W / H is consistent with the aspect ratio of the picture or shape in PowerPoint; Define the range of the rotation angles of the X, Y, and Z axes in the 3D camera parameters as [0°, 360°), and set the initial search step size K1; Define the search range for the perspective field of view as [0°, 120°] and set the search step size K2.

3. The intelligent perspective method according to claim 2, characterized in that, Searching within the preset parameter search space according to the specified search strategy includes: Perform a coarse grid search using the stated search step size; Based on the results of the coarse grid search, the search step size of the angle and the search step size of the width are halved, and the iteration is repeated until the angle step size is <0.1° and the width step size is <0.01°.

4. The intelligent perspective method according to claim 3, characterized in that, During the search, Parallel.ForEach is used to perform an outer traversal of W, and an inner nested traversal of the three-axis rotation angle and perspective field of view angle.

5. The intelligent perspective method according to claim 1 or 4, characterized in that, During the search process, the fit of each parameter combination is evaluated using a cost function: The parameter combination is determined based on the magnitude of the cost function E=E_pts+λ˙E_edge, where E_pts is the squared error of the projection points of the preset rectangle to be fitted relative to the points of the target quadrilateral, and E_edge is the side length consistency error.

6. The intelligent perspective method according to claim 5, characterized in that, Before applying the parameter combination to an image or shape in PowerPoint, the method includes verifying the effect of the determined parameter combination; and selecting the optimal parameter combination after verification. The verification method includes transforming the four vertices of the rectangle to be fitted into three-dimensional space based on each determined parameter combination; calling a custom projection function to perform perspective mapping on the pose of the three-dimensional space according to the FOV of the determined parameter combination to obtain the preset final projection point set {p0,p1,p2,p3} of the rectangle to be fitted; and subtracting the mean of the vertex coordinates of {p0,p1,p2,p3} from the vertex set {t0,t1,t2,t3} of the target quadrilateral.

7. The intelligent perspective method according to claim 1, characterized in that, Applying the parameter combination to images or shapes in PowerPoint includes: Assign the optimal parameter combination to the ThreeD and size properties of the selected shape or image in PowerPoint; The shape or image after applying the optimal parameter combination is aligned with the target quadrilateral in the center.

8. An intelligent X-ray vision device, characterized in that, include: A reading unit is used to read a target quadrilateral, wherein the target quadrilateral is obtained based on a quadrilateral inserted by the terminal interface or selected from a preset graphic; The parameter determination unit is used to search within the preset parameter search space according to the specified search strategy to determine the parameter combination that best fits the projected preset rectangle to be fitted to the target quadrilateral. A perspective unit is used to apply the combined parameters to images or shapes in PowerPoint.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the method according to any one of claims 1-7.

10. An electronic device, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to cause the at least one processor to perform the method according to any one of claims 1-7.