Reflection symmetry detection method and system of two-dimensional image, terminal and storage medium

Through deep learning and rotation-equivariant convolution optimization of the ReResNet model, combined with asymmetric region denoising and rotation loss calculation, the problem of image reflection symmetry detection under the influence of background noise is solved, and high-precision symmetry axis detection is achieved.

CN120707619AActive Publication Date: 2025-09-26GUANGDONG LAB OF ARTIFICIAL INTELLIGENCE & DIGITAL ECONOMY (SZ)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511187887.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-25
Publication Date
2025-09-26
Estimated Expiration
2045-08-25

AI Technical Summary

Technical Problem

Existing image reflection symmetry detection methods are often affected by background noise, resulting in low detection accuracy and inability to accurately predict the symmetry axis of a two-dimensional image.

Method used

A deep learning method is adopted to perform image preprocessing and feature extraction through the asymmetric region denoising module and rotation loss mechanism, combined with the ReResNet model. Rotational equivariant convolution and focal loss calculation are used to optimize the symmetry detection model. The symmetry axis is detected by combining binary mask fusion and probabilistic Hough transform.

Benefits of technology

The accuracy of image reflection symmetry detection is improved, it can adapt to rotated and flipped images in complex scenes, and enhances the robustness and accuracy of symmetry axis detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120707619A_ABST
    Figure CN120707619A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and discloses a two-dimensional image reflection symmetry detection method and system, a terminal and a storage medium, and the method comprises the steps: obtaining an original image in a preset data set, carrying out the preprocessing and asymmetric region denoising processing, and obtaining an asymmetric region denoising feature map; performing rotation processing on the original image to obtain a target rotation image score graph; calculating the rotation loss between the target rotation image score graph and the asymmetric region denoising feature graph, and obtaining a reflection symmetry axis prediction feature graph according to the rotation loss; and carrying out binary mask fusion processing and probability Hough transform processing on the reflection symmetry axis prediction feature map to obtain an image reflection symmetry axis. According to the invention, the asymmetric region denoising processing is carried out on the preset data set to obtain the asymmetric region denoising feature map, and the rotation loss between the asymmetric region denoising feature map and the target rotation image score map is calculated, so that the accuracy of image reflection symmetry axis detection can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method, system, terminal and computer-readable storage medium for detecting reflection symmetry of a two-dimensional image. Background Art

[0002] In the field of computer vision, reflection symmetry refers to the geometric property that the structure in an image presents a mirror image about a specific line (axis of symmetry). Image reflection symmetry detection is of great value in the field of computer vision and is applied to many fields such as image compression and object recognition.

[0003] However, existing image reflection symmetry detection methods are often affected by background noise, resulting in low accuracy of image reflection symmetry detection results and inability to accurately predict the symmetry axis of a two-dimensional image.

[0004] Therefore, the existing technology still needs to be improved and developed. Summary of the Invention

[0005] The main purpose of the present invention is to provide a reflection symmetry detection method, system, terminal and computer-readable storage medium for two-dimensional images, aiming to solve the problem that the image reflection symmetry detection method in the prior art is often affected by background noise, resulting in low accuracy of the image reflection symmetry detection results and inability to accurately predict the symmetry axis of the two-dimensional image.

[0006] To achieve the above object, the present invention provides a method for detecting reflection symmetry of a two-dimensional image, the method comprising the following steps: Obtaining an original image from a preset data set, and performing preprocessing and asymmetric region denoising on the original image to obtain an asymmetric region denoising feature map; Performing rotation processing on the original image to obtain a target rotated image score map; Calculating the rotation loss between the target rotated image score map and the asymmetric region denoising feature map, and obtaining a reflection symmetry axis prediction feature map according to the rotation loss; The reflection symmetry axis prediction feature map is subjected to binary mask fusion processing and probabilistic Hough transform processing to obtain the image reflection symmetry axis.

[0007] Optionally, in the reflection symmetry detection method for a two-dimensional image, the preprocessing includes symmetry axis labeling processing and data enhancement processing; The method of obtaining an original image from a preset data set and performing preprocessing and asymmetric region denoising on the original image to obtain an asymmetric region denoising feature specifically includes: Obtain each original image in the preset data set, and perform symmetry axis annotation processing and data enhancement processing on each original image to obtain a target data set; The data enhancement processing includes rotation processing, scaling processing, translation processing, cropping processing and filling processing; Determine a preset symmetry detection model, input the target data set into the preset symmetry detection model, and output a symmetry axis score map; Performing encoding processing on the target data set to obtain a feature map; The symmetry axis score map and the feature map are subjected to asymmetric region denoising processing to obtain an asymmetric region denoising feature map.

