Image optimization method and system combined with attention mechanism

By constructing vertical lines to record length differences, extracting template features, and calculating the optimal combination, the problem that existing image optimization methods cannot differentiate target regions is solved, thus achieving the highlighting of visual focus and precise locking of target regions.

CN120894243BActive Publication Date: 2025-12-05SHANGHAI MARITIME UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511374415.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-25
Publication Date
2025-12-05
Estimated Expiration
2045-09-25

AI Technical Summary

Technical Problem

Existing attention-based image optimization methods cannot differentiate between target and background regions, resulting in poor visual focus in the optimized image.

Method used

By constructing vertical lines to record length differences to extract template features, and combining them with preset weight coefficients to calculate the optimal combination, the target area can be accurately locked and optimized.

Benefits of technology

It improves the accuracy of feature verification, suppresses interference from non-target features, and ensures accurate locking and optimized processing of the target area.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120894243B_ABST
    Figure CN120894243B_ABST
Patent Text Reader

Abstract

The application discloses an image optimization method and system combined with an attention mechanism, and relates to the technical field of image optimization.The application solves the problem that global unified parameter adjustment (such as overall sharpening) cannot be used for differential processing of target regions (such as a human subject) and background regions, leading to the problem that the visual focus of the optimized image is not outstanding.The application is based on preset weight coefficients (for example, when Query is a human, A1=0.685, and the number of inflection points is emphasized), and the combination of similar features is subjected to process feature calculation (Value), and the optimal combination is selected by maximizing the process feature.This mechanism can inhibit the interference of non-target features (such as a dog in the background), ensure the accurate locking of the features to be optimized (such as a group of people), and realize the efficient calculation of the Value in the attention mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image optimization technology, specifically to an image optimization method and system that incorporates an attention mechanism. Background Technology

[0002] With the rapid development of computer vision technology, image recognition and optimization are increasingly widely used in fields such as security monitoring, medical imaging, and autonomous driving. However, images in complex scenes often face problems such as blurred target features, strong background noise interference, and multiple target overlap, resulting in shortcomings of traditional image recognition methods, such as insufficient accuracy and inaccurate target localization.

[0003] The introduction of attention mechanisms offers a new approach to image recognition optimization. Its core idea is to simulate the attention allocation mechanism of human vision, enabling the algorithm to focus on key features (Query) and achieve accurate target processing through feature association (Key-Value mapping). However, existing image recognition methods based on attention mechanisms still suffer from the following technical bottlenecks:

[0004] Traditional methods for fusing geometric features (such as area and contour) and color features (such as RGB values) often use fixed weights and do not dynamically adjust them according to specific scenarios, making it difficult to adapt to the differences in feature priority for different query types (such as people and vehicles).

[0005] Existing optimization methods often use globally uniform parameter adjustments (such as overall sharpening), which cannot differentiate between the target area (such as the subject) and the background area, resulting in the optimized image lacking visual emphasis. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention provides an image optimization method and system that incorporates an attention mechanism. This solves the problem that commonly used global uniform parameter adjustments (such as overall sharpening) cannot differentiate between target areas (such as the subject) and background areas, resulting in the optimized image lacking visual emphasis.

[0007] To achieve the above objectives, this invention proposes an image optimization method incorporating an attention mechanism, comprising the following steps:

[0008] P1. Determine the input query features, lock the associated template based on the determined query features, and perform feature verification on the associated template to confirm the template features;

[0009] P2. The Sobel algorithm is used to identify the gradient pixels in the image to be optimized, and the feature units in the image are identified based on the identified gradient pixels. Based on the template features identified by the associated template, the overlap of several feature units is checked to lock similar features.

[0010] P3. Based on several sets of similar features identified in the image to be optimized, the multiple sets of feature parameters that need to be verified for each similar feature are sequentially calibrated.

[0011] P4. Randomly combine several groups of similar features, and lock the process features associated with the corresponding combination process based on the weight coefficients associated with different feature parameters. Based on multiple combination processes, select the optimal combination to lock the feature to be optimized.

