WO2022127916A1 - 图像处理方法、描述子提取方法及其装置、电子设备 - Google Patents

图像处理方法、描述子提取方法及其装置、电子设备 Download PDF

Info

Publication number
WO2022127916A1
WO2022127916A1 PCT/CN2021/139279 CN2021139279W WO2022127916A1 WO 2022127916 A1 WO2022127916 A1 WO 2022127916A1 CN 2021139279 W CN2021139279 W CN 2021139279W WO 2022127916 A1 WO2022127916 A1 WO 2022127916A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
original
original image
processed
target
Prior art date
Application number
PCT/CN2021/139279
Other languages
English (en)
French (fr)
Inventor
朱明铭
张国华
王进
林乃养
Original Assignee
虹软科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 虹软科技股份有限公司 filed Critical 虹软科技股份有限公司
Publication of WO2022127916A1 publication Critical patent/WO2022127916A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/94Dynamic range modification of images or parts thereof based on local image properties, e.g. for local contrast enhancement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/60Image enhancement or restoration using machine learning, e.g. neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20224Image subtraction

Definitions

  • the present invention relates to image processing technology, in particular, to an image processing method, a descriptor extraction method, a device thereof, and an electronic device.
  • the sensor is located below a specific area of the screen.
  • the phone screen lights up, and the sensor receives the reflection from the surface of the user's finger to form a fingerprint image.
  • the imaging result contains not only the fingerprint information, but also the texture information of the display screen itself (that is, the background texture), and the background texture is usually more obvious than the fingerprint information.
  • the background texture is usually more obvious than the fingerprint information.
  • the present disclosure provides an image processing method, a descriptor extraction method, a device, and an electronic device to at least solve the technical problem in the prior art that a clear target image cannot be obtained by removing background textures in different environments.
  • an image processing method comprising: acquiring a first original image and a second original image, wherein the first original image is one of an original target image and a background image, and the second original image is Another one of the original target image and the background image; perform local brightness alignment processing on the first original image to obtain a first processed image; and obtain a background-removed target image based on the first processed image and the second original image.
  • the original target image is a target image collected when the target is pressed on the display screen surface of the electronic device
  • the background image is a simulated object with a reflectivity close to the target object and a smooth surface that is pressed on the display screen of the electronic device.
  • the texture image of the display screen itself captured when the surface is displayed.
  • the target is a finger and the simulant is a skin tone rubber block.
  • the image processing method continuously collects multiple frames of target images when the target completely presses the screen, and performs overall or partial weighted fusion on the multiple frames of target images according to the overall quality or local quality of the multiple frames of the target images, to obtain:
  • the fused target image is used as the original target image.
  • performing local brightness alignment processing on the first original image, and obtaining the first processed image includes: respectively calculating the pixel value of each pixel in the first original image and the pixel value of all pixels in the neighborhood window of each pixel.
  • the pixel average value of all pixels in the neighborhood window of each pixel point, and the pixel value of each pixel point in the second original image and the pixel average value of all pixel points in the neighborhood window of each pixel point to obtain the same value as the first pixel point.
  • the local luminance of the two original images is aligned with the first processed image.
  • obtaining the first result image based on the first processed image and the second original image includes: performing a subtraction operation on the first processed image and the second original image to obtain the first result image.
  • the image processing method further includes performing global luminance alignment processing before or after the local luminance alignment processing.
  • Alignment processing to obtain the second processed image includes: calculating the maximum pixel value and the minimum pixel value of the first processed image, and the maximum pixel value and the minimum pixel value of the second original image respectively; according to the maximum pixel value and the minimum pixel value of the first processed image The pixel value, and the maximum pixel value and the minimum pixel value of the second original image, to obtain the overall brightness scale coefficient and the overall brightness offset coefficient of the first processed image relative to the second original image; based on the overall brightness scale coefficient and the overall brightness offset coefficient Linear transformation is performed on the first processed image to obtain a second processed image aligned with the overall brightness of the second original image.
  • performing an overall brightness alignment process on the second original image to obtain a third processed image comprising: respectively calculating the maximum pixel value and the minimum pixel value of the first processed image, and the maximum pixel value and the minimum pixel value of the second original image. value; according to the maximum pixel value and minimum pixel value of the first processed image, and the maximum pixel value and minimum pixel value of the second original image, obtain the overall brightness scale coefficient and overall brightness offset of the second original image relative to the first processed image coefficient; linearly transform the second original image based on the overall luminance scale coefficient and the overall luminance offset coefficient to obtain a third processed image aligned with the overall luminance of the first processed image.
  • the image processing method further includes performing smoothing processing before the overall luminance alignment.
  • the smoothing process includes at least one of the following: mean filtering, Gaussian filtering.
  • the image processing method further includes: taking an image of the target object collected when the target object just touches the screen but does not fully press the display screen as the background image.
  • the image processing method further includes: performing shape alignment processing before or after the local luminance alignment processing.
  • Obtaining the fourth processed image includes: calculating the position offset of each pixel in the first processed image to the corresponding target pixel in the second original image; fitting the displacement of the first processed image relative to the second original image according to the position offset parameters and scale parameters; perform shape alignment processing on the first processed image according to the displacement parameter and the scale parameter, and obtain a fourth processed image that is aligned in shape with the second original image.
  • performing shape alignment processing on the second original image to obtain a fifth processed image comprising: calculating a positional offset from each pixel in the first processed image to a corresponding target pixel in the second original image;
  • the displacement parameters and scale parameters of the second original image relative to the first processed image are obtained by shift fitting;
  • the shape alignment processing is performed on the second original image according to the displacement parameters and the scale parameters to obtain a fifth processed image aligned in shape with the first processed image.
  • the image processing method further includes: performing at least one of the following processing on the background-removed target image: local contrast enhancement, fast non-local mean denoising, and three-dimensional block matching filtering.
  • the image processing method further includes: before performing the shape alignment processing, judging whether the background image has deformation.
  • the image processing method further includes: collecting candidate background images, wherein the candidate background images are multiple frames of target object images sampled from the period when the target object just touches the screen to when the target object completely presses the screen.
  • the image processing method further includes: obtaining a result image after removing the candidate background based on the candidate background image and the first original image or the second original image subjected to local brightness alignment processing.
  • the image processing method further includes: taking a better one of the background-removed result image and the candidate background-removed result image as the background-removing target image.
  • an image processing method comprising: acquiring a third original image and a fourth original image, wherein the third original image is one of an original target image and a background image, and the fourth original image is The image is another one of the original target image and the background image; according to the third original image and the fourth original image, the input image is obtained; the initial image generation network is trained to construct the trained image generation network; wherein, the image generation network The network is trained with a template image as a reference object, and the template image is the target image with background removed obtained by using any of the above image processing methods; the input image is input to the trained image generation network to obtain the target image with background removed.
  • obtaining the input image according to the third original image and the fourth original image includes: performing local luminance alignment processing on the third original image and the fourth original image, and using the processing result as the input image.
  • training the initial image generation network, and constructing the trained image generation network includes: acquiring a first sample image and a second sample image; inputting the first sample image and the second sample image to the initial to obtain the first training image; input the first training image and the template image into the first loss function module, train the initial image generation network according to the first loss value output by the first loss function module, and construct a trained image generation network.
  • Image generation network includes: acquiring a first sample image and a second sample image; inputting the first sample image and the second sample image to the initial to obtain the first training image; input the first training image and the template image into the first loss function module, train the initial image generation network according to the first loss value output by the first loss function module, and construct a trained image generation network.
  • the initial image generation network is trained, and the construction of the trained image generation network also includes: inputting the first training image and the template image into the feature extraction network, and obtaining the high-level semantic features of the first training image and the template image. High-level semantic features; input the high-level semantic features of the first training image and the high-level semantic features of the template image into the second loss function module, and train the image generation network and/or the features according to the second loss value output by the second loss function module Extract the network.
  • a method for extracting descriptors comprising: acquiring key points of a target image, wherein the target image is a target image with background removed obtained by using any of the above image processing methods; Multiple target images with the same key points are classified into the same category, and the category information is marked as image labels; with the key points as the center, image blocks are intercepted from multiple target images with image labels representing the same category;
  • the descriptor extraction network is trained to construct a trained descriptor extraction network; the image blocks are input into the trained descriptor extraction network to obtain feature descriptors.
  • the descriptor extraction method before inputting the image block into the trained descriptor extraction network to obtain the feature descriptor, the descriptor extraction method further includes: acquiring the direction and angle of the key point; Rotate and flatten to get aligned image blocks.
  • the descriptor extraction method uses an end-to-end training method to train the image generation network, the feature extraction network and the descriptor extraction network.
  • an image processing apparatus comprising: an image acquisition unit configured to acquire a first original image and a second original image, wherein the first original image is an original target image and a background image One of the two original images, the second original image is the other one of the original target image and the background image; the local brightness alignment unit is set to perform local brightness alignment processing on the first original image to obtain the first original image. a processed image; a result acquisition unit configured to acquire a first result image based on the first processed image and the second original image.
  • the local brightness alignment unit includes: a first pixel value calculation unit, configured to calculate the pixel value of each pixel in the first original image and the pixel average value of all pixels in the neighborhood window of each pixel respectively. , and the pixel value of each pixel in the second original image and the pixel average value of all pixels in the neighborhood window of each pixel; the first processed image obtaining unit is set to be based on each pixel in the first original image. The pixel value of the point and the pixel average value of all pixels in the neighborhood window of each pixel point, as well as the pixel value of each pixel point in the second original image and the pixels of all pixels in the neighborhood window of each pixel point Averaged to obtain the first processed image aligned with the local brightness of the second original image.
  • the result obtaining unit obtains the first result image by performing a subtraction operation on the first processed image and the second original image.
  • the image processing apparatus further includes an overall luminance alignment unit, configured to perform the overall luminance alignment processing before or after the local luminance alignment processing.
  • the overall brightness alignment unit includes: a second pixel value calculation unit, configured to calculate the maximum pixel value and the minimum pixel value of the first processed image, and the maximum pixel value and the minimum pixel value of the second original image respectively; the overall brightness The coefficient calculation unit, according to the maximum pixel value and the minimum pixel value of the first processed image, and the maximum pixel value and the minimum pixel value of the second original image, obtain the overall brightness scale coefficient of the first processed image relative to the second original image and an overall brightness offset coefficient; a linear transformation unit that performs linear transformation on the first processed image based on the overall brightness scale coefficient and the overall brightness offset coefficient to obtain a second processed image aligned with the overall brightness of the second original image.
  • the overall brightness alignment unit includes: a second pixel value calculation unit, configured to calculate the maximum pixel value and the minimum pixel value of the first processed image, and the maximum pixel value and the minimum pixel value of the second original image respectively; the overall brightness The coefficient calculation unit, according to the maximum pixel value and the minimum pixel value of the first processed image, and the maximum pixel value and the minimum pixel value of the second original image, to obtain the overall brightness scale coefficient and the overall brightness of the second original image relative to the first processed image an offset coefficient; a linear transformation unit that performs linear transformation on the second original image based on the overall brightness scale coefficient and the overall brightness offset coefficient to obtain a third processed image aligned with the overall brightness of the first processed image.
  • a second pixel value calculation unit configured to calculate the maximum pixel value and the minimum pixel value of the first processed image, and the maximum pixel value and the minimum pixel value of the second original image respectively
  • the overall brightness The coefficient calculation unit according to the maximum pixel value and the minimum pixel value of the first processed image, and the maximum
  • the image processing apparatus further includes a smoothing processing unit configured to perform smoothing processing before the overall brightness alignment.
  • the image processing apparatus further includes a shape alignment unit, configured to perform the shape alignment process before or after the local luminance alignment process.
  • the shape alignment unit includes: a position calculation unit, configured to calculate the position offset of each pixel point in the first processed image to the corresponding target pixel point in the second original image; a fitting unit, configured to calculate the position offset according to the position offset. Fitting out the displacement parameters and scale parameters of the first processed image relative to the second original image; the alignment unit is set to perform shape alignment processing on the first processed image according to the displacement parameters and the scale parameters, and obtain a shape aligned with the second original image. D. Process the image.
  • the shape alignment unit includes: a position calculation unit, configured to calculate the position offset of each pixel point in the first processed image to the corresponding target pixel point in the second original image; a fitting unit, configured to calculate the position offset according to the position offset.
  • the displacement parameter and scale parameter of the second original image relative to the first processed image are fitted; the alignment unit is set to perform shape alignment processing on the second original image according to the displacement parameter and the scale parameter, and obtain the first processed image shape aligned with the first processed image. 5. Process the images.
  • an image processing apparatus comprising: an image acquisition unit for acquiring a third original image and a fourth original image, wherein the third original image is one of an original target image and a background image , the fourth original image is another one of the original target image and the background image; the input image acquisition unit obtains the input image according to the third original image and the fourth original image; the network construction unit trains the initial image generation network , build a trained image generation network; wherein, the image generation network is trained with a template image as a reference object, and the template image is a target image obtained by using any of the above image processing methods to remove the background; the result acquisition unit is to input the input image to the trained image generation network to obtain the target image with the background removed.
  • the input image acquisition unit is configured to perform local brightness alignment processing on the third original image and the fourth original image, and use the processing result as the input image.
  • the network construction unit includes: a sample acquisition unit, configured to acquire a first sample image and a second sample image; a training image acquisition unit, configured to input the first sample image and the second sample image to the initial image generating a network to obtain a first training image; a first training unit, configured to input the first training image and the template image into the first loss function module, and train the initial image generation network according to the first loss value output by the first loss function module , construct the trained image generation network.
  • the network construction unit further includes: a feature extraction unit, configured to input the first training image and the template image into the feature extraction network, to obtain the high-level semantic features of the first training image and the high-level semantic features of the template image; the second training image The unit is configured to input the high-level semantic features of the first training image and the high-level semantic features of the template image into the second loss function module, and train the image generation network and/or the feature extraction network according to the second loss value output by the second loss function module .
  • a feature extraction unit configured to input the first training image and the template image into the feature extraction network, to obtain the high-level semantic features of the first training image and the high-level semantic features of the template image
  • the second training image The unit is configured to input the high-level semantic features of the first training image and the high-level semantic features of the template image into the second loss function module, and train the image generation network and/or the feature extraction network according to the second loss value output by the second loss function module .
  • an apparatus for extracting descriptors comprising: a key point acquiring unit configured to acquire key points of a target image, wherein the target image is a background-removed image obtained by using any of the above image processing methods
  • the classification unit is set to classify multiple target images with the same key point into the same category, and the category information is marked as the image label;
  • the screenshot unit is set to be centered on the key point, and it is set to represent the same category in the
  • the image blocks are intercepted from multiple target images of the image label;
  • the descriptor extraction network construction unit is set to train the initial descriptor extraction network, and the trained descriptor extraction network is constructed;
  • the feature descriptor acquisition unit is set to Image patches are input into the trained descriptor extraction network to obtain feature descriptors.
  • the descriptor extraction device further includes: a direction and angle obtaining unit, configured to obtain the direction and angle of the key point; image block.
  • the descriptor extraction device uses an end-to-end training method to train the image generation network, the feature extraction network and the descriptor extraction network.
  • a storage medium including a stored program, wherein when the program is run, a device where the storage medium is located is controlled to execute the image processing method described in any one of the above.
  • an electronic device comprising: a processor; and a memory configured to store executable instructions of the processor; wherein the processor is configured to execute the executable instructions by executing the instruction to execute the image processing method described in any one of the above.
  • the present disclosure by performing the following steps: collecting a first original image and a second original image, wherein the first original image is one of an original target image and a background image, and the second original image is the Another one of the original target image and the background image; performing local brightness alignment processing on the first original image to obtain a first processed image; based on the first processed image and the second original image, obtaining a removal
  • the target image of the background so that the background texture contained in the original image can be removed in various environments to obtain a clear target image, which solves the problem that the existing technology cannot obtain a clear target image by removing the background texture in different environments. technical issues.
  • FIG. 1 is a flowchart of an optional image processing method according to an embodiment of the present invention.
  • FIG. 2 is a flowchart of another optional image processing method according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of another optional image processing method according to an embodiment of the present invention.
  • FIG. 4 is a flowchart of another optional image processing method according to an embodiment of the present invention.
  • FIG. 5 is a flowchart of another optional image processing method according to an embodiment of the present invention.
  • FIG. 6 is a flowchart of an optional deep learning-based image processing method according to an embodiment of the present invention.
  • FIG. 7 is a flowchart of an optional descriptor extraction method according to an embodiment of the present invention.
  • FIG. 8 is a structural block diagram of an optional image processing apparatus according to an embodiment of the present invention.
  • FIG. 9 is a structural block diagram of another optional image processing apparatus according to an embodiment of the present invention.
  • FIG. 10 is a structural block diagram of another optional image processing apparatus according to an embodiment of the present invention.
  • FIG. 11 is a structural block diagram of another optional deep learning-based image processing apparatus according to an embodiment of the present invention.
  • FIG. 12 is a structural block diagram of yet another optional descriptor extraction apparatus according to an embodiment of the present invention.
  • the target images with the background removed in the original target image are respectively represented by the first result image, the second result image, the third result image, the first result image, and the third result image.
  • the fourth result image, the fifth result image, and the sixth result image are described.
  • FIG. 1 it is a flowchart of an optional image processing method according to an embodiment of the present invention. As shown in Figure 1, the image processing method includes the following steps:
  • S100 Collect a first original image and a second original image, where the first original image is one of the original target image and the background image, and the second original image is the other of the original target image and the background image.
  • the original target image refers to the target image collected when the target is pressed against the surface of the display screen of the electronic device
  • the background image refers to using a simulation with a reflectivity close to the target and a smooth surface
  • the texture image of the display screen itself is collected when the object presses on the display screen surface of the electronic device.
  • the target can be a finger
  • the simulant can be a skin color rubber block.
  • a method of multi-frame image fusion is also used to reduce noise signal, while keeping the signal intensity of the target image unchanged. For example, when the target completely presses the screen, multiple frames of target images are continuously collected, and then the overall or local weighted fusion of the multiple frames of target images is performed according to the overall or local quality of the multiple frames of target images to obtain the fused target. image as the original target image. Compared with collecting a single frame of target image as the original target image, the overall noise of the original target image obtained by the multi-frame image fusion method is smaller, which provides a better basis for the subsequent target image processing steps.
  • S102 Perform local luminance alignment processing on the first original image to obtain a first processed image.
  • step S102 includes:
  • the neighborhood window can be set according to the actual situation. For example, when the image processing method is specifically applied to processing fingerprint images, the 11*11 window range centered on each pixel point is selected as the neighborhood window;
  • S104 Obtain a first result image based on the first processed image and the second original image.
  • a subtraction operation may be performed on the first processed image and the second original image to obtain the first result image.
  • the first processed image is the original target image that has undergone local brightness alignment processing
  • the second original image is subtracted from the first processed image to get A first result image is obtained, where the first result image is a target image for background removal.
  • the first processed image is the background image that has undergone local brightness alignment processing
  • the second original image is subtracted from the first processed image, and the same can be achieved.
  • a first result image is obtained, which is also the target image for background removal.
  • the subtraction operation of the first processed image and the second original image means that the pixel value of each pixel of the first processed image is compared with the pixel value of each pixel of the second original image. Do subtraction.
  • the image processing method provided by the embodiment of the present invention can not only remove the main background texture, but also solve the problem of uneven local brightness between the background image and the original target image, so that the local brightness of the target image with the background removed is relatively uniform and Clear, when it is specifically applied to processing fingerprint images, a clear fingerprint image can be obtained without the background texture of the display screen.
  • FIG. 2 a flowchart of another optional image processing method according to an embodiment of the present invention is provided. As shown in Figure 2, the image processing method includes the following steps:
  • S200 Collect a first original image and a second original image, where the first original image is one of the original target image and the background image, and the second original image is the other of the original target image and the background image.
  • step S200 and S202 are the same as the steps S100 and S102 in the embodiment described in FIG. 1 .
  • the image processing method further includes step S204, performing an overall brightness alignment process on the first processed image to obtain a second processed image, and step S206 is based on the overall brightness Aligning the processed second processed image with the second original image to obtain a second resultant image.
  • step S204 includes:
  • S2042 respectively calculate the maximum pixel value rmax and the minimum pixel value rmin of the first processed image, and the maximum pixel value bmax and the minimum pixel value bmin of the second original image;
  • overall luminance alignment processing may also be performed on the second original image.
  • FIG. 3 a flowchart of another optional image processing method according to an embodiment of the present invention is provided. As shown in Figure 3, the image processing method includes the following steps:
  • S300 Collect a first original image and a second original image, where the first original image is one of the original target image and the background image, and the second original image is the other of the original target image and the background image.
  • S306 Obtain a third result image based on the first processed image and the third processed image.
  • step S304 includes:
  • S3042 respectively calculate the maximum pixel value rmax and the minimum pixel value rmin of the first processed image, and the maximum pixel value bmax and the minimum pixel value bmin of the second original image;
  • S3046 Perform linear transformation on the second original image based on the overall brightness scale coefficient ⁇ ' and the overall brightness offset coefficient ⁇ ' to obtain a third processed image whose overall brightness is aligned with the first processed image;
  • the local luminance alignment processing is performed first, and then the overall luminance alignment processing is performed.
  • the above sequence of steps is only an example rather than a strict limitation, and those skilled in the art can perform corresponding adjustments and transformations based on the principles of the above embodiments, for example, perform overall luminance alignment processing first and then perform local luminance alignment processing.
  • the image processing method may further include smoothing processing before the overall brightness alignment processing, for example, for the first original image and the second Perform smoothing processing on the original image; for another example, perform smoothing processing on the first processed image and the second original image, etc., those skilled in the art can make reasonable adjustments according to specific embodiments.
  • the smoothing process may be performed by means of mean value filtering, Gaussian filtering, or the like.
  • the background texture contained in the original target image may be quite different from the background image, that is, there is deformation of the background texture.
  • the external temperature changes greatly, the internal structure of the display screen will be different.
  • the image of the background texture in the original target image is significantly different from the background image; for example, when the target image is collected, the display screen is deformed to different degrees due to the different strength of the target pressing the display screen.
  • the distance from the imaging sensor also changes, which in turn causes the imaging changes of the background texture.
  • the background texture may not be removed by the above embodiment.
  • an image of the target object collected when the target object just touches the screen but does not fully press the display screen is used as the background image.
  • the screen lights up, but the target has not been fully pressed down, the target image signal in the imaging of the sensor is weak and the background texture is clear, so the target image collected at this moment can be approximated as the background image.
  • shape alignment processing can be performed before or after the local luminance alignment processing.
  • FIG. 4 a flowchart of yet another optional image processing method according to an embodiment of the present invention is provided. As shown in Figure 4, the image processing method includes the following steps:
  • S400 Collect a first original image and a second original image, where the first original image is one of the original target image and the background image, and the second original image is the other of the original target image and the background image.
  • S402 Perform local luminance alignment processing on the first original image to obtain a first processed image.
  • S404 Perform shape alignment processing on the first processed image to obtain a fourth processed image.
  • S406 Obtain a fourth result image based on the fourth processed image and the second original image.
  • step S400 and S402 are the same as the embodiment described in FIG. 1 , for details, reference may be made to the corresponding description in FIG. 1 , which will not be described in detail here.
  • step S404 performing shape alignment processing on the first processed image to obtain a fourth processed image
  • step S406 is based on the shape alignment process
  • the processed fourth processed image is combined with the second original image to obtain a fourth resultant image.
  • it before performing the shape alignment processing step, it may further include: judging whether the background image has deformation; optionally, judging whether the background image has deformation includes: judging the difference between the first processed image and the second original image.
  • the similarity of the images specifically, can be judged by, for example, a zero-mean normalized cross-correlation coefficient ZNCC (zero-mean normalized cross-correlation); when the similarity is less than the first threshold, it is judged that the background image is deformed.
  • step S404 includes:
  • S4042 Calculate the position offset of each pixel in the first processed image to the corresponding target pixel in the second original image; optionally, the Lucas-Kanade algorithm can be used to calculate;
  • S4044 Fit the displacement parameter ( ⁇ x, ⁇ y) and the scale parameter ⁇ of the first processed image relative to the second original image according to the position offset; optionally, the least squares method may be used for fitting;
  • S4046 Perform shape alignment processing on the first processed image according to the displacement parameters ( ⁇ x, ⁇ y) and the scale parameter ⁇ , to obtain a fourth processed image that is aligned with the shape of the second original image.
  • shape alignment processing may also be performed on the second original image.
  • FIG. 5 a flowchart of another optional image processing method according to an embodiment of the present invention is provided. As shown in Figure 5, the image processing method includes the following steps:
  • S500 Collect a first original image and a second original image, where the first original image is one of the original target image and the background image, and the second original image is the other of the original target image and the background image.
  • S502 Perform local luminance alignment processing on the first original image to obtain a first processed image.
  • S504 Perform shape alignment processing on the second original image to obtain a fifth processed image.
  • S506 Obtain a fifth result image based on the first processed image and the fifth processed image.
  • step S400 and S402 are the same as the embodiment described in FIG. 1 , for details, reference may be made to the corresponding description in FIG. 1 , which will not be described in detail here.
  • step S504 performing shape alignment processing on the second original image to obtain a fifth processed image
  • step S506 is the first processed image
  • a fifth result image is obtained based on the fifth processed image subjected to the shape alignment process.
  • step S504 includes:
  • S5042 Calculate the position offset of each pixel in the first processed image to the corresponding target pixel in the second original image; optionally, the Lucas-Kanade algorithm can be used to calculate;
  • S5044 Fit the displacement parameters ( ⁇ x', ⁇ y') and the scale parameter ⁇ ' between the second original image and the first processed image according to the position offset; optionally, the least squares method may be used for fitting;
  • S5046 Perform shape alignment processing on the second original image according to the displacement parameters ( ⁇ x', ⁇ y') and the scale parameter ⁇ ' to obtain a fifth processed image that is shape-aligned with the first processed image.
  • the local luminance alignment processing is performed first, and then the shape alignment processing is performed.
  • the above sequence of steps is only an example rather than a strict limitation, and those skilled in the art can perform corresponding adjustments and transformations based on the principles of the above embodiments, for example, perform shape alignment processing first and then perform local brightness alignment processing;
  • the order of the overall luminance alignment processing, the local luminance alignment processing and the shape alignment processing can have different arrangements. For example, the overall luminance alignment processing is performed first, and then the local luminance alignment processing is performed.
  • Alignment processing, and then shape alignment processing for another example, perform local brightness alignment processing first, then perform overall brightness alignment processing, and finally perform shape alignment processing; for another example, perform shape brightness alignment processing first, then perform overall brightness alignment processing, and finally Perform local luminance alignment processing and so on.
  • the step of collecting the first original image and the second original image may further include collecting candidate background images, that is, sampling multiple frames of the target from the time when the target first touches the screen to when the target completely presses the screen object image as candidate background image.
  • the image processing method further includes obtaining a result image after removing the candidate background based on the candidate background image and the first original image or the second original image subjected to at least partial brightness alignment processing; and, selecting FIG. 1-FIG. 5 The better one of the background-removed result image and the candidate background-removed result image obtained in the described embodiment is used as the background-removed target image.
  • the obtained background-removed target image may have uneven local quality.
  • the quality of the center area is better, while the quality of the edge area is poor. Therefore, the quality of the background-removed target image needs to be checked.
  • Enhancement to improve the quality of edge areas Compared with the central area, the poor quality of the edge area is mainly manifested in the low contrast of the fingerprint texture, which can be improved by local contrast enhancement, but the original noise will also be amplified at the same time, so it can be removed after the local contrast enhancement.
  • Noise processing, optionally, denoising methods include Fast Non-Local Means Denoising and 3D Block-matching and 3D filtering (BM3D). After local contrast enhancement and denoising, a clearer target image can be obtained.
  • the target image with the background removed can be obtained, the overall image is clear, the overall and local brightness is uniform, the noise is small, there is no obvious background texture residue, and it has good adaptability to changes in the external environment.
  • a clear fingerprint image can be obtained without the background texture of the display screen.
  • the fingerprint texture is clear, the brightness is uniform, and there is no obvious background texture residue, which can overcome the background deformation caused by changes in the external environment and finger pressing force. The impact brought by it does not have strict requirements on the timing of fingerprint collection, and has better adaptability.
  • FIG. 6 it is a flowchart of an optional deep learning-based image processing method according to an embodiment of the present invention. As shown in Figure 6, the image processing method includes the following steps:
  • S600 collect a third original image and a fourth original image; wherein, the third original image is one of the original target image and the background image, and the fourth original image is the other of the original target image and the background image;
  • the third original image refers to the target image collected when the target is pressed on the display screen surface of the electronic device
  • the background image refers to the use of a The texture image of the display screen itself collected when the simulant presses on the surface of the display screen of the electronic device.
  • the target can be a finger
  • the simulant can be a skin color rubber block.
  • the third original image and the fourth original image may be used as multi-channel input images
  • obtaining the input image according to the third original image and the fourth original image includes: performing a subtraction operation on the third original image and the fourth original image, and using the operation result as the input image; specifically , the fourth original image can be subtracted from the third original image, that is, the background-removed image can be obtained as the input image.
  • obtaining the input image according to the third original image and the fourth original image includes: performing local brightness alignment processing on the third original image and the fourth original image, and using the processing result as the input image; Specifically, the local luminance alignment process can be implemented according to step S102 as described in FIG. 1 .
  • S604 train the initial image generation network, and construct a trained image generation network; wherein, the image generation network is trained with a template image as a reference object, and the template image is the one described in the embodiment described in FIG. 1-FIG. 5 .
  • the background-removed target image obtained by the image processing method.
  • the image generation network is a U-net network.
  • the image generation network can include three parts, the first part includes two convolution modules, the second part includes four simple residual modules, and the third part includes two deconvolution modules, this structure can ensure that the image generation network The output image size is the same as the input image.
  • the initial image generation network is trained, and the construction of the trained image generation network includes:
  • S6042 Acquire the first sample image and the second sample image
  • S6044 Input the first sample image and the second sample image to the initial image generation network to obtain the first training image
  • S6046 Input the first training image and the template image into the first loss function module, train an initial image generation network according to the first loss value output by the first loss function module, and construct a trained image generation network.
  • the first loss function module may be an L2-LOSS function.
  • training the initial image generation network, and constructing the trained image generation network further includes:
  • S6048 Input the first training image and the template image to the feature extraction network to obtain the high-level semantic feature of the first training image and the high-level semantic feature of the template image;
  • the feature extraction network may select the VGG network.
  • S6050 Input the high-level semantic features of the first training image and the high-level semantic features of the template image into the second loss function module, and train the image generation network and/or the feature extraction network according to the second loss value output by the second loss function module.
  • the second loss function module may be an L2-LOSS function.
  • the final generated target image can be made closer to the template image.
  • the background texture in the third original image or the fourth original image can be removed by the method of deep learning in various environments, and the background texture of the third original image or the fourth original image can be removed. Quality has strict requirements.
  • FIG. 7 it is a flowchart of an optional descriptor extraction method according to an embodiment of the present invention. As shown in Figure 7, the descriptor extraction method includes the following steps:
  • the key points of the target image are determined using a SIFT algorithm.
  • an image block with a size of 32*32 may be cut out with a key point as the center.
  • the descriptor extraction network is trained according to the third loss value output by the third loss function module.
  • the third loss function can be implemented by various functions, for example, tiplet loss, N-pairs loss, histogram loss, contrastive loss, circle loss, etc.
  • the descriptor extraction method before the image block is input to the trained descriptor extraction network and the feature descriptor is obtained, the descriptor extraction method further includes: acquiring the direction and angle of the key point; Angle, rotate and flatten the image block to obtain aligned image blocks.
  • the image generation network and the feature extraction network can be trained separately, then the descriptor extraction network can be trained, and finally the image generation network, the feature extraction network and the descriptor extraction network can be trained using the end-to-end training method. Network, fine-tune the network parameters to obtain more robust feature descriptors.
  • an electronic device comprising: a processor; and a memory configured to store executable instructions of the processor; wherein the processor is configured to execute the above-mentioned execution of the executable instructions Any image processing method.
  • a storage medium is further provided, the storage medium includes a stored program, wherein when the program is run, a device where the storage medium is located is controlled to execute any one of the image processing methods described above.
  • an image processing apparatus is also provided.
  • FIG. 8 it is a structural block diagram of an optional image processing apparatus according to an embodiment of the present invention.
  • the image processing apparatus 80 includes an image acquisition unit 800 , a local brightness alignment unit 802 and a result acquisition unit 804 .
  • the image acquisition unit 800 is configured to acquire a first original image and a second original image, wherein the first original image is one of the original target image and the background image, and the second original image is the other of the original target image and the background image. A sort of.
  • the original target image refers to the target image collected when the target is pressed against the surface of the display screen of the electronic device
  • the background image refers to using a simulation with a reflectivity close to the target and a smooth surface
  • the texture image of the display screen itself is collected when the object presses on the display screen surface of the electronic device.
  • the target object may be a finger
  • the simulated object may be a skin color rubber block.
  • the image acquisition unit 800 since the distribution of the noise signal has a certain randomness, and the target image signal is relatively fixed, in order to improve the quality of the target image, the image acquisition unit 800 also adopts multi-frame image fusion.
  • the method reduces the noise signal while keeping the signal intensity of the target image unchanged. For example, when the target completely presses the screen, multiple frames of target images are continuously collected, and then the overall or local weighted fusion of the multiple frames of target images is performed according to the overall or local quality of the multiple frames of target images to obtain the fused target. image as the original target image. Compared with collecting a single frame of target image as the original target image, the overall noise of the original target image obtained by the multi-frame image fusion method is smaller, which provides a better basis for the subsequent target image processing steps.
  • the local luminance alignment unit 802 is configured to perform local luminance alignment processing on the first original image to obtain a first processed image.
  • the local luminance alignment unit 802 includes:
  • the first pixel value calculation unit 8022 is configured to calculate the pixel value r of each pixel in the first original image and the pixel average value of all pixels in the neighborhood window of each pixel and the pixel value b of each pixel in the second original image and the pixel average value of all pixels in the neighborhood window of each pixel Among them, the neighborhood window can be set according to the actual situation. For example, when the image processing method should be specifically set to process the fingerprint image, the 11*11 window range centered on each pixel point is selected as the neighborhood window;
  • the first processed image obtaining unit 8024 is set to the pixel value r of each pixel in the first original image and the pixel average value of all pixels in the neighborhood window of each pixel and the pixel average of all pixels within the neighborhood window of each pixel in the second original image Obtain the first processed image aligned with the local brightness of the second original image, wherein the pixel value r1 of each pixel in the first processed image can be obtained according to formula 1, formula 1:
  • the result obtaining unit 804 is configured to obtain a first result image based on the first processed image and the second original image.
  • the result obtaining unit 804 may perform a subtraction operation on the first processed image and the second original image to obtain the first result image.
  • the first processed image is the original target image subjected to local luminance alignment processing
  • the result obtaining unit 804 subtracts the second original image from the first processed image image
  • the first result image can be obtained, and the first result image is the target image for background removal.
  • the first processed image is the background image that has undergone local luminance alignment processing
  • the result obtaining unit 804 subtracts the first processed image from the second original image. image, the first result image can also be obtained, and the first result image is also the target image for background removal.
  • the subtraction operation of the first processed image and the second original image means that the pixel value of each pixel of the first processed image is compared with the pixel value of each pixel of the second original image. Do subtraction.
  • the image processing device provided according to the embodiment of the present invention can not only remove the main background texture, but also solve the problem of uneven local brightness between the background image and the original target image, so that the local brightness of the background-removed target image is relatively uniform and Clear, when it should be set to process fingerprint images, a clear fingerprint image can be obtained without the background texture of the display screen.
  • FIG. 9 a structural block diagram of another optional image processing apparatus according to an embodiment of the present invention is provided.
  • the image processing apparatus 90 includes:
  • the image acquisition unit 900 is configured to acquire a first original image and a second original image, wherein the first original image is one of the original target image and the background image, and the second original image is the other of the original target image and the background image. A sort of.
  • the local brightness alignment unit 902 is configured to perform local brightness alignment processing on the first original image to obtain a first processed image.
  • the overall brightness alignment unit 904 is configured to perform overall brightness alignment processing on the first processed image to obtain a second processed image.
  • Result obtaining unit 906 Obtain a second result image based on the second processed image and the second original image.
  • the image acquisition unit 900 and the local brightness alignment unit 902 are the same as the image acquisition unit 800 and the local brightness alignment unit 802 in the embodiment described in FIG. 8 .
  • the image processing apparatus 90 further includes an overall brightness alignment unit 904, which is configured to perform overall brightness alignment processing on the first processed image, obtain a second processed image, and obtain the result
  • the unit 906 is to obtain a second result image based on the second processed image and the second original image subjected to the overall luminance alignment process.
  • the overall luminance alignment unit 904 includes:
  • the second pixel value calculation unit 9042 is configured to calculate the maximum pixel value rmax and the minimum pixel value rmin of the first processed image, and the maximum pixel value bmax and the minimum pixel value bmin of the second original image;
  • the overall brightness coefficient calculation unit 9044 is set to obtain the relative value of the first processed image relative to the second original image according to the maximum pixel value rmax and the minimum pixel value rmin of the first processed image, and the maximum pixel value bmax and the minimum pixel value bmin of the second original image.
  • the linear transformation unit 9046 is configured to perform linear transformation on the first processed image based on the overall brightness scale coefficient ⁇ and the overall brightness offset coefficient ⁇ to obtain a second processed image aligned with the overall brightness of the second original image; wherein, the second processed image
  • the overall brightness alignment process may also be performed on the second original image.
  • the image processing apparatus 90 includes an image acquisition unit 900, a local brightness alignment unit 902, an overall brightness alignment unit 904' and The result acquisition unit 906'.
  • the image acquisition unit 900 and the local brightness alignment unit 902 are the same as the image acquisition unit 800 and the local brightness alignment unit 802 in the embodiment described in FIG. 8 .
  • the overall brightness alignment unit 904' is set to perform overall brightness alignment processing on the second original image to obtain a third processed image; the result acquisition unit 906' is set to Based on the first processed image and the third processed image, a third resultant image is obtained.
  • the overall luminance alignment unit 904' includes:
  • the second pixel value calculation unit 9042 is configured to calculate the maximum pixel value rmax and the minimum pixel value rmin of the first processed image, and the maximum pixel value bmax and the minimum pixel value bmin of the second original image;
  • the overall brightness coefficient calculation unit 9044' is set to obtain the second original image relative to the first according to the maximum pixel value rmax and the minimum pixel value rmin of the first processed image, and the maximum pixel value bmax and the minimum pixel value bmin of the second original image.
  • the linear transformation unit 9046' is set to perform linear transformation on the second original image based on the overall brightness scale coefficient ⁇ ' and the overall brightness offset coefficient ⁇ ' to obtain a third processed image aligned with the overall brightness of the first processed image;
  • the local luminance alignment processing is performed first, and then the overall luminance alignment processing is performed.
  • the above sequence of steps is only an example rather than a strict limitation, and those skilled in the art can perform corresponding adjustments and transformations based on the principles of the above embodiments, for example, perform overall luminance alignment processing first and then perform local luminance alignment processing.
  • the image processing apparatus may further include a smoothing processing unit, which is set to perform smoothing processing before the overall brightness alignment processing, for example, for the first Perform smoothing processing on an original image and a second original image; for another example, perform smoothing processing on the first processed image and the second original image, etc., those skilled in the art can make reasonable adjustments according to specific embodiments.
  • the smoothing processing unit may perform smoothing processing by means of mean filtering, Gaussian filtering, or the like.
  • the background texture contained in the original target image may be quite different from the background image, that is, there is deformation of the background texture.
  • the external temperature changes greatly, the internal structure of the display screen will be different.
  • the image of the background texture in the original target image is significantly different from the background image; for example, when the target image is collected, the display screen is deformed to different degrees due to the different strength of the target pressing the display screen.
  • the distance from the imaging sensor also changes, which in turn causes the imaging changes of the background texture.
  • the background texture may not be removed by the above embodiment.
  • an image of the target object collected when the target object just touches the screen but does not fully press the display screen is used as the background image.
  • the screen lights up, but the target has not been fully pressed down, the target image signal in the imaging of the sensor is weak and the background texture is clear, so the target image collected at this moment can be approximated as the background image.
  • FIG. 10 a structural block diagram of another optional image processing apparatus according to an embodiment of the present invention is provided. As shown in FIG. 10 , the image processing apparatus 100 includes the following steps:
  • the image acquisition unit 1000 is configured to acquire a first original image and a second original image, wherein the first original image is one of the original target image and the background image, and the second original image is the other of the original target image and the background image. A sort of.
  • the local luminance alignment unit 1002 is configured to perform local luminance alignment processing on the first original image to obtain a first processed image.
  • the shape alignment unit 1004 is configured to perform shape alignment processing on the first processed image to obtain a fourth processed image.
  • Result obtaining unit 1006 Obtain a fourth result image based on the fourth processed image and the second original image.
  • the above image acquisition unit 1000 and the local brightness alignment unit 1002 are the same as the embodiment described in FIG. 8 .
  • the image processing apparatus 100 further includes a shape alignment unit 1004 configured to perform shape alignment processing on the first processed image to obtain a fourth processed image, and a result acquisition unit 1006 A fourth result image is obtained based on the fourth processed image and the second original image subjected to the shape alignment process.
  • the image processing apparatus 100 further includes a deformation determination unit, configured to determine whether the background image has deformation before the shape alignment unit 1004 performs the shape alignment processing step; optionally, determine whether the background image is deformed
  • a deformation determination unit configured to determine whether the background image has deformation before the shape alignment unit 1004 performs the shape alignment processing step; optionally, determine whether the background image is deformed
  • Existing deformation includes: judging the similarity between the first processed image and the second original image. Specifically, for example, a zero-mean normalized cross-correlation coefficient ZNCC (zero-mean normalized cross-correlation) can be used to judge; when the similarity is less than the first When the threshold is set, it is judged that the background image is deformed.
  • ZNCC zero-mean normalized cross-correlation
  • the shape alignment unit 1004 includes:
  • the position calculation unit 10042 is configured to calculate the position offset of each pixel in the first processed image to the corresponding target pixel in the second original image; optionally, the Lucas-Kanade algorithm can be used to calculate;
  • the fitting unit 10044 is configured to fit a displacement parameter ( ⁇ x, ⁇ y) and a scale parameter ⁇ of the first processed image relative to the second original image according to the position offset; optionally, the least squares method can be used for fitting;
  • the alignment unit 10046 is configured to perform shape alignment processing on the first processed image according to the displacement parameters ( ⁇ x, ⁇ y) and the scale parameter ⁇ , to obtain a fourth processed image that is aligned with the shape of the second original image.
  • shape alignment processing may also be performed on the second original image.
  • the image processing apparatus 100 includes an image acquisition unit 1000, a local brightness alignment unit 1002, a shape alignment unit 1004' and a result acquisition unit unit 1006'.
  • the image acquisition unit 1000 and the local brightness alignment unit 1002 are the same as the image acquisition unit 800 and the local brightness alignment unit 802 in the embodiment described in FIG. 8 .
  • FIG. 8 For details, please refer to the corresponding description in FIG. 8 , which will not be described in detail here.
  • the shape aligning unit 1004' is set to perform shape alignment processing on the second original image to obtain the fifth processed image; the result obtaining unit 1006' is set to be based on the first The processed image and the fifth processed image are obtained to obtain a fifth result image.
  • the shape alignment unit 1004' includes:
  • the position calculation unit 10042 is configured to calculate the position offset of each pixel in the first processed image to the corresponding target pixel in the second original image; optionally, the Lucas-Kanade algorithm can be used to calculate;
  • the fitting unit 10044' is configured to fit the displacement parameter ( ⁇ x', ⁇ y') and the scale parameter ⁇ ' between the second original image and the first processed image according to the position offset; multiplicative fit;
  • the alignment unit 10046' is configured to perform shape alignment processing on the second original image according to the displacement parameters ( ⁇ x', ⁇ y') and the scale parameter ⁇ ' to obtain a fifth processed image that is shape aligned with the first processed image.
  • the local luminance alignment processing is performed first, and then the shape alignment processing is performed.
  • the above sequence of steps is only an example rather than a strict limitation, and those skilled in the art can perform corresponding adjustments and transformations based on the principles of the above embodiments, for example, perform shape alignment processing first and then perform local brightness alignment processing;
  • the order of the overall luminance alignment processing, the local luminance alignment processing and the shape alignment processing can have different arrangements. For example, the overall luminance alignment processing is performed first, and then the local luminance alignment processing is performed.
  • Alignment processing, and then shape alignment processing for another example, perform local brightness alignment processing first, then perform overall brightness alignment processing, and finally perform shape alignment processing; for another example, perform shape brightness alignment processing first, then perform overall brightness alignment processing, and finally Perform local luminance alignment processing and so on.
  • the image acquisition unit may further include acquiring candidate background images, that is, sampling multiple frames of target object images as candidate background images during the period from when the target object just touches the screen to when the target object completely presses the screen.
  • the image processing device also includes obtaining a result image after removing the candidate background based on the candidate background image and the first original image or the second original image subjected to at least partial brightness alignment processing; and, select Figure 8- Figure 10 The better one of the background-removed result image and the candidate background-removed result image obtained in the described embodiment is used as the background-removed target image.
  • the obtained background-removed target image may have uneven local quality.
  • the quality of the center area is better, while the quality of the edge area is poor. Therefore, the quality of the background-removed target image needs to be checked. Enhancement to improve the quality of edge areas. Relative to the central area, the poor quality of the edge area is mainly manifested in the low contrast of fingerprint patterns.
  • the image processing device may include a local contrast enhancement unit set to improve the local contrast, but the original noise will also be amplified at the same time, so , the image processing device may further include a denoising unit, configured to perform denoising processing after local contrast enhancement, optionally, fast non-local mean denoising (Fast Non-Local Means Denoising) and three-dimensional block matching filter BM3D (Block-matching and 3D filtering) and other denoising methods. After local contrast enhancement and denoising, a clearer target image can be obtained.
  • a denoising unit configured to perform denoising processing after local contrast enhancement, optionally, fast non-local mean denoising (Fast Non-Local Means Denoising) and three-dimensional block matching filter BM3D (Block-matching and 3D filtering) and other denoising methods.
  • the target image with background removed can be obtained, the overall image is clear, the overall and local brightness is uniform, the noise is small, there is no obvious background texture residue, and it has good adaptability to changes in the external environment.
  • the above-mentioned image processing device is specifically set to process the fingerprint image, it can obtain a clear fingerprint image with the background texture of the display screen removed, the fingerprint texture is clear, the brightness is uniform, and there is no obvious background texture residue, which can overcome the external environment changes and finger pressing.
  • the influence of the background deformation caused by the strength does not have strict requirements on the timing of fingerprint collection, and it has good adaptability.
  • FIG. 11 it is a structural block diagram of an optional deep learning-based image processing apparatus according to an embodiment of the present invention. As shown in FIG. 11 , the image processing apparatus 110 includes:
  • the image acquisition unit 1100 is configured to acquire a third original image and a fourth original image; wherein the third original image is one of the original target image and the background image, and the fourth original image is the other of the original target image and the background image.
  • the third original image refers to the target image collected when the target is pressed on the display screen surface of the electronic device
  • the background image refers to the use of a The texture image of the display screen itself collected when the simulant presses on the surface of the display screen of the electronic device.
  • the target object can be a finger
  • the simulated object can be a skin color rubber block.
  • the input image obtaining unit 1102 obtains the input image according to the third original image and the fourth original image;
  • the input image acquisition unit 1102 may use the third original image and the fourth original image as multi-channel input images;
  • the input image obtaining unit 1102 is configured to perform a subtraction operation on the third original image and the fourth original image, and use the operation result as the input image; specifically, the third original image may be subtracted from the fourth original image. Go to the fourth original image, that is, obtain the image with the background removed as the input image.
  • the input image acquisition unit 1102 is configured to perform local luminance alignment processing on the third original image and the fourth original image, and use the processing result as the input image; specifically, the local luminance alignment processing may be It is implemented according to step S104 as described in FIG. 1 .
  • the network construction unit 1104 is configured to train the initial image generation network, and construct the trained image generation network; wherein, the image generation network is trained with a template image as a reference object, and the template image is described in FIG. 1-FIG. 5 The background-removed target image obtained by the image processing method described in the embodiment.
  • the image generation network is a U-net network.
  • the image generation network can include three parts, the first part includes two convolution modules, the second part includes four simple residual modules, and the third part includes two deconvolution modules, this structure can ensure that the image generation network The output image size is the same as the input image.
  • the network construction unit 1104 includes:
  • the sample acquisition unit 11042 is configured to acquire the first sample image and the second sample image
  • the training image acquisition unit 11044 is configured to input the first sample image and the second sample image into the initial image generation network to obtain the first training image;
  • the first training unit 11046 is configured to input the first training image and the template image into the first loss function module, train the initial image generation network according to the first loss value output by the first loss function module, and construct the trained image generation network .
  • the first loss function module may be an L2-LOSS function.
  • the network construction unit 1104 further includes:
  • the feature extraction unit 11048 is configured to input the first training image and the template image to the feature extraction network, and obtain high-level semantic features of the first training image and high-level semantic features of the template image.
  • the feature extraction network may select the VGG network.
  • the second training unit 11050 is configured to input the high-level semantic features of the first training image and the high-level semantic features of the template image into the second loss function module, and train the image generation network and/or the second loss value output according to the second loss function module. or feature extraction network.
  • the second loss function module may be an L2-LOSS function.
  • the final generated target image can be made closer to the template image.
  • the result obtaining unit 1106 is configured to input the input image into the trained image generation network to obtain a sixth result image.
  • the background texture in the third original image or the fourth original image can be removed by the deep learning method in various environments, and there is no strict requirement on the quality of the third original image or the fourth original image.
  • FIG. 12 it is a structural block diagram of an optional descriptor extraction apparatus according to an embodiment of the present invention. As shown in FIG. 12 , the descriptor extraction device 120 includes:
  • the key point obtaining unit 1200 is set to obtain the key points of the target image, wherein the target image is the target image with the background removed obtained by using the image processing method described in the embodiment described in FIG. 1 to FIG. 6 ;
  • the key points of the target image are determined using a SIFT algorithm.
  • Classification unit 1202 classifies multiple target images with the same key point into the same category, and labels the category information as an image label;
  • Screenshot unit 1204 intercepts image blocks in multiple target images with image labels representing the same category;
  • an image block of size 32*32 may be cut out with a key point as the center.
  • the descriptor extraction network construction unit 1206 is set to train the initial descriptor extraction network, and constructs the trained descriptor extraction network
  • the descriptor extraction network is trained according to the third loss value output by the third loss function module.
  • the third loss function can be implemented by various functions, for example, tiplet loss, N-pairs loss, histogram loss, contrastive loss, circle loss, etc.
  • the feature descriptor obtaining unit 1208 inputs the image block into the trained descriptor extraction network to obtain feature descriptors.
  • the apparatus 120 further includes: an orientation and angle acquiring unit, configured to acquire the orientation and angle of the key points; and a rotation and leveling unit, set to rotate and level the image blocks according to the orientation and angle of the key points to obtain aligned image blocks.
  • the image generation network and the feature extraction network can be trained separately, then the descriptor extraction network can be trained, and finally the image generation network, the feature extraction network and the descriptor extraction network can be trained using the end-to-end training method. Network, fine-tune the network parameters to obtain more robust feature descriptors.
  • the disclosed technical content can be implemented in other ways.
  • the device embodiments described above are only illustrative, for example, the division of the units may be a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components may be combined or Integration into another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of units or modules, and may be in electrical or other forms.
  • the units described as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium.
  • the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
  • the aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes .
  • the solutions provided by the embodiments of the present application can achieve the target image with the background removed, the overall image is clear, the overall and local brightness is uniform, the noise is small, there is no obvious background texture residue, and it has good adaptability to changes in the external environment.
  • the technical solutions provided in the application embodiments can be applied to electronic devices with at least one image processing unit, for example, applicable to various mobile platforms, vehicle-mounted chips, embedded chips, etc.
  • the fingerprint image with the background texture of the display screen is clearly removed.
  • the fingerprint texture is clear, the brightness is uniform, and there is no obvious background texture residue. It can overcome the influence of the background deformation caused by the change of the external environment and the pressure of the finger. There are no strict requirements, and it has good adaptability.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