[0008] Optionally, the reflection symmetry detection method for a two-dimensional image, wherein the step of performing asymmetric region denoising on the symmetry axis score map and the feature map to obtain the asymmetric region denoised feature map, specifically includes: Inputting the symmetry axis score map and the feature map into the convolution layer and the ReLU layer of the preset symmetry detection model in sequence, performing dot product multiplication on the symmetry axis score map and the feature map through the convolution layer and the ReLU layer to obtain a multiplication result; The multiplication result is smoothed by using a Softmax function to obtain a smoothed result; The smoothed result is input into the convolution layer and the ReLU layer again, and the asymmetric region denoising feature map is output.

[0009] Optionally, the reflection symmetry detection method for a two-dimensional image, wherein the step of rotating the original image to obtain a target rotated image score map, specifically includes: Rotating the original image at a preset angle to obtain a rotated image; The original image and the rotated image are input into the preset symmetry detection model, and a target rotated image score map is output, wherein the target rotated image score map includes the original image score map and the rotated image score map.

[0010] Optionally, the reflection symmetry detection method for a two-dimensional image, wherein the calculating the rotation loss between the target rotated image score map and the asymmetric region denoising feature map, and obtaining the reflection symmetry axis prediction feature map according to the rotation loss, specifically includes: Rotating the asymmetric region denoising feature map by the preset angle to obtain a rotationally asymmetric region denoising feature map; Calculating the rotation loss between the target rotated image score map and the rotationally asymmetric region denoising feature map, and optimizing the preset symmetry detection model according to the rotation loss to obtain a target symmetry detection model; Obtain a reflection symmetry axis prediction feature map output by the target symmetry detection model.

[0011] Optionally, the reflection symmetry detection method for a two-dimensional image, wherein the step of performing binary mask fusion processing and probabilistic Hough transform processing on the reflection symmetry axis prediction feature map to obtain the image reflection symmetry axis, specifically includes: Performing grayscale conversion processing on the reflection symmetry axis prediction feature map to obtain a grayscale image; Performing dynamic threshold segmentation processing on the grayscale image to obtain a binary mask; Using a probabilistic Hough transform method to perform straight line segment set detection on the binary mask to obtain multiple symmetry axes; The symmetry axis with the highest matching degree among the multiple symmetry axes is selected to obtain the image reflection symmetry axis.

[0012] Optionally, in the reflection symmetry detection method for a two-dimensional image, the expression of the reflection symmetry axis of the image is: ; in, is the image reflection symmetry axis, To calculate The maximum value of is the Hough accumulator matrix, are multiple symmetry axes obtained by the probabilistic Hough transform method, for The Axis of symmetry, The axis of symmetry The diameter of the The axis of symmetry level angle.

[0013] In addition, to achieve the above-mentioned object, the present invention further provides a reflection symmetry detection system for a two-dimensional image, wherein the reflection symmetry detection system for a two-dimensional image comprises: An asymmetric region denoising module is used to obtain an original image from a preset data set, and perform preprocessing and asymmetric region denoising on the original image to obtain an asymmetric region denoising feature map; A rotation processing module, configured to perform rotation processing on the original image to obtain a target rotated image score map; A rotation loss calculation module, configured to calculate the rotation loss between the target rotated image score map and the asymmetric region denoising feature map, and obtain a reflection symmetry axis prediction feature map based on the rotation loss; The image reflection symmetry axis generation module is used to perform binary mask fusion processing and probabilistic Hough transform processing on the reflection symmetry axis prediction feature map to obtain the image reflection symmetry axis.

[0014] In the present invention, an original image in a preset data set is obtained, and the original image is preprocessed and subjected to asymmetric region denoising to obtain an asymmetric region denoising feature map; the original image is rotated to obtain a target rotated image score map; the rotation loss between the target rotated image score map and the asymmetric region denoising feature map is calculated, and a reflection symmetry axis prediction feature map is obtained based on the rotation loss; the reflection symmetry axis prediction feature map is subjected to binary mask fusion processing and probabilistic Hough transform processing to obtain the image reflection symmetry axis. The present invention performs asymmetric region denoising on a preset data set to obtain an asymmetric region denoising feature map, constructs a target rotated image score map, calculates the rotation loss between the target rotated image score map and the asymmetric region denoising feature map, and then optimizes the symmetry detection model based on the rotation loss, thereby effectively improving the accuracy of the image reflection symmetry axis output. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 is a flow chart of a preferred embodiment of the method for detecting reflection symmetry of a two-dimensional image of the present invention; Figure 2 1 is a schematic diagram of an overall implementation process of reflection symmetry detection of a preferred embodiment of the reflection symmetry detection method of a two-dimensional image of the present invention; Figure 3 1 is a structural diagram of a preferred embodiment of the reflection symmetry detection system for two-dimensional images of the present invention; Figure 4 It is a structural diagram of a preferred embodiment of the terminal of the present invention. DETAILED DESCRIPTION