[0012] P5. Based on the several sets of features to be optimized identified in the image to be optimized, and based on the set optimization object, optimize the features to be optimized, generate the optimized image and display it.

[0013] Furthermore, in step P1, the specific method for confirming the template features is as follows:

[0014] Based on the confirmed query characteristics, multiple sets of associated templates related to such query characteristics are located from the cloud database;

[0015] The center point within the associated template is calibrated. Based on the calibrated center point, two sets of perpendicular lines are constructed that pass through the center point and are perpendicular to each other. The endpoints of the two sets of perpendicular lines are located on the contour edge of the associated template. The two sets of perpendicular lines are rotated according to the calibrated center point, and the length difference between the two sets of perpendicular lines is recorded in real time. The length difference is ≥0. The different length differences associated in different rotation processes are denoted as CZi, where i represents different rotation processes. From the recorded sets of length difference CZi, the rotation process associated with CZimax is selected, and the positions of the two sets of perpendicular lines determined by the corresponding rotation process are recorded as the template features of the corresponding associated template.

[0016] Furthermore, in step P2, the specific method for locking the feature single entity is as follows:

[0017] The image to be optimized is converted to grayscale to confirm the grayscale image. Then, the Sobel algorithm is used to confirm the vertical and longitudinal gradients associated with different pixels in the grayscale image. The confirmed vertical gradient is denoted as CZk, and the confirmed longitudinal gradient is denoted as SZk, where k represents different pixels. Confirm the overall gradient ZH associated with the corresponding pixel. k , will satisfy: ZH k Pixels with a value greater than or equal to Y1 are labeled as gradient pixels; otherwise, no labeling is performed. In the formula, Y1 is the threshold used to determine the significance of the gradient.

[0018] Based on several gradient pixels marked in the grayscale image, the gradient contour formed by continuous gradient pixels is identified, and the regional features associated with the closed gradient contour are recorded as feature units.

[0019] Furthermore, in step P2, the specific method for locking similar features is as follows:

[0020] Combine the closed gradient profile of the feature unit with the two-dimensional coordinate system to confirm the two-dimensional coordinates associated with different profile points. Then, perform mean processing on several sets of two-dimensional coordinates to confirm the mean coordinates. Mark the points associated with the mean coordinates within the feature unit and record them as the center point of the feature unit.

[0021] The method of confirming the same template features by using associated templates is adopted. The individual features existing in the feature unit are calibrated. A set of associated templates is randomly selected, and the overlap of the feature unit is checked to make the individual feature coincide with the template feature. When coinciding, the longest perpendicular line of the two sets of perpendicular lines coincides and the shortest perpendicular line coincides. After the overlap is completed, the feature unit is scaled, and the overlap of the feature unit and the associated template in different scaling processes is recorded. When confirming the overlap, the area of ​​the overlapping region is recorded as M1, and the total area parameter of the associated template is recorded as M2. The overlap = M1 ÷ M2. If the overlap of a certain scaling process satisfies: overlap ≥ 98%, then this feature unit is recorded as a similar feature. Otherwise, other associated templates are used to confirm the similarity of the feature unit.

[0022] Similarly, several sets of similar features existing in the image to be optimized are confirmed in turn.

[0023] Furthermore, in step P3, the specific method for calibrating the feature parameters is as follows:

[0024] Based on the closed gradient contour associated with similar features, the included angle between adjacent contour points is determined. The direction of the included angle is determined by the direction of the center point of the similar feature. A set of contour points is randomly selected and recorded as the determined point. Based on the points adjacent to this contour point, two included angle edges are generated. The included angle generated by the two included angle edges facing the included angle determined direction is recorded as the included angle Jq of the corresponding determined point, where q represents different determined points. Determined points that satisfy: Jq≤120° are recorded as contour inflection points. The number of contour inflection points is confirmed, and the total number of confirmed inflection points is recorded as the first feature of the corresponding similar feature.

[0025] Next, the overall area parameter of the similar features is determined and recorded as the second feature corresponding to the similar features;

