Efficient image redirection method based on Bezier curve
By using Bézier curves and regression networks to replace the traditional seam clipping method, the problems of path representation and computational complexity are solved, achieving efficient and compact image retargeting suitable for real-time and high-resolution image processing.
Patent Information
- Application Number
- CN202511484386.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-17
- Publication Date
- 2026-01-23
AI Technical Summary
Existing image retargeting methods based on seam cropping have bottlenecks in path representation and computational complexity, making it difficult to meet the requirements of real-time and high-resolution image processing.
By replacing discrete pixel path representation with Bézier curves and predicting seam control point coordinates through regression networks, dynamic programming algorithms are replaced to achieve continuous seam modeling and iterative image size adjustment.
Significantly reduces path representation and computational overhead, improves storage efficiency and computation speed, supports efficient image redirection, adapts to complex geometric structures, and enhances visual effects and fidelity.
Smart Images

Figure CN121391602A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer vision and image processing, and particularly relates to an efficient image redirection method based on Bezier curve. BACKGROUND
[0002] In the field of image processing, the content-aware image redirection technology based on seam carving is widely used because it can effectively preserve key visual content. The core of this method is to remove or insert the minimum energy seam (i.e. the connected pixel path with the lowest sum of energy function values) in the image through iteration to realize intelligent adjustment of the image size. In recent years, with the development of artificial intelligence technology, great progress has been made in constructing more robust and more specialized application scenarios (such as combining face detection, text detection, and other model processing results to apply to adaptive scaling of face and text images) in energy graph.
[0003] However, these improvements are mostly focused on the construction of energy graph, and the lengthy processing flow and pixel-level segmentation results of some redirection methods combined with deep learning further limit the improvement of efficiency. The existing image redirection method based on seam carving itself does not break through the two bottlenecks in the seam carving technology: 1. Low efficiency of path representation: The existing method uses a discrete pixel-by-pixel path to represent the seam. For a vertical seam with a height of H, H pixel coordinates need to be stored. This discrete representation leads to a linear increase in path storage overhead with the image size, which becomes a significant storage and transmission bottleneck in high-resolution image processing tasks.
[0004] 2. High complexity of dynamic programming calculation: The seam carving method relies on a dynamic programming algorithm to search for the minimum energy seam, which needs to traverse each pixel point in the image and maintain a cumulative energy matrix, and after processing a seam, the cumulative energy matrix needs to be recalculated. This process is severely limited in efficiency in large-scale image or real-time processing scenarios.
[0005] The method provided in the Chinese invention patent application "Image self-adaptive method based on combination of semantic-based fine slit cropping and non-uniform mapping" (application number: CN201010264739.5) by Wuli Fang et al. includes: combining the intermediate layer semantic analysis result in sports video, extracting statistical features of user's subjective evaluation on the importance of semantic area for image frames, and using the statistical features to weight the energy function based on bottom layer features to obtain a semantic-weighted energy function; using a forward energy fine slit cropping method to remove unimportant information in the image, and using the change of important semantic edges to measure important information deformation, terminating the fine slit cropping method when the deformation exceeds a set index, and using a non-uniform mapping method to obtain an image of target size. The method framework is shown in the abstract drawing. The method combines the fine slit cropping method and the non-uniform mapping method, fully utilizes the advantages of each method, realizes a comprehensive optimal image / video self-adaptive result, and introduces a semantic-weighted energy function calculation to realize image size self-adaptation based on semantic content. The technical core and advantages include: • Semantic-weighted energy function: assigning weights to pixel points through intermediate layer semantic analysis (such as field area, athlete area, etc.), combining gradient energy calculation to calculate a weighted energy function, and effectively protecting key areas of the image; • Dynamic switching strategy: monitoring important edge deformation (such as field edge offset) in real time during fine slit cropping, and switching to non-uniform mapping when the deformation exceeds a threshold, balancing efficiency and content fidelity; However, the following problems exist: • Calculation efficiency bottleneck: fine slit cropping relies on dynamic programming to find the minimum energy path pixel by pixel, which has high computational complexity and is difficult to meet real-time requirements. Semantic edge deformation monitoring requires traversing all pixel points to calculate the offset, further increasing the computational overhead; • Path representation redundancy: using discrete seam path representation leads to high memory usage and difficulty in extending to high-resolution images.
[0006] In the Chinese patent application "A fast seam cutting method based on strip and adjacency" (application number: CN201310142222.2) by Wuli Fang et al., the fast seam cutting method is improved by combining the ideas of adjacency and strip to constrain the distribution of the seam, so that the seam can be more evenly distributed in each region of the image, and a more satisfactory scaling result is obtained. The method first divides the image into several equally spaced strips, then calculates the average importance of each strip using the corresponding saliency map of the image, and obtains the target size of each strip by solving an optimization problem with a strip constraint condition according to the importance of the strip and the target size of the whole image. Finally, the fast seam cutting method combined with adjacency is used in each strip to obtain the target size image. This method is much faster than other seam cutting methods based on seam cutting, and the resulting image quality is better than the fast seam cutting method, but it still has the following problems: • The method still relies on pixel-by-pixel discrete seam path, resulting in high storage and computation complexity; • Although the method improves the computational efficiency by processing in regions, it does not change the low efficiency of dynamic programming itself; • The method adjusts the seam energy by weighting the adjacency, but the optimization process is still limited to local adjacency, making it difficult to globally coordinate the seam distribution, which may lead to local deformation or faults in important areas.
[0007] The method is limited by discrete path representation and dynamic programming efficiency, making it difficult to balance computational complexity and result quality.
[0008] The above problems jointly restrict the applicability of seam cutting technology in real-time systems, mobile devices and large-scale image processing tasks. Therefore, there is an urgent need for an efficient and compact seam modeling and optimization mechanism that can significantly reduce the overhead of path representation and computation while ensuring content-aware capabilities. SUMMARY
[0009] In view of the above-mentioned defects of the prior art, the technical problem to be solved by the present application is how to realize an efficient and compact seam modeling and optimization mechanism that can significantly reduce the overhead of path representation and computation while ensuring content-aware capabilities.
[0010] To achieve the above-mentioned purpose, the present application provides an efficient image reorientation method based on Bezier curve, comprising the following steps: Step 1, continuous seam modeling, including modeling the minimum energy seam as a Bezier curve, the Bezier curve is defined by control points, and the seam path is represented in a parameterized continuous manner, replacing the discrete pixel path representation; Step 2, regression network predicts the seam, including constructing and applying a regression network to directly predict the control point coordinates of the Bezier curve according to the features of the input image, instead of using a dynamic programming algorithm to search for the minimum energy seam; Step 3, iteratively adjusting the image size, including determining the number of seams to be removed or inserted according to the target size requirement, and repeatedly performing the following operations: predicting the optimal Bezier seam of the current image using the regression network, removing or inserting pixel columns or rows along the discretized curve path to adjust the image size.
[0011] Further, the parametric equation of the Bezier curve in step 1 is calculated based on Bernstein basis functions, the path is uniformly sampled in the vertical direction, the number of sampling points is equal to the image height, and the discrete coordinate sequence is obtained by rounding off; the Bezier curve is a third-order Bezier curve defined by four control points, including the starting point, the ending point and two intermediate control points, wherein the vertical coordinates of the starting point and the ending point are fixed on the image boundary.
[0012] Further, step 2 includes the following sub-steps: Step 2.1, making a training data set; Step 2.2, designing a loss function; Step 2.3, constructing and applying the regression network; Wherein, step 2.1 further includes the following sub-steps: Step 2.1.1, dynamic programming to find the minimum energy seam of the input image; Step 2.1.2, fitting the control points of the Bezier curve as the true label by least squares method.
[0013] Further, in step 2.1.1, first, the energy map of the input image is calculated Wherein, the energy function E(i, j) at position (i, j) is: When the pixels on the seam path are removed, the image neighborhood relationship will change, so a new energy cost is introduced; the energy cost is calculated by forward difference, reflecting the energy difference between the new adjacent pixels after removal; According to the direction of the seam path, the energy cost is divided into the following three cases: Wherein, , , respectively represent the energy cost increased after the pixels of the path connected from the (i, j) position pixel in three different directions of left, top and right are removed; the energy cost can ensure that the path with the minimum energy change is preferentially selected when the seam is removed; Then, the minimum cumulative energy matrix M is calculated by traversing each pixel of the input image from the second row to the last row using a dynamic programming algorithm; the minimum cumulative energy to the pixel (i, j) position is expressed as: The minimum value in the last row of the minimum cumulative energy matrix M will indicate the end point of the minimum vertical connecting seam, and the path of the minimum energy seam is found by backtracking from the point where the minimum value is located .
[0014] Further, in the step 2.1.2, the path of the minimum energy seam is expressed as, wherein H is the height of the input image: First, the start point and the end point of the Bezier curve are fixed, and , the to-be-solved parameter is a four-dimensional vector : Then, the objective function is set to minimize the geometric distance between the Bezier curve and the discrete seam: A system of over-determined linear equations is constructed and solved for the above problem, and the optimal control point coordinates are output by a numerical stability algorithm, and is taken as the true label of supervised learning.
[0015] Further, the loss function of the step 2.2 includes a mean square error loss and a connectivity loss, wherein the connectivity loss punishes unstable jumps between adjacent rows of the path, and is defined as a combination of an indicator function and a path offset.
[0016] Further, the regression network of the step 2.3 is a convolutional neural network CNN, and the input is RGB three-channel data or single-channel energy graph of the original image, and the output is a normalized control point coordinate vector.
[0017] Further, the energy graph of the input image of the step 2.1.1 A composite energy map composed of a gradient amplitude map, a saliency map, or a plurality of energy maps; the composite energy map is a processing result of fusing edge detection, semantic segmentation, or a specific model, and the specific model includes a text detection or a face detection model.
[0018] Further, the regression network of step 2.3 is implemented by a lightweight backbone network, including MobileNetV3 or a feature extraction module based on a Transformer, to accelerate the inference process.
[0019] Further, the step 3 includes the following sub-steps: Step 3.1, determining the number C of seams to be removed / inserted according to the target size requirement; Step 3.2, performing the following operations in a loop until C seams are processed: (a) predicting an optimal Bezier seam of the current image using the regression network; (b) removing / inserting pixels along the discretized curve path Removing / inserting a column of pixels of a vertical seam or a row of pixels of a horizontal seam.
[0020] The efficient image resizing method based on a Bezier curve provided by the present application at least has the following technical effects: 1) The technical solution provided by the present application has higher storage efficiency: seam description parameters are reduced (for example, from 1080 pixel points to 6 scalars when H=1080); 2) The technical solution provided by the present application has higher calculation efficiency: the processing speed of a single seam is improved; 3) The technical solution provided by the present application has a breakthrough in geometric expression capability: the traditional method forcibly limits the offset of adjacent rows of pixels ≤1 (i.e., the maximum inclination angle of the path is 45°) to ensure path continuity, while the Bezier curve naturally supports arbitrary slope seam modeling (such as a 70° inclined path) due to its parameterized continuous characteristics, greatly expanding the feasible solution space.
[0021] 4) The technical solution provided by the present application enhances technical compatibility: the regression network architecture can seamlessly integrate CNN, Transformer, and other feature extraction modules, and supports parallel acceleration.
[0022] 5) The technical solution provided by the present application improves visual effects: the Bezier curve generates a smooth seam path, avoiding the jagged distortion of the traditional SC, and the continuous curve path suppresses the stair effect and jagged texture caused by seam cropping from the source, improving the geometric fidelity and visual naturalness of the resized image.
[0023] The concept, specific structure, and resulting technical effects of the present application will be further described below with reference to the accompanying drawings, so as to fully understand the purpose, features, and effects of the present application. BRIEF DESCRIPTION OF DRAWINGS
[0024] Figure 1 is a method flowchart of a preferred embodiment of the present application; Figure 2 is a comparison diagram of a discrete path representation method and a cubic Bezier curve representation method of a preferred embodiment of the present application; Figure 3 is a comparison of feasible solution spaces of a discretization representation method in original seam cutting and a Bezier curve representation method proposed by a preferred embodiment of the present application; Figure 4 is a three-path possible increased energy cost graph of a preferred embodiment of the present application for calculating the pixel point E(i, j) using the forward energy method. DETAILED DESCRIPTION
[0025] The following reference description of the drawings introduces a plurality of preferred embodiments of the present application, so that the technical content thereof is more clear and convenient to understand. The present application can be embodied in many different forms of embodiments, and the protection scope of the present application is not limited to the embodiments mentioned herein.
[0026] Embodiment 1 The traditional seam-cutting-based image retargeting method relies on discrete pixel path representation and dynamic programming algorithm, resulting in large seam storage overhead and low calculation efficiency, which is difficult to meet the real-time processing requirement. A continuous image retargeting method based on Bezier curve is proposed in the embodiment of the present application, which solves the above problems through the following core innovations: 1) Continuous seam modeling: replace the discrete pixel path representation of the minimum energy seam with a cubic Bezier curve; 2) Efficient regression mechanism: design a lightweight regression network to directly predict the seam control point coordinates, instead of the dynamic programming process.
[0027] Specifically, as shown in Figure 1 The embodiment of the present application provides an efficient image retargeting method based on Bezier curve, which includes the following steps: Step 1, continuous seam modeling, including modeling the minimum energy seam as a Bezier curve, the Bezier curve is defined by control points, and the seam path is represented in a parameterized continuous manner, instead of discrete pixel path representation; Step 2, regression network predicts seam, including constructing and applying a regression network, directly predicting the control point coordinates of the Bezier curve according to the features of the input image, instead of using the dynamic programming algorithm to search for the minimum energy seam; Step 3, iteratively adjust the image size, including determining the number of seams to be removed or inserted according to the target size requirement, and repeatedly performing the following operations: using the regression network to predict the optimal Bezier seam of the current image, removing or inserting pixel columns or rows along the discretized curve path to adjust the image size.
[0028] Embodiment 2 On the basis of embodiment 1, the parametric equation of the Bezier curve in step 1 is calculated based on Bernstein basis functions, the path is uniformly sampled in the vertical direction, the number of sampling points is equal to the image height, and the discrete coordinate sequence is obtained by rounding; the Bezier curve is a third-order Bezier curve defined by four control points, including the starting point, the ending point and two intermediate control points, wherein the vertical coordinates of the starting point and the ending point are fixed on the image boundary.
[0029] Specifically, the Bezier curve is a parametric curve defined by control points, and its mathematical basis is Bernstein polynomial. Given n+1 control points The parametric equation of the n-order Bezier curve is: Wherein, n represents the order of the curve, which determines the number of control points and the complexity of the curve, represents the kth control point, t is the curve parameter, which controls the progress of the curve, t∈[0,1].
[0030] is the n-order Bernstein basis function, which is also the weight function of the kth control point, and its value is: Wherein, is the binomial coefficient, and its value is .
[0031] In the accompanying Figure 2 , the left graph is a discrete path representation method, and the right graph is a cubic Bezier curve representation method. Figure 2 The left and right graphs are comparative schematic diagrams, wherein the dashed line constitutes a control polygon, and the thick solid line is the seam path defined by the Bezier curve. Taking the vertical seam in the accompanying Figure 2 as an example, the parametric continuity of the Bezier curve is used to encode the geometric shape of the entire path with 4 control points, instead of explicitly storing all the discrete pixel points on the path.
[0032] The discrete path representation in the original SC method is: Wherein, H is the image height, is the column coordinate of the hth row of pixels on the path.
[0033] According to practical experience, cubic Bezier curve can meet the diverse image challenges in the field of image retargeting. Cubic Bezier curve has four control points: where, the starting point at the top of the image, the first control point, the second control point, the ending point at the bottom of the image.
[0034] Given the control points of the curve, the parametric equation of the cubic Bezier curve is: The path is uniformly sampled in the vertical direction, and the number of sampling points is the image height H. The normalized parameter t is uniformly distributed from 0 to 1. The continuous horizontal coordinate and the vertical coordinate of the path can be calculated by the cubic Bezier curve formula 4: where, is the solution of the following equation in the interval, ∈[0,1].
[0035] According to formula 5, for each sampling point with row number h, its continuous x coordinate is: The coordinate is rounded to an integer to obtain the integer x coordinate of the hth row : where, is the floor function that returns the largest integer not greater than the number.
[0036] The final path can be represented as a sequence of integer coordinates: where, to ensure that all pixel points on the seam path are within the image area, it is limited that .
[0037] Therefore, after the improvement of the cubic Bezier curve, the vertically discrete path in the appendix Figure 2 can be replaced by the six coordinate values in the four control points of the cubic Bezier curve (6 scalars, because the vertical coordinates of P0 and P3 are fixed): Similarly, if it is a horizontal seam, the image is rotated 90° clockwise as a vertical seam and rotated back.
[0038] After using a cubic Bezier curve to model the seam, only six scalar coordinates of control points need to be stored. According to formula 3, the discrete path representation method in the original SC method needs H scalars to represent a single vertical seam. Therefore, the storage complexity of a single seam is reduced from linear complexity O(H) (O(W) for horizontal seam, W is the width of the image) to constant space complexity O(1) by the proposed representation method.
[0039] As shown in the accompanying Figure 3 The traditional discrete seam path is limited by the 8-connected neighborhood continuity constraint (i.e., the adjacent row pixel coordinate offset |Δx|≤1), which results in the path extending from the starting point being limited in a 45° cone-shaped solution space (the gray texture pixel area in Fig. Figure 3 .a). The cubic Bezier curve used in the present application naturally satisfies the path smoothness requirement through its parametric continuity characteristics without additional neighborhood constraint conditions. This expands the feasible solution space of the seam path from the limited cone-shaped area of the discrete method to a full-plane continuous solution space (the gray texture pixel area in Fig. Figure 3 .b). This expansion significantly enhances the adaptability of image retargeting to complex geometric structures (such as seams crossing 70° steep edges), fundamentally improving the structural robustness of the algorithm.
[0040] In particular, to pursue more flexible curve shapes, the number of control points for adjusting the order of the Bezier curve can also be increased.
[0041] Embodiment 3 Based on Embodiment 1 or 2, step 2 comprises the following sub-steps: Step 2.1, preparation of a training data set; Step 2.2, design of a loss function; Step 2.3, construction and application of a regression network; Step 2.1 further comprises the following sub-steps: Step 2.1.1, dynamic programming to find the minimum energy seam of the input image; Step 2.1.2, fitting the control points of the Bezier curve as the true label by the least squares method.
[0042] In particular, in step 2.1.1, first, the energy map of the input image is calculated where the energy function E(i, j) at position (i, j) is: When pixels on the seam path are removed, the image neighborhood relationship will change, thus introducing new energy cost. As shown in the bolded pixel edges in the figure Figure 4 , the removal of the neighboring pixels of the seam will introduce new energy changes, which result in the energy cost changes being the forward difference between the new neighboring pixels after the removal of the seam. The energy cost is calculated by the forward difference, reflecting the energy difference between the new neighboring pixels after the removal.
[0043] According to the direction of the seam path, the energy cost can be divided into the following three cases: wherein, , , respectively represent the increased energy cost after the removal of the pixels on the path connected from the left, top and right of the pixel at the (i, j) position; the energy cost can ensure that the path with the smallest energy change is preferentially selected when the seam is removed; the black bolded edges in the figure Figure 4 represent the new neighborhood relationship generated after the removal of the seam. Left, up and right respectively represent the relative positions between the neighboring pixels on the seam path.
[0044] Then, the dynamic programming algorithm is used to traverse each pixel of the input image from the second row to the last row, and the minimum cumulative energy matrix M is calculated; the minimum cumulative energy at the pixel (i, j) position is represented as: The minimum value in the last row of the minimum cumulative energy matrix M will indicate the end point of the minimum vertical seam, and the path of the minimum energy seam can be found by backtracking from the point where the minimum value is located .
[0045] The definition of the cumulative energy M of the horizontal seam is also similar.
[0046] In particular, the energy map of the input image in step 2.1.1 is a gradient magnitude map, a saliency map or a composite energy map composed of multiple energy maps; the composite energy map is the processing result of edge detection, semantic segmentation or a specific model, which improves the ability of the seam to avoid important content. The specific model includes a text detection or face detection model. Among them, in combination with the processing result of the text detection model, it can be used for size adjustment of a text image; in combination with the result of the face detection model, it can be used for size adaptive adjustment to protect the face.
[0047] Embodiment 4 On the basis of embodiment 3, the optimal seam path of the picture is obtained by step 2.1.1 Afterwards, the ground truth labels of the Bezier curve control points are generated by the following procedure.
[0048] In step 2.1.2, the path of the minimum energy seam is computed is denoted as, where H is the height of the input image: First, the start point and end point of the Bezier curve are fixed, let , and the parameters to be solved are the four-dimensional vector : Then, the objective function is set to minimize the geometric distance between the Bezier curve and the discrete seam: The over-determined linear equations are constructed and solved for the above problem, and the optimal control point coordinates are output by numerical stable algorithm (such as QR decomposition), and is taken as the ground truth label of supervised learning.
[0049] In particular, the loss function of step 2.2 includes mean square error loss and connectivity loss, where the connectivity loss penalizes unstable jumps between adjacent rows of the path, and is defined as the combination of indicator function and path offset.
[0050] The connectivity loss is defined as: where is the indicator function: Regarding the mean square error loss MSE, is the predicted output (6 Bezier curve parameters) of the model for the i-th sample, is the ground truth label vector corresponding to the i-th sample.
[0051] Then the mean square error loss MSE is defined as: where N is the total number of samples, : represents the L2 norm of the vector.
[0052] Therefore, the total loss function can be completely expressed as: where and is a weight coefficient used to adjust the importance of both the cumulative energy and the connectivity loss. M is the minimum cumulative energy defined in step 2.1.1, is the actual cumulative energy of a certain seam path.
[0053] Embodiment 5 On the basis of embodiment 4, the regression network of step 2.3 is a convolutional neural network CNN, and the input is RGB three-channel data of the original image or a single-channel energy map, and the output is a normalized control point coordinate vector.
[0054] Specifically, step 2.3 constructs a lightweight convolutional neural network (CNN) as a Bezier seam control point regressor, and the input is an original image (an energy map can also be used as input, which needs to be adjusted, and usually the original image input is RGB three-channel, and the energy map is single-channel); the network output layer directly regresses the normalized coordinates of four control points (corresponding to six coordinate values of four control points). This end-to-end regression design discards the complex process of traditional dynamic programming to find the seam, realizes the direct mapping from the image pixel space to the continuous seam parameter space, and can use GPU parallel acceleration to improve the upper limit of efficiency.
[0055] In particular, the regression network of step 2.3 can also be implemented using a lightweight backbone network, including MobileNetV3 or a feature extraction module based on Transformer, to accelerate the inference process. Or combine attention mechanism or image pyramid at different levels to regress control points and then integrate them to improve robustness in complex scenarios; when the efficiency requirement is not high or the computing resources are insufficient, traditional optimization algorithms (such as PSO, simulated annealing, genetic algorithm, etc.) can be used to replace the optimization of the loss function design.
[0056] In particular, step 3 includes the following sub-steps: Step 3.1, according to the target size requirement, determine the number of seams C that need to be removed / inserted; Step 3.2, loop the following operations until C seams are processed: (a) use the regression network to predict the optimal Bezier seam of the current image; (b) along the discretized curve path remove / insert pixel columns (vertical seam) or pixel rows (horizontal seam).
[0057] The preferred embodiments of the present application have been described above in detail. It should be understood that modifications and variations to the preferred embodiments could be made by those skilled in the art without departing from the spirit and scope of the application. Accordingly, it is intended that there be included within the scope of the application, all such modifications and variations as would be apparent to those skilled in the art upon reading this disclosure. It is intended to obtain for the inventors such patent rights as are available for any patent granted on the present application.
Claims
1. A high efficiency image reorientation method based on Bezier curves, characterized in that, The method comprises the following steps: Step 1, continuous seam modeling, comprising modeling the minimum energy seam as a Bezier curve defined by control points to represent the seam path in a parameterized continuous manner instead of a discrete pixel path representation; Step 2, regression network predicting seam, comprising constructing and applying a regression network to directly predict the control point coordinates of the Bezier curve according to the features of the input image, instead of using a dynamic programming algorithm to search for the minimum energy seam; Step 3, iterative adjustment of image size, comprising determining the number of seams to be removed or inserted according to the target size requirement, and repeatedly performing the following operations: predicting the optimal Bezier seam of the current image using the regression network, removing or inserting pixel columns or rows along the discretized curve path to adjust the image size.
2. The Bezier curve based efficient image reorientation method of claim 1, wherein, The parametric equation of the Bezier curve in step 1 is calculated based on Bernstein basis functions, the path is uniformly sampled in the vertical direction, the number of sampling points is equal to the image height, and the discrete coordinate sequence is obtained by rounding; the Bezier curve is a third-order Bezier curve defined by four control points, including the starting point, the ending point and two intermediate control points, wherein the vertical coordinates of the starting point and the ending point are fixed at the image boundary.
3. The Bezier curve based efficient image reorientation method of claim 1, wherein, The step 2 comprises the following sub-steps: Step 2.1, making a training data set; Step 2.2, designing a loss function; Step 2.3, constructing and applying the regression network; Wherein, the step 2.1 further comprises the following sub-steps: Step 2.1.1, dynamic programming to find the minimum energy seam of the input image; Step 2.1.2, fitting the control points of the Bezier curve as the true label by least squares method.
4. The Bezier curve based high efficiency image reorientation method of claim 3, wherein, In said step 2.1.1, first, an energy map of the input image is computed where the energy function E(i, j) at position (i, j) is: When the pixels on the seam path are removed, the image neighborhood relationship will change, so a new energy cost is introduced; the energy cost is calculated by forward difference, reflecting the energy difference between the new adjacent pixels after removal; According to the direction of the seam path, the energy cost can be divided into the following three cases: wherein, , , respectively represent the energy cost increased after the pixels on the paths connected from the three different directions of left, top and right of the previous row of the (i, j) position pixel are removed; the energy cost can ensure that the path with the minimum energy change is preferentially selected when the seam is removed; Then, a dynamic programming algorithm is used to traverse each pixel of the input image from the second row to the last row, to calculate a minimum cumulative energy matrix M; of the minimum cumulative energy to the pixel (i, j) position is represented as: The minimum value in the last row of the minimum cumulative energy matrix M will indicate the end point of the minimum connecting vertical seam, and the path of the minimum energy seam is found by backtracking from the point where the minimum value is located .
5. The Bezier curve based high efficiency image reorientation method of claim 4, wherein, In said step 2.1.2, the path of the minimum energy seam is determined by is represented as, where H is the height of the input image: First, fix the start point and the end point of the Bezier curve , and let the parameters to be solved be the four-dimensional vector : Then, set the objective function to minimize the geometric distance between the Bezier curve and the discrete seam: To solve the above problem, an overdetermined system of linear equations is constructed and solved. The optimal control point coordinates are then output using a numerical stabilization algorithm. and will The true label serves as the basis for supervised learning.
6. The Bezier curve based high efficiency image reorientation method of claim 3, wherein, The loss function of step 2.2 includes mean square error loss and connectivity loss, wherein the connectivity loss punishes unstable jumps between adjacent rows of the path, and is defined as the combination of the indicator function and the path offset.
7. The Bezier curve based high efficiency image reorientation method of claim 3, wherein, The regression network of step 2.3 is a convolutional neural network (CNN), which takes RGB three-channel data or single-channel energy map of the original image as input, and outputs a normalized control point coordinate vector.
8. The Bezier curve based high efficiency image reorientation method of claim 4, wherein, the energy map of the input image of step 2.1.1 a composite energy map constituted by a gradient magnitude map, a saliency map, or a plurality of energy maps; the composite energy map is a processing result of fusing edge detection, semantic segmentation, or a specific model including a text detection or a face detection model.
9. The Bezier curve based efficient image reorientation method of claim 3, wherein, The regression network of step 2.3 is implemented using a lightweight backbone network, including MobileNetV3 or a feature extraction module based on Transformer to accelerate the inference process.
10. The Bezier curve based efficient image reorientation method of claim 3, wherein, The step 3 comprises the following sub-steps: Step 3.1, determining the number of seams to be removed / inserted C according to the target size requirement; Step 3.2, repeatedly perform the following until the C seam processing is complete: (a) use the regression network to predict the optimal Bezier seam for the current image; (b) along the discretized curve path Remove / insert pixel columns for vertical seams or pixel rows for horizontal seams.
Citation Information
Patent Citations
Semantic-based image adaptive method by combination of slit cropping and non-homogeneous mapping
CN101923703B
Quick seam carving method based on strips and adjacency
CN103208095A