[0016] In order to make the purpose, technical solutions and advantages of the present invention more clear and distinct, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0017] In the field of computer vision, reflection symmetry refers to the geometric property whereby structures in an image exhibit mirror-image correspondence about a specific line (axis of symmetry). Image reflection symmetry detection is of great value in computer vision, with applications in a variety of fields, including image compression, object recognition, and medical diagnosis. For example, in medical image analysis, detecting the reflection symmetry of human organs can assist doctors in diagnosing diseases. In image compression, image symmetry can be exploited to compress images, effectively reducing data volume.

[0018] Image reflection symmetry detection methods fall into two main categories: sparse prediction based on keypoint matching and dense prediction using score maps based on deep learning. Keypoint matching-based sparse prediction methods achieve detection by finding keypoint pairs that satisfy predefined symmetry constraints. For each pair of matching feature points in the image, this method calculates the perpendicular bisector perpendicular to the midpoint of the pair of symmetric points as a candidate symmetry axis. However, this method relies on handcrafted features and is sensitive to background noise, making it difficult to adapt to scenarios where the target's appearance varies due to factors such as lighting, viewing angle, and occlusion. Deep learning-based symmetry detection techniques predict a score map for the image, using a neural network to measure the symmetry of each pixel in the image to generate a symmetry score map. However, these methods can produce afterimages near the symmetry axis due to background noise, misidentifying the background as the symmetry axis. Furthermore, when detecting the symmetry axis of a rotated image, most models suffer from rotational inequality, meaning they cannot accurately predict the symmetry axis for images rotated at different angles.

[0019] To solve the above problems, the present invention proposes an image reflection symmetry detection method based on asymmetric region denoising and rotation equivariance, which is particularly suitable for image reflection symmetry detection tasks in complex scenes.

[0020] This method differs from existing image reflection symmetry detection methods by leveraging deep learning, an asymmetric region denoising module, and a rotation loss mechanism to achieve high-precision symmetry detection. Furthermore, it can detect symmetry even after image transformations such as rotation and flipping, and calculate the image's axis of symmetry using a symmetry score map.

[0021] The reflection symmetry detection method of a two-dimensional image according to a preferred embodiment of the present invention is as follows: Figure 1 As shown, the reflection symmetry detection method of the two-dimensional image includes the following steps: Step S10: Obtain an original image from a preset data set, and perform preprocessing and asymmetric region denoising on the original image to obtain an asymmetric region denoising feature map, wherein the preprocessing includes symmetry axis labeling and data enhancement.

[0022] In actual scenes, images have various symmetries. Generally, mathematical expressions are used to define symmetry. Image symmetry can be divided into three types: mirror symmetry (also known as reflection symmetry), rotational symmetry, and translational symmetry. The present invention mainly realizes the reflection symmetry detection of images.

[0023] Specifically, each original image in the preset data set is obtained, and each original image is subjected to symmetry axis labeling and data enhancement processing to obtain a target data set; wherein, the data enhancement processing includes rotation processing, scaling processing, translation processing, cropping processing and filling processing; a preset symmetry detection model is determined, and the target data set is input into the preset symmetry detection model, and a symmetry axis score map is output.

[0024] First, we perform asymmetric region denoising on the image: Existing image reflection symmetry detection methods, after multiple training cycles, produce predictions with irregular noise in the background class, which interferes with background detection. To address this issue, we propose asymmetric region denoising, which is specifically implemented as follows: The dataset used in the present invention is an open source image dataset. The symmetry axis is annotated for each image in the dataset (the annotation process is: for each symmetry axis in the image, the coordinates of the two endpoints of the symmetry axis are annotated and stored in a json file), and data enhancement methods such as rotation, scaling, translation, cropping and padding are performed (which can increase the size and diversity of the dataset and enhance the robustness of subsequent models). After that, it is input into the ReResNet framework (i.e., the preset symmetry detection model in the present invention) of the equivariant ResNet50 (a deep convolutional neural network architecture), and the pre-trained weights are loaded for training using the pre-defined network structure of ReResNet.