本发明公开了一种图像处理方法、描述子提取方法及其装置、电子设备。其中,该图像处理方法,包括:采集第一原始图像和第二原始图像,其中,所述第一原始图像是原始目标图像和背景图像中的一种,所述第二原始图像是所述原始目标图像和所述背景图像中的另一种;对所述第一原始图像进行局部亮度对齐处理,获得第一处理图像;基于所述第一处理图像与所述第二原始图像,获得去除背景的目标图像。

Description

图像处理方法、描述子提取方法及其装置、电子设备
本申请要求于2020年12月17日提交中国专利局、申请号为202011502579.3、申请名称“图像处理方法、描述子提取方法及其装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及图像处理技术,具体而言,涉及一种图像处理方法、描述子提取方法及其装置、电子设备。
背景技术
随着电子技术和通信技术的发展,电子图像的使用范围越来越广,但电子图像中往往会存在用户不希望出现的背景内容。例如,在屏下光学指纹识别领域,传感器位于屏幕特定区域的下方,当用户手指按压到该区域时,手机屏幕点亮,传感器接收到来自用户手指表面的反光,形成指纹图像。由于传感器与手指之间隔着显示屏,因此成像结果中不仅包含指纹信息,还包含显示屏自身的纹理信息(即背景纹理),而且背景纹理通常比指纹信息更明显。为了得到准确的指纹识别结果,我们需要将背景纹理去除,得到清晰的指纹图像。
因此,能够在各种环境下都将电子图像中包含的背景纹理去除,得到清晰的去除背景图像的图像处理技术也变得日益重要。
发明内容
本公开提供了一种图像处理方法、描述子提取方法及其装置、电子设备,以至少解决了现有技术中在不同环境下无法通过去除背景纹理获得清晰的目标图像的技术问题。
根据公开的一个方面,提供了一种图像处理方法,包括:采集第一原始图像和第二原始图像,其中,第一原始图像是原始目标图像和背景图像中的一种,第二原始图像是原始目标图像和背景图像中的另一种;对第一原始图像进行局部亮度对齐处理,获得第一处理图像;基于第一处理图像与第二原始图像,获得去除背景的目标图像。
可选地,原始目标图像是目标物按压在电子设备的显示屏表面时采集到的目标物图像,背景图像是使用一个与目标物反射率接近且表面光滑的模拟物按压在电子设备 的显示屏表面时采集到的显示屏自身的纹理图像。
可选地,目标物为手指,模拟物是肤色橡胶块。
可选地,图像处理方法在目标物完全按压屏幕时,连续采集多帧目标物图像,根据多帧目标物图像的整体质量或局部质量对多帧目标物图像进行整体或局部的加权融合,得到融合后的目标图像作为原始目标图像。
可选地,对第一原始图像进行局部亮度对齐处理,获得第一处理图像包括:分别计算第一原始图像中每个像素点的像素值和每个像素点邻域窗口内的所有像素点的像素平均值,以及第二原始图像中每个像素点的像素值和每个像素点邻域窗口内的所有像素点的像素平均值;根据第一原始图像中每个像素点的像素值和每个像素点邻域窗口内的所有像素点的像素平均值,以及第二原始图像中每个像素点的像素值和每个像素点邻域窗口内的所有像素点的像素平均值,获得与第二原始图像局部亮度对齐的第一处理图像。
可选地,基于第一处理图像与第二原始图像,获得第一结果图像包括:对第一处理图像和第二原始图像做减法运算,获得第一结果图像。
可选地,图像处理方法还包括在局部亮度对齐处理之前或之后进行整体亮度对齐处理。
可选地,在对第一原始图像进行局部亮度对齐处理,获得第一处理图像之后,对第一处理图像进行整体亮度对齐处理,获得第二处理图像;其中,对第一处理图像进行整体亮度对齐处理,获得第二处理图像包括:分别计算第一处理图像的最大像素值和最小像素值,以及第二原始图像的最大像素值和最小像素值;根据第一处理图像的最大像素值和最小像素值,以及第二原始图像的最大像素值和最小像素值,获取第一处理图像相对第二原始图像的整体亮度尺度系数和整体亮度偏移系数;基于整体亮度尺度系数和整体亮度偏移系数对第一处理图像进行线性变换,得到与第二原始图像整体亮度对齐的第二处理图像。
可选地,对第二原始图像进行整体亮度对齐处理,获得第三处理图像,包括:分别计算第一处理图像的最大像素值和最小像素值,以及第二原始图像的最大像素值和最小像素值;根据第一处理图像的最大像素值和最小像素值,以及第二原始图像的最大像素值和最小像素值,获取第二原始图像相对第一处理图像的整体亮度尺度系数和整体亮度偏移系数;基于整体亮度尺度系数和所述整体亮度偏移系数对第二原始图像进行线性变换,得到与第一处理图像整体亮度对齐的第三处理图像。
可选地,图像处理方法还包括,在整体亮度对齐之前进行平滑处理。
可选地,平滑处理包括以下至少一项:均值滤波、高斯滤波。
可选地,图像处理方法还包括:将目标物刚接触屏幕但未完全按压显示屏时采集到的目标物图像作为背景图像。
可选地,图像处理方法还包括:在局部亮度对齐处理之前或之后进行形状对齐处理。
可选地,在对第一原始图像进行局部亮度对齐处理,获得第一处理图像之后,对第一处理图像进行形状对齐处理,获得第四处理图像;其中,第一处理图像进行形状对齐处理,获得第四处理图像包括:计算第一处理图像中每个像素点到第二原始图像中对应目标像素点的位置偏移;根据位置偏移拟合出第一处理图像相对第二原始图像的位移参数和尺度参数;根据位移参数和尺度参数对第一处理图像进行形状对齐处理,获得与第二原始图像形状对齐的第四处理图像。
可选地,对第二原始图像进行形状对齐处理,获得第五处理图像,包括:计算第一处理图像中每个像素点到第二原始图像中对应目标像素点的位置偏移;根据位置偏移拟合出第二原始图像相对第一处理图像的位移参数和尺度参数;根据位移参数和尺度参数对第二原始图像进行形状对齐处理,获得与第一处理图像形状对齐的第五处理图像。
可选地,图像处理方法还包括:对去除背景的目标图像进行以下至少一项处理:局部对比度增强、快速非局部均值去噪、三维块匹配滤波。
可选地,图像处理方法还包括:在进行形状对齐处理之前,判断背景图像是否存在形变。
可选地,图像处理方法还包括:采集候选背景图像,其中,候选背景图像为自目标物刚接触屏幕至目标物完全按压屏幕期间采样的多帧目标物图像。
可选地,图像处理方法还包括:基于候选背景图像和经过局部亮度对齐处理的第一原始图像或第二原始图像,获得去除候选背景后的结果图像。
可选地,图像处理方法还包括:将去除背景后的结果图像和去除候选背景后的结果图像中较好的一个作为去除背景的目标图像。
根据本公开的另一个方面,提供了一种图像处理方法,包括:采集第三原始图像和第四原始图像,其中,第三原始图像是原始目标图像和背景图像中的一种,第四原 始图像是原始目标图像和背景图像中的另一种;根据第三原始图像和第四原始图像,获得输入图像;对初始的图像生成网络进行训练,构建经过训练的图像生成网络;其中,图像生成网络以模板图像为参考对象进行训练,模板图像为使用上述任一项图像处理方法获得的去除背景的目标图像;将输入图像输入至经过训练的图像生成网络,获得去除背景的目标图像。
可选地,根据第三原始图像和第四原始图像,获得输入图像包括:对第三原始图像和第四原始图像进行局部亮度对齐处理,将处理结果作为输入图像。
可选地,对初始的图像生成网络进行训练,构建经过训练的图像生成网络包括:获取第一样本图像和第二样本图像;将第一样本图像和所述第二样本图像输入至初始的图像生成网络,获得第一训练图像;将第一训练图像和模板图像输入至第一损失函数模块,根据第一损失函数模块输出的第一损失值训练初始的图像生成网络,构建经过训练的图像生成网络。
可选地,对初始的图像生成网络进行训练,构建经过训练的图像生成网络还包括:将第一训练图像和模板图像输入至特征提取网络,获得第一训练图像的高层语义特征和模板图像的高层语义特征;将第一训练图像的高层语义特征和模板图像的高层语义特征输入至第二损失函数模块,根据第二损失函数模块输出的第二损失值训练图像生成网络和/或所述特征提取网络。
根据本公开的另一个方面,提供了一种描述子提取方法,包括:获取目标图像的关键点,其中,所述目标图像为使用上述任一项图像处理方法获得的去除背景的目标图像;将具有相同关键点的多张目标图像归为同一个类别,标注类别信息作为图像标签;以关键点为中心,在具有表示同一个类别的图像标签的多张目标图像中截取图像块;对初始的描述子提取网络进行训练,构建经过训练的描述子提取网络;将图像块输入经过训练的描述子提取网络,获得特征描述子。
可选地,在将图像块输入经过训练的描述子提取网络,获得特征描述子之前,描述子提取方法还包括:获取关键点的方向和角度;根据关键点的方向和角度,对图像块进行旋转拉平,获得对齐的图像块。
可选地,描述子提取方法使用端到端训练的方法训练图像生成网络、特征提取网络和描述子提取网络。
根据本公开的另一个方面,提供了一种图像处理装置,包括:图像采集单元,设置为采集第一原始图像和第二原始图像,其中,所述第一原始图像是原始目标图像和背景图像中的一种,所述第二原始图像是所述原始目标图像和所述背景图像中的另一 种;局部亮度对齐单元,设置为对所述第一原始图像进行局部亮度对齐处理,获得第一处理图像;结果获取单元,设置为基于所述第一处理图像与所述第二原始图像,获得第一结果图像。
可选地,局部亮度对齐单元包括:第一像素值计算单元,设置为分别计算第一原始图像中每个像素点的像素值和每个像素点邻域窗口内的所有像素点的像素平均值,以及第二原始图像中每个像素点的像素值和每个像素点邻域窗口内的所有像素点的像素平均值;第一处理图像获得单元,设置为根据第一原始图像中每个像素点的像素值和每个像素点邻域窗口内的所有像素点的像素平均值,以及第二原始图像中每个像素点的像素值和每个像素点邻域窗口内的所有像素点的像素平均值,获得与第二原始图像局部亮度对齐的第一处理图像。
可选地,结果获取单元,通过对第一处理图像和第二原始图像做减法运算,获得第一结果图像。
可选地,图像处理装置还包括整体亮度对齐单元,设置为在局部亮度对齐处理之前或之后进行整体亮度对齐处理。
可选地,整体亮度对齐单元包括:第二像素值计算单元,设置为分别计算第一处理图像的最大像素值和最小像素值,以及第二原始图像的最大像素值和最小像素值;整体亮度系数计算单元,根据第一处理图像的最大像素值和最小像素值,以及第二原始图像的最大像素值和最小像素值,获取第一处理图像相对所述第二原始图像的整体亮度尺度系数和整体亮度偏移系数;线性变换单元,基于整体亮度尺度系数和整体亮度偏移系数对第一处理图像进行线性变换,得到与第二原始图像整体亮度对齐的第二处理图像。
可选地,整体亮度对齐单元包括:第二像素值计算单元,设置为分别计算第一处理图像的最大像素值和最小像素值,以及第二原始图像的最大像素值和最小像素值;整体亮度系数计算单元,根据第一处理图像的最大像素值和最小像素值,以及第二原始图像的最大像素值和最小像素值,获取第二原始图像相对第一处理图像的整体亮度尺度系数和整体亮度偏移系数;线性变换单元,基于整体亮度尺度系数和整体亮度偏移系数对第二原始图像进行线性变换,得到与第一处理图像整体亮度对齐的第三处理图像。
可选地,图像处理装置还包括平滑处理单元,设置为在整体亮度对齐之前进行平滑处理。
可选地,图像处理装置还包括形状对齐单元,设置为在局部亮度对齐处理之前或 之后进行形状对齐处理。
可选地,形状对齐单元包括:位置计算单元,设置为计算第一处理图像中每个像素点到第二原始图像中对应目标像素点的位置偏移;拟合单元,设置为根据位置偏移拟合出第一处理图像相对第二原始图像的位移参数和尺度参数;对齐单元,设置为根据位移参数和尺度参数对第一处理图像进行形状对齐处理,获得与第二原始图像形状对齐的第四处理图像。
可选地,形状对齐单元包括:位置计算单元,设置为计算第一处理图像中每个像素点到第二原始图像中对应目标像素点的位置偏移;拟合单元,设置为根据位置偏移拟合出第二原始图像相对第一处理图像的位移参数和尺度参数;对齐单元,设置为根据位移参数和尺度参数对第二原始图像进行形状对齐处理,获得与第一处理图像形状对齐的第五处理图像。
根据本公开的另一个方面,提供了一种图像处理装置,包括:图像采集单元,采集第三原始图像和第四原始图像,其中,第三原始图像是原始目标图像和背景图像中的一种,第四原始图像是原始目标图像和背景图像中的另一种;输入图像获取单元,根据第三原始图像和第四原始图像,获得输入图像;网络构建单元,对初始的图像生成网络进行训练,构建经过训练的图像生成网络;其中,图像生成网络以模板图像为参考对象进行训练,模板图像为使用上述任一项图像处理方法获得的去除背景的目标图像;结果获取单元,将输入图像输入至经过训练的图像生成网络,获得去除背景的目标图像。
可选地,输入图像获取单元,设置为对第三原始图像和第四原始图像进行局部亮度对齐处理,将处理结果作为所述输入图像。
可选地,网络构建单元包括:样本获取单元,设置为获取第一样本图像和第二样本图像;训练图像获取单元,设置为将第一样本图像和第二样本图像输入至初始的图像生成网络,获得第一训练图像;第一训练单元,设置为将第一训练图像和模板图像输入至第一损失函数模块,根据第一损失函数模块输出的第一损失值训练初始的图像生成网络,构建所述经过训练的图像生成网络。
可选地,网络构建单元还包括:特征提取单元,设置为将第一训练图像和模板图像输入至特征提取网络,获得第一训练图像的高层语义特征和模板图像的高层语义特征;第二训练单元,设置为将第一训练图像的高层语义特征和模板图像的高层语义特征输入至第二损失函数模块,根据第二损失函数模块输出的第二损失值训练图像生成网络和/或特征提取网络。
根据本公开的另一个方面,提供了一种描述子提取装置,包括:关键点获取单元,设置为获取目标图像的关键点,其中,目标图像为使用上述任一项图像处理方法获得的去除背景的目标图像;归类单元,设置为将具有相同关键点的多张目标图像归为同一个类别,标注类别信息作为图像标签;截图单元,设置为以关键点为中心,在具有表示同一个类别的图像标签的多张目标图像中截取图像块;描述子提取网络构建单元,设置为对初始的描述子提取网络进行训练,构建经过训练的描述子提取网络;特征描述子获取单元,设置为将图像块输入经过训练的描述子提取网络,获得特征描述子。
可选地,描述子提取装置还包括:方向角度获取单元,设置为获取关键点的方向和角度;旋转拉平单元,设置为根据关键点的方向和角度,对图像块进行旋转拉平,获得对齐的图像块。
可选地,描述子提取装置,使用端到端训练的方法训练图像生成网络、特征提取网络和描述子提取网络。
根据本公开的另一方面,还提供了一种存储介质,包括存储的程序,其中,在所述程序运行时控制所述存储介质所在设备执行上述任意一项所述的图像处理方法。
根据本公开的另一方面,还提供了一种电子设备,包括:处理器;以及存储器,设置为存储所述处理器的可执行指令;其中,所述处理器配置为经由执行所述可执行指令来执行上述任意一项所述的图像处理方法。
在本公开中,通过执行以下步骤:采集第一原始图像和第二原始图像,其中,所述第一原始图像是原始目标图像和背景图像中的一种,所述第二原始图像是所述原始目标图像和所述背景图像中的另一种;对所述第一原始图像进行局部亮度对齐处理,获得第一处理图像;基于所述第一处理图像与所述第二原始图像,获得去除背景的目标图像,以实现在各种环境下都能将原始图像中包含的背景纹理去除,得到清晰的目标图像,解决了现有技术中在不同环境下无法通过去除背景纹理获得清晰的目标图像的技术问题。
附图说明
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明设置为解释本发明,并不构成对本发明的不当限定。在附图中:
图1是根据本发明实施例的一种可选的图像处理方法的流程图;
图2是根据本发明实施例的另一种可选的图像处理方法的流程图;
图3是根据本发明实施例的又一种可选的图像处理方法的流程图;
图4是根据本发明实施例的又一种可选的图像处理方法的流程图;
图5是根据本发明实施例的又一种可选的图像处理方法的流程图;
图6是根据本发明实施例的一种可选的基于深度学习的图像处理方法的流程图;
图7是根据本发明实施例的一种可选的描述子提取方法的流程图;
图8是根据本发明实施例的一种可选的图像处理装置的结构框图;
图9是根据本发明实施例的另一种可选的图像处理装置的结构框图;
图10是根据本发明实施例的又一种可选的图像处理装置的结构框图;
图11是根据本发明实施例的又一种可选的基于深度学习的图像处理装置的结构框图;
图12是根据本发明实施例的又一种可选的描述子提取装置的结构框图。
具体实施方式
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是设置为区别类似的对象,而不必设置为描述特定的顺序或先后次序。应该理解这样使用的顺序在适当情况下可以互换,以便这里描述的本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
下面说明本发明实施例的一种可选的图像处理方法的流程图。需要说明的是,在附图流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
需要说明的是,为了更清楚地进行说明,在下述图像处理方法的不同实施例中,原始目标图像中去除背景的目标图像分别以第一结果图像、第二结果图像、第三结果图像、第四结果图像、第五结果图像、第六结果图像进行描述。
参考图1,是根据本发明实施例的一种可选的图像处理方法的流程图。如图1所示,该图像处理方法包括如下步骤:
S100,采集第一原始图像和第二原始图像,其中,第一原始图像是原始目标图像和背景图像中的一种,第二原始图像是原始目标图像和背景图像中的另一种。
在一种可选的实施例中,原始目标图像是指目标物按压在电子设备的显示屏表面时采集到的目标物图像,背景图像是指使用一个与目标物反射率接近且表面光滑的模拟物按压在电子设备的显示屏表面时采集到的显示屏自身的纹理图像。当图像处理方法具体应用于处理指纹图像时,目标物可以是手指,模拟物可以是肤色橡胶块。
在另一种可选的实施例中,由于噪声信号的分布具有一定随机性,而目标物图像信号是相对固定的,为了提高目标物图像的质量,还采用了多帧图像融合的方法降低噪声信号,同时保持目标物图像信号强度不变。例如,在目标物完全按压屏幕时,连续采集多帧目标物图像,然后根据多帧目标物图像的整体质量或局部质量对多帧目标物图像进行整体或局部的加权融合,得到融合后的目标图像作为原始目标图像。与采集单帧目标物图像作为原始目标图像相比,采用多帧图像融合方法获得的原始目标图像整体噪声更小,为后续目标图像处理步骤提供更好的基础。
S102,对第一原始图像进行局部亮度对齐处理,获得第一处理图像。
虽然模拟物的反射率与目标物接近,但实际与模拟物的反射率仍然不完全相同,导致第一原始图像与第二原始图像之间的局部亮度不均匀,在一种可选的实施例中,步骤S102包括:
S1020:分别计算第一原始图像中每个像素点的像素值r和每个像素点邻域窗口内的所有像素点的像素平均值
Figure PCTCN2021139279-appb-000001
以及第二原始图像中每个像素点的像素值b和每个像素点邻域窗口内的所有像素点的像素平均值
Figure PCTCN2021139279-appb-000002
其中,邻域窗口可以根据实际情况进行设置,例如,在图像处理方法具体应用于处理指纹图像时,选择以每个像素点为中心的11*11窗口范围作为邻域窗口;
S1022:根据第一原始图像中每个像素点的像素值r和每个像素点邻域窗口内的所有像素点的像素平均值
Figure PCTCN2021139279-appb-000003
以及第二原始图像中每个像素点邻域窗口内的所有像素点的像素平均值
Figure PCTCN2021139279-appb-000004
获得与第二原始图像局部亮度对齐的第一处理图像,其中,第一处理图 像中每个像素点的像素值r1可依据公式1得到,公式1:
Figure PCTCN2021139279-appb-000005
由此,通过上述步骤S1020和S1022,可以实现对第一原始图像进行局部亮度对齐处理,使得经过局部亮度对齐处理的第一处理图像与第二原始图像的局部亮度保持一致。
S104:基于第一处理图像与第二原始图像,获得第一结果图像。
在一种可选的实施例中,可以对第一处理图像和第二原始图像做减法运算,获得第一结果图像。例如,当第一原始图像为原始目标图像,第二原始图像为背景图像时,第一处理图像为经过局部亮度对齐处理的原始目标图像,将第一处理图像减去第二原始图像,即可获得第一结果图像,该第一结果图像为去除背景的目标图像。又例如,当第一原始图像为背景图像,第二原始图像为原始目标图像时,第一处理图像为经过局部亮度对齐处理的背景图像,将第二原始图像减去第一处理图像,同样可获得第一结果图像,该第一结果图像同样为去除背景的目标图像。
需要说明的是,在本申请的实施例中,第一处理图像和第二原始图像做减法运算代表将第一处理图像的各个像素点的像素值与第二原始图像的各个像素点的像素值做减法运算。
依据本发明实施例提供的图像处理方法,不仅能够去除了主要的背景纹理,且解决了背景图像与原始目标图像之间的局部亮度不均匀的问题,使得去除背景的目标图像局部亮度相对均匀且清晰,在具体应用于处理指纹图像时,能够获得清晰的去除显示屏背景纹理的指纹图像。
但是,由于硬件成像异常或受外界环境影响,有时得到的第一原始图像与第二原始图像整体亮度差异较大,经过上述步骤S100-S104获得的第一结果图像仍然会有明显的背景纹理残留,因此,可以在局部亮度对齐处理之前或之后进行整体亮度对齐处理。参考图2,提供了根据本发明实施例的另一种可选的图像处理方法的流程图。如图2所示,该图像处理方法包括如下步骤:
S200,采集第一原始图像和第二原始图像,其中,第一原始图像是原始目标图像和背景图像中的一种,第二原始图像是原始目标图像和背景图像中的另一种。
S202,对第一原始图像进行局部亮度对齐处理,获得第一处理图像。
S204,对第一处理图像进行整体亮度对齐处理,获得第二处理图像。
S206:基于第二处理图像与第二原始图像,获得第二结果图像。
上述步骤S200,S202与图1所描述的实施例中的步骤S100和S102相同,具体可参见图1的相应描述,在此不再详细说明。图2所描述的实施例与图1的不同之处在于,该图像处理方法还包括步骤S204,对第一处理图像进行整体亮度对齐处理,获得第二处理图像,以及步骤S206是基于经过整体亮度对齐处理的第二处理图像与第二原始图像,获得第二结果图像。
在一种可选的实施例中,步骤S204包括:
S2042:分别计算第一处理图像的最大像素值rmax和最小像素值rmin,以及第二原始图像的最大像素值bmax和最小像素值bmin;
S2044:根据第一处理图像的最大像素值rmax和最小像素值rmin,以及第二原始图像的最大像素值bmax和最小像素值bmin,获取第一处理图像相对第二原始图像的整体亮度尺度系数α和整体亮度偏移系数β;其中,整体亮度尺度系数α可以根据公式2计算得到,公式2:
Figure PCTCN2021139279-appb-000006
整体亮度偏移系数β可以根据公式3计算得到,公式3:β=(b min·r max-b max·r min)/(r max-r min);
S2046:基于整体亮度尺度系数α和整体亮度偏移系数β对第一处理图像进行线性变换,得到与第二原始图像整体亮度对齐的第二处理图像;其中,第二处理图像中每个像素点的像素值r2基于公式4通过线性变换得到,公式4:r2=α·r+β。
在另一种可选的实施例中,也可以对第二原始图像进行整体亮度对齐处理,参考图3,提供了根据本发明实施例的又一种可选的图像处理方法的流程图。如图3所示,该图像处理方法包括如下步骤:
S300,采集第一原始图像和第二原始图像,其中,第一原始图像是原始目标图像和背景图像中的一种,第二原始图像是原始目标图像和背景图像中的另一种。
S302,对第一原始图像进行局部亮度对齐处理,获得第一处理图像。
S304,对第二原始图像进行整体亮度对齐处理,获得第三处理图像。
S306:基于第一处理图像与第三处理图像,获得第三结果图像。
在一种可选的实施例中,步骤S304包括:
S3042:分别计算第一处理图像的最大像素值rmax和最小像素值rmin,以及第二原始图像的最大像素值bmax和最小像素值bmin;
S3044:根据第一处理图像的最大像素值rmax和最小像素值rmin,以及第二原始 图像的最大像素值bmax和最小像素值bmin,获取第二原始图像相对第一处理图像的整体亮度尺度系数α′和整体亮度偏移系数β′;其中,整体亮度尺度系数α′可以根据公式2计算得到,公式4:
Figure PCTCN2021139279-appb-000007
整体亮度偏移系数β′可以根据公式3计算得到,公式5:β′=(r min·b max-r max·b min)/(b max-b min);
S3046:基于整体亮度尺度系数α′和整体亮度偏移系数β′对第二原始图像进行线性变换,得到与第一处理图像整体亮度对齐的第三处理图像;其中,第三处理图像中每个像素点的像素值b2基于公式4通过线性变换得到,公式4:b2=α′·b+β′。
需要说明的是,上述实施例是先进行局部亮度对齐处理,再进行整体亮度对齐处理的。但上述步骤顺序仅仅是作为一种示例而非严格的限制,本领域技术人员可以基于上述实施例的原理进行相应的调整和变换,例如,先进行整体亮度对齐处理再进行局部亮度对齐处理。
此外,为了避免局部噪声对参数计算的影响,在包含整体亮度对齐处理步骤的实施例中,图像处理方法还可以包含在整体亮度对齐处理之前进行平滑处理,例如,针对第一原始图像和第二原始图像进行平滑处理;又例如,针对第一处理图像和第二原始图像进行平滑处理等等,本领域技术人员可以根据具体的实施例进行合理的调整。具体地,平滑处理可以采用均值滤波、高斯滤波等方法进行平滑处理。
此外,由于外界环境变化以及按压方式不同,原始目标图像中包含的背景纹理可能与背景图像差异较大,即存在背景纹理的形变,比如当外界温度变化较大时,显示屏内部结构会发生不同程度的热胀冷缩效应,此时背景纹理在原始目标图像中的成像与背景图像具有明显差异;又如目标图像采集时由于目标物按压显示屏的力度不同,导致显示屏发生不同程度的形变,且与成像传感器之间的距离也有所改变,进而引起背景纹理的成像变化。此时通过上述实施例可能无法将背景纹理去除。
为了解决背景纹理存在形变的问题,在一种可选的实施例中,将目标物刚接触屏幕但未完全按压显示屏时采集到的目标物图像作为背景图像。在目标物刚刚接触显示屏时,屏幕点亮,而目标物尚未完全按压下去,传感器的成像中目标图像信号微弱而背景纹理清晰,因此可以把该时刻采集到的目标物图像近似作为背景图像。通过精确控制图像采集时刻,可以得到与当前原始目标图像中的背景纹理基本一致的背景图像,由此,可以较好的解决背景纹理形变问题。但是该方法对采图时机要求较高,如果采图过早则屏幕尚未点亮或目标物距屏幕较远而反光不足,导致成像强度太弱;如果采图过晚则目标物已完全按压,无法得到纯净的背景图像。
为了在不严格要求采图时机的情况下解决背景纹理存在形变的问题,可以在局部 亮度对齐处理之前或之后进行形状对齐处理。参考图4,提供了根据本发明实施例的又一种可选的图像处理方法的流程图。如图4所示,该图像处理方法包括如下步骤:
S400,采集第一原始图像和第二原始图像,其中,第一原始图像是原始目标图像和背景图像中的一种,第二原始图像是原始目标图像和背景图像中的另一种。
S402,对第一原始图像进行局部亮度对齐处理,获得第一处理图像。
S404:对第一处理图像进行形状对齐处理,获得第四处理图像。
S406:基于第四处理图像与第二原始图像,获得第四结果图像。
上述步骤S400,S402与图1所描述的实施例相同,具体可参见图1的相应描述,在此不再详细说明。图4所描述的实施例与图1的不同之处在于,该图像处理方法包括还包括步骤S404,对第一处理图像进行形状对齐处理,获得第四处理图像,以及步骤S406是基于经过形状对齐处理的第四处理图像与第二原始图像,获得第四结果图像。
在另一种可选的实施例中,在进行形状对齐处理步骤之前还可以包括:判断背景图像是否存在形变;可选地,判断背景图像是否存在形变包括:判断第一处理图像与第二原始图像的相似度,具体地,可以采用例如零均值归一化互相关系数ZNCC(zero-mean normalized cross-correlation)判断;当相似度小于第一阈值时,判断背景图像存在形变。
在一种可选的实施例中,步骤S404包括:
S4042:计算第一处理图像中每个像素点到第二原始图像中对应目标像素点的位置偏移;可选地,可以采用Lucas-Kanade算法计算;
S4044:根据位置偏移拟合出第一处理图像相对第二原始图像的位移参数(Δx,Δy)和尺度参数δ;可选地,可以采用最小二乘法拟合;
S4046:根据位移参数(Δx,Δy)和尺度参数δ对第一处理图像进行形状对齐处理,获得与第二原始图像形状对齐的第四处理图像。
在另一种可选的实施例中,也可以对第二原始图像进行形状对齐处理,参考图5,提供了根据本发明实施例的另一种可选的图像处理方法的流程图。如图5所示,该图像处理方法包括如下步骤:
S500,采集第一原始图像和第二原始图像,其中,第一原始图像是原始目标图像和背景图像中的一种,第二原始图像是原始目标图像和背景图像中的另一种。
S502,对第一原始图像进行局部亮度对齐处理,获得第一处理图像。
S504:对第二原始图像进行形状对齐处理,获得第五处理图像。
S506:基于第一处理图像与第五处理图像,获得第五结果图像。
上述步骤S400,S402与图1所描述的实施例相同,具体可参见图1的相应描述,在此不再详细说明。图5所描述的实施例与图1的不同之处在于,该图像处理方法包括还包括步骤S504,对第二原始图像进行形状对齐处理,获得第五处理图像,以及步骤S506是第一处理图像与基于经过形状对齐处理的第五处理图像,获得第五结果图像。
在一种可选的实施例中,步骤S504包括:
S5042:计算第一处理图像中每个像素点到第二原始图像中对应目标像素点的位置偏移;可选地,可以采用Lucas-Kanade算法计算;
S5044:根据位置偏移拟合出第二原始图像相对第一处理图像之间的位移参数(Δx′,Δy′)和尺度参数δ′;可选地,可以采用最小二乘法拟合;
S5046:根据位移参数(Δx′,Δy′)和尺度参数δ′对第二原始图像进行形状对齐处理,获得与第一处理图像形状对齐的第五处理图像。
需要说明的是,上述实施例是先进行局部亮度对齐处理,再进行形状对齐处理的。但上述步骤顺序仅仅是作为一种示例而非严格的限制,本领域技术人员可以基于上述实施例的原理进行相应的调整和变换,例如,先进行形状对齐处理再进行局部亮度对齐处理;在包含整体亮度对齐处理步骤的图像处理方法中,整体亮度对齐处理、局部亮度对齐处理以及形状对齐处理这三个步骤的顺序可以具有不同的排列方式,例如,先进行整体亮度对齐处理,再进行局部亮度对齐处理,最后进行形状对齐处理;又例如,先进行局部亮度对齐处理,再进行整体亮度对齐处理,最后进行形状对齐处理;再例如,先进行形状亮度对齐处理,再进行整体亮度对齐处理,最后进行局部亮度对齐处理等等。
在一种可选的实施例中,在采集第一原始图像和第二原始图像的步骤中还可以包括采集候选背景图像,即自目标物刚接触屏幕至目标物完全按压屏幕期间采样多帧目标物图像作为候选背景图像。对应于该步骤,图像处理方法还包括基于该候选背景图像和至少经过局部亮度对齐处理的第一原始图像或第二原始图像,获得去除候选背景后的结果图像;以及,选取图1-图5所描述的实施例中获得的去除背景后的结果图像和去除候选背景后的结果图像中较好的一个作为去除背景的目标图像。
由于传感器本身的成像特性,得到的去除背景的目标图像可能会存在局部质量不 均的情况,通常表现为中心区域质量较好,而边缘区域质量较差,因此需要对去除背景的目标图像进行质量增强,提高边缘区域的质量。相对中心区域而言,边缘区域质量较差主要表现为指纹纹路对比度较低,对此可用局部对比度增强进行改善,但是原有的噪声也会同时被放大,所以在局部对比度增强后还可以进行去噪处理,可选地,去噪方法包括快速非局部均值去噪(Fast Non-Local Means Denoising)和三维块匹配滤波BM3D(Block-matching and 3D filtering)等。经过局部对比度增强和去噪处理后,可以得到更加清晰的目标图像。
经过上述图像处理方法,可以得到去除背景的目标图像,整体图像清晰、整体及局部亮度均匀、噪声小、没有明显的背景纹理残留,且对外界环境变化具有较好的适应性。在具体应用于处理指纹图像时,能够获得清晰的去除显示屏背景纹理的指纹图像,指纹纹路清晰、亮度均匀、没有明显的背景纹理残留,可以克服因外界环境变化以及手指按压力度导致的背景形变所带来的影响,对指纹采集时机也没有严格要求,具有较好的适应性。
通过上述图1-图5所描述的图像处理方法获得了清晰的去除背景的目标图像,若将其作为参考图像,也可以使用深度学习的方法将图像中的背景去除。参考图6,是根据本发明实施例的一种可选的基于深度学习的图像处理方法的流程图。如图6所示,该图像处理方法包括如下步骤:
S600,采集第三原始图像和第四原始图像;其中,第三原始图像是原始目标图像和背景图像中的一种,第四原始图像是原始目标图像和背景图像中的另一种;
在一种可选的实施例中,第三原始图像是指目标物按压在电子设备的显示屏表面时采集到的目标物图像,背景图像是指使用一个与目标物反射率接近且表面光滑的模拟物按压在电子设备的显示屏表面时采集到的显示屏自身的纹理图像。当图像处理方法具体应用于处理指纹图像时,目标物可以是手指,模拟物可以是肤色橡胶块。
S602,根据第三原始图像和第四原始图像,获得输入图像;
在一种可选的实施例中,可以将第三原始图像和第四原始图像作为多通道的输入图像;
在另一种可选的实施例中,根据第三原始图像和第四原始图像,获得输入图像包括:对第三原始图像和第四原始图像进行减法运算,将运算结果作为输入图像;具体地,可以将第三原始图像减去第四原始图像,即获得去除背景的图像作为输入图像。
在另一种可选的实施例中,根据第三原始图像和第四原始图像,获得输入图像包 括:对第三原始图像和第四原始图像进行局部亮度对齐处理,将处理结果作为输入图像;具体地,局部亮度对齐处理可以根据如图1中所描述的步骤S102实现。
S604,对初始的图像生成网络进行训练,构建经过训练的图像生成网络;其中,图像生成网络以模板图像为参考对象进行训练,模板图像为使用图1-图5所述的实施例中描述的图像处理方法获得的去除背景的目标图像。
在一种可选的实施例中,图像生成网络为U-net网络。具体地,图像生成网络可以包括三个部分,第一部分包括两个卷积模块,第二部分包括四个简单残差模块,第三部分包括两个反卷积模块,该结构可以保证图像生成网络的输出图像大小跟输入图像保持一致。
在一种可选的实施例中,对初始的图像生成网络进行训练,构建经过训练的图像生成网络包括:
S6042:获取第一样本图像和第二样本图像;
S6044:将第一样本图像和第二样本图像输入至初始的图像生成网络,获得第一训练图像;
S6046:将第一训练图像和模板图像输入至第一损失函数模块,根据第一损失函数模块输出的第一损失值训练初始的图像生成网络,构建经过训练的图像生成网络。其中,第一损失函数模块可以为L2-LOSS函数。
在另一种可选的实施例中,对初始的图像生成网络进行训练,构建经过训练的图像生成网络还包括:
S6048:将第一训练图像和模板图像输入至特征提取网络,获得第一训练图像的高层语义特征和模板图像的高层语义特征;
在一种可选的实施例中,特征提取网络可以选择VGG网络。
S6050:将第一训练图像的高层语义特征和模板图像的高层语义特征输入至第二损失函数模块,根据第二损失函数模块输出的第二损失值训练图像生成网络和/或特征提取网络。其中,第二损失函数模块可以为L2-LOSS函数。
在本实施例中,通过添加特征提取网络获取高层语义特征,以及通过第二损失函数训练图像生成网络和/或特征提取网络,可以使得最终生成的目标图像更接近模板图像。
S606,将输入图像输入至经过训练的图像生成网络,获得第六结果图像。
依据上述步骤S600-S606提供的实施例,可以在各种环境下通过深度学习的方法将第三原始图像或第四原始图像中的背景纹理去除,且不对第三原始图像或第四原始图像的质量有严格要求。
当然,本领域技术人员可知,在图6对应的基于深度学习的图像处理方法中也可以直接使用质量较高的清晰图像作为训练的参考对象,而不使用可以图1-图5所述的实施例中描述的图像处理方法获得的去除背景的结果图像作为训练的参考对象。
通过上述图1-图6所描述的图像处理方法获得了清晰的去除背景的目标图像,因此,可以从去除背景的目标图像中提取更为准确的描述子。参考图7,是根据本发明实施例的一种可选的描述子提取方法的流程图。如图7所示,该描述子提取方法包括如下步骤:
S700,获取目标图像的关键点,其中,目标图像为使用图1-图6所述的实施例中描述的图像处理方法获得的去除背景的目标图像;
在一种可选的实施例中,使用SIFT算法确定目标图像的关键点。
S702,将具有相同关键点的多张目标图像归为同一个类别,标注类别信息作为图像标签;
S704,以关键点为中心,在具有表示同一个类别的图像标签的多张目标图像中截取图像块;
在一种可选的实施例中,在具体应用于处理指纹图像时,可以以关键点为中心截取32*32大小的图像块。
S706,对初始的描述子提取网络进行训练,构建经过训练的描述子提取网络;
在一种可选的实施例中,根据第三损失函数模块输出的第三损失值训练所述描述子提取网络。第三损失函数可以由多种函数实现,例如,tiplet loss,N-pairs loss,histogram loss,contrastive loss,circle loss等。
S708,将图像块输入经过训练的描述子提取网络,获得特征描述子。
在具体应用于处理指纹图像时,由于指纹的重复纹理信息太多,若直接将图像块输入经过训练的描述子提取网络,会降低描述子提取方法的鲁棒性,针对该问题,本发明提供了一种可选的实施例,在将图像块输入至经过训练的描述子提取网络,获得特征描述子之前,描述子提取方法还包括:获取关键点的方向和角度;根据关键点的方向和角度,对图像块进行旋转拉平,获得对齐的图像块。
在一种可选的实施例中,可以先分别训练图像生成网络、特征提取网络,然后再训练描述子提取网络,最后使用端到端训练的方法训练图像生成网络、特征提取网络和描述子提取网络,对网络参数进行微调,获得更鲁棒的特征描述子。
根据本发明实施例的另一方面,还提供了一种电子设备,包括:处理器;以及存储器,设置为存储处理器的可执行指令;其中,处理器配置为经由执行可执行指令来执行上述任意一项的图像处理方法。
根据本发明实施例的另一方面,还提供了一种存储介质,存储介质包括存储的程序,其中,在程序运行时控制存储介质所在设备执行上述任意一项的图像处理方法。
根据本发明实施例的另一方面,还提供了一种图像处理装置。参考图8,是根据本发明实施例的一种可选的图像处理装置的结构框图。如图8所示,图像处理装置80包括图像采集单元800、局部亮度对齐单元802和结果获取单元804。
下面对图像处理装置80包含的各个单元进行具体描述。
图像采集单元800,设置为采集第一原始图像和第二原始图像,其中,第一原始图像是原始目标图像和背景图像中的一种,第二原始图像是原始目标图像和背景图像中的另一种。
在一种可选的实施例中,原始目标图像是指目标物按压在电子设备的显示屏表面时采集到的目标物图像,背景图像是指使用一个与目标物反射率接近且表面光滑的模拟物按压在电子设备的显示屏表面时采集到的显示屏自身的纹理图像。当图像采集单元800具体应设置为处理指纹图像时,目标物可以是手指,模拟物可以是肤色橡胶块。
在另一种可选的实施例中,由于噪声信号的分布具有一定随机性,而目标物图像信号是相对固定的,为了提高目标物图像的质量,图像采集单元800还采用了多帧图像融合的方法降低噪声信号,同时保持目标物图像信号强度不变。例如,在目标物完全按压屏幕时,连续采集多帧目标物图像,然后根据多帧目标物图像的整体质量或局部质量对多帧目标物图像进行整体或局部的加权融合,得到融合后的目标图像作为原始目标图像。与采集单帧目标物图像作为原始目标图像相比,采用多帧图像融合方法获得的原始目标图像整体噪声更小,为后续目标图像处理步骤提供更好的基础。
局部亮度对齐单元802,设置为对第一原始图像进行局部亮度对齐处理,获得第一处理图像。
虽然模拟物的反射率与目标物接近,但实际与模拟物的反射率仍然不完全相同,导致第一原始图像与第二原始图像之间的局部亮度不均匀,在一种可选的实施例中, 局部亮度对齐单元802包括:
第一像素值计算单元8022,设置为计算第一原始图像中每个像素点的像素值r和每个像素点邻域窗口内的所有像素点的像素平均值
Figure PCTCN2021139279-appb-000008
以及第二原始图像中每个像素点的像素值b和每个像素点邻域窗口内的所有像素点的像素平均值
Figure PCTCN2021139279-appb-000009
其中,邻域窗口可以根据实际情况进行设置,例如,在图像处理方法具体应设置为处理指纹图像时,选择以每个像素点为中心的11*11窗口范围作为邻域窗口;
第一处理图像获得单元8024,设置为根据第一原始图像中每个像素点的像素值r和每个像素点邻域窗口内的所有像素点的像素平均值
Figure PCTCN2021139279-appb-000010
以及第二原始图像中每个像素点邻域窗口内的所有像素点的像素平均值
Figure PCTCN2021139279-appb-000011
获得与第二原始图像局部亮度对齐的第一处理图像,其中,第一处理图像中每个像素点的像素值r1可依据公式1得到,公式1:
Figure PCTCN2021139279-appb-000012
由此,通过上述像素值计算单元8022和第一处理图像获得单元8024,可以实现对第一原始图像进行局部亮度对齐处理,使得经过局部亮度对齐处理的第一处理图像与第二原始图像的局部亮度保持一致。
结果获取单元804,设置为基于第一处理图像与第二原始图像,获得第一结果图像。
在一种可选的实施例中,结果获取单元804可以对第一处理图像和第二原始图像做减法运算,获得第一结果图像。例如,当第一原始图像为原始目标图像,第二原始图像为背景图像时,第一处理图像为经过局部亮度对齐处理的原始目标图像,结果获取单元804将第一处理图像减去第二原始图像,即可获得第一结果图像,该第一结果图像为去除背景的目标图像。又例如,当第一原始图像为背景图像,第二原始图像为原始目标图像时,第一处理图像为经过局部亮度对齐处理的背景图像,结果获取单元804将第二原始图像减去第一处理图像,同样可获得第一结果图像,该第一结果图像同样为去除背景的目标图像。
需要说明的是,在本申请的实施例中,第一处理图像和第二原始图像做减法运算代表将第一处理图像的各个像素点的像素值与第二原始图像的各个像素点的像素值做减法运算。
依据本发明实施例提供的图像处理装置,不仅能够去除了主要的背景纹理,且解决了背景图像与原始目标图像之间的局部亮度不均匀的问题,使得去除背景的目标图像局部亮度相对均匀且清晰,在具体应设置为处理指纹图像时,能够获得清晰的去除显示屏背景纹理的指纹图像。
但是,由于硬件成像异常或受外界环境影响,有时图像采集单元800得到的第一原始图像与第二原始图像整体亮度差异较大,经过上述步骤S102-S104获得的第一结果图像仍然会有明显的背景纹理残留,因此,可以在局部亮度对齐处理之前或之后进行整体亮度对齐处理。参考图9,提供了根据本发明实施例的另一种可选的图像处理装置的结构框图。如图9所示,图像处理装置90包括:
图像采集单元900,设置为采集第一原始图像和第二原始图像,其中,第一原始图像是原始目标图像和背景图像中的一种,第二原始图像是原始目标图像和背景图像中的另一种。
局部亮度对齐单元902,设置为对第一原始图像进行局部亮度对齐处理,获得第一处理图像。
整体亮度对齐单元904,设置为对第一处理图像进行整体亮度对齐处理,获得第二处理图像。
结果获取单元906:基于第二处理图像与第二原始图像,获得第二结果图像。
上述图像采集单元900,局部亮度对齐单元902与图8所描述的实施例中的图像采集单元800和局部亮度对齐单元802相同,具体可参见图8的相应描述,在此不再详细说明。图9所描述的实施例与图8的不同之处在于,图像处理装置90还包括整体亮度对齐单元904,设置为对第一处理图像进行整体亮度对齐处理,获得第二处理图像,以及结果获取单元906是基于经过整体亮度对齐处理的第二处理图像与第二原始图像,获得第二结果图像。
在一种可选的实施例中,整体亮度对齐单元904包括:
第二像素值计算单元9042,设置为计算第一处理图像的最大像素值rmax和最小像素值rmin,以及第二原始图像的最大像素值bmax和最小像素值bmin;
整体亮度系数计算单元9044,设置为根据第一处理图像的最大像素值rmax和最小像素值rmin,以及第二原始图像的最大像素值bmax和最小像素值bmin,获取第一处理图像相对第二原始图像的整体亮度尺度系数α和整体亮度偏移系数β;其中,整体亮度尺度系数α可以根据公式2计算得到,公式2:
Figure PCTCN2021139279-appb-000013
整体亮度偏移系数β可以根据公式3计算得到,公式3:β=(b min·r max-b max·r min)/(r max-r min);
线性变换单元9046,设置为基于整体亮度尺度系数α和整体亮度偏移系数β对第一处理图像进行线性变换,得到与第二原始图像整体亮度对齐的第二处理图像;其中, 第二处理图像中每个像素点的像素值r2基于公式4通过线性变换得到,公式4:r2=α·r+β。
在另一种可选的实施例中,也可以对第二原始图像进行整体亮度对齐处理,此时,图像处理装置90包括图像采集单元900、局部亮度对齐单元902、整体亮度对齐单元904’和结果获取单元906'。其中,图像采集单元900,局部亮度对齐单元902与图8所描述的实施例中的图像采集单元800和局部亮度对齐单元802相同,具体可参见图8的相应描述,在此不再详细说明。
与整体亮度对齐单元904不同的是,在本实施例中,整体亮度对齐单元904’,设置为对第二原始图像进行整体亮度对齐处理,获得第三处理图像;结果获取单元906',设置为基于第一处理图像与第三处理图像,获得第三结果图像。
在一种可选的实施例中,整体亮度对齐单元904'包括:
第二像素值计算单元9042,设置为计算第一处理图像的最大像素值rmax和最小像素值rmin,以及第二原始图像的最大像素值bmax和最小像素值bmin;
整体亮度系数计算单元9044',设置为根据第一处理图像的最大像素值rmax和最小像素值rmin,以及第二原始图像的最大像素值bmax和最小像素值bmin,获取第二原始图像相对第一处理图像的整体亮度尺度系数α′和整体亮度偏移系数β′;其中,整体亮度尺度系数α′可以根据公式2计算得到,公式4:
Figure PCTCN2021139279-appb-000014
整体亮度偏移系数β′可以根据公式3计算得到,公式5:β′=(r min·b max-r max·b min)/(b max-b min);
线性变换单元9046',设置为基于整体亮度尺度系数α′和整体亮度偏移系数β′对第二原始图像进行线性变换,得到与第一处理图像整体亮度对齐的第三处理图像;其中,第三处理图像中每个像素点的像素值b2基于公式4通过线性变换得到,公式4:b2=α′·b+β′。
需要说明的是,上述实施例是先进行局部亮度对齐处理,再进行整体亮度对齐处理的。但上述步骤顺序仅仅是作为一种示例而非严格的限制,本领域技术人员可以基于上述实施例的原理进行相应的调整和变换,例如,先进行整体亮度对齐处理再进行局部亮度对齐处理。
此外,为了避免局部噪声对参数计算的影响,在包含整体亮度对齐处理步骤的实施例中,图像处理装置还可以包含平滑处理单元,设置为在整体亮度对齐处理之前进行平滑处理,例如,针对第一原始图像和第二原始图像进行平滑处理;又例如,针对第一处理图像和第二原始图像进行平滑处理等等,本领域技术人员可以根据具体的实 施例进行合理的调整。具体地,平滑处理单元可以采用均值滤波、高斯滤波等方法进行平滑处理。
此外,由于外界环境变化以及按压方式不同,原始目标图像中包含的背景纹理可能与背景图像差异较大,即存在背景纹理的形变,比如当外界温度变化较大时,显示屏内部结构会发生不同程度的热胀冷缩效应,此时背景纹理在原始目标图像中的成像与背景图像具有明显差异;又如目标图像采集时由于目标物按压显示屏的力度不同,导致显示屏发生不同程度的形变,且与成像传感器之间的距离也有所改变,进而引起背景纹理的成像变化。此时通过上述实施例可能无法将背景纹理去除。
为了解决背景纹理存在形变的问题,在一种可选的实施例中,将目标物刚接触屏幕但未完全按压显示屏时采集到的目标物图像作为背景图像。在目标物刚刚接触显示屏时,屏幕点亮,而目标物尚未完全按压下去,传感器的成像中目标图像信号微弱而背景纹理清晰,因此可以把该时刻采集到的目标物图像近似作为背景图像。通过精确控制图像采集时刻,可以得到与当前原始目标图像中的背景纹理基本一致的背景图像,由此,可以较好的解决背景纹理形变问题。但是该方法对采图时机要求较高,如果采图过早则屏幕尚未点亮或目标物距屏幕较远而反光不足,导致成像强度太弱;如果采图过晚则目标物已完全按压,无法得到纯净的背景图像。
为了在不严格要求采图时机的情况下解决背景纹理存在形变的问题,可以在局部亮度对齐处理之前或之后进行形状对齐处理。参考图10,提供了根据本发明实施例的又一种可选的图像处理装置的结构框图。如图10所示,该图像处理装置100包括如下步骤:
图像采集单元1000,设置为采集第一原始图像和第二原始图像,其中,第一原始图像是原始目标图像和背景图像中的一种,第二原始图像是原始目标图像和背景图像中的另一种。
局部亮度对齐单元1002,设置为对第一原始图像进行局部亮度对齐处理,获得第一处理图像。
形状对齐单元1004,设置为对第一处理图像进行形状对齐处理,获得第四处理图像。
结果获取单元1006:基于第四处理图像与第二原始图像,获得第四结果图像。
上述图像采集单元1000,局部亮度对齐单元1002与图8所描述的实施例相同,具体可参见图8的相应描述,在此不再详细说明。图10所描述的实施例与图8的不同 之处在于,图像处理装置100还包括形状对齐单元1004,设置为对第一处理图像进行形状对齐处理,获得第四处理图像,以及结果获取单元1006是基于经过形状对齐处理的第四处理图像与第二原始图像,获得第四结果图像。
在另一种可选的实施例中,图像处理装置100还包括形变判断单元,设置为在形状对齐单元1004进行形状对齐处理步骤之前,判断背景图像是否存在形变;可选地,判断背景图像是否存在形变包括:判断第一处理图像与第二原始图像的相似度,具体地,可以采用例如零均值归一化互相关系数ZNCC(zero-mean normalized cross-correlation)判断;当相似度小于第一阈值时,判断背景图像存在形变。
在一种可选的实施例中,形状对齐单元1004包括:
位置计算单元10042,设置为计算第一处理图像中每个像素点到第二原始图像中对应目标像素点的位置偏移;可选地,可以采用Lucas-Kanade算法计算;
拟合单元10044,设置为根据位置偏移拟合出第一处理图像相对第二原始图像的位移参数(Δx,Δy)和尺度参数δ;可选地,可以采用最小二乘法拟合;
对齐单元10046,设置为根据位移参数(Δx,Δy)和尺度参数δ对第一处理图像进行形状对齐处理,获得与第二原始图像形状对齐的第四处理图像。
在另一种可选的实施例中,也可以对第二原始图像进行形状对齐处理,此时,图像处理装置100包括图像采集单元1000、局部亮度对齐单元1002、形状对齐单元1004’和结果获取单元1006'。其中,图像采集单元1000,局部亮度对齐单元1002与图8所描述的实施例中的图像采集单元800和局部亮度对齐单元802相同,具体可参见图8的相应描述,在此不再详细说明。
与形状对齐单元1004不同的是,在本实施例中,形状对齐单元1004',设置为对第二原始图像进行形状对齐处理,获得第五处理图像;结果获取单元1006',设置为基于第一处理图像与第五处理图像,获得第五结果图像。
在一种可选的实施例中,形状对齐单元1004'包括:
位置计算单元10042,设置为计算第一处理图像中每个像素点到第二原始图像中对应目标像素点的位置偏移;可选地,可以采用Lucas-Kanade算法计算;
拟合单元10044',设置为根据位置偏移拟合出第二原始图像相对第一处理图像之间的位移参数(Δx′,Δy′)和尺度参数δ′;可选地,可以采用最小二乘法拟合;
对齐单元10046',设置为根据位移参数(Δx′,Δy′)和尺度参数δ′对第二原始图像进 行形状对齐处理,获得与第一处理图像形状对齐的第五处理图像。
需要说明的是,上述实施例是先进行局部亮度对齐处理,再进行形状对齐处理的。但上述步骤顺序仅仅是作为一种示例而非严格的限制,本领域技术人员可以基于上述实施例的原理进行相应的调整和变换,例如,先进行形状对齐处理再进行局部亮度对齐处理;在包含整体亮度对齐处理步骤的图像处理方法中,整体亮度对齐处理、局部亮度对齐处理以及形状对齐处理这三个步骤的顺序可以具有不同的排列方式,例如,先进行整体亮度对齐处理,再进行局部亮度对齐处理,最后进行形状对齐处理;又例如,先进行局部亮度对齐处理,再进行整体亮度对齐处理,最后进行形状对齐处理;再例如,先进行形状亮度对齐处理,再进行整体亮度对齐处理,最后进行局部亮度对齐处理等等。
在一种可选的实施例中,图像采集单元还可以包括采集候选背景图像,即自目标物刚接触屏幕至目标物完全按压屏幕期间采样多帧目标物图像作为候选背景图像。对应于该步骤,图像处理装置还包括基于该候选背景图像和至少经过局部亮度对齐处理的第一原始图像或第二原始图像,获得去除候选背景后的结果图像;以及,选取图8-图10所描述的实施例中获得的去除背景后的结果图像和去除候选背景后的结果图像中较好的一个作为去除背景的目标图像。
由于传感器本身的成像特性,得到的去除背景的目标图像可能会存在局部质量不均的情况,通常表现为中心区域质量较好,而边缘区域质量较差,因此需要对去除背景的目标图像进行质量增强,提高边缘区域的质量。相对中心区域而言,边缘区域质量较差主要表现为指纹纹路对比度较低,对此,图像处理装置可以包括局部对比度增强单元设置为改善局部对比度,但是原有的噪声也会同时被放大,所以,图像处理装置还可以包括去噪单元,设置为在局部对比度增强后还进行去噪处理,可选地,可以采用快速非局部均值去噪(Fast Non-Local Means Denoising)和三维块匹配滤波BM3D(Block-matching and 3D filtering)等去噪方法。经过局部对比度增强和去噪处理后,可以得到更加清晰的目标图像。
使用上述图像处理装置,可以得到去除背景的目标图像,整体图像清晰、整体及局部亮度均匀、噪声小、没有明显的背景纹理残留,且对外界环境变化具有较好的适应性。上述图像处理装置在具体应设置为处理指纹图像时,能够获得清晰的去除显示屏背景纹理的指纹图像,指纹纹路清晰、亮度均匀、没有明显的背景纹理残留,可以克服因外界环境变化以及手指按压力度导致的背景形变所带来的影响,对指纹采集时机也没有严格要求,具有较好的适应性。
使用上述图8-图10所描述的图像处理装置可以获得清晰的去除背景的目标图像,若将其作为参考图像,也可以使用深度学习的方法将图像中的背景去除。参考图11,是根据本发明实施例的一种可选的基于深度学习的图像处理装置的结构框图。如图11所示,该图像处理装置110包括:
图像采集单元1100,设置为采集第三原始图像和第四原始图像;其中,第三原始图像是原始目标图像和背景图像中的一种,第四原始图像是原始目标图像和背景图像中的另一种;
在一种可选的实施例中,第三原始图像是指目标物按压在电子设备的显示屏表面时采集到的目标物图像,背景图像是指使用一个与目标物反射率接近且表面光滑的模拟物按压在电子设备的显示屏表面时采集到的显示屏自身的纹理图像。当图像处理方法具体应设置为处理指纹图像时,目标物可以是手指,模拟物可以是肤色橡胶块。
输入图像获取单元1102,根据第三原始图像和第四原始图像,获得输入图像;
在一种可选的实施例中,输入图像获取单元1102可以将第三原始图像和第四原始图像作为多通道的输入图像;
在另一种可选的实施例中,输入图像获取单元1102,设置为对第三原始图像和第四原始图像进行减法运算,将运算结果作为输入图像;具体地,可以将第三原始图像减去第四原始图像,即获得去除背景的图像作为输入图像。
在另一种可选的实施例中,输入图像获取单元1102,设置为对第三原始图像和第四原始图像进行局部亮度对齐处理,将处理结果作为输入图像;具体地,局部亮度对齐处理可以根据如图1中所描述的步骤S104实现。
网络构建单元1104,设置为对初始的图像生成网络进行训练,构建经过训练的图像生成网络;其中,图像生成网络以模板图像为参考对象进行训练,模板图像为使用图1-图5所述的实施例中描述的图像处理方法获得的去除背景的目标图像。
在一种可选的实施例中,图像生成网络为U-net网络。具体地,图像生成网络可以包括三个部分,第一部分包括两个卷积模块,第二部分包括四个简单残差模块,第三部分包括两个反卷积模块,该结构可以保证图像生成网络的输出图像大小跟输入图像保持一致。
在一种可选的实施例中,网络构建单元1104包括:
样本获取单元11042,设置为获取第一样本图像和第二样本图像;
训练图像获取单元11044,设置为将第一样本图像和第二样本图像输入至初始的图像生成网络,获得第一训练图像;
第一训练单元11046,设置为将第一训练图像和模板图像输入至第一损失函数模块,根据第一损失函数模块输出的第一损失值训练初始的图像生成网络,构建经过训练的图像生成网络。其中,第一损失函数模块可以为L2-LOSS函数。
在另一种可选的实施例中,网络构建单元1104还包括:
特征提取单元11048,设置为将第一训练图像和模板图像输入至特征提取网络,获得第一训练图像的高层语义特征和模板图像的高层语义特征。在一种可选的实施例中,特征提取网络可以选择VGG网络。
第二训练单元11050,设置为将第一训练图像的高层语义特征和模板图像的高层语义特征输入至第二损失函数模块,根据第二损失函数模块输出的第二损失值训练图像生成网络和/或特征提取网络。其中,第二损失函数模块可以为L2-LOSS函数。
在本实施例中,通过添加特征提取网络获取高层语义特征,以及通过第二损失函数训练图像生成网络和/或特征提取网络,可以使得最终生成的目标图像更接近模板图像。
结果获取单元1106,设置为将输入图像输入至经过训练的图像生成网络,获得第六结果图像。
依据上述实施例,可以在各种环境下通过深度学习的方法将第三原始图像或第四原始图像中的背景纹理去除,且不对第三原始图像或第四原始图像的质量有严格要求。
当然,本领域技术人员可知,在图11对应的基于深度学习的图像处理装置中也可以直接使用质量较高的清晰图像作为训练的参考对象,而不使用可以图1-图5所述的实施例中描述的图像处理方法获得的去除背景的结果图像作为训练的参考对象。
通过上述图8-图11所描述的图像处理装置获得了清晰的去除背景的目标图像,因此,可以从去除背景的目标图像中提取更为准确的描述子。参考图12,是根据本发明实施例的一种可选的描述子提取装置的结构框图。如图12所示,该描述子提取装置120包括:
关键点获取单元1200,设置为获取目标图像的关键点,其中,目标图像为使用图1-图6所述的实施例中描述的图像处理方法获得的去除背景的目标图像;
在一种可选的实施例中,使用SIFT算法确定目标图像的关键点。
归类单元1202,将具有相同关键点的多张目标图像归为同一个类别,标注类别信息作为图像标签;
截图单元1204,以关键点为中心,在具有表示同一个类别的图像标签的多张目标图像中截取图像块;
在一种可选的实施例中,在具体应设置为处理指纹图像时,可以以关键点为中心截取32*32大小的图像块。
描述子提取网络构建单元1206,设置为对初始的描述子提取网络进行训练,构建经过训练的描述子提取网络;
在一种可选的实施例中,根据第三损失函数模块输出的第三损失值训练所述描述子提取网络。第三损失函数可以由多种函数实现,例如,tiplet loss,N-pairs loss,histogram loss,contrastive loss,circle loss等。
特征描述子获取单元1208,将图像块输入经过训练的描述子提取网络,获得特征描述子。
在具体应用于处理指纹图像时,由于指纹的重复纹理信息太多,若直接将图像块输入经过训练的描述子提取网络,会降低描述子提取方法的鲁棒性,针对该问题,描述子提取装置120还包括:方向角度获取单元,设置为获取关键点的方向和角度;旋转拉平单元,设置为根据关键点的方向和角度,对图像块进行旋转拉平,获得对齐的图像块。
在一种可选的实施例中,可以先分别训练图像生成网络、特征提取网络,然后再训练描述子提取网络,最后使用端到端训练的方法训练图像生成网络、特征提取网络和描述子提取网络,对网络参数进行微调,获得更鲁棒的特征描述子。
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。
在本发明的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,可以为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。
工业实用性
本申请实施例提供的方案可以实现得到去除背景的目标图像,整体图像清晰、整体及局部亮度均匀、噪声小、没有明显的背景纹理残留,且对外界环境变化具有较好的适应性,在本申请实施例提供的技术方案中,可以应用于具有至少一个图像处理单元的电子设备中,例如,适用于各类移动平台、车载芯片、嵌入式芯片等,不需要大型复杂的硬件设备,能够获得清晰的去除显示屏背景纹理的指纹图像,指纹纹路清晰、亮度均匀、没有明显的背景纹理残留,可以克服因外界环境变化以及手指按压力度导致的背景形变所带来的影响,对指纹采集时机也没有严格要求,具有较好的适应性。