[0026] Next, the RGB values ​​associated with each different pixel of the similar feature are confirmed, and the total feature ZT of the corresponding pixel is locked by: R×C1+G×C2+B×C3=ZT, where C1, C2 and C3 are preset fixed coefficient factors. Then, the total feature ZT confirmed by several pixels of the corresponding similar feature is averaged, and the obtained average is recorded as the third feature of the corresponding similar feature.

[0027] Furthermore, in step P4, the specific method for locking the features to be optimized is as follows:

[0028] The first, second, and third features identified in each group of similar features are sequentially labeled as T1m, T2m, and T3m, where m represents different similar features.

[0029] Several groups of similar features are randomly combined to identify several combined processes, and the process features associated with each combined process are identified: the similar features included in a single combined process are recorded as selected features, and the number of selected features is recorded as L. The specific values ​​of several groups of selected features belonging to the same feature parameter are summed to identify the total parameters ZT1m (sum of the first feature), ZT2m (sum of the second feature), and ZT3m (sum of the third feature) of the corresponding features. The process features are defined as: (ZT1m×A1+ZT2m×A2+ZT3m×A3)÷L=process features, where A1, A2, and A3 are preset fixed coefficient factors.

[0030] The different process characteristics associated with several groups of combined processes are confirmed in turn. The combined process with the maximum value of the process characteristic is selected and marked as the optimal combination. The similar characteristics associated with the optimal combination are marked as features to be optimized.

[0031] Furthermore, in step P5, the specific method for optimizing the features to be optimized is as follows:

[0032] The resolution and sharpness associated with the feature to be optimized in the image are increased, while the resolution associated with other regions in the image that do not belong to the feature to be optimized is decreased, so that the feature to be optimized becomes more obvious.

[0033] When the corresponding resolution and clarity reach the set maximum values, the optimization process is completed. The maximum values ​​are all preset values.

[0034] This invention also proposes an image optimization system incorporating an attention mechanism, comprising:

[0035] The template feature verification end determines the input query features, locks the associated templates based on the determined query features, and performs feature verification on the associated templates to confirm the template features.

[0036] In the overlap verification end, the Sobel algorithm is used to confirm the gradient pixels in the image to be optimized, and the feature units in the image are confirmed based on the confirmed gradient pixels. Based on the template features confirmed by the associated template, the overlap of several feature units is verified to lock similar features.

[0037] The feature parameter calibration end calibrates multiple sets of feature parameters that need to be verified for each similar feature based on several sets of similar features calibrated in the image to be optimized.

[0038] In the feature locking process, several groups of similar features are randomly combined, and the process features associated with the corresponding combination process are locked based on the weight coefficients associated with different feature parameters. Based on multiple combination processes, the optimal combination is selected to lock the feature to be optimized.

[0039] The image optimization processing unit optimizes the image based on several sets of features identified within the image to be optimized, and optimizes the features according to the set optimization objects, generating and displaying the optimized image.

[0040] Compared with existing technologies, the advantages of this invention are as follows: This invention constructs a vertical line based on the center point of the template, records the length difference by rotating the vertical line, and extracts the vertical line feature at the position of the maximum difference as the template feature. This method utilizes geometric feature differences to achieve unique template identification, avoids false detections caused by feature ambiguity in traditional template matching, and improves the accuracy of feature verification;

[0041] Based on preset weight coefficients (e.g., when the query is a person, A1=0.685 focuses on the number of inflection points), process feature calculation (Value) is performed on combinations of similar features. The optimal combination is selected by maximizing process features. This mechanism can suppress the interference of non-target features (e.g., a puppy in the background) and ensure the accurate locking of the features to be optimized (e.g., a group of people), thus achieving efficient calculation of Value in the attention mechanism. Attached Figure Description

[0042] Figure 1 This is a schematic diagram of the method flow of the present invention;

[0043] Figure 2 This is a schematic diagram of the principle framework of the present invention. Detailed Implementation

[0044] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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 are within the scope of protection of the present invention.