[0025] Resnet is a residual network widely used as a backbone network for computer vision tasks. It is equivariant to translation (i.e., if the input is translated, the feature map is also translated), but not to rotation. ReResnet is a modified Resnet. The basic architecture remains unchanged, but the convolutional module is replaced with equivariant convolution (group convolution instead of standard convolution), which makes ReResnet equivariant to rotation and other deformations.

[0026] The training process is as follows: the basic framework ReResNet is a pre-trained model (the ReResNet model can be pre-trained on the ImageNet-1K dataset, where the ImageNet-1k dataset contains 1.2 million images and covers 1,000 categories). First, the trained ReResNet model is initialized and trained for 100 rounds using the Adam optimizer (the Adam optimizer is an optimization algorithm with adaptive learning rate, which is particularly suitable for gradient descent problems in machine learning and deep learning). The learning rate is 0.001 and the batch size is set to 16. The ReResNet model runs on four NVIDIA GeForce RTX A100 (a data center GPU) graphics cards.

[0027] The target data set is encoded to obtain a feature map; the symmetry axis score map and the feature map are sequentially input into the convolution layer and the ReLU layer of the preset symmetry detection model, and the symmetry axis score map and the feature map are dot-product multiplied by the convolution layer and the ReLU layer to obtain a multiplication result; the multiplication result is smoothed by using a Softmax function to obtain a smoothed result; the smoothed result is again input into the convolution layer and the ReLU layer to output the denoised feature map of the asymmetric area.

[0028] like Figure 2 As shown, for each image in the preset data set, the above process is used to obtain a preliminary symmetry axis score map. , thereby locating the specific area where the symmetry axis is located. At this time, the symmetry axis score map There are a lot of fuzzy features in the background class. In order to determine a more accurate symmetry axis, the symmetry axis score map And the encoded feature map (That is, the feature map obtained after the image in the target dataset passes through the encoder, that is, Figure 2 Feature maps in ) to obtain the asymmetric region denoising feature map by performing dot product multiplication .

[0029] In this process, the present invention sets up an asymmetric region denoising module, which is represented as ,but The realization can be expressed as Among them, the symmetry axis score map Equivalent to weight, that is, the symmetry axis score map The foreground class (that is, the symmetrical area) in the image has a larger proportion than the background class, and the symmetry axis score map is used. As a weight, the original features can focus more on the symmetry axis area and ignore the background, thereby eliminating the interference of artifacts and noise.

[0030] The asymmetric region denoising module provided in the present invention First, the feature map and symmetry axis score plot After being processed by the convolution layer and the ReLU layer respectively, the feature map Represents the extracted features, symmetry axis score map Represents the weight of the symmetric area to focus on, so the feature map and symmetry axis score plot Performing dot product multiplication is equivalent to adding weights to the features, which can focus more on the symmetrical areas, thus achieving the purpose of denoising. and symmetry axis score plot The result of multiplication is often too large, so it is necessary to use the Softmax function to smooth it out. Finally, it is processed by the convolution layer and the ReLU layer to obtain the final prediction result.

[0031] It is understandable that the entire The process can be expressed as: ; in, for The process of denoising asymmetric regions, feature maps and symmetry axis score plot for Input, is an exponential function, is the feature map (here 、 、 are the image height, image width and number of image channels of the feature map respectively), is the symmetry axis score map (here 、 、 are the image height, image width, and number of image channels of the symmetry axis score map, respectively).

[0032] Step S20: rotating the original image to obtain a target rotated image score map.

[0033] Furthermore, after denoising the asymmetric regions, rotation loss is required. In the pre-set dataset, the symmetry axis of most images is vertical or horizontal. Given a rotated image whose symmetry axis is not vertical or horizontal, the network cannot distinguish the rotated image and has difficulty detecting the true symmetry axis because it does not extract features of the image at a specific rotation angle.

[0034] To address the above problem, the present invention sets up dual branches and introduces additional rotation loss to simultaneously extract the unrotated and rotated image information, thereby achieving rotation equivariance.

[0035] Specifically, the original image is rotated at a preset angle to obtain a rotated image; the original image and the rotated image are input into the preset symmetry detection model, and a target rotated image score map is output, wherein the target rotated image score map includes the original image score map and the rotated image score map.

