Image registration method and device, electronic equipment and computer readable storage medium
By determining the target feature threshold and filtering out image patches with high feature intensity in the image registration method, the error problem existing in the traditional image registration method is solved, and more accurate image registration is achieved, especially in noisy scenes.
Patent Information
- Application Number
- CN202310868175.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-14
- Publication Date
- 2025-01-14
AI Technical Summary
Traditional image registration methods suffer from registration errors, leading to inaccurate image registration.
By determining the target feature threshold from the correspondence between photosensitivity and feature threshold, image blocks with feature values greater than the target feature threshold are selected, and the corresponding image blocks are determined in the second image. Image registration is performed based on these correspondences, taking into account the influence of image noise.
It improves the accuracy of image registration, especially in scenarios with high shooting noise and poor signal-to-noise ratio, significantly enhancing local alignment.
Smart Images

Figure CN119313712A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of imaging technology, and in particular to an image registration method, device, electronic device and computer-readable storage medium. Background Art
[0002] Image registration (alignment) is a basic technology of image algorithm. It refers to the adjustment of the spatial position and direction of two or more images so that they can be compared and analyzed in the same coordinate system. It is often used in medical imaging, satellite imaging, geographic information systems, robot navigation, visual sensors and other fields.
[0003] However, traditional image registration methods usually have certain registration errors and the problem of inaccurate image registration exists. Summary of the invention
[0004] The embodiments of the present application provide an image registration method, apparatus, electronic device, computer-readable storage medium, and computer program product, which can improve the accuracy of image registration.
[0005] In a first aspect, the present application provides an image registration method. The method comprises:
[0006] Determining a target feature threshold corresponding to the sensitivity of the first registered image from a correspondence between the sensitivity and the feature threshold, wherein the correspondence between the sensitivity and the feature threshold is obtained based on image noise;
[0007] Based on the feature value of each registered image block in the first registered image, a first registered image block having a feature value greater than the target feature threshold is screened out from each registered image block in the first registered image; the feature value represents the feature strength of the image block;
[0008] Determining in the second registered image a second registered image block corresponding to the first registered image block;
[0009] The first registered image and the second registered image are registered based on the corresponding relationship between the first registered image block and the second registered image block.
[0010] In a second aspect, the present application also provides an image registration device. The device comprises:
[0011] A target feature threshold determination module, used to determine a target feature threshold corresponding to the sensitivity of the first registered image from a correspondence between the sensitivity and the feature threshold; the correspondence between the sensitivity and the feature threshold is obtained based on image noise;
[0012] a screening module, configured to screen out first registered image blocks having a characteristic value greater than the target characteristic threshold from the respective registered image blocks in the first registered image based on the characteristic value of each registered image block in the first registered image; the characteristic value represents the characteristic strength of the image block;
[0013] A second registered image block determination module, configured to determine, in a second registered image, a second registered image block corresponding to the first registered image block;
[0014] A registration module is used to register the first registered image and the second registered image based on the corresponding relationship between the first registered image block and the second registered image block.
[0015] In a third aspect, the present application further provides an electronic device. The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0016] Determining a target feature threshold corresponding to the sensitivity of the first registered image from a correspondence between the sensitivity and the feature threshold, wherein the correspondence between the sensitivity and the feature threshold is obtained based on image noise;
[0017] Based on the feature value of each registered image block in the first registered image, a first registered image block having a feature value greater than the target feature threshold is screened out from each registered image block in the first registered image; the feature value represents the feature strength of the image block;
[0018] Determining in the second registered image a second registered image block corresponding to the first registered image block;
[0019] The first registered image and the second registered image are registered based on the corresponding relationship between the first registered image block and the second registered image block.
[0020] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0021] Determining a target feature threshold corresponding to the sensitivity of the first registered image from a correspondence between the sensitivity and the feature threshold, wherein the correspondence between the sensitivity and the feature threshold is obtained based on image noise;
[0022] Based on the feature value of each registered image block in the first registered image, a first registered image block having a feature value greater than the target feature threshold is screened out from each registered image block in the first registered image; the feature value represents the feature strength of the image block;
[0023] Determining in the second registered image a second registered image block corresponding to the first registered image block;
[0024] The first registered image and the second registered image are registered based on the corresponding relationship between the first registered image block and the second registered image block.
[0025] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0026] Determining a target feature threshold corresponding to the sensitivity of the first registered image from a correspondence between the sensitivity and the feature threshold, wherein the correspondence between the sensitivity and the feature threshold is obtained based on image noise;
[0027] Based on the feature value of each registered image block in the first registered image, a first registered image block having a feature value greater than the target feature threshold is screened out from each registered image block in the first registered image; the feature value represents the feature strength of the image block;
[0028] Determining in the second registered image a second registered image block corresponding to the first registered image block;
[0029] The first registered image and the second registered image are registered based on the corresponding relationship between the first registered image block and the second registered image block.
[0030] In the above-mentioned image registration method, device, electronic device, computer-readable storage medium and computer program product, the electronic device determines the target feature threshold corresponding to the sensitivity of the first registered image from the correspondence between the sensitivity and the feature threshold, and the correspondence between the sensitivity and the feature threshold is obtained based on image noise; that is, the target feature threshold corresponding to the sensitivity of the first registered image takes into account the factor of image noise, so that based on the feature value of each registered image block in the first registered image, from each registered image block in the first registered image, a first registered image block with a feature value greater than the target feature threshold is screened out, and the feature value represents the feature intensity of the image block; in the second registered image, a second registered image block corresponding to the first registered image block is determined; then, based on the correspondence between the first registered image block and the second registered image block, the influence of image noise is taken into account, and the first registered image and the second registered image can be registered more accurately. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0032] Figure 1 is a flow chart of an image registration method in one embodiment;
[0033] Figure 2 is a schematic diagram of feature extraction in one embodiment;
[0034] Figure 3 is a flow chart of an image registration method in another embodiment;
[0035] Figure 4 is a structural block diagram of an image registration device in one embodiment;
[0036] Figure 5 FIG. 4 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0038] In one embodiment, Figure 1 As shown, an image registration method is provided. This embodiment uses the method applied to an electronic device as an example. The electronic device can be a terminal or a non-server. It can be understood that the method can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be but not limited to various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, smart cars, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented as an independent server or a server cluster consisting of multiple servers.
[0039] In this embodiment, Figure 1 As shown, the image registration method includes the following steps:
[0040] Step S102, determining a target feature threshold corresponding to the sensitivity of the first registered image from the corresponding relationship between the sensitivity and the feature threshold; the corresponding relationship between the sensitivity and the feature threshold is obtained based on image noise.
[0041] Among them, the photosensitivity is also called ISO (photosensibility) value, which is a measure of the sensitivity of the film to light and is determined by sensitivity measurement and measuring several values. The feature threshold is the threshold for the feature value, and the feature value represents the feature intensity. The target feature threshold is the feature threshold used to screen each registration image block of the first registration image. The first registration image and the second registration image are both images to be registered.
[0042] Optionally, the electronic device obtains the correspondence between sensitivity and feature threshold, determines the sensitivity of the first registered image, matches the correspondence between sensitivity and feature threshold with the sensitivity of the first registered image, and uses the feature threshold that matches the sensitivity of the first registered image as the target feature threshold.
[0043] Optionally, the electronic device pre-establishes a correspondence between the sensitivity and the characteristic threshold.
[0044] Optionally, the electronic device may also determine a target feature threshold corresponding to the sensitivity of the first registered image from the correspondence between the feature matching error and the sensitivity. The correspondence between the feature matching error and the sensitivity is obtained based on image noise, the feature matching error is a matching error between a first noise image block of the first noise image and a second noise image block of the second noise image, and the sensitivity is a sensitivity to which the noise superimposed on the first noise image and the second noise image belongs.
[0045] Step S104, based on the feature value of each registered image block in the first registered image, first registered image blocks having feature values greater than a target feature threshold are screened out from the registered image blocks in the first registered image; the feature value represents the feature strength of the image block.
[0046] Among them, the registered image block can be a regional block where an edge, a corner point or a spot is located. The eigenvalue of the registered image block represents the feature strength of the image block. It can be understood that the higher the eigenvalue of the registered image block, the higher the feature strength of the registered image. Exemplarily, the higher the Harris eigenvalue of the registered image block, the higher the probability that the registered image block is a Harris image block; the higher the Fast eigenvalue of the registered image block, the higher the probability that the registered image block is a Fast image block; the higher the ORB eigenvalue of the registered image block, the higher the probability that the registered image block is an ORB (Oriented FAST and RotatedBRIEF) image block.
[0047] Optionally, the electronic device uses an eigenvalue calculation algorithm to calculate the eigenvalue of each registered image block in the first registered image, and based on the eigenvalue of each registered image block, screens out first registered image blocks whose eigenvalues are greater than a target feature threshold from the respective registered image blocks in the first registered image.
[0048] It can be understood that the correspondence between sensitivity and feature threshold is obtained based on image noise, that is, the electronic device establishes the correspondence between sensitivity and feature threshold based on image noise, and accurately establishes the correspondence between sensitivity and feature threshold by considering the influence of image noise on image registration, thereby accurately determining the target feature threshold, and screening out the first registered image block whose characteristic value is greater than the target feature threshold from each registered image block in the first registered image.
[0049] Step S106: determining in the second registered image a second registered image block corresponding to the first registered image block.
[0050] Optionally, the electronic device matches the first registered image block with the second registered image, and determines a second registered image block matching the first registered image block from the second registered image.
[0051] Optionally, the electronic device searches the second registered image for a second registered image block that matches the first registered image block.
[0052] Optionally, the electronic device matches each registered image block in the second registered image with the first registered image block, determines the matching errors between each registered image block in the second registered image and the first registered image block, and uses the registered image block with the smallest matching error among the registered image blocks in the second registered image as the second registered image block. In other optional embodiments, the electronic device may also use the registered image block with the second smallest matching error as the second registered image block, which is not limited here.
[0053] Step S108: registering the first registered image and the second registered image based on the correspondence between the first registered image block and the second registered image block.
[0054] Optionally, the electronic device obtains a registration parameter based on the correspondence between the first registered image block and the corresponding second registered image block, and registers the first registered image and the second registered image based on the registration parameter. The registration parameter is a parameter related to image registration and can be analyzed from the first registered image block and the corresponding second registered image block.
[0055] Optionally, the electronic device uses the first registered image block and the corresponding second registered image block as a pair of registered image block pairs, sends at least one pair of registered image block pairs to the homography transformation model, obtains registration parameters based on at least one pair of registered image blocks through the homography transformation model, and generates a global transformation model based on the registration parameters; the first registered image and the second registered image are registered using the global transformation model. The first registered image blocks with high matching accuracy are screened and based on the target feature threshold, reliable matches are screened to obtain a more accurate global motion model.
[0056] In the above-mentioned image registration method, the electronic device determines the target feature threshold corresponding to the sensitivity of the first registered image from the correspondence between the sensitivity and the feature threshold, and the correspondence between the sensitivity and the feature threshold is obtained based on image noise; that is, the target feature threshold corresponding to the sensitivity of the first registered image takes the factor of image noise into account, so that based on the feature value of each registered image block in the first registered image, from each registered image block in the first registered image, a first registered image block having a feature value greater than the target feature threshold is screened out, and the feature value represents the feature intensity of the image block; in the second registered image, a second registered image block corresponding to the first registered image block is determined; then, based on the correspondence between the first registered image block and the second registered image block, the influence of image noise is taken into account, and the first registered image and the second registered image can be registered more accurately.
[0057] In addition, the above image registration method can more accurately register the first registered image and the second registered image by measuring the effect of image noise on the screening of the registered image blocks, setting a reasonable and effective target feature threshold to filter the reliable first registered image blocks, and then based on the correspondence between the first registered image blocks and the second registered image blocks. When electronic devices are shooting in scenes with large noise and poor signal-to-noise ratio, the above image registration method can significantly improve the local alignment effect.
[0058] In one embodiment, a method for determining the correspondence between sensitivity and feature thresholds includes: performing image transformation on a first sample image to obtain a second sample image; using the first sample image and the second sample image as a pair of sample image pairs; for each pair of sample image pairs, superimposing noise on the first sample image to obtain a first noise image, and superimposing noise on the second sample image to obtain a second noise image; using the first noise image and the second noise image as a pair of noise image pairs; based on at least two pairs of noise image pairs, determining a target feature value corresponding to the sensitivity to which each type of noise belongs; and using the target feature value as the feature threshold to establish a correspondence between the sensitivity and the feature threshold.
[0059] The first sample image may be a RAW image obtained by actually shooting a scene.
[0060] Optionally, the electronic device obtains a first sample image and a transformation matrix, performs a dot product between each pixel in the first sample image and the transformation matrix, and obtains a second sample image; each pixel in the second sample image is obtained by performing a dot product between a corresponding pixel in the first sample image and the transformation matrix. The transformation matrix may be randomly generated.
[0061] Exemplarily, the electronic device obtains the first sample image image1, randomly generates a transformation matrix recorded as mat1, performs a dot product between each pixel in the first sample image image1 and the transformation matrix mat1, and obtains the second sample image image2. The inverse transformation matrix of the transformation matrix mat1 is mat2.
[0062] The electronic device uses the following formula to perform image transformation on the first sample image to obtain a second sample image:
[0063]
[0064] in, is the transformation matrix mat1, is the pixel value of the pixel in the first sample image, is the pixel value of the pixel in the second sample image.
[0065] Optionally, for each pair of sample images, the electronic device superimposes the same noise on the first sample image and the second sample image, respectively, to obtain a first noise image and a second noise image. Optionally, the electronic device selects a first sensitivity from a sensitivity range of the electronic device, generates noise corresponding to the first sensitivity using a noise estimation algorithm, and superimposes the same noise on the first sample image and the second sample image, respectively, to obtain a first noise image and a second noise image.
[0066] Optionally, the electronic device can perform noise estimation on the first sample image and randomly generate noise, superimpose the noise on a flat area of the first sample image and a flat area of the second sample image to obtain a first noise image and a second noise image, calculate the eigenvalue distribution of each noise image block in each pair of noise images, and determine a feature threshold based on the eigenvalue distribution.
[0067] Noise is the main factor affecting the image registration effect. Image noise can be divided into shot noise and read noise. Read noise is independent of the signal size, while shot noise is related to the signal size. By shooting a chart, the intensity of the image noise corresponding to each sensitivity of the RAW image can be estimated, and the image noise corresponding to each sensitivity can be more accurately collected. The noise obtained by noise estimation is closer to the shape and intensity of the actual noise; for example, the image noise corresponding to each sensitivity can be collected through the k-sigma noise model. Noise estimation can statistically calculate the impact of noise on features to filter out some poor feature matches affected by noise.
[0068] It should be noted that there is no restriction on the noise collection method, but no matter what noise estimation method is used, the noise can be simply simulated into a Gaussian distribution. By measuring the noise, the relationship between noise and pixel value at each sensitivity can be obtained. For example, the measured noise conforms to the normal distribution N[x,f(x,iso)]; where x is the pixel value of a pixel in the RAW image, and f is the distribution variance of the noise.
[0069] It is understandable that after the electronic device collects the noise corresponding to each sensitivity, it can generate the noise corresponding to the first sensitivity according to the first sensitivity, and simulate the virtual noise that is close to the actual noise distribution.
[0070] It is understandable that the noise superimposed in each pair of noise images may be the same or different, the first noise image and the second noise image may include multiple image blocks, and the noise superimposed in different image blocks may be the same or different, which is not limited here.
[0071] Optionally, the electronic device determines the target feature value corresponding to the sensitivity to which each type of noise belongs based on at least two pairs of noise images, and uses the target feature value as a feature threshold, which can be used to screen out the influence of noise and more accurately establish the correspondence between sensitivity and feature threshold.
[0072] In this embodiment, the electronic device performs image transformation on the first sample image to obtain a second sample image; the first sample image and the second sample image are used as a pair of sample image pairs; for each pair of sample image pairs, noise is superimposed on the first sample image to obtain a first noise image, and noise is superimposed on the second sample image to obtain a second noise image; the first noise image and the second noise image are used as a pair of noise image pairs; based on at least two pairs of noise image pairs, a target feature value corresponding to the sensitivity to which each type of noise belongs is determined; using the target feature value as a feature threshold value, the correspondence between the sensitivity and the feature threshold value can be more accurately established.
[0073] In one embodiment, based on at least two pairs of noise image pairs, the target feature value corresponding to the sensitivity to which each type of noise belongs is determined, including: determining a registration data set for each pair of noise image pairs; the registration data set includes candidate feature values of the noise image pairs, and the sensitivity to which the noise belongs; for each sensitivity in the at least two registration data sets, determining the target feature value corresponding to the sensitivity.
[0074] The registration data set includes registration data, which is used to more accurately establish the correspondence between the sensitivity and the feature threshold to more accurately perform image registration. The registration data set includes candidate feature values of the noise image pair, the sensitivity to which the noise belongs, and may also include position deviations.
[0075] Among them, a pair of noise image pairs can correspond to at least one registration data set; if the electronic device targets the entire image of a pair of noise image pairs, then the pair of noise image pairs can correspond to one registration data set; if the electronic device targets at least two image blocks in a pair of noise image pairs, then the pair of noise image pairs can correspond to at least two registration data sets.
[0076] Optionally, the registration data set also includes a position deviation; determining the registration data set for each pair of noise image pairs includes: for each pair of noise image pairs, determining a first noise image block from a first noise image, and determining a second noise image block from a second noise image; there is an image transformation relationship between the second noise image block and the first noise image block; determining a third noise image block matching the first noise image block from the second noise image; determining a position deviation between the third noise image block and the second noise image block, and determining a feature value of the first sample image block; the feature value of the first noise image block is used as a candidate feature value of the noise image pair; the first sample image block is an image block corresponding to the first noise image block in the first sample image.
[0077] Optionally, the electronic device may randomly divide a first sample image block from the first sample image, perform image transformation on the first sample image block, and determine a second sample image block in the second sample image after the image transformation on the first sample image block; superimpose noise on the first sample image block to obtain a first noise image block, and superimpose noise on the second sample image block to obtain a second noise image block, and there is also an image transformation relationship between the second noise image block and the first noise image block.
[0078] It can be understood that after the position coordinates of the first sample image block of the electronic device are subjected to image transformation, the position coordinates of the second sample image block are obtained.
[0079] Exemplarily, the electronic device performs a dot product between each pixel in the first sample image block and the transformation matrix mat1 to determine a second sample image block in the second sample image block; after superimposing noise on the first sample image and the second sample image respectively, a first noise image block is obtained corresponding to the first sample image block, and a second noise image block is obtained corresponding to the second sample image block.
[0080] Optionally, the electronic device matches the first noise image block with each noise image block in the second noise image, determines the matching errors between the first noise image block and each noise image block in the second noise image, and determines a third noise image block in the second noise image based on the matching errors.
[0081] Optionally, the electronic device may use the image block with the smallest matching error in the second noise image as the third noise image block, or may use the image block with the second smallest matching error in the second noise image as the third noise image block, which is not limited here.
[0082] Optionally, the electronic device obtains the position coordinates of the third noise image block and the position coordinates of the second noise image block, and calculates the position deviation between the position coordinates of the third noise image block and the position coordinates of the second noise image block. The position deviation may be the distance between the third noise image block and the second noise image block.
[0083] It should be noted that the third noise image block and the second noise image block may be the same or different. If the third noise image block and the second noise image block are the same, the position deviation between the third noise image block and the second noise image block is zero.
[0084] Optionally, the electronic device uses an eigenvalue calculation algorithm to calculate the eigenvalue of a first sample image block, where the first sample image block is an image block corresponding to the first noise image block in the first sample image, that is, the first sample image block and the first noise image block have the same position coordinates.
[0085] Optionally, the electronic device determines the registration data set for each pair of noise image pairs, and multiple groups of registration data sets (fp, iso, d_e) can be obtained, wherein fp is the characteristic value of the first sample image block, indicating the characteristic intensity of the first sample image block, iso is the sensitivity of the noise superimposed in each pair of noise image pairs, and d_e is the position deviation between the third noise image block and the second noise image block.
[0086] like Figure 2As shown, the electronic device uses Harris corner points to perform feature point detection on the first noise image to obtain one or more first noise image blocks 202. Feature extraction can help better feature matching. Since the calculation of Harris score in Harris corner point detection is easily affected by noise, it is necessary to count the impact of noise on Harris score in advance.
[0087] In this embodiment, the electronic device determines a registration data set for each pair of noise images; the registration data set includes candidate feature values of the noise image pair and the sensitivity to which the noise belongs; for each sensitivity in at least two registration data sets, the target feature value corresponding to the sensitivity can be more accurately determined. Furthermore, the electronic device can also include a position deviation between the third noise image block and the second noise image block, which can determine a more accurate registration data set, thereby more accurately performing image registration.
[0088] In one embodiment, for each sensitivity in at least two registration data sets, a target feature value corresponding to the sensitivity is determined, including: for a registration data set with the same sensitivity in at least two registration data sets, determining a target position deviation whose position deviation is less than a preset deviation threshold from various position deviations; based on a registration data set with the same sensitivity and having a target position deviation, determining the target feature value corresponding to the sensitivity.
[0089] Among them, the preset deviation threshold can be set as needed.
[0090] Optionally, for a registration data set with the same sensitivity in at least two registration data sets, a target position deviation whose position deviation is less than a preset deviation threshold is determined from each position deviation, and the registration data set to which the position deviation whose position deviation is greater than or equal to the preset deviation threshold is discarded; based on the candidate feature values of the noise image pairs in the registration data set with the same sensitivity and the target position deviation, the target feature value corresponding to the sensitivity is determined.
[0091] Optionally, the electronic device can take the maximum or minimum candidate feature value from a set of registration data with the same sensitivity and target position deviation as the target feature value corresponding to the sensitivity, or average the candidate feature values to obtain the target feature value, which is not limited here.
[0092] Optionally, based on a registration data set with the same sensitivity and a target position deviation, a target feature value corresponding to the sensitivity is determined, including: arranging the candidate feature values in each registration data set with the same sensitivity and a target position deviation; based on a preset feature value screening rate, determining the candidate feature value corresponding to the feature value screening rate from each arranged candidate feature value, and using the candidate feature value corresponding to the feature value screening rate as the target feature value corresponding to the sensitivity.
[0093] Among them, the feature value screening rate is the probability of screening out candidate feature values in each registration data set with the same sensitivity and target position deviation, which can be set as needed. For example, the feature value screening rate can be 10%, which means that the probability of screening out candidate feature values in each registration data set with the same sensitivity and target position deviation is 10%, and the final screening probability can be less than 10%, that is, the proportion of failure to meet the screening criteria is less than 10% when screening candidate feature values in each registration data set with the same sensitivity and target position deviation.
[0094] Optionally, the electronic device arranges the candidate feature values in each registration data set with the same sensitivity and target position deviation, and generates a histogram; determines the candidate feature values corresponding to the feature value screening rate in the histogram, and uses the candidate feature values corresponding to the feature value screening rate as the target feature values corresponding to the sensitivity.
[0095] Exemplarily, the electronic device acquires multiple sets of registration data sets (fp, iso, d_e), the preset deviation threshold is 1 pixel, and the feature value screening rate can be 10%; for the registration data sets of the same sensitivity iso in at least two sets of registration data sets, the distribution of candidate feature values fp and position deviation d_e can be obtained, and the target position deviation less than 1 pixel is determined from each position deviation d_e to obtain the registration data sets of the same sensitivity iso and the position deviation less than 1 pixel; the candidate feature values fp in the registration data sets of the same sensitivity iso and the position deviation less than 1 pixel are arranged, and a histogram is generated; the candidate feature value fp corresponding to the feature value screening rate is determined in the histogram, that is, the candidate feature value fp corresponding to the 10% quantile in the histogram, and the candidate feature value fp corresponding to the 10% quantile in the histogram is used as the target feature value corresponding to the sensitivity iso.
[0096] Repeating the above steps, multiple sets of target characteristic values corresponding to the sensitivities can be obtained, and based on the multiple sets of target characteristic values corresponding to the sensitivities, a smooth curve of sensitivity and target characteristic value g(iso)=t is fitted, where iso is the sensitivity and t is the target characteristic value.
[0097] In this embodiment, the electronic device determines a target position deviation whose position deviation is less than a preset deviation threshold value from each position deviation for a registration data set of the same sensitivity in at least two registration data sets, and can accurately determine a target feature value corresponding to the sensitivity based on the registration data set of the same sensitivity and having the target position deviation. Further, the electronic device determines a candidate feature value corresponding to the feature value screening rate from each arranged candidate feature value based on a preset feature value screening rate, and uses the candidate feature value corresponding to the feature value screening rate as the target feature value corresponding to the sensitivity, thereby accurately obtaining the target feature value.
[0098] In one embodiment, the method is applied to an electronic device, and further includes: when the electronic device is shooting, shooting at a target sensitivity to obtain a first sample image; the target sensitivity is a lower limit value in a sensitivity range of the electronic device.
[0099] The first sample image may be a RAW image.
[0100] Optionally, when the electronic device is taking pictures, the sensitivity is positioned to the lower limit value in the sensitivity range, and a first sample image is obtained by taking pictures with the target sensitivity. The first sample image is a clean image with less noise, so that the sensitivity to which the noise belongs can be more accurately determined when the noise is subsequently superimposed, thereby more accurately obtaining the correspondence between the sensitivity and the characteristic threshold.
[0101] In one embodiment, another image registration method is provided for an electronic device, comprising the following steps:
[0102] Step A1: When the electronic device is shooting, a first sample image is obtained by shooting at a target sensitivity; the target sensitivity is the lower limit value in the sensitivity range of the electronic device.
[0103] Step A2: performing image transformation on the first sample image to obtain a second sample image; the first sample image and the second sample image are used as a sample image pair.
[0104] Step A3: for each pair of sample images, superimpose noise on the first sample image to obtain a first noise image, and superimpose noise on the second sample image to obtain a second noise image; the first noise image and the second noise image are regarded as a pair of noise images.
[0105] Step A4: for each noise image pair, determine a first noise image block from the first noise image, and determine a second noise image block from the second noise image; there is an image transformation relationship between the second noise image block and the first noise image block.
[0106] Step A5: Determine, from the second noise image, a third noise image block that matches the first noise image block.
[0107] Step A6, determining the position deviation between the third noise image block and the second noise image block, and determining the eigenvalue of the first sample image block, and using the eigenvalue of the first noise image block as the candidate eigenvalue of the noise image pair to obtain a registration data set; the first sample image block is an image block corresponding to the first noise image block in the first sample image, and the registration data set includes the candidate eigenvalue corresponding to the noise image, the sensitivity to which the noise belongs, and the position deviation.
[0108] Step A8: for the registration data sets of the same sensitivity in at least two registration data sets, determine, from the various position deviations, a target position deviation whose position deviation is less than a preset deviation threshold.
[0109] Step A9, arranging candidate feature values in each registration data set having the same sensitivity and target position deviation.
[0110] Step A10, based on a preset feature value screening rate, determining a candidate feature value corresponding to the feature value screening rate from the arranged candidate feature values, and using the candidate feature value corresponding to the feature value screening rate as a target feature value corresponding to the sensitivity.
[0111] Step A11, taking the target feature value as the feature threshold, and establishing a corresponding relationship between the sensitivity and the feature threshold.
[0112] Step A12, determining a target feature threshold corresponding to the sensitivity of the first registered image from the corresponding relationship between the sensitivity and the feature threshold; the corresponding relationship between the sensitivity and the feature threshold is obtained based on image noise.
[0113] Step A13, based on the feature value of each registered image block in the first registered image, select the first registered image block whose feature value is greater than the target feature threshold from each registered image block in the first registered image; the feature value represents the feature strength of the image block.
[0114] Step A14: determining in the second registered image a second registered image block corresponding to the first registered image block.
[0115] Step A15: registering the first registered image and the second registered image based on the correspondence between the first registered image block and the second registered image block.
[0116] In another embodiment, the electronic device can perform noise estimation on the first sample image and randomly generate noise, superimpose the noise on a flat area of the first sample image and a flat area of the second sample image to obtain a first noise image and a second noise image, calculate the eigenvalue distribution of each noise image block in each pair of noise images, and determine a feature threshold based on the eigenvalue distribution, thereby establishing a correspondence between sensitivity and feature threshold.
[0117] The electronic device determines the target feature threshold corresponding to the sensitivity of the first registered image from the correspondence between the sensitivity and the feature threshold, performs feature extraction on the first registered image, determines the first registered image block in the first registered image, and determines the second registered image block corresponding to the first registered image block in the second registered image; performs feature matching on the first registered image block and the second registered image block, and establishes a correspondence between the first registered image block and the second registered image block; the electronic device performs model estimation based on the correspondence between the first registered image block and the second registered image block to obtain a global transformation model, that is, estimates the registration parameters (transformation parameters) based on the selected image transformation model, so that the matching error between the two images is minimized; wherein the image transformation model is, for example, a homography transformation model; the first registered image and the second registered image are registered using the global transformation model, that is, the first registered image and the second registered image are coordinately transformed according to the estimated transformation parameters, so that the two images overlap.
[0118] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0119] Based on the same inventive concept, the embodiment of the present application also provides an image registration device for implementing the above-mentioned image registration method. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above-mentioned method, so the specific limitations in one or more image registration device embodiments provided below can refer to the limitations of the image registration method above, and will not be repeated here.
[0120] In one embodiment, Figure 4As shown, an image registration device is provided, comprising: a target feature threshold determination module 402, a screening module 404, a second registration image block determination module 406 and a registration module 408, wherein:
[0121] The target feature threshold determination module 402 is used to determine the target feature threshold corresponding to the sensitivity of the first registered image from the corresponding relationship between the sensitivity and the feature threshold; the corresponding relationship between the sensitivity and the feature threshold is obtained based on image noise.
[0122] The screening module 404 is used to screen out first registered image blocks whose characteristic values are greater than a target characteristic threshold from each registered image block in the first registered image based on the characteristic value of each registered image block in the first registered image; the characteristic value represents the characteristic strength of the image block.
[0123] The second registered image block determining module 406 is configured to determine, in the second registered image, a second registered image block corresponding to the first registered image block.
[0124] The registration module 408 is configured to register the first registered image with the second registered image based on the correspondence between the first registered image block and the second registered image block.
[0125] In the above-mentioned image registration device, the electronic device determines the target feature threshold corresponding to the sensitivity of the first registered image from the correspondence between the sensitivity and the feature threshold, and the correspondence between the sensitivity and the feature threshold is obtained based on image noise; that is, the target feature threshold corresponding to the sensitivity of the first registered image takes the factor of image noise into account, so that based on the feature value of each registered image block in the first registered image, from each registered image block in the first registered image, a first registered image block with a feature value greater than the target feature threshold is screened out, and the feature value represents the feature intensity of the image block; in the second registered image, a second registered image block corresponding to the first registered image block is determined; then, based on the correspondence between the first registered image block and the second registered image block, the influence of image noise is taken into account, and the first registered image and the second registered image can be registered more accurately.
[0126] In one embodiment, the above-mentioned device also includes a correspondence establishment module, which is used to perform image transformation on the first sample image to obtain a second sample image; the first sample image and the second sample image are used as a pair of sample image pairs; for each pair of sample image pairs, noise is superimposed on the first sample image to obtain a first noise image, and noise is superimposed on the second sample image to obtain a second noise image; the first noise image and the second noise image are used as a pair of noise image pairs; based on at least two pairs of noise image pairs, the target feature value corresponding to the sensitivity to which each type of noise belongs is determined; the target feature value is used as a feature threshold to establish a correspondence between the sensitivity and the feature threshold.
[0127] In one embodiment, the above-mentioned device also includes a correspondence establishment module which is also used to determine a registration data set for each pair of noise images; the registration data set includes candidate feature values corresponding to the noise image and the sensitivity to which the noise belongs; for each sensitivity in at least two registration data sets, determine the target feature value corresponding to the sensitivity.
[0128] In one embodiment, the registration data set also includes a position deviation; the above-mentioned device also includes a correspondence establishment module, which is also used to determine, for each pair of noise image pairs, a first noise image block from the first noise image and a second noise image block from the second noise image; there is an image transformation relationship between the second noise image block and the first noise image block; from the second noise image, a third noise image block matching the first noise image block is determined; the position deviation between the third noise image block and the second noise image block is determined, and the characteristic value of the first sample image block is determined; the characteristic value of the first noise image block is used as a candidate characteristic value of the noise image pair; the first sample image block is an image block corresponding to the first noise image block in the first sample image.
[0129] In one embodiment, the above-mentioned device also includes a correspondence establishment module which is also used to determine, for a registration data set with the same sensitivity in at least two registration data sets, a target position deviation whose position deviation is less than a preset deviation threshold from various position deviations; and determine a target feature value corresponding to the sensitivity based on a registration data set with the same sensitivity and a target position deviation.
[0130] In one embodiment, the above-mentioned device also includes a correspondence establishment module, which is also used to arrange the candidate feature values in each registration data set with the same sensitivity and target position deviation; based on a preset feature value screening rate, determine the candidate feature value corresponding to the feature value screening rate from the arranged candidate feature values, and use the candidate feature value corresponding to the feature value screening rate as the target feature value corresponding to the sensitivity.
[0131] In one embodiment, the apparatus further includes a correspondence establishing module which is further used to obtain the first sample image by photographing at a target sensitivity when the electronic device is photographing; the target sensitivity is a lower limit value in a sensitivity range of the electronic device.
[0132] Each module in the above-mentioned image registration device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in an electronic device in the form of hardware, or can be stored in a memory in an electronic device in the form of software, so that the processor can call and execute operations corresponding to each module above.
[0133] In one embodiment, an electronic device is provided. The electronic device may be a terminal, and its internal structure diagram may be as follows: Figure 5 As shown. The electronic device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the electronic device is used to exchange information between the processor and an external device. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, an image registration method is implemented. The display unit of the electronic device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the electronic device casing, or an external keyboard, touchpad or mouse.
[0134] Those skilled in the art will understand that Figure 5 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0135] The embodiment of the present application further provides a computer-readable storage medium, one or more non-volatile computer-readable storage media containing computer-executable instructions, which, when executed by one or more processors, enable the processors to perform the steps of the image registration method.
[0136] An embodiment of the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the image registration method.
[0137] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0138] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0139] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0140] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. An image registration method, characterized in that: include: Determine the target feature threshold corresponding to the sensitivity of the first registered image from the corresponding relationship between the sensitivity and the feature threshold; The corresponding relationship between the sensitivity and the characteristic threshold is obtained based on the image noise; Based on the feature value of each registered image block in the first registered image, a first registered image block having a feature value greater than the target feature threshold is screened out from each registered image block in the first registered image; the feature value represents the feature strength of the image block; Determining in the second registered image a second registered image block corresponding to the first registered image block; The first registered image and the second registered image are registered based on the corresponding relationship between the first registered image block and the second registered image block.
2. The method according to claim 1, characterized in that The method for determining the corresponding relationship between the sensitivity and the characteristic threshold includes: Performing image transformation on the first sample image to obtain a second sample image; the first sample image and the second sample image are taken as a pair of sample images; For each pair of sample images, superimposing noise on the first sample image to obtain a first noise image, and superimposing the noise on the second sample image to obtain a second noise image; the first noise image and the second noise image are regarded as a pair of noise images; Based on at least two pairs of noise images, determine a target feature value corresponding to the sensitivity to which each type of noise belongs; The target characteristic value is used as a characteristic threshold, and a corresponding relationship between the sensitivity and the characteristic threshold is established.
3. The method according to claim 2, characterized in that The step of determining the target feature value corresponding to the sensitivity to which each type of noise belongs based on at least two pairs of noise images includes: Determine a registration data set for each pair of noise images; the registration data set includes candidate feature values corresponding to the noise images and the sensitivity to which the noise belongs; For each sensitivity in at least two registration data sets, a target feature value corresponding to the sensitivity is determined.
4. The method according to claim 3, characterized in that The registration data set also includes position deviation; the registration data set for determining each pair of noise image pairs includes: For each pair of noise images, a first noise image block is determined from the first noise image, and a second noise image block is determined from the second noise image; there is an image transformation relationship between the second noise image block and the first noise image block; Determining, from the second noise image, a third noise image block that matches the first noise image block; Determine the position deviation between the third noise image block and the second noise image block, and determine the feature value of the first sample image block; the feature value of the first noise image block is used as a candidate feature value of the noise image pair; the first sample image block is an image block in the first sample image corresponding to the first noise image block.
5. The method according to claim 4, characterized in that The step of determining, for each sensitivity in at least two registration data sets, a target feature value corresponding to the sensitivity includes: For the registration data sets of the same sensitivity in at least two registration data sets, determining, from the respective position deviations, a target position deviation whose position deviation is less than a preset deviation threshold; Based on a registration data set having the same sensitivity and the target position deviation, a target feature value corresponding to the sensitivity is determined.
6. The method according to claim 5, characterized in that The registering data set based on the same sensitivity and having the target position deviation, determining the target feature value corresponding to the sensitivity, comprises: Arrange candidate feature values in each registration data set having the same sensitivity and target position deviation; Based on a preset eigenvalue screening rate, a candidate eigenvalue corresponding to the eigenvalue screening rate is determined from the arranged candidate eigenvalues, and the candidate eigenvalue corresponding to the eigenvalue screening rate is used as the target eigenvalue corresponding to the sensitivity.
7. The method according to any one of claims 2 to 6, characterized in that: Applied to electronic equipment, the method further comprises: When the electronic device is shooting, a first sample image is obtained by shooting at a target sensitivity; the target sensitivity is a lower limit value in a sensitivity range of the electronic device.
8. An image registration device, characterized in that: include: A target feature threshold determination module, used to determine the target feature threshold corresponding to the sensitivity of the first registered image from the corresponding relationship between the sensitivity and the feature threshold; The corresponding relationship between the sensitivity and the characteristic threshold is obtained based on the image noise; a screening module, configured to screen out first registered image blocks having a characteristic value greater than the target characteristic threshold from the respective registered image blocks in the first registered image based on the characteristic value of each registered image block in the first registered image; the characteristic value represents the characteristic strength of the image block; A second registered image block determination module, configured to determine, in a second registered image, a second registered image block corresponding to the first registered image block; A registration module is used to register the first registered image and the second registered image based on the corresponding relationship between the first registered image block and the second registered image block.
9. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the computer program is executed by the processor, the processor is caused to perform the steps of the image registration method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.