[0045] First Embodiment

[0046] Please see Figure 1 This application provides an image optimization method incorporating an attention mechanism, comprising the following steps:

[0047] P1. Determine the input query features (i.e., the Query in the attention mechanism, which is a query item), and based on the determined query features, lock the associated templates and perform feature verification on the associated templates to confirm the template features. Specifically, assuming that the image to be optimized is a person, then the query feature Query is a person. There are a large number of template features for such people. To find the person object in the corresponding image, it is necessary to search based on the corresponding template features. Therefore, in order to ensure the accuracy of the search and comparison process, it is necessary to verify the features of the associated templates to facilitate the specific accuracy of the subsequent object search.

[0048] The specific method for confirming template features is as follows:

[0049] Based on the confirmed query features, multiple sets of associated templates related to such query features are locked from the cloud database (for example, when the query feature is a person, there are templates for children, the elderly, men, and women, etc., which are all templates pre-recorded in the cloud database with corresponding feature tags, and can be directly indexed and determined according to the corresponding query features).

[0050] The center point within the associated template is marked (the center point is pre-set within the associated template, or determined using a two-dimensional coordinate system. Based on the coordinate representation of the associated template outline in the two-dimensional coordinate system, several sets of coordinates are averaged to determine the corresponding mean coordinates. The location of the mean coordinates is the location of the center point of the corresponding template. Therefore, some of this process is common in existing technologies and will not be elaborated upon here). Based on the marked center point, two sets of perpendicular lines are constructed, passing through this center point and perpendicular to each other. The endpoints of both sets of perpendicular lines are located on the outline edge of the associated template. On the edge, the two sets of perpendicular lines are rotated according to the marked center point, and the length difference between the two sets of perpendicular lines is recorded in real time. The length difference is ≥0. The different length differences associated with different rotation processes are recorded as CZi, where i represents different rotation processes. From the recorded length difference CZi, the rotation process associated with CZimax is selected, and the position of the two sets of perpendicular lines determined by the corresponding rotation process is recorded as the template feature of the corresponding associated template. That is, the two sets of perpendicular lines are in the state of maximum difference within the corresponding template, which facilitates subsequent feature verification and comparison, and gradually confirms the key associated with the Query in the image.

[0051] This is the first step. When optimizing an image, the first step is to determine the object to be optimized. This requires confirming the Query, which is the corresponding query feature. These features are selected or input by the operator to carry out the image optimization process. If the Query is a person, then in the subsequent operation process, several people (keys) existing in the image need to be selected in sequence, and then the optimization process is locked by confirming the Value, thus completing the image optimization process.

[0052] P2. The Sobel algorithm is used to identify gradient pixels in the image to be optimized, and based on these identified gradient pixels, feature units within the image are determined. Then, based on the template features identified by the associated template, the overlap of several feature units is checked to lock similar features (i.e., the key). The specific method for locking feature units is as follows:

[0053] The image to be optimized is converted to grayscale to confirm the grayscale image (based on the different RGB values ​​associated with different pixels, and assigning different weights to the RGB values, the grayscale value associated with the corresponding pixel can be confirmed, and then grayscale adjustment is performed to confirm the corresponding grayscale image; grayscale processing is quite common in existing technologies, so it will not be elaborated on here). Then, the Sobel algorithm is used to confirm the vertical gradient and vertical gradient associated with different pixels in the grayscale image, and the confirmed vertical gradient is labeled as CZk, and the confirmed vertical gradient is labeled as S. Zk, where k represents different pixels. Specifically, these different pixels do not include edge points of the grayscale image. Since the pixels are sorted in a grid format, eight groups of pixels can be identified around each pixel, resulting in nine groups of pixels. Each pixel is assigned a different weight based on its pixel value. The features identified from these nine groups of pixels are then convolved and summed to determine the corresponding vertical and gradient gradients. The weighting factors are in the range [-2, 2]. Since some of these processing methods are common in existing technologies, they will not be elaborated upon here. Once the comprehensive gradient ZHk associated with a corresponding pixel is identified, pixels satisfying ZHk ≥ Y1 are labeled as gradient pixels; otherwise, no labeling is performed. In the formula, Y1 is the threshold used to determine the significance of the gradient.