[0036] The present invention defines rotational equivariance on a group (including input group and output group), assuming that the input group is expressed as , acting on ( is the input space, which is the function The domain of Accept from elements as input), the output group is expressed as , acting on ( Represents the output space, which is a function If a learnable function A function is said to be strictly equivariant if the following conditions are met: ; in, is a group element, , represents a mathematical group, yes A specific element in represents a specific symmetry transformation operation, such as "rotate 90 degrees" or "translate 3 pixels to the right". , For input data, is input Through the function Processing results, Indicates that first according to the group elements Get the corresponding first transformation function , and then apply this first transformation function to the specific input data, Indicates that first according to the group elements Get the corresponding second transformation function , and then apply this second transformation function to the function exist The output on superior.

[0037] Given an original image (i.e. the original image in the preset dataset), this image has not been rotated. In addition, the original image is rotated at a preset angle. Random rotation of The value range of is 0 degrees to 45 degrees), and the unrotated image (i.e., the original image) and the rotated image (i.e., the rotated image in the present invention) are respectively used as two inputs, and these two inputs are simultaneously passed through the preset symmetry detection model to obtain the prediction results (i.e., the target rotated image score map in the present invention, including the original image score map and the rotated image score map), wherein the two inputs share a weight, which can be used for subsequent loss calculation to predict the symmetry axis.

[0038] Step S30: Calculate the rotation loss between the target rotated image score map and the asymmetric region denoising feature map, and obtain a reflection symmetry axis prediction feature map according to the rotation loss.

[0039] Specifically, the asymmetric area denoising feature map is rotated at the preset angle to obtain a rotationally asymmetric area denoising feature map; the rotation loss between the target rotated image score map and the rotationally asymmetric area denoising feature map is calculated, and the preset symmetry detection model is optimized according to the rotation loss to obtain a target symmetry detection model; and the reflection symmetry axis prediction feature map output by the target symmetry detection model is obtained.

[0040] For the target rotation image score map , hoping to increase its similarity with the ground-truth (real result). In addition, the asymmetric region denoising feature map after asymmetric region denoising After rotating at the same angle (i.e. the preset angle in the present invention), the denoising feature map of the rotationally asymmetric region is obtained. , and compare it with the target rotation image score map obtained by the rotation branch above Compare and calculate the rotation loss (because the denoising feature map of the rotationally asymmetric region after rotation And the target rotation image score map after rotation through the rotation branch The result of is to predict the same image, so the results of the two are equivariant). Similarly, for and , and also hope to increase the similarity between the two. The specific implementation process is expressed as: ; in, represents the parameters of the network, Indicates taking parameters The minimum value of Indicates that no The output of the module's model, Indicates the real result. Indicates passing The output of the module's model, is the least squares norm.

[0041] The second input image (i.e., the denoising feature map of the asymmetric region ) to preset the angle This is because the random rotation of The rotation equivariant convolution of This can cover all angles of an image, thereby improving the accuracy of detecting the symmetry axis of the rotated image.

[0042] At the same time, compared with a single input, the present invention uses a dual input combining the original image and the rotated image to enable the model to extract the features of the rotated image. By comparison, the model can learn the difference between the original image and the rotated image, so that the model can use richer features during symmetry detection, thereby enhancing the model's predictive ability.

[0043] Symmetry detection is used to represent the foreground class of the symmetric axis and the background class of the asymmetric area, and uses pixel-level binary classification to detect the symmetric axis. Since the symmetric axis area only occupies a small part and the asymmetric area is unbalanced, focus loss can be used to balance the proportion of these two categories. In other words, the calculation of the rotation loss in this invention is based on the focus loss. The expression for the focus loss calculation is as follows: ; in, represents the focal loss, Indicates summation, Represents the focusing parameter, which is used to adjust the ratio of simple samples and difficult-to-classify samples. Parameters representing the equilibrium symmetric and asymmetric regions, is the confidence level of the symmetry.

[0044] Further, and The expression is as follows: ; ; in, Represents the prediction result, represents the true value (the true predicted image, also refers to the true symmetry axis), is the weight, and the present invention preferably sets it to 0.75, so that the proportion of positive samples is large (that is, the proportion of symmetry axis is large). Different, then Also different.

[0045] Therefore, for the prediction results and the true value , its focal loss is, ; for and , the present invention defines the difference as rotation loss: ; in, That is, the score map of the original image after rotation and the score map of the rotated image are calculated using focal loss.

[0046] like Figure 2 As shown, Figure 2 in The original loss is obtained by applying the focal loss to the original image score map; Figure 2 in The rotation loss is calculated by using the focal loss on the target rotation image score map; Figure 2 in The score map of the original image after rotation and the score map of the rotated image are calculated using focal loss. and These are all feature maps that have not been denoised in the asymmetric region, and the focal loss is calculated for this feature map; and The difference is: is an image without rotation, is the rotated image.

[0047] The present invention learns the difference between the rotated image and the original image by optimizing the rotation loss, so that the model has rotation equivariance, can be used for rotated image prediction, and enhances the robustness of image reflection symmetry detection.