Claims (46)

  1. 一种图像处理方法,包括:
    采集第一原始图像和第二原始图像,其中,所述第一原始图像是原始目标图像和背景图像中的一种,所述第二原始图像是所述原始目标图像和所述背景图像中的另一种;
    对所述第一原始图像进行局部亮度对齐处理,获得第一处理图像;
    基于所述第一处理图像与所述第二原始图像,获得去除背景的目标图像。
  2. 根据权利要求1所述的图像处理方法,其中,所述原始目标图像是目标物按压在电子设备的显示屏表面时采集到的目标物图像,所述背景图像是使用一个与所述目标物反射率接近且表面光滑的模拟物按压在所述电子设备的显示屏表面时采集到的显示屏自身的纹理图像。
  3. 根据权利要求2所述的图像处理方法,其中,所述目标物为手指,所述模拟物是肤色橡胶块。
  4. 根据权利要求2所述的图像处理方法,其中,在所述目标物完全按压屏幕时,连续采集多帧目标物图像,根据所述多帧目标物图像的整体质量或局部质量对所述多帧目标物图像进行整体或局部的加权融合,得到融合后的目标图像作为所述原始目标图像。
  5. 根据权利要求1所述的图像处理方法,其中,对所述第一原始图像进行局部亮度对齐处理,获得第一处理图像包括:
    分别计算所述第一原始图像中每个像素点的像素值和每个像素点邻域窗口内的所有像素点的像素平均值,以及所述第二原始图像中每个像素点的像素值和每个像素点邻域窗口内的所有像素点的像素平均值;
    根据所述第一原始图像中每个像素点的像素值和每个像素点邻域窗口内的所有像素点的像素平均值,以及所述第二原始图像中每个像素点的像素值和每个像素点邻域窗口内的所有像素点的像素平均值,获得与所述第二原始图像局部亮度对齐的所述第一处理图像。
  6. 根据权利要求1所述的图像处理方法,其中,所述基于第一处理图像与第二原始图像,获得第一结果图像包括:对所述第一处理图像和所述第二原始图像做减法 运算,获得所述第一结果图像。
  7. 根据权利要求1所述的图像处理方法,还包括在所述局部亮度对齐处理之前或之后进行整体亮度对齐处理。
  8. 根据权利要求7所述的图像处理方法,其中,在对所述第一原始图像进行局部亮度对齐处理,获得第一处理图像之后,对所述第一处理图像进行整体亮度对齐处理,获得第二处理图像;
    其中,对所述第一处理图像进行整体亮度对齐处理,获得第二处理图像包括:
    分别计算所述第一处理图像的最大像素值和最小像素值,以及所述第二原始图像的最大像素值和最小像素值;
    根据所述第一处理图像的最大像素值和最小像素值,以及所述第二原始图像的最大像素值和最小像素值,获取所述第一处理图像相对所述第二原始图像的整体亮度尺度系数和整体亮度偏移系数;
    基于所述整体亮度尺度系数和所述整体亮度偏移系数对所述第一处理图像进行线性变换,得到与所述第二原始图像整体亮度对齐的所述第二处理图像。
  9. 根据权利要求7所述的图像处理方法,其中,对所述第二原始图像进行整体亮度对齐处理,获得第三处理图像,包括:
    分别计算所述第一处理图像的最大像素值和最小像素值,以及所述第二原始图像的最大像素值和最小像素值;
    根据所述第一处理图像的最大像素值和最小像素值,以及所述第二原始图像的最大像素值和最小像素值,获取所述第二原始图像相对所述第一处理图像的整体亮度尺度系数和整体亮度偏移系数;
    基于所述整体亮度尺度系数和所述整体亮度偏移系数对所述第二原始图像进行线性变换,得到与所述第一处理图像整体亮度对齐的所述第三处理图像。
  10. 根据权利要求7所述的图像处理方法,还包括,在所述整体亮度对齐之前进行平滑处理。
  11. 根据权利要求10所述的图像处理方法,其中,所述平滑处理包括以下至少一项:均值滤波、高斯滤波。
  12. 根据权利要求2所述的图像处理方法,其中,将所述目标物刚接触屏幕但未完全 按压显示屏时采集到的目标物图像作为所述背景图像。
  13. 根据权利要求1所述的图像处理方法,还包括:在所述局部亮度对齐处理之前或之后进行形状对齐处理。
  14. 根据权利要求13所述的图像处理方法,其中,在对所述第一原始图像进行局部亮度对齐处理,获得第一处理图像之后,对所述第一处理图像进行形状对齐处理,获得第四处理图像;
    其中,所述第一处理图像进行形状对齐处理,获得第四处理图像包括:
    计算所述第一处理图像中每个像素点到所述第二原始图像中对应目标像素点的位置偏移;
    根据所述位置偏移拟合出所述第一处理图像相对所述第二原始图像的位移参数和尺度参数;
    根据所述位移参数和所述尺度参数对所述第一处理图像进行形状对齐处理,获得与所述第二原始图像形状对齐的所述第四处理图像。
  15. 根据权利要求13所述的图像处理方法,其中:对第二原始图像进行形状对齐处理,获得第五处理图像,包括:
    计算所述第一处理图像中每个像素点到所述第二原始图像中对应目标像素点的位置偏移;
    根据所述位置偏移拟合出所述第二原始图像相对所述第一处理图像的位移参数和尺度参数;
    根据所述位移参数和所述尺度参数对所述第二原始图像进行形状对齐处理,获得与所述第一处理图像形状对齐的所述第五处理图像。
  16. 根据权利要求1所述的图像处理方法,还包括:对所述去除背景的目标图像进行以下至少一项处理:局部对比度增强、快速非局部均值去噪、三维块匹配滤波。
  17. 根据权利要求13所述的图像处理方法,还包括:在进行所述形状对齐处理之前,判断所述背景图像是否存在形变。
  18. 根据权利要求1所述的图像处理方法,还包括:采集候选背景图像,其中,所述候选背景图像为自目标物刚接触屏幕至目标物完全按压屏幕期间采样的多帧目标物图像。
  19. 根据权利要求18所述的图像处理方法,还包括:基于所述候选背景图像和经过局部亮度对齐处理的所述第一原始图像或所述第二原始图像,获得去除候选背景后的结果图像。
  20. 根据权利要求19所述的图像处理方法,还包括:将去除背景后的结果图像和所述去除候选背景后的结果图像中较好的一个作为所述去除背景的目标图像。
  21. 一种图像处理方法,包括:
    采集第三原始图像和第四原始图像,其中,所述第三原始图像是原始目标图像和背景图像中的一种,所述第四原始图像是所述原始目标图像和所述背景图像中的另一种;
    根据所述第三原始图像和所述第四原始图像,获得输入图像;
    对初始的图像生成网络进行训练,构建经过训练的图像生成网络;其中,所述图像生成网络以模板图像为参考对象进行训练,模板图像为使用权利要求1至20中任一项所述的图像处理方法获得的去除背景的目标图像;
    将输入图像输入至经过训练的图像生成网络,获得所述去除背景的目标图像。
  22. 根据权利要求21所述的图像处理方法,其中,根据第三原始图像和第四原始图像,获得输入图像包括:
    对所述第三原始图像和所述第四原始图像进行局部亮度对齐处理,将处理结果作为所述输入图像。
  23. 根据权利要求21所述的图像处理方法,其中,对初始的图像生成网络进行训练,构建经过训练的图像生成网络包括:
    获取第一样本图像和第二样本图像;
    将所述第一样本图像和所述第二样本图像输入至所述初始的图像生成网络,获得第一训练图像;
    将所述第一训练图像和所述模板图像输入至第一损失函数模块,根据所述第一损失函数模块输出的第一损失值训练所述初始的图像生成网络,构建所述经过训练的图像生成网络。
  24. 根据权利要求23所述的图像处理方法,其中,对初始的图像生成网络进行训练,构建经过训练的图像生成网络还包括:
    将所述第一训练图像和所述模板图像输入至特征提取网络,获得所述第一训练图像的高层语义特征和所述模板图像的高层语义特征;
    将所述第一训练图像的高层语义特征和所述模板图像的高层语义特征输入至第二损失函数模块,根据所述第二损失函数模块输出的第二损失值训练所述图像生成网络和/或所述特征提取网络。
  25. 一种描述子提取方法,包括:
    获取目标图像的关键点,其中,所述目标图像为使用权利要求1至20中任一项所述的图像处理方法获得的所述去除背景的目标图像;
    将具有相同关键点的多张所述目标图像归为同一个类别,标注类别信息作为图像标签;
    以所述关键点为中心,在具有表示所述同一个类别的所述图像标签的多张所述目标图像中截取图像块;
    对初始的描述子提取网络进行训练,构建经过训练的描述子提取网络;
    将所述图像块输入经过所述训练的描述子提取网络,获得特征描述子。
  26. 根据权利要求25所述的描述子提取方法,其中,在将所述图像块输入经过所述训练的描述子提取网络,获得特征描述子之前,所述描述子提取方法还包括:
    获取所述关键点的方向和角度;
    根据所述关键点的方向和角度,对所述图像块进行旋转拉平,获得对齐的图像块。
  27. 根据权利要求25所述的描述子提取方法,其中,使用端到端训练的方法训练图像生成网络、特征提取网络和所述描述子提取网络。
  28. 一种图像处理装置,包括:
    图像采集单元,设置为采集第一原始图像和第二原始图像,其中,所述第一原始图像是原始目标图像和背景图像中的一种,所述第二原始图像是所述原始目标图像和所述背景图像中的另一种;
    局部亮度对齐单元,设置为对所述第一原始图像进行局部亮度对齐处理,获得第一处理图像;
    结果获取单元,设置为基于所述第一处理图像与所述第二原始图像,获得第一结 果图像。
  29. 根据权利要求28所述的图像处理装置,其中,所述局部亮度对齐单元包括:
    第一像素值计算单元,设置为分别计算所述第一原始图像中每个像素点的像素值和每个像素点邻域窗口内的所有像素点的像素平均值,以及所述第二原始图像中每个像素点的像素值和每个像素点邻域窗口内的所有像素点的像素平均值;
    第一处理图像获得单元,设置为根据所述第一原始图像中每个像素点的像素值和每个像素点邻域窗口内的所有像素点的像素平均值,以及所述第二原始图像中每个像素点的像素值和每个像素点邻域窗口内的所有像素点的像素平均值,获得与所述第二原始图像局部亮度对齐的所述第一处理图像。
  30. 根据权利要求28所述的图像处理装置,其中,所述结果获取单元,通过对所述第一处理图像和所述第二原始图像做减法运算,获得所述第一结果图像。
  31. 根据权利要求28所述的图像处理装置,还包括整体亮度对齐单元,设置为在所述局部亮度对齐处理之前或之后进行整体亮度对齐处理。
  32. 根据权利要求31所述的图像处理装置,其中,所述整体亮度对齐单元包括:
    第二像素值计算单元,设置为分别计算所述第一处理图像的最大像素值和最小像素值,以及所述第二原始图像的最大像素值和最小像素值;
    整体亮度系数计算单元,根据所述第一处理图像的最大像素值和最小像素值,以及所述第二原始图像的最大像素值和最小像素值,获取所述第一处理图像相对所述第二原始图像的整体亮度尺度系数和整体亮度偏移系数;
    线性变换单元,基于所述整体亮度尺度系数和所述整体亮度偏移系数对所述第一处理图像进行线性变换,得到与所述第二原始图像整体亮度对齐的第二处理图像。
  33. 根据权利要求31所述的图像处理装置,其中,所述整体亮度对齐单元包括:
    第二像素值计算单元,设置为分别计算所述第一处理图像的最大像素值和最小像素值,以及所述第二原始图像的最大像素值和最小像素值;
    整体亮度系数计算单元,根据所述第一处理图像的最大像素值和最小像素值,以及所述第二原始图像的最大像素值和最小像素值,获取所述第二原始图像相对所述第一处理图像的整体亮度尺度系数和整体亮度偏移系数;
    线性变换单元,基于所述整体亮度尺度系数和所述整体亮度偏移系数对所述第二 原始图像进行线性变换,得到与所述第一处理图像整体亮度对齐的第三处理图像。
  34. 根据权利要求31所述的图像处理装置,还包括平滑处理单元,设置为在所述整体亮度对齐之前进行平滑处理。
  35. 根据权利要求28所述的图像处理装置,还包括形状对齐单元,设置为在所述局部亮度对齐处理之前或之后进行形状对齐处理。
  36. 根据权利要求35所述的图像处理装置,其中,所述形状对齐单元包括:
    位置计算单元,设置为计算所述第一处理图像中每个像素点到所述第二原始图像中对应目标像素点的位置偏移;
    拟合单元,设置为根据所述位置偏移拟合出所述第一处理图像相对所述第二原始图像的位移参数和尺度参数;
    对齐单元,设置为根据所述位移参数和所述尺度参数对所述第一处理图像进行形状对齐处理,获得与所述第二原始图像形状对齐的第四处理图像。
  37. 根据权利要求35所述的图像处理装置,其中,所述形状对齐单元包括:
    位置计算单元,设置为计算所述第一处理图像中每个像素点到所述第二原始图像中对应目标像素点的位置偏移;
    拟合单元,设置为根据所述位置偏移拟合出所述第二原始图像相对所述第一处理图像的位移参数和尺度参数;
    对齐单元,设置为根据所述位移参数和所述尺度参数对所述第二原始图像进行形状对齐处理,获得与所述第一处理图像形状对齐的第五处理图像。
  38. 一种图像处理装置,包括:
    图像采集单元,采集第三原始图像和第四原始图像,其中,所述第三原始图像是原始目标图像和背景图像中的一种,所述第四原始图像是所述原始目标图像和所述背景图像中的另一种;
    输入图像获取单元,根据所述第三原始图像和所述第四原始图像,获得输入图像;
    网络构建单元,对初始的图像生成网络进行训练,构建经过训练的图像生成网络;其中,所述图像生成网络以模板图像为参考对象进行训练,模板图像为使用权利要求1至24中任一项所述的图像处理方法获得的去除背景的目标图像;
    结果获取单元,将所述输入图像输入至所述经过训练的图像生成网络,获得所述 去除背景的目标图像。
  39. 根据权利要求38的图像处理装置,其中,所述输入图像获取单元,设置为对所述第三原始图像和所述第四原始图像进行局部亮度对齐处理,将处理结果作为所述输入图像。
  40. 根据权利要求38的图像处理装置,其中,所述网络构建单元包括:
    样本获取单元,设置为获取第一样本图像和第二样本图像;
    训练图像获取单元,设置为将所述第一样本图像和所述第二样本图像输入至所述初始的图像生成网络,获得第一训练图像;
    第一训练单元,设置为将所述第一训练图像和所述模板图像输入至第一损失函数模块,根据所述第一损失函数模块输出的第一损失值训练所述初始的图像生成网络,构建所述经过训练的图像生成网络。
  41. 根据权利要求38的图像处理装置,其中,所述网络构建单元还包括:
    特征提取单元,设置为将所述第一训练图像和所述模板图像输入至特征提取网络,获得所述第一训练图像的高层语义特征和所述模板图像的高层语义特征;
    第二训练单元,设置为将所述第一训练图像的高层语义特征和所述模板图像的高层语义特征输入至第二损失函数模块,根据所述第二损失函数模块输出的第二损失值训练所述图像生成网络和/或所述特征提取网络。
  42. 一种描述子提取装置,包括:
    关键点获取单元,设置为获取目标图像的关键点,其中,所述目标图像为使用权利要求1至24中任一项所述的图像处理方法获得的所述去除背景的目标图像;
    归类单元,设置为将具有相同关键点的多张所述目标图像归为同一个类别,标注类别信息作为图像标签;
    截图单元,设置为以所述关键点为中心,在具有表示所述同一个类别的所述图像标签的多张所述目标图像中截取图像块;
    描述子提取网络构建单元,设置为对初始的描述子提取网络进行训练,构建经过训练的描述子提取网络;
    特征描述子获取单元,设置为将所述图像块输入经过所述训练的描述子提取网络,获得特征描述子。
  43. 根据权利要求42所述的描述子提取装置,还包括:
    方向角度获取单元,设置为获取所述关键点的方向和角度;
    旋转拉平单元,设置为根据所述关键点的方向和角度,对所述图像块进行旋转拉平,获得对齐的图像块。
  44. 根据权利要求42所述的描述子提取装置,其中,使用端到端训练的方法训练所述图像生成网络、所述特征提取网络和所述描述子提取网络。
  45. 一种存储介质,其中,所述存储介质包括存储的程序,其中,在所述程序运行时控制所述存储介质所在设备执行权利要求1至24中任意一项所述的图像处理方法。
  46. 一种电子设备,其中,包括:
    处理器;以及
    存储器,设置为存储所述处理器的可执行指令;
    其中,所述处理器配置为经由执行所述可执行指令来执行权利要求1至24中任意一项所述的图像处理方法。