[0054] Based on several gradient pixels marked in the grayscale image, the gradient contour formed by continuous gradient pixels is confirmed, and the regional features associated with the closed gradient contour are recorded as feature units. The closed gradient contour is a completely closed overall contour, that is, the edge contour generated by a single unit. The corresponding edge contour is a closed gradient contour, which forms a closed loop edge contour.

[0055] The specific method for locking similar features is as follows:

[0056] Combine the closed gradient profile of the feature unit with the two-dimensional coordinate system to confirm the two-dimensional coordinates associated with different profile points. Then, perform mean processing on several sets of two-dimensional coordinates to confirm the mean coordinates. Mark the points associated with the mean coordinates within the feature unit and record them as the center point of the feature unit.

[0057] The method of confirming the same template features by using associated templates is adopted. The individual features existing in the feature unit are calibrated. A set of associated templates is randomly selected, and the overlap of the feature unit is checked to make the individual feature coincide with the template feature. When coinciding, the longest perpendicular line of the two sets of perpendicular lines coincides and the shortest perpendicular line coincides (the long perpendicular line cannot coincide with the short perpendicular line). After the overlap is completed, the feature unit is scaled, and the overlap of the feature unit and the associated template in different scaling processes is recorded. When confirming the overlap, the area of ​​the overlapping area is recorded as M1, and the total area parameter of the associated template is recorded as M2. The overlap = M1 ÷ M2. If the overlap of a certain scaling process satisfies: overlap ≥ 98%, then this feature unit is recorded as a similar feature. Otherwise, other associated templates are used to confirm the similarity of the feature unit.

[0058] Similarly, the similar features existing in the image to be optimized are confirmed in turn. That is, the overlap degree of each feature is compared and verified by each set of associated templates to determine the corresponding overlap degree. When there is a corresponding overlap degree that meets the corresponding overlap degree verification feature, the several keys existing in the image can be confirmed in turn.

[0059] P3. Based on several sets of similar features identified in the image to be optimized, the multiple sets of feature parameters that need to be verified for each similar feature are sequentially calibrated. Specifically, in order to better calculate the value later, there are several preset calculation weights, which are the features that need to be verified, such as: the number of feature points inside the similar feature, the total area, and the average value of the RGB three channels.

[0060] The specific method for calibrating the feature parameters is as follows:

[0061] Based on the closed gradient contour associated with similar features, the included angle between adjacent contour points is determined. The direction of the included angle is determined by the direction of the center point of the similar feature. A set of contour points is randomly selected and recorded as the determined point. Based on the points adjacent to this contour point, two included angle edges are generated. The included angle generated by the two included angle edges facing the included angle determined direction is recorded as the included angle Jq of the corresponding determined point, where q represents different determined points. Determined points that satisfy: Jq≤120° are recorded as contour inflection points. The number of contour inflection points is confirmed, and the total number of confirmed inflection points is recorded as the first feature of the corresponding similar feature.

[0062] Next, the overall area parameter of the similar features is determined and recorded as the second feature corresponding to the similar features;

[0063] Next, the RGB values ​​associated with each different pixel of the similar feature are confirmed, and the total feature ZT of the corresponding pixel is locked by: R×C1+G×C2+B×C3=ZT. C1, C2 and C3 are preset fixed coefficient factors, and their specific values ​​are determined by the operator based on experience. Then, the total feature ZT confirmed by several pixels of the corresponding similar feature is averaged, and the obtained average is recorded as the third feature of the corresponding similar feature.

[0064] Assuming the similar feature is a person, then the surface of a person has RGB values ​​for the skin, hair, or clothing, etc. By considering the overall area ratio of the corresponding regions, the specific weights of the RGB values ​​can be effectively determined, which are the corresponding coefficient factors C1, C2, and C3.