[0048] Step S40: performing binary mask fusion processing and probabilistic Hough transform processing on the reflection symmetry axis prediction feature map to obtain the image reflection symmetry axis.

[0049] Furthermore, after the rotation loss is calculated, the entire model can be optimized based on the rotation loss, and the reflection symmetry axis prediction feature map output by the model can be obtained, and then the symmetry axis can be drawn based on the binary mask fusion processing and probabilistic Hough transform processing.

[0050] The present invention proposes a symmetry axis visualization method based on binary mask fusion and probabilistic Hough transform, which can realize the accurate drawing of the symmetry axis from the reflection symmetry axis prediction feature map to the original image.

[0051] Specifically, the reflection symmetry axis prediction feature map is grayscale converted to obtain a grayscale image; the grayscale image is subjected to dynamic threshold segmentation to obtain a binary mask; a probabilistic Hough transform method is used to perform straight line segment set detection on the binary mask to obtain multiple symmetry axes; and the symmetry axis with the highest matching degree among the multiple symmetry axes is selected to obtain the image reflection symmetry axis. The expression of the image reflection symmetry axis is: ; in, is the image reflection symmetry axis, To calculate The maximum value of is the Hough accumulator matrix, are multiple symmetry axes obtained by the probabilistic Hough transform method, for The Axis of symmetry, The axis of symmetry The diameter of the The axis of symmetry level angle.