PCT/CN2021/139279 2020-12-17 2021-12-17 图像处理方法、描述子提取方法及其装置、电子设备 WO2022127916A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011502579.3A CN114648548A (zh) 2020-12-17 2020-12-17 图像处理方法、描述子提取方法及其装置、电子设备
CN202011502579.3 2020-12-17

Publications (1)

Publication Number Publication Date
WO2022127916A1 true WO2022127916A1 (zh) 2022-06-23

Family

ID=81990863

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/139279 WO2022127916A1 (zh) 2020-12-17 2021-12-17 图像处理方法、描述子提取方法及其装置、电子设备

Country Status (2)

Country Link
CN (1) CN114648548A (zh)
WO (1) WO2022127916A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117473105A (zh) * 2023-12-28 2024-01-30 浪潮电子信息产业股份有限公司 基于多模态预训练模型的三维内容生成方法及相关组件

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105590099A (zh) * 2015-12-22 2016-05-18 中国石油大学(华东) 一种基于改进卷积神经网络的多人行为识别方法
US20170220836A1 (en) * 2016-01-28 2017-08-03 University Of The West Indies Fingerprint classification system and method using regular expression machines
CN109446954A (zh) * 2018-10-17 2019-03-08 长安大学 一种基于超短二值描述子的快速指纹匹配方法和装置
CN110400335A (zh) * 2019-07-25 2019-11-01 广西科技大学 基于深度学习的纹理图像质量估计方法
CN111695386A (zh) * 2019-03-15 2020-09-22 虹软科技股份有限公司 一种指纹图像增强、指纹识别和应用程序启动方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105590099A (zh) * 2015-12-22 2016-05-18 中国石油大学(华东) 一种基于改进卷积神经网络的多人行为识别方法
US20170220836A1 (en) * 2016-01-28 2017-08-03 University Of The West Indies Fingerprint classification system and method using regular expression machines
CN109446954A (zh) * 2018-10-17 2019-03-08 长安大学 一种基于超短二值描述子的快速指纹匹配方法和装置
CN111695386A (zh) * 2019-03-15 2020-09-22 虹软科技股份有限公司 一种指纹图像增强、指纹识别和应用程序启动方法
CN110400335A (zh) * 2019-07-25 2019-11-01 广西科技大学 基于深度学习的纹理图像质量估计方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117473105A (zh) * 2023-12-28 2024-01-30 浪潮电子信息产业股份有限公司 基于多模态预训练模型的三维内容生成方法及相关组件
CN117473105B (zh) * 2023-12-28 2024-04-05 浪潮电子信息产业股份有限公司 基于多模态预训练模型的三维内容生成方法及相关组件