[0065] P4. Randomly combine several groups of similar features, and lock the process features associated with the corresponding combination process based on the weight coefficients associated with different feature parameters. Based on multiple combination processes, select the optimal combination to lock the feature to be optimized. Specifically, the specific processing content of this part is the specific confirmation process of the corresponding value. The group of combination processes associated with the strongest total value is the specific feature object that needs to be optimized.

[0066] The specific method for locking the features to be optimized is as follows:

[0067] The first, second, and third features identified in each group of similar features are sequentially labeled as T1m, T2m, and T3m, where m represents different similar features.

[0068] Several sets of similar features are randomly combined to identify several combined processes. The process features associated with each combined process are then identified. The similar features included in a single combined process are recorded as selected features, and the number of selected features is recorded as L (the value of L associated with each combined process may be the same or different). The specific values ​​of the same feature parameter belonging to several sets of selected features are summed to identify the total parameters ZT1m (sum of the first feature), ZT2m (sum of the second feature), and ZT3m (sum of the third feature). The sum of the three features is calculated as: (ZT1m×A1+ZT2m×A2+ZT3m×A3)÷L=process feature, where A1, A2, and A3 are preset fixed coefficient factors. When the query is "person", we compare the first feature, which is the number of inflection points. A1 is generally 0.685, and A2 and A3 are generally 0.145 and 0.170, respectively. When the query has different query features, A1, A2, and A3 will have different values. These values ​​are confirmed based on practical experience.

[0069] The different process characteristics associated with several groups of combined processes are confirmed in turn. The combined process with the maximum value of the process characteristic is selected and marked as the optimal combination. The similar characteristics associated with the optimal combination are all marked as features to be optimized.

[0070] Specifically, each different similar feature has different feature parameters. When the input query is a person feature, after feature combination, if the selected similar features in the corresponding combination process are all people, then the process feature generated here must be at its maximum value. If other features (such as dogs) are involved in this process, the corresponding process feature will be reduced. Therefore, based on this feature processing process, the features to be optimized in the image to be optimized can be quickly and effectively identified. The identified process feature here is the value to be obtained.

[0071] By combining attention mechanisms, the objects to be optimized within the image to be optimized can be identified step by step quickly and effectively, thereby achieving the best feature processing effect. P5. Based on the identified sets of features to be optimized within the image to be optimized, and based on the set optimization objects, the features to be optimized are processed to generate and display the optimized image;

[0072] The optimization methods include: the set optimization objects include resolution and sharpness, increasing the resolution associated with the feature to be optimized in the image, and decreasing the resolution associated with other areas in the image that do not belong to the feature to be optimized, so as to make the feature to be optimized more obvious.

[0073] Similarly, the same applies to the handling of sharpness;

[0074] When the corresponding resolution and clarity reach the set maximum values, the optimization process is completed. The maximum values ​​are all preset values, which are determined by the operator based on experience. This part of the optimization process is quite common in existing technologies, so it will not be described in detail here.

[0075] Example 2

[0076] Combination Figure 2 The present invention also proposes an image optimization system incorporating an attention mechanism, comprising:

[0077] The template feature verification end determines the input query features, locks the associated template based on the determined query features, and performs feature verification on the associated template to confirm the template features. The overlap verification end uses the Sobel algorithm to confirm the gradient pixels in the image to be optimized, and confirms the feature units in the image based on the confirmed gradient pixels. Based on the template features confirmed by the associated template, it performs overlap verification on several existing feature units to lock similar features.

[0078] The feature parameter calibration end calibrates multiple sets of feature parameters that need to be verified for each similar feature based on several sets of similar features calibrated in the image to be optimized.

[0079] In the feature locking process, several groups of similar features are randomly combined, and the process features associated with the corresponding combination process are locked based on the weight coefficients associated with different feature parameters. Based on multiple combination processes, the optimal combination is selected to lock the feature to be optimized.

[0080] The image optimization processing unit optimizes the image based on several sets of features identified within the image to be optimized, and optimizes the features according to the set optimization objects, generating and displaying the optimized image.