[0052] The first is the preprocessing process of the reflection symmetry axis prediction feature map: 1. Convert the reflection symmetry axis prediction map output by the model into a grayscale image (which can be processed by using Python's cvtColor function) to eliminate color interference. 2. The grayscale image is segmented by dynamic thresholding to generate a binary mask of the symmetry axis area to highlight the high-confidence symmetric area (wherein the pixel value of the grayscale image is between 0-255, and the present invention sets this value to 255 if the value of the pixel in the image is ≥127) and suppress background noise (similarly, if the value of the pixel in the image is <127, this value is set to 0), that is, after processing, there are only pixels with values ​​of 255 and 0, and the pixel value of 255 is the determined symmetric area.

[0053] The preprocessing expression of the reflection symmetry axis prediction feature map is as follows: ; is the binary mask obtained after processing, The grayscale image obtained by grayscale processing the reflection symmetry axis prediction feature map. is the threshold value, preferably set to 127, which means that if the value of the pixel in the image is ≥127, this value is set to 255, and if the value of the pixel in the image is <127, this value is set to 0.

[0054] Furthermore, after the preprocessing of the reflection symmetry axis prediction feature map is completed, the symmetry axis geometry detection is performed. The specific process is as follows: the probabilistic Hough transform is used to detect a set of straight line segments on the binary mask of the grayscale image. However, there are multiple symmetry axes obtained by the Hough transform. The present invention preferentially selects the first detected straight line as the main symmetry axis, which is often the straight line with the highest matching degree (that is, the image reflection symmetry axis in the present invention).

[0055] The expression processed by Hough transform is as follows: ; in, is the Hough transform function.

[0056] Furthermore, based on the possible set of straight lines obtained by probabilistic Hough transform, the image reflection symmetry axis can be obtained, and its expression is: .

[0057] Beneficial effects: 1. Sparse prediction methods based on keypoint matching are generally applicable to simple, symmetrical image scenes. However, in the real world, images may vary in lighting, perspective, occlusion, and other factors. Therefore, the deep learning method used in this invention can better handle these variations, making the detection algorithm applicable to a wider range of scenarios.

[0058] 2. The objects in the image may appear in various postures, including rotation and flipping, and their symmetry axes are not absolutely vertical or horizontal. By detecting objects in rotated and flipped images, the present invention can be applied to a wider range of scenarios.

[0059] 3. The present invention combines dynamic threshold segmentation with probabilistic Hough transform to convert the symmetric score map output by the deep model into a geometric straight line, thereby realizing the visualization of the symmetry axis.

[0060] The innovative features of the present invention are as follows: 1. The present invention proposes symmetric region denoising, which can increase the weight of the symmetric region and remove background noise and artifact interference, thereby detecting the symmetry axis region.

[0061] 2. The present invention introduces rotated images and rotation loss calculation to increase the similarity between the score map after rotation and the score map of the rotated branch after rotation, and to explore the relevant features between the original image and the rotated image, so as to determine the symmetry of the image after transformation such as flipping and rotation.

[0062] 3. The present invention processes the image based on the symmetry score map according to the threshold, and then uses the Hough transform to detect the straight line according to the voting mechanism. It can output the position of the symmetry axis in the image based on the symmetry score map and the Hough transform.

[0063] Further, if Figure 3 As shown, based on the above-mentioned reflection symmetry detection method of a two-dimensional image, the present invention also provides a reflection symmetry detection system for a two-dimensional image, wherein the reflection symmetry detection system for a two-dimensional image includes: An asymmetric region denoising module 51 is configured to obtain an original image from a preset data set, and perform preprocessing and asymmetric region denoising on the original image to obtain an asymmetric region denoising feature map; A rotation processing module 52 is used to perform rotation processing on the original image to obtain a target rotated image score map; A rotation loss calculation module 53 is used to calculate the rotation loss between the target rotated image score map and the asymmetric region denoising feature map, and obtain a reflection symmetry axis prediction feature map according to the rotation loss; The image reflection symmetry axis generation module 54 is used to perform binary mask fusion processing and probabilistic Hough transform processing on the reflection symmetry axis prediction feature map to obtain the image reflection symmetry axis.

[0064] Further, if Figure 4 As shown, based on the above-mentioned reflection symmetry detection method and system of a two-dimensional image, the present invention also provides a terminal, which includes a processor 10, a memory 20 and a display 30. Figure 4 Only some of the components of the terminal are shown, but it should be understood that implementation of all of the shown components is not required, and more or fewer components may be implemented instead.

[0065] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. In other embodiments, the memory 20 may also be an external storage device of the terminal, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal. Furthermore, the memory 20 may include both an internal storage unit of the terminal and an external storage device. The memory 20 is used to store application software installed on the terminal and various types of data, such as program code of the installation terminal. The memory 20 may also be used to temporarily store data that has been output or is about to be output. In one embodiment, the memory 20 stores a reflection symmetry detection program 40 for a two-dimensional image, which can be executed by the processor 10, thereby implementing the reflection symmetry detection method for a two-dimensional image in the present application.

[0066] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor, or other data processing chip, configured to execute program codes or process data stored in the memory 20, such as executing the reflection symmetry detection method of the two-dimensional image.

[0067] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch screen, etc. The display 30 is used to display information on the terminal and to display a visual user interface.

[0068] In one embodiment, when the processor 10 executes the reflection symmetry detection program 40 of the two-dimensional image in the memory 20 , the steps of the reflection symmetry detection method of the two-dimensional image are implemented.

[0069] In summary, the present invention provides a reflection symmetry detection method, system and terminal for two-dimensional images, the method comprising: obtaining an original image in a preset data set, and performing preprocessing and asymmetric region denoising on the original image to obtain an asymmetric region denoising feature map; rotating the original image to obtain a target rotated image score map; calculating the rotation loss between the target rotated image score map and the asymmetric region denoising feature map, and obtaining a reflection symmetry axis prediction feature map based on the rotation loss; performing binary mask fusion processing and probabilistic Hough transform processing on the reflection symmetry axis prediction feature map to obtain the image reflection symmetry axis. The present invention obtains an asymmetric region denoising feature map by performing asymmetric region denoising on the preset data set, constructs a target rotated image score map, calculates the rotation loss between the target rotated image score map and the asymmetric region denoising feature map, and then optimizes the symmetry detection model based on the rotation loss, which can effectively improve the accuracy of the image reflection symmetry axis output.

[0070] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or terminal comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or terminal comprising the element.

[0071] Of course, those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware (such as a processor, controller, etc.) through a computer program. The program can be stored in a computer-readable storage medium that can be read by a computer. When executed, the program can include the processes in the above-described method embodiments. The computer-readable storage medium can be a memory, a magnetic disk, an optical disk, etc.

[0072] It should be understood that the application of the present invention is not limited to the above examples. For those skilled in the art, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.

Claims

1. A method for detecting reflection symmetry of a two-dimensional image, characterized in that: The reflection symmetry detection method of the two-dimensional image includes: Obtaining an original image from a preset data set, and performing preprocessing and asymmetric region denoising on the original image to obtain an asymmetric region denoising feature map; Performing rotation processing on the original image to obtain a target rotated image score map; Calculating the rotation loss between the target rotated image score map and the asymmetric region denoising feature map, and obtaining a reflection symmetry axis prediction feature map according to the rotation loss; The reflection symmetry axis prediction feature map is subjected to binary mask fusion processing and probabilistic Hough transform processing to obtain the image reflection symmetry axis.

2. The method for detecting reflection symmetry of a two-dimensional image according to claim 1, wherein: The preprocessing includes symmetry axis labeling processing and data enhancement processing; The method of obtaining an original image from a preset data set and performing preprocessing and asymmetric region denoising on the original image to obtain an asymmetric region denoising feature specifically includes: Obtain each original image in the preset data set, and perform symmetry axis annotation processing and data enhancement processing on each original image to obtain a target data set; The data enhancement processing includes rotation processing, scaling processing, translation processing, cropping processing and filling processing; Determine a preset symmetry detection model, input the target data set into the preset symmetry detection model, and output a symmetry axis score map; Performing encoding processing on the target data set to obtain a feature map; The symmetry axis score map and the feature map are subjected to asymmetric region denoising processing to obtain an asymmetric region denoising feature map.

3. The method for detecting reflection symmetry of a two-dimensional image according to claim 2, wherein: The step of performing asymmetric region denoising on the symmetry axis score map and the feature map to obtain an asymmetric region denoising feature map specifically includes: Inputting the symmetry axis score map and the feature map into the convolution layer and the ReLU layer of the preset symmetry detection model in sequence, performing dot product multiplication on the symmetry axis score map and the feature map through the convolution layer and the ReLU layer to obtain a multiplication result; The multiplication result is smoothed by using a Softmax function to obtain a smoothed result; The smoothed result is input into the convolution layer and the ReLU layer again, and the asymmetric region denoising feature map is output.

4. The method for detecting reflection symmetry of a two-dimensional image according to claim 2, wherein: The rotating the original image to obtain a target rotated image score map specifically includes: Rotating the original image at a preset angle to obtain a rotated image; The original image and the rotated image are input into the preset symmetry detection model, and a target rotated image score map is output, wherein the target rotated image score map includes the original image score map and the rotated image score map.

5. The method for detecting reflection symmetry of a two-dimensional image according to claim 4, wherein: The calculating of the rotation loss between the target rotated image score map and the asymmetric region denoising feature map, and obtaining the reflection symmetry axis prediction feature map according to the rotation loss, specifically includes: Rotating the asymmetric region denoising feature map by the preset angle to obtain a rotationally asymmetric region denoising feature map; Calculating the rotation loss between the target rotated image score map and the rotationally asymmetric region denoising feature map, and optimizing the preset symmetry detection model according to the rotation loss to obtain a target symmetry detection model; Obtain a reflection symmetry axis prediction feature map output by the target symmetry detection model.

6. The method for detecting reflection symmetry of a two-dimensional image according to claim 1, wherein: The performing binary mask fusion processing and probabilistic Hough transform processing on the reflection symmetry axis prediction feature map to obtain the image reflection symmetry axis specifically includes: Performing grayscale conversion processing on the reflection symmetry axis prediction feature map to obtain a grayscale image; Performing dynamic threshold segmentation processing on the grayscale image to obtain a binary mask; Using a probabilistic Hough transform method to perform straight line segment set detection on the binary mask to obtain multiple symmetry axes; The symmetry axis with the highest matching degree among the multiple symmetry axes is selected to obtain the image reflection symmetry axis.

7. The method for detecting reflection symmetry of a two-dimensional image according to claim 6, wherein: The expression of the image reflection symmetry axis is: ; in, is the image reflection symmetry axis, To calculate The maximum value of is the Hough accumulator matrix, are multiple symmetry axes obtained by the probabilistic Hough transform method, for The Axis of symmetry, The axis of symmetry The diameter of the The axis of symmetry level angle.

8. A reflection symmetry detection system for a two-dimensional image, characterized in that: The reflection symmetry detection system of the two-dimensional image comprises: An asymmetric region denoising module is used to obtain an original image from a preset data set, and perform preprocessing and asymmetric region denoising on the original image to obtain an asymmetric region denoising feature map; A rotation processing module, configured to perform rotation processing on the original image to obtain a target rotated image score map; A rotation loss calculation module, configured to calculate the rotation loss between the target rotated image score map and the asymmetric region denoising feature map, and obtain a reflection symmetry axis prediction feature map based on the rotation loss; The image reflection symmetry axis generation module is used to perform binary mask fusion processing and probabilistic Hough transform processing on the reflection symmetry axis prediction feature map to obtain the image reflection symmetry axis.

9. A terminal, characterized in that: The terminal includes: a memory, a processor, and a reflection symmetry detection program for a two-dimensional image stored in the memory and runnable on the processor. When the reflection symmetry detection program for a two-dimensional image is executed by the processor, the steps of the reflection symmetry detection method for a two-dimensional image as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a reflection symmetry detection program for a two-dimensional image, and when the reflection symmetry detection program for a two-dimensional image is executed by a processor, the steps of the reflection symmetry detection method for a two-dimensional image according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Non-local mean image denoising method combined with structure information

    CN102117482A

  • Learning device, symmetry evaluation device, learning method, and recording medium

    WO2023188171A1