Also Published As

Publication number Publication date
CN114648548A (zh) 2022-06-21

Similar Documents

Publication Publication Date Title
CN109154978B (zh) 用于检测植物疾病的系统和方法
TWI395145B (zh) 手勢辨識系統及其方法
CN112052831B (zh) 人脸检测的方法、装置和计算机存储介质
JP4597391B2 (ja) 顔領域検出装置およびその方法並びにコンピュータ読み取り可能な記録媒体
US20160307057A1 (en) Fully Automatic Tattoo Image Processing And Retrieval
Konwar et al. An American sign language detection system using HSV color model and edge detection
TWI254891B (en) Face image detection method, face image detection system, and face image detection program
JP2002342756A (ja) デジタル画像において目と口の位置を検出する方法
Wu et al. Hemorrhage detection in fundus image based on 2D Gaussian fitting and human visual characteristics
KR20140139730A (ko) 깊이 차이를 이용한 얼굴 구성요소의 자동 분류 방법
JP2000105829A (ja) 顔パーツ検出方法及びその装置
CN107203742B (zh) 一种基于显著特征点提取的手势识别方法及装置
WO2020156033A1 (zh) 指纹验证方法及相关装置
TW201322058A (zh) 手勢辨識系統及方法
CN114862845B (zh) 手机触摸屏的缺陷检测方法、装置、设备及存储介质
WO2009114967A1 (zh) 基于移动扫描的图像处理方法及装置
CN107274452B (zh) 一种痘痘自动检测方法
Jaberi et al. Improving the detection and localization of duplicated regions in copy-move image forgery
WO2022127916A1 (zh) 图像处理方法、描述子提取方法及其装置、电子设备
CN112967264A (zh) 缺陷检测方法及装置、电子设备和存储介质
WO2018107574A1 (zh) 一种对印防伪特征的检测方法及装置
CN108647605B (zh) 一种结合全局颜色与局部结构特征的人眼凝视点提取方法
KR101967858B1 (ko) 3d 깊이 이미지 기반 객체 분리 장치 및 그 방법
CN111275687B (zh) 一种基于连通区域标记的细粒度图像拼接检测方法
CN109934152B (zh) 一种针对手语图像的改进小弯臂图像分割方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21905839

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21905839

Country of ref document: EP

Kind code of ref document: A1