[0081] Some of the data in the above formulas are numerical calculations with dimensions removed, and the contents not described in detail in this specification are all prior art known to those skilled in the art.

[0082] The above embodiments are only used to illustrate the technical methods of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of the present invention without departing from the spirit and scope of the technical methods of the present invention.

Claims

1. An image optimization method incorporating an attention mechanism, characterized in that, Includes the following steps: P1. Determine the input query features, and based on the determined query features, locate multiple sets of associated templates related to such query features from the cloud database, and perform feature verification on the associated templates to confirm the template features. P2. The Sobel algorithm is used to identify the gradient pixels in the image to be optimized, and the feature units in the image are identified based on the identified gradient pixels. Based on the template features identified by the associated template, the overlap of several feature units is checked to lock similar features. The specific method for locking similar features is as follows: Combine the closed gradient profile of the feature unit with the two-dimensional coordinate system to confirm the two-dimensional coordinates associated with different profile points. Then, perform mean processing on several sets of two-dimensional coordinates to confirm the mean coordinates. Mark the points associated with the mean coordinates within the feature unit and record them as the center point of the feature unit. The method of confirming the same template features by using associated templates is adopted. The individual features existing in the feature unit are calibrated. A set of associated templates is randomly selected, and the overlap of the feature unit is checked to make the individual feature coincide with the template feature. When coinciding, the longest perpendicular line of the two sets of perpendicular lines coincides and the shortest perpendicular line coincides. After the overlap is completed, the feature unit is scaled, and the overlap of the feature unit and the associated template in different scaling processes is recorded. When confirming the overlap, the area of ​​the overlapping region is recorded as M1, and the total area parameter of the associated template is recorded as M2. The overlap = M1 ÷ M2. If the overlap of a certain scaling process satisfies: overlap ≥ 98%, then this feature unit is recorded as a similar feature. Otherwise, other associated templates are used to confirm the similarity of the feature unit. Similarly, the similar features existing in the image to be optimized are confirmed in turn. P3. Based on several sets of similar features identified in the image to be optimized, the multiple sets of feature parameters that need to be verified for each similar feature are sequentially calibrated. P4. Randomly combine several groups of similar features, and lock the process features associated with the corresponding combination process based on the weight coefficients associated with different feature parameters. Based on multiple combination processes, select the optimal combination to lock the feature to be optimized. P5. Based on several sets of features to be optimized within the image to be optimized, and based on the set optimization object, optimize the features to be optimized, generate the optimized image and display it. The specific method for optimizing the features to be optimized is as follows: The resolution and sharpness associated with the feature to be optimized in the image are increased, while the resolution associated with other regions in the image that do not belong to the feature to be optimized is decreased, so that the feature to be optimized becomes more obvious. When the corresponding resolution and clarity reach the set maximum values, the optimization process is completed. The maximum values ​​are all preset values.

2. The image optimization method combining an attention mechanism according to claim 1, characterized in that, In step P1, the specific method for confirming the template features is as follows: The center point within the associated template is calibrated. Based on the calibrated center point, two sets of perpendicular lines are constructed that pass through the center point and are perpendicular to each other. The endpoints of the two sets of perpendicular lines are located on the contour edge of the associated template. The two sets of perpendicular lines are rotated according to the calibrated center point, and the length difference between the two sets of perpendicular lines is recorded in real time. The length difference is ≥0. The different length differences associated in different rotation processes are denoted as CZi, where i represents different rotation processes. From the recorded sets of length difference CZi, the rotation process associated with CZimax is selected, and the positions of the two sets of perpendicular lines determined by the corresponding rotation process are recorded as the template features of the corresponding associated template.

