An image detection method, device, equipment and storage medium for intrinsic symmetry
By extracting and matching feature points in the image, iterative optimization, and determining symmetry pairs and axes, the problem of high error detection rate in the prior art is solved, and high-accurate image intrinsic symmetry detection is achieved, and automation and robustness are achieved.
Patent Information
- Application Number
- CN202411612505.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2044-11-13
AI Technical Summary
The prior art has problems such as high error detection rate and poor robustness to noise and outliers in image segmentation and recognition, especially when using area growth algorithms, the accuracy is not high.
By extracting multiple feature points in the image information, matching feature points, iterative optimization, determining symmetry pairs, and determining the axis of symmetry of the image based on the symmetry pairs, pre-processing using feature point description algorithm and scale-invariant feature conversion algorithm, combining merging and segmentation strategies to eliminate mismatch and noise.
It improves the accuracy of image detection, reduces the error detection rate of internal symmetry, realizes automated and intelligent image processing, has scale and rotation invariance, and can effectively deal with image changes.
Smart Images

Figure CN119131416B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and particularly relates to an image detection method, device, equipment and storage medium for inherent symmetry. Background Art
[0002] Symmetry is a prominent and important feature of an object. Users can drive memory and perceptual classification through symmetry. Therefore, symmetry is widely used in algorithms and applications of computer vision, including image segmentation and image recognition, etc.
[0003] The prior art uses a method of image segmentation or target recognition by utilizing a region growing algorithm. The region growing algorithm is an image segmentation method based on pixel similarity. Starting from one or more seed pixels, adjacent pixels similar to the seed pixels are gradually merged into the same region, thereby gradually "growing" out the complete region. Although the existing method can effectively process objects at the edge, it is prone to false detection and has low accuracy. For example, it is sensitive to the selection of seed pixels and has poor robustness to noise and outliers. If the similarity measurement criterion is set improperly or the growth stop condition is set unreasonably, it may also lead to false detection and a decrease in accuracy. Summary of the Invention
[0004] The present invention provides an image detection method for inherent symmetry, which can reduce the false detection rate of inherent symmetry and improve the detection accuracy.
[0005] The method includes:
[0006] S101: Obtain image information;
[0007] S102: Extract a plurality of feature points from the image information;
[0008] S103: Match the plurality of feature points to obtain at least one target feature pair;
[0009] Iteratively optimize the at least one target feature pair to determine at least one symmetry pair;
[0010] S104: Determine the axis of symmetry of the image information according to the at least one symmetry pair.
[0011] Further, in step S102, the image information is parsed based on a preset algorithm, and a plurality of feature points are extracted from the image information;
[0012] The preset algorithm includes: a feature point feature description algorithm and / or a scale-invariant feature transform algorithm.
[0013] Further, step S103 further includes:
[0014] Determine the feature information of multiple feature points, where the feature information includes at least one of orientation, scale, and content;
[0015] Traverse any two feature points among the multiple feature points as candidate feature pairs;
[0016] Based on the feature information of the candidate feature pairs, calculate the confidence corresponding to the candidate feature pairs;
[0017] Determine whether the confidence meets a first preset condition;
[0018] If it meets the condition, determine the candidate feature pair as the target feature pair.
[0019] Further, it should be noted that the method further includes: traversing any two feature points among the multiple feature points as candidate feature pairs, and the two feature points of the candidate feature pairs are described by vectors and vector for description;
[0020] The candidate feature pairs are described by quaternions to calculate the confidence corresponding to the candidate feature pairs according to the feature information of the two feature points of the candidate feature pairs;
[0021] Calculate the position confidence of the candidate feature pair according to the orientation, scale, and content of the two feature points of the candidate feature pair scale confidence and content confidence ;
[0022] Among them, the calculation formula for the position confidence is:
[0023]
[0024] The calculation formula for the scale confidence is:
[0025]
[0026] Among them, is an influence factor used to constrain the scale.
[0027] The calculation formula for the content confidence is:
[0028]
[0029] Determine whether the confidence meets the first preset condition;
[0030] If it meets the condition, determine the candidate feature pair as the target feature pair.
[0031] It should be further noted that step S103 further includes: iteratively optimizing the at least one target feature pair to determine at least one symmetric pair, including:
[0032] In the polar coordinate system, according to the merging strategy, perform a merging process on at least one center point corresponding to each of the at least one target feature pair to obtain at least one first cluster;
[0033] In the Cartesian coordinate system, according to the segmentation strategy, perform a segmentation process on the at least one first cluster to obtain at least one second cluster;
[0034] Iteratively execute the merging process and the segmentation process to determine at least one target cluster;
[0035] Determine the at least one target cluster as the at least one symmetric pair.
[0036] It should be further noted that the merging strategy includes: if the distance between the center points of the target feature pairs is less than a preset distance threshold and the number of center points within the cluster is greater than a preset number threshold;
[0037] Calculate the distance between the center points of any two target feature pairs; select any two target feature pairs with a distance less than the preset threshold, that is, when any two target feature pairs are and perform a merging process on these two target feature pairs to obtain a merged cluster;
[0038] wherein, and are both fixed values;
[0039] The merged cluster is ;
[0040] Judge that the number of inliers in the merged cluster is greater than the preset value ;
[0041] If the number of inliers in the merged cluster is greater than the preset value , then determine the merged cluster as the first cluster;
[0042] If the number of inliers in the merged cluster is less than or equal to the preset value , then delete the merged cluster;
[0043] According to the merging strategy, perform a merging process on at least one center point corresponding to each of the at least one target feature pair, thereby obtaining at least one first cluster.
[0044] It should be further noted that the segmentation strategy at least includes the nearest neighbor principle;
[0045] The nearest neighbor principle is the K-nearest neighbor principle, that is, the inliers whose distance from the center point exceeds the K value are outliers. The outliers are segmented out to form a new first cluster. The outliers include the center point where the outlier is located, the weighted sum of the outlier direction, and the outlier weight factor. At least one second cluster is obtained after removing the outliers from at least one first cluster;
[0046] Iteratively perform outlier segmentation to form a new cluster, and perform merging and segmentation processing to determine at least one target cluster, and determine at least one target cluster as at least one symmetric pair.
[0047] This application also provides an image detection device for intrinsic symmetry of an image. The device includes: an acquisition module, an extraction module, a matching module, a first determination module, and a second determination module;
[0048] The acquisition module is used to acquire image information;
[0049] The extraction module is used to extract a plurality of feature points from the image information;
[0050] The matching module is used to match the plurality of feature points to obtain at least one target feature pair;
[0051] The first determination module is used to iteratively optimize the at least one target feature pair to determine at least one symmetric pair;
[0052] The second determination module is used to determine the axis of symmetry of the image information according to the at least one symmetric pair.
[0053] According to another embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the steps of the image detection method for intrinsic symmetry are implemented.
[0054] According to still another embodiment of the present application, a storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the image detection method for intrinsic symmetry are implemented.
[0055] From the above technical solutions, it can be seen that the present invention has the following advantages:
[0056] In the method for detecting the intrinsic symmetry provided by this application, irrelevant information and noise in the image can be removed, making subsequent feature point detection and matching more accurate and efficient. It can automatically and accurately identify key points in the image, and remove redundant feature points through methods such as non-maximum suppression to improve the processing speed. This application has scale invariance and rotation invariance, can cope with scale changes and rotation changes in the image, thereby improving the robustness of symmetry detection. It can further eliminate false matches and noise to ensure that the finally determined symmetry pairs are accurate and reliable. The method can automatically extract feature points from the image, match feature points, screen symmetry pairs, and finally determine the symmetry axis without manual intervention, realizing the automation and intelligence of image processing.
[0057] This application matches multiple feature points extracted from the image information to obtain at least one target feature pair. It can not only detect the image information with multiple symmetry axes, but also make full use of the image information through feature point matching. Iteratively optimize at least one target feature pair to determine at least one symmetry pair, making the obtained symmetry pair highly accurate. Determine the symmetry axis of the image information according to at least one symmetry pair, reducing the false detection rate of intrinsic symmetry. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the technical solutions of the present invention, the accompanying drawings required for description will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0059] Figure 1 It is a flowchart of the method for detecting the intrinsic symmetry provided by an embodiment of the present disclosure;
[0060] Figure 2 It is a schematic diagram of an image information provided by an embodiment of the present disclosure;
[0061] Figure 3 It is a schematic diagram of multiple feature points in an image information provided by an embodiment of the present disclosure;
[0062] Figure 4 It is a schematic diagram of a feature pair of an image information provided by an embodiment of the present disclosure;
[0063] Figure 5 It is a schematic diagram of a symmetry pair of an image information provided by an embodiment of the present disclosure;
[0064] Figure 6 It is a schematic diagram of the structure of the device for detecting the intrinsic symmetry provided by an embodiment of the present disclosure;
[0065] Figure 7Schematic structural diagram of the electronic device provided by the embodiments of the present disclosure. Detailed implementation manners
[0066] The following details the method for detecting images with intrinsic symmetry involved in the present application. For illustration rather than limitation, specific details such as specific system structures and technologies are proposed to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details.
[0067] In the method for detecting images with intrinsic symmetry provided by the present application, when used in the specification of the present application, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations. The terms "comprising", "including", "having", and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0068] "One or more" mentioned in the present application refers to one, two, or more than two, and "a plurality" mentioned in the present application refers to two or more than two. In the description of the present application, unless otherwise specified, " / " means "or". For example, A / B can represent A or B. The "and / or" herein is merely a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone.
[0069] For the convenience of clearly describing the technical solutions of the present application, terms such as "first" and "second" are used to distinguish the same items or similar items with basically the same functions and roles. Those skilled in the art can understand that the terms such as "first" and "second" do not limit the quantity and execution order, and the terms such as "first" and "second" do not necessarily mean different.
[0070] The statements such as "in one embodiment" or "in some embodiments" described in the present application mean that the specific features, structures, or characteristics described in the embodiment are included in one or more embodiments of the present application. Thus, the statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments" and the like that appear in different parts of the present application do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.
[0071] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0072] Please refer to Figure 1 The flowchart shown is for an image detection method of internal symmetry in a specific embodiment. The method includes:
[0073] S101: Obtain image information.
[0074] In some embodiments, the system can obtain image information of an image containing at least a pair of symmetry axes. The image information can be obtained in various ways, such as loading from a file, capturing in real time from a camera, or obtaining from a network request. After the image is loaded into the system, it will be used as the input image information for subsequent processing.
[0075] Exemplarily speaking, the obtained and processed image information can be the running image information of equipment in a port, or the port road image information, or the port environment image information, etc. The specific usage scenarios of the image information are not limited in this application.
[0076] S102: Extract multiple feature points from the image information.
[0077] In some embodiments, before extracting feature points, the image needs to be preprocessed, such as grayscale conversion, noise reduction, edge detection, etc., to improve the efficiency and accuracy of subsequent processing.
[0078] Optionally, the ORB image preprocessing algorithm or the SIFT image preprocessing algorithm is used to detect feature points of the image. The ORB image preprocessing algorithm or the SIFT image preprocessing algorithm can automatically detect key points in the image. The key points can be corner points, edge points, or points with certain unique properties in the image.
[0079] In this embodiment, candidate points are found quickly by the FAST algorithm for feature points, and then the optimal feature points are screened out by using machine learning methods. Using rotation invariance, the main direction of the feature points is calculated, and based on scale invariance, an image pyramid is constructed to enhance the robustness of the feature points.
[0080] Extreme points are searched for in the scale space as candidate feature points, and then one or more directions are determined for each candidate point by fitting the gradient direction histogram of the local image, thereby generating a feature descriptor with scale invariance and rotation invariance.
[0081] S103: Match the multiple feature points to obtain at least one target feature pair; perform iterative optimization on the at least one target feature pair to determine at least one symmetric pair.
[0082] In this embodiment, the similarity between feature descriptors can be used to match the detected feature points. The matching result may include multiple candidate feature point pairs. Here, the similarity between feature descriptors can be obtained based on the Euclidean distance or the Hamming distance.
[0083] Based on distance constraints, angle constraints, and symmetry assumptions, filter out possible symmetric pairs from the candidate feature point pairs. The symmetric pairs should satisfy certain symmetry properties, such as the distances from two points to a certain line being equal and the directions being opposite.
[0084] In this embodiment, by performing iterative optimization on the candidate symmetric pairs, false matches and noises are further eliminated to determine the final symmetric pairs.
[0085] The iterative optimization method can adopt the least squares method, the RANSAC method, etc.
[0086] S104: Determine the axis of symmetry of the image information according to the at least one symmetric pair.
[0087] In some embodiments, for each determined symmetric pair, their axis of symmetry can be calculated. This can be completed by finding the perpendicular bisectors of all symmetric pairs and merging the perpendicular bisectors through weighted averaging.
[0088] This embodiment also calculates whether the axis of symmetry truly conforms to the symmetry property of the image. Fine-tuning or recalculation is performed according to the specific content and symmetry property of the image. Finally, the system outputs the axis of symmetry information of the image for further analysis, processing, or visualization. In this way, the entire process combines technologies in multiple fields such as image processing, feature detection and matching, and geometric calculation, achieving the goal of automatically detecting and identifying the axis of symmetry from the image.
[0089] Furthermore, as a refinement and extension of the specific implementation manner of the above embodiment, in order to fully illustrate the specific implementation process in this embodiment, the image detection method for internal symmetry includes the following specific steps:
[0090] S201. Obtain image information.
[0091] In some embodiments, the obtained image information includes at least one pair of axes of symmetry. Exemplarily, the image information can be the image information 21 as shown in Figure 2 Figure 21.
[0092] S202. Extract multiple feature points from the image information according to the image information.
[0093] According toFigure 2 The image information shown, and extract multiple feature points from the above image information.
[0094] Optionally, according to the image information, extract multiple feature points from the image information, including: detecting the image information through a preset algorithm, and extracting multiple feature points from the image information, where the preset algorithm at least includes a feature point feature description algorithm and / or a scale-invariant feature transform algorithm.
[0095] The steps of the feature point feature description algorithm (Oriented Fast and Rotated Brief, ORB) are rough extraction, screening the optimal feature points by machine learning methods, removing locally dense feature points by non-maximum suppression, scale invariance of feature points, and rotational invariance of feature points.
[0096] Scale Invariant Feature Transform (SIFT) is a local feature description algorithm in the field of image processing.
[0097] Specifically, detect the above image information through a preset algorithm, which can be a feature point feature description algorithm and a scale-invariant feature transform algorithm, and extract multiple feature points from the above image information.
[0098] Exemplarily, as Figure 3 shown, detect the image information 21 through the above feature point feature description algorithm and scale-invariant feature transform algorithm, and extract multiple feature points such as feature point 31, feature point 32, feature point 33, etc. from the image information 21.
[0099] Optionally, the feature information of the feature points includes at least one of orientation, scale, and content.
[0100] Specifically, describe the feature sub of the feature points through SIFT, that is, each feature point can be described by a vector Among them represents the coordinates of the feature point , represents the orientation of the feature point, that is represents the orientation of the feature point, represents the scale of the feature point, and represents the content of the feature point.
[0101] S203. Match the multiple feature points to obtain at least one target feature pair.
[0102] In some embodiments, the matching situation of two feature points is detected by the discrimination ability of the local feature sub of the two feature points. If the local feature sub or all feature sub corresponding to the two feature points match, a feature pair composed of the two feature points can be obtained. Matching the above-mentioned multiple feature points to obtain at least one target feature pair.
[0103] Exemplarily, as Figure 3 shown, matching multiple feature points such as feature point 31, feature point 32, feature point 33, etc., to obtain a target feature pair composed of feature point 31 and feature point 33, and target feature pairs composed of other matching feature points, connecting at least two feature points that form the target feature pair, to obtain four lines A, B, C, D as shown in Figure 4 that may be the axis of symmetry.
[0104] Optionally, matching the multiple feature points to obtain at least one target feature pair includes: traversing any two feature points among the multiple feature points as a candidate feature pair; calculating the confidence corresponding to the candidate feature pair based on the feature information of the candidate feature pair; determining whether the confidence satisfies a first preset condition; if it is satisfied, determining the candidate feature pair as the target feature pair.
[0105] Specifically, if two feature points can form a feature pair, the average value of the orientations of the two feature points is close to the perpendicular bisector of the coordinate connection line, the scales are close, and the contents are similar. Therefore, traversing any two feature points among the multiple feature points as a candidate feature pair, the two feature points of the candidate feature pair can be described by vectors and vector , and the candidate feature pair can be described by a ternary number . Calculate the confidence corresponding to the candidate feature pair according to the feature information of the two feature points of the candidate feature pair, that is, calculate the position confidence , scale confidence and content confidence of the candidate feature pair according to the orientations, scales, and contents of the two feature points of the candidate feature pair.
[0106] Among them, and respectively represent the abscissa and ordinate of the feature point in the image, that is, the position information of the feature point.
[0107] and respectively represent the abscissa and ordinate of the feature point in the image, that is, the position information of the feature point.
[0108] represents the direction of the feature point , used to describe the feature point The orientation of the object at the position.
[0109] Represents the direction of the feature point and is used to describe the orientation of the object at the position of the feature point. The orientation of the object at the position.
[0110] Represents the scale of the feature point and describes the scale information of the object where the feature point is located.
[0111] Represents the scale of the feature point and describes the scale information of the object where the feature point is located.
[0112] Represents the feature point 's content descriptor, which is used to describe the visual characteristics of the feature point so that similar feature points have similar values.
[0113] Represents the feature point 's content descriptor, which is used to describe the visual characteristics of the feature point so that similar feature points have similar values.
[0114] The calculation formula for the position confidence is:
[0115]
[0116] Represents the angle between the line connecting the feature point and and the horizontal direction. When calculating the position confidence , it is used to measure the consistency of the directions of two feature points.
[0117] The calculation formula for the scale confidence is:
[0118]
[0119] Among them, is an influence factor used to constrain the scale.
[0120] The calculation formula for the content confidence is:
[0121]
[0122] In some embodiments, it is determined whether the confidence meets the first preset condition; if it meets, the candidate feature pair is determined as the target feature pair.
[0123] Specifically, when the position confidence , scale confidence and content confidence of the two feature points in the candidate feature pair satisfy the first preset condition, these two feature points are determined as the target feature pair.
[0124] Exemplarily, when any two feature points are feature point 31 and feature point 33, that is, when feature point 31 and feature point 33 are used as the candidate feature pair, feature point 31 is described by the vector , feature point 33 is described by the vector , and the candidate feature pair composed of feature point 31 and feature point 33 is described by the ternary number . According to the feature information of feature point 31 and feature point 33 of the candidate feature pair, the confidence corresponding to the candidate feature pair is calculated, that is, according to the orientation, scale, and content of feature point 31 and feature point 33, the position confidence , scale confidence and content confidence of feature point 31 and feature point 33 are calculated. When the position confidence , scale confidence and content confidence of feature point 31 and feature point 33 satisfy the first preset condition, feature point 31 and feature point 33 are determined as the target feature pair.
[0125] Wherein, the first preset condition is that the position confidence is greater than the first threshold, the scale confidence is greater than the second threshold, and the content confidence is greater than the third threshold.
[0126] In some embodiments, according to the fact that the position confidence of the candidate feature pair composed of feature point 31 and feature point 33 is greater than the first threshold, the scale confidence is greater than the second threshold, and the content confidence is greater than the third threshold, it is determined that the candidate feature pair composed of feature point 31 and feature point 33 is the target feature pair. It can be understood that the first threshold, the second threshold, and the third threshold may be the same or different, and are specifically set according to the actual situation, which is not limited in this embodiment.
[0127] Optionally, when any one of the position confidence, scale confidence, and content confidence does not satisfy the first preset condition, it is determined that the candidate feature pair is not the target feature pair.
[0128] Specifically, if any two feature points are feature point 31 and feature point 32, that is, feature point 31 and feature point 32 form a candidate feature pair, according to the feature information of feature point 31 and feature point 32 of the candidate feature pair, the confidence corresponding to the candidate feature pair is calculated, that is, according to the orientation, scale, and content of feature point 31 and feature point 32, the position confidence , scale confidence and content confidence , when the position confidence , scale confidence and content confidence do not satisfy the first preset condition, it is determined that the candidate feature pair composed of the feature point 31 and the feature point 32 is a non-target feature pair. Among them, the position confidence , scale confidence and content confidence not satisfying the first preset condition can be that the position confidence is less than or equal to the first threshold, can be that the scale confidence is less than or equal to the second threshold, or can be that the content confidence is less than or equal to one or more of the third thresholds, which will not be elaborated in this embodiment.
[0129] S204. Iteratively optimize the at least one target feature pair to determine at least one symmetry pair.
[0130] Iteratively optimize the above at least one target feature pair, and screen symmetry pairs from the at least one target feature pair.
[0131] S205. Determine the axis of symmetry of the image information according to the at least one symmetry pair.
[0132] Determine the axis of symmetry of the image information 21 according to the above at least one symmetry pair.
[0133] Specifically, as Figure 5 shown, determine that the axes of symmetry of the image information 21 are the straight line A and the straight line B according to the above at least one symmetry pair.
[0134] In the embodiment of the present disclosure, by extracting multiple feature points in the image information for matching to obtain at least one target feature pair, it is not only possible to detect the image information with multiple axes of symmetry, but also the image information can be fully utilized through feature point matching; iteratively optimizing the at least one target feature pair to determine at least one symmetry pair makes the obtained symmetry pair highly accurate; determining the axis of symmetry of the image information according to the at least one symmetry pair reduces the false detection rate of the internal symmetry.
[0135] In some specific embodiments, iterative optimization is performed on the at least one target feature pair to determine at least one symmetric pair, including: in the polar coordinate system, according to the merging strategy, performing a merging process on at least one center point corresponding to each of the at least one target feature pair to obtain at least one first cluster; in the Cartesian coordinate system, according to the segmentation strategy, performing a segmentation process on the at least one first cluster to obtain at least one second cluster; iteratively performing the merging process and the segmentation process to determine at least one target cluster; and determining the at least one target cluster as the at least one symmetric pair.
[0136] Specifically, the center point of each feature pair is , and in the Cartesian coordinate system, the confidence of the center point is expressed as , and the orientation is expressed as , and the center point of each feature pair represents the feature pair. The center point of the target feature pair is ; for each target feature pair, performing a polar coordinate transformation on the alignment of the center point of the target feature pair to obtain the polar coordinates of the center point .
[0137] respectively represent the abscissa and ordinate of the center point of the target feature pair in the image.
[0138] The parametric equations in the polar coordinate system are:
[0139]
[0140] Specifically, initialize a first cluster and a second cluster; in the polar coordinate system, according to the merging strategy, perform a merging process on at least one center point corresponding to each of the at least one target feature pair to obtain at least one first cluster; in the Cartesian coordinate system, according to the segmentation strategy, perform a segmentation process on the at least one first cluster to obtain at least one second cluster; iteratively perform the merging process and the segmentation process to determine at least one target cluster, and determine the at least one target cluster as the at least one symmetric pair.
[0141] Optionally, the merging strategy is: the distance between the center points of the target feature pairs is less than a preset distance threshold and the number of center points within the cluster is greater than a preset number threshold.
[0142] Specifically, the merging strategy is: the distance between the center points of the target feature pairs is less than a preset distance threshold and the number of center points within the cluster is greater than a preset number threshold. Calculate the distance between the center points of any two target feature pairs; select any two target feature pairs with a distance less than the preset threshold, that is, when any two target feature pairs are and , where and All are fixed values; merge the two target feature pairs to obtain a merged cluster, and the merged cluster is ; determine that the number of inliers in the merged cluster is greater than a preset value , if the number of inliers in the merged cluster is greater than the preset value , then determine that the merged cluster is the first cluster; if the number of inliers in the merged cluster is less than or equal to the preset value , then delete the merged cluster. According to the merging strategy, perform merging processing on at least one center point corresponding to at least one target feature pair, so as to obtain at least one first cluster.
[0143] In this embodiment, is the distance value of the center point of the first target feature pair in the spatial position.
[0144] is the distance value of the center point of the second target feature pair in the spatial position.
[0145] Among them, r represents the distance value, m and n respectively represent two different target feature pairs, and c represents the center point. is the azimuth angle of the center point of the first target feature pair under the preset angle dimension. The azimuth angle of the center point of the second target feature pair of is the feature vector of the first target feature pair. is the feature vector of the second target feature pair. represents the weight of the first target feature pair among the two target feature pairs; represents the weight of the second target feature pair among the two target feature pairs.
[0146] Optionally, the segmentation strategy at least includes the nearest neighbor principle.
[0147] In some specific embodiments, the center points of the first clusters in the polar coordinate system may be discretely distributed in the Cartesian coordinate system. Therefore, according to the nearest neighbor principle, perform segmentation processing on at least one first cluster. The nearest neighbor principle may specifically be the K-nearest neighbor principle, that is, the inliers whose distance from the center point exceeds the K value are outliers, and the outliers are segmented out to form a new first cluster. The outliers include the center point where the outliers are located, the weighted sum of the outlier directions, and the outlier weight factor. At least one second cluster is obtained after removing the outliers from at least one first cluster.
[0148] Iteratively execute the above merging processing and the above segmentation processing to determine at least one target cluster, and determine at least one target cluster as at least one symmetric pair.
[0149] Optionally, merge the second clusters that meet the second preset condition to obtain a third cluster.
[0150] In some specific embodiments, after iterative clustering, the target clusters corresponding to the symmetry axes have all been extracted. In the polar coordinate system, if the distance between two target clusters corresponding to the same symmetry axis is less than the fourth threshold, but these two target clusters are not merged, then refinement processing is performed on these two target clusters. If these two target clusters meet the second preset condition, then the two target clusters that meet the second preset condition are merged.
[0151] Among them, the second preset condition is and , the merged third cluster is expressed as:
[0152]
[0153] By specifically describing how to screen symmetry pairs in the embodiments of the present disclosure, compared with the prior art, the false detection rate of inherent symmetry is further reduced under the same precision-recall rate.
[0154] The following are embodiments of an image detection device for image inherent symmetry provided by the embodiments of the present disclosure. This device and the image detection method for inherent symmetry in the above embodiments belong to the same inventive concept. Details not described in detail in the embodiments of the image detection device for image inherent symmetry can refer to the embodiments of the image detection method for inherent symmetry above.
[0155] Now, mobile terminals implementing various embodiments of the present invention will be described with reference to the accompanying drawings. In the following description, suffixes such as "module", "component", or "unit" used to represent elements are only for the convenience of describing the embodiments of the present invention, and they have no specific meaning in themselves. Therefore, "module" and "component" can be used interchangeably.
[0156] As Figure 6 shown, the detection device 60 for inherent symmetry includes: the detection device 60 for inherent symmetry includes: an acquisition module 61, an extraction module 62, a matching module 63, a first determination module 64, and a second determination module 65.
[0157] In this embodiment, the acquisition module 61 is used to acquire image information; the extraction module 62 is used to extract a plurality of feature points from the image information according to the image information; the matching module 63 is used to match the plurality of feature points to obtain at least one target feature pair; the first determination module 64 is used to perform iterative optimization on the at least one target feature pair to determine at least one symmetry pair; the second determination module 65 is used to determine the symmetry axis of the image information according to the at least one symmetry pair.
[0158] In some embodiments, the extraction module 62 is further configured to detect the image information through a preset algorithm, and extract a plurality of feature points from the image information, where the preset algorithm includes a feature point feature description algorithm and / or a scale-invariant feature transform algorithm.
[0159] In some embodiments, the matching module 63 is further configured to determine the feature information of the plurality of feature points, where the feature information includes at least one of orientation, scale, and content; traverse any two feature points among the plurality of feature points as candidate feature pairs; calculate the confidence corresponding to the candidate feature pairs based on the feature information of the candidate feature pairs; determine whether the confidence satisfies a first preset condition; if so, determine the candidate feature pairs as target feature pairs.
[0160] In some embodiments, the first preset condition is that the orientation confidence is greater than a first threshold, the scale confidence is greater than a second threshold, and the content confidence is greater than a third threshold.
[0161] In some embodiments, the first determination module 64 is further configured to, in a polar coordinate system, perform a merging process on at least one center point respectively corresponding to the at least one target feature pair according to a merging strategy to obtain at least one first cluster; in a Cartesian coordinate system, perform a splitting process on the at least one first cluster according to a splitting strategy to obtain at least one second cluster; iteratively execute the merging process and the splitting process to determine at least one target cluster; and determine the at least one target cluster as the at least one symmetry pair.
[0162] In some embodiments, the merging strategy is that the distance between the center points of the target feature pairs is less than a preset distance threshold and the number of center points within the cluster is greater than a preset number threshold. The splitting strategy at least includes the nearest neighbor principle.
[0163] Figure 6 The detection device for the internal symmetry of the illustrated embodiment can be used to execute the technical solutions of the above-mentioned embodiments of the detection method for internal symmetry. The implementation principles and technical effects are similar and will not be elaborated here.
[0164] Figure 7 The structural schematic diagram of the electronic device provided by the embodiments of the present disclosure. This electronic device can be the terminal as described in the above embodiments. The electronic device provided by the embodiments of the present disclosure can execute the processing flow provided by the embodiments of the detection method for internal symmetry, as Figure 7 shown, the electronic device 70 includes: a memory 71, a processor 72, a computer program, and a communication interface 73; wherein, the computer program is stored in the memory 71 and is configured to be executed by the processor 72 to perform the detection method for internal symmetry as described above.
[0165] In addition, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to implement the method for detecting the internal symmetry described in the above embodiment.
[0166] In addition, an embodiment of the present disclosure further provides a computer program product, which includes a computer program or instruction, and when the computer program or instruction is executed by a processor, the method for detecting the internal symmetry described above is implemented.
[0167] It should be noted that the computer-readable medium in the present disclosure may be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program can be used by or combined with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which the computer-readable program code is carried. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable medium other than the computer-readable storage medium, and the computer-readable signal medium can send, propagate, or transmit a program for use by or combined with an instruction execution system, apparatus, or device. The program code included on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0168] In some embodiments, the client and the server can communicate using any currently known or future-developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include local area networks ("LANs"), wide area networks ("WANs"), the Internet (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.
[0169] The above computer-readable medium may be included in the above electronic device; or it may exist independently and not be assembled into the electronic device.
[0170] The above computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device is caused to:
[0171] Obtain image information;
[0172] Extract a plurality of feature points from the image information according to the image information;
[0173] Match the plurality of feature points to obtain at least one target feature pair;
[0174] Iteratively optimize the at least one target feature pair to determine at least one symmetry pair;
[0175] Determine the axis of symmetry of the image information according to the at least one symmetry pair.
[0176] In addition, the electronic device may also execute other steps in the above-described method for detecting intrinsic symmetry.
[0177] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof. The above programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).
[0178] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a portion of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur in a different order than that noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or by a combination of dedicated hardware and computer instructions.
[0179] The units described in the embodiments of the present disclosure can be implemented in software or in hardware. In some cases, the name of the unit does not constitute a limitation on the unit itself.
[0180] The functions described above herein can be performed, at least in part, by one or more hardware logic components. By way of example, and not limitation, the types of hardware logic components that may be used include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0181] The storage medium in the present disclosure may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0182] The foregoing description of the disclosed embodiments enables those skilled in the art to practice or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An image detection method for internal symmetry, characterized in that, The method includes: S101: Obtain image information; S102: Extract multiple feature points from the image information; S103: Match the multiple feature points to obtain at least one target feature pair; Iteratively optimize the at least one target feature pair to determine at least one symmetry pair; Determine the feature information of the multiple feature points, where the feature information includes at least one of orientation, scale, and content; Traverse any two feature points among multiple feature points as candidate feature pairs, and describe the two feature points of the candidate feature pairs with vector and vector for description; Among them, and respectively represent the abscissa and ordinate of the feature point in the image. respectively represent the feature points the abscissa and ordinate in the image; Representative feature points The direction of, used to describe the feature points The orientation of the object at; Representative feature points The direction of, used to describe the feature points The orientation of the object at; Represents the scale of the feature point, describing the scale information of the object where the feature point is located; Represents the scale of the feature point, describing the scale information of the object where the feature point is located; Content descriptor representing feature points for describing the feature points and their visual characteristics, such that similar feature points have similar values; Content descriptor representing feature points used to describe the feature points visual characteristics, such that similar feature points have similar values; Candidate feature pairs are described by triples According to the feature information of the two feature points of the candidate feature pair, the confidence corresponding to the candidate feature pair is calculated; Calculate the position confidence of the candidate feature pair based on the orientation, scale, and content of the two feature points of the candidate feature pair , scale confidence and content confidence ; Among them, the calculation formula for the orientation confidence is: Representative feature points and the angle between the connecting line and the horizontal direction; The calculation formula for the scale confidence is: Among them, is the influence factor used to constrain the scale; The calculation formula for the content confidence is: Judge whether the confidence meets the first preset condition; If it meets the condition, determine the candidate feature pair as the target feature pair; Based on the feature information of the candidate feature pair, calculate the confidence corresponding to the candidate feature pair; Judge whether the confidence meets the first preset condition; If it meets the condition, determine the candidate feature pair as the target feature pair; S104: Determine the axis of symmetry of the image information according to the at least one symmetry pair; Step S103 further includes: Iteratively optimizing the at least one target feature pair to determine at least one symmetry pair, including: In the polar coordinate system, according to the merging strategy, perform merging processing on at least one center point corresponding to each of the at least one target feature pair to obtain at least one first cluster; In the Cartesian coordinate system, according to the segmentation strategy, perform segmentation processing on the at least one first cluster to obtain at least one second cluster; Iteratively execute the merging processing and the segmentation processing to determine at least one target cluster; Determine the at least one target cluster as the at least one symmetry pair.
2. The method for detecting the internal symmetry of an image according to claim 1, characterized in that In step S102, the image information is parsed based on a preset algorithm, and multiple feature points are extracted from the image information; The preset algorithm includes: a feature point feature description algorithm and / or a scale-invariant feature transform algorithm.
3. The method for detecting the internal symmetry of an image according to claim 1, characterized in that The merging strategy includes: If the distance between the center points of the target feature pairs is less than a preset distance threshold and the number of center points within the cluster is greater than a preset number threshold; Calculate the distance between the center points of any two target feature pairs; select any two target feature pairs with a distance less than a preset threshold, that is, when any two target feature pairs are and , merge the two target feature pairs to obtain a merged cluster; Among them, and are both fixed values; Merge clusters into ; is the distance value of the center point of the first target feature pair in the spatial position; is the distance value of the center point of the second target feature pair in the spatial position; is the azimuth angle of the center point of the first target feature pair in the preset angle dimension; is the azimuth angle of the center point of the second target feature pair in the preset angle dimension; is the feature vector of the first target feature pair; is the feature vector of the second target feature pair; represents the weight of the first target feature pair among the two target feature pairs; represents the weight of the second target feature pair among the two target feature pairs; Determine that the number of inliers in the merged cluster is greater than a preset value ; If the number of inliers in the merged cluster is greater than the preset value , then determine that the merged cluster is the first cluster; If the number of inner points of the merged cluster is less than or equal to the preset value , then the merged cluster will be deleted; According to the merging strategy, perform merging processing on at least one center point corresponding to each of the at least one target feature pair, thereby obtaining at least one first cluster.
4. The image detection method with inherent symmetry according to claim 1, characterized in that, The segmentation strategy at least includes the nearest neighbor principle; The nearest neighbor principle is the K-nearest neighbor principle, that is, the inliers whose distance from the center point exceeds the K value are outliers, and the outliers are segmented out to form a new first cluster. The outliers include the center point where the outliers are located, the weighted sum of the outlier directions, and the outlier weight factor. At least one second cluster is obtained after removing the outliers from at least one first cluster; Iteratively execute outlier segmentation, form a new cluster, and perform merging and segmentation processing to determine at least one target cluster, and determine at least one target cluster as at least one symmetry pair.
5. An image detection device for intrinsic symmetry of an image, characterized in that: A device is used to implement the method for detecting the internal symmetry of an image according to any one of claims 1 to 4; The device includes: an acquisition module, an extraction module, a matching module, a first determination module, and a second determination module; The acquisition module is used to acquire image information; An extraction module, configured to extract a plurality of feature points from the image information; A matching module, configured to match the plurality of feature points to obtain at least one target feature pair; A first determination module, configured to perform iterative optimization on the at least one target feature pair to determine at least one symmetric pair; A second determination module, configured to determine the axis of symmetry of the image information according to the at least one symmetric pair.
6. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, the steps of the image detection method for internal symmetry according to any one of claims 1 to 4 are implemented.
7. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the image detection method for internal symmetry according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Image symmetry detection method and device, and terminal equipment
CN107633506A
Track prediction method for removing wrong matching of feature points in visual SLAM (Simultaneous Localization and Mapping) system
CN115619821A