3. The image optimization method combining attention mechanisms according to claim 2, characterized in that, In step P2, the specific method for locking the feature single entity is as follows: The image to be optimized is converted to grayscale to confirm the grayscale image. Then, the Sobel algorithm is used to confirm the vertical and longitudinal gradients associated with different pixels in the grayscale image. The confirmed vertical gradient is denoted as CZk, and the confirmed longitudinal gradient is denoted as SZk, where k represents different pixels. Confirm the overall gradient ZH associated with the corresponding pixel. k , will satisfy: ZH k Pixels with a value ≥ Y1 are labeled as gradient pixels; otherwise, no labeling is performed. In the formula, Y1 is the threshold used to determine the significance of the gradient. Based on several gradient pixels marked in the grayscale image, the gradient contour formed by continuous gradient pixels is identified, and the regional features associated with the closed gradient contour are recorded as feature units.

4. The image optimization method combining attention mechanisms according to claim 1, characterized in that, In step P3, the specific method for calibrating the feature parameters is as follows: Based on the closed gradient contour associated with similar features, the included angle between adjacent contour points is determined. The direction of the included angle is determined by the direction of the center point of the similar feature. A set of contour points is randomly selected and recorded as the determined point. Based on the points adjacent to this contour point, two included angle edges are generated. The included angle generated by the two included angle edges facing the included angle determined direction is recorded as the included angle Jq of the corresponding determined point, where q represents different determined points. Determined points that satisfy: Jq≤120° are recorded as contour inflection points. The number of contour inflection points is confirmed, and the total number of confirmed inflection points is recorded as the first feature of the corresponding similar feature. Next, the overall area parameter of the similar features is determined and recorded as the second feature corresponding to the similar features; Next, the RGB values ​​associated with each different pixel of the similar feature are confirmed, and the total feature ZT of the corresponding pixel is locked by: R×C1+G×C2+B×C3=ZT, where C1, C2 and C3 are preset fixed coefficient factors. Then, the total feature ZT confirmed by several pixels of the corresponding similar feature is averaged, and the obtained average is recorded as the third feature of the corresponding similar feature.

5. The image optimization method combining an attention mechanism according to claim 4, characterized in that, In step P4, the specific method for locking the features to be optimized is as follows: The first, second, and third features identified in each group of similar features are sequentially labeled as T1m, T2m, and T3m, where m represents different similar features. Several groups of similar features are randomly combined to identify several combined processes, and the process features associated with each combined process are identified: the similar features included in a single combined process are recorded as selected features, and the number of selected features is recorded as L. The specific values ​​of several groups of selected features belonging to the same feature parameter are summed to identify the total parameters ZT1m (sum of the first feature), ZT2m (sum of the second feature), and ZT3m (sum of the third feature) of the corresponding features. The process features are defined as: (ZT1m×A1+ZT2m×A2+ZT3m×A3)÷L=process features, where A1, A2, and A3 are preset fixed coefficient factors. The different process characteristics associated with several groups of combined processes are confirmed in turn. The combined process with the maximum value of the process characteristic is selected and marked as the optimal combination. The similar characteristics associated with the optimal combination are marked as features to be optimized.

6. An image optimization system incorporating an attention mechanism, running an image optimization method incorporating an attention mechanism as described in any one of claims 1-5, characterized in that, include: The template feature verification end determines the input query features, locks the associated templates based on the determined query features, and performs feature verification on the associated templates to confirm the template features. In the overlap verification end, the Sobel algorithm is used to confirm the gradient pixels in the image to be optimized, and the feature units in the image are confirmed based on the confirmed gradient pixels. Based on the template features confirmed by the associated template, the overlap of several feature units is verified to lock similar features. The feature parameter calibration end calibrates multiple sets of feature parameters that need to be verified for each similar feature based on several sets of similar features calibrated in the image to be optimized. In the feature locking process, several groups of similar features are randomly combined, and the process features associated with the corresponding combination process are locked based on the weight coefficients associated with different feature parameters. Based on multiple combination processes, the optimal combination is selected to lock the feature to be optimized. The image optimization processing unit optimizes the image based on several sets of features identified within the image to be optimized, and optimizes the features according to the set optimization objects, generating and displaying the optimized image.

Citation Information

Patent Citations

  • Dynamic target tracking method based on LBP features and semantic features

    CN120411176A

  • High-definition image optimization method for intelligent connected automobile

    CN120563369A