WO2023125087A1 - Image processing method and related apparatus - Google Patents

Image processing method and related apparatus Download PDF

Info

Publication number
WO2023125087A1
WO2023125087A1 PCT/CN2022/139807 CN2022139807W WO2023125087A1 WO 2023125087 A1 WO2023125087 A1 WO 2023125087A1 CN 2022139807 W CN2022139807 W CN 2022139807W WO 2023125087 A1 WO2023125087 A1 WO 2023125087A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
infrared
infrared image
neural network
aforementioned
Prior art date
Application number
PCT/CN2022/139807
Other languages
French (fr)
Chinese (zh)
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
Priority claimed from CN202210207925.8A external-priority patent/CN116433729A/en
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023125087A1 publication Critical patent/WO2023125087A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration by the use of more than one image, e.g. averaging, subtraction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10048Infrared image
    • 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

Definitions

  • the present application relates to the technical field of image processing, and in particular to an image processing method and related devices.
  • the image collected by a color camera based on visible light imaging is usually blurry, while the image collected by an infrared camera based on infrared imaging is clear, but the color is not in color (the image captured by an infrared camera is usually a grayscale image).
  • the industry usually adopts a technical solution combining visible light and infrared light imaging.
  • the technical scheme of combining visible light and infrared light imaging is usually: after visible light and infrared light are respectively imaged to obtain visible light image and infrared image, then the visible light image and infrared image are fused to obtain the final output fusion image.
  • image registration based on feature matching usually needs to be performed on the multiple images first, but this kind of image registration scheme usually has lower accuracy when registering visible light images and infrared images. Poor, resulting in poor clarity of the image after fusion of visible light image and infrared image.
  • the present application discloses an image processing method and a related device, which can obtain a clear color image based on fusion of an obtained infrared image and a visible light image.
  • the present application provides an image processing method, the method comprising:
  • the target infrared image is calculated based on the aforementioned first infrared image and the aforementioned second infrared image, the aforementioned target infrared image includes a third infrared image and/or a fourth infrared image; the aforementioned third infrared image is obtained from the aforementioned first infrared image from the aforementioned T0 The moment is converted to the image obtained at the aforementioned T1 moment, and the aforementioned fourth infrared image is an image obtained by converting the aforementioned second infrared image from the aforementioned T2 moment to the aforementioned T1 moment;
  • the aforementioned target infrared image and the aforementioned visible light image are fused to obtain a fused image.
  • This application first acquires the first infrared image, the visible light image and the second infrared image (these three images are obtained by the shooting device at T0 time, T1 time and T2 time respectively in the same scene), and then based on the two infrared images conversion
  • the infrared image is corresponding to the moment when the visible light image is captured, so as to realize the registration of the captured infrared image and the visible light image.
  • This application realizes the registration of the infrared image and the visible light image through the conversion processing of the infrared image of the same mode (based on two captured infrared images), which improves the registration accuracy of the infrared image and the visible light image, so that the final fused image is more accurate. clear. Especially in low-light environments, clear and natural color images can be obtained.
  • the aforementioned calculation based on the aforementioned first infrared image and the aforementioned second infrared image to obtain the target infrared image includes:
  • the aforementioned target infrared image is calculated and obtained.
  • the aforementioned target infrared image includes the aforementioned third infrared image; the aforementioned adopts the optical flow method, and according to the relationship between the aforementioned T0, the aforementioned T1 and the aforementioned T2, as well as the aforementioned first infrared image and the aforementioned second infrared image, it is calculated to obtain
  • the aforementioned target infrared images include:
  • the aforementioned third infrared image is obtained by performing optical flow reverse mapping based on the aforementioned optical flow F3 and the aforementioned first infrared image.
  • this application uses the optical flow method to convert the captured infrared image to the corresponding infrared image at the time when the visible light image is captured, so as to realize the infrared image and visible light image registration.
  • the registration of the infrared image and the visible light image is realized by processing the infrared image of the same mode (based on two captured infrared images), and the registration accuracy of the infrared image and the visible light image is improved.
  • the aforementioned fusion of the aforementioned target infrared image and the aforementioned visible light image to obtain a fused image includes:
  • the aforementioned fused image is obtained.
  • the visible light image contributes color features
  • the infrared image obtained after the above conversion contributes texture features
  • image fusion based on the color features and texture features can obtain a clear and natural color image.
  • the aforementioned fusion of the aforementioned target infrared image and the aforementioned visible light image to obtain a fused image includes:
  • the aforementioned target infrared image and the aforementioned visible light image are fused through the first neural network to obtain the aforementioned fused image;
  • the aforementioned first neural network includes a color extraction neural network and a texture extraction neural network, and the aforementioned color extraction neural network is used to extract the color of the aforementioned visible light image
  • the aforementioned texture extraction neural network is used to extract the texture features of the aforementioned target infrared image.
  • the trained neural network is used to extract the color features of visible light images and the texture features of infrared images, which can make the extracted features more accurate and make the fused images more natural and clear.
  • the resolution of the color extraction neural network is not higher than a preset first resolution threshold and the number of layers of the color extraction neural network is not lower than a preset first network depth threshold.
  • the resolution of the texture extraction neural network is higher than a preset second resolution threshold, and the layer number of the texture extraction neural network is lower than a preset second network depth threshold.
  • the entire first neural network The computing power requirement is relatively low, compared with the existing neural network (for example, Unet neural network) which has high computing power requirement, the solution of this application has better hardware adaptability.
  • the visible light image input to the color extraction neural network may be a downsampled image, part of the noise is eliminated during the downsampling process, and the noise in the downsampled image is reduced. Therefore, the use of low-resolution color extraction neural network can enhance the anti-interference ability to noise.
  • the aforementioned method is implemented by an image processing model, and the aforementioned image processing model includes the aforementioned first neural network and the second neural network;
  • the aforementioned second neural network is used to obtain the optical flow F1 from the aforementioned first infrared image to the aforementioned second infrared image and the optical flow F2 from the aforementioned second infrared image to the aforementioned first infrared image; the aforementioned optical flow F1 and the aforementioned optical flow F2 is used to calculate and obtain the infrared image of the aforementioned target;
  • the aforementioned first neural network and the aforementioned second neural network included in the aforementioned image processing model are obtained through end-to-end training.
  • the end-to-end training can make the first neural network fault-tolerant to the calculation error of the optical flow in the second neural network (the neural network that extracts the optical flow), and finally makes the trained image processing model more robust .
  • the training images of the aforementioned image processing model are collected in an environment where the illuminance is lower than a preset illuminance threshold.
  • the image processing model trained in this way can learn the dark details, color and texture of the image, so that it can be fused to obtain a clear color image in a low-light environment .
  • the present application provides a photographing device, which includes a lens, a dimmer, a drive module, and an imaging module; the dimmer is located between the lens and the imaging module, and the driver module and the dimmer connect;
  • the aforementioned lens is used to gather the light incident on the aforementioned lens onto the aforementioned dimming sheet;
  • the aforementioned dimmer includes an infrared bandpass filter, an infrared cutoff filter and a shading sheet, the aforementioned infrared bandpass filter is used to allow infrared light to pass through and filter visible light, and the aforementioned infrared cutoff filter is used to allow visible light to pass through and filter the infrared light, the aforementioned shading sheet is used to prevent the light from passing through;
  • the aforementioned driving module is used to drive the movement of the aforementioned dimmer, so that the light collected on the aforementioned dimmer is incident on the aforementioned infrared bandpass filter during the first period, and is incident on the aforementioned infrared cutoff filter during the second period. , incident on the aforementioned shading sheet during the third period and the fourth period;
  • the aforementioned imaging module is used to receive the infrared light passing through the aforementioned infrared bandpass filter during the aforementioned first period, and to obtain a first infrared image based on the received infrared light during the aforementioned third period; and to receive the infrared image during the aforementioned second period Visible light passing through the aforementioned infrared cut filter, and obtaining a visible light image based on the received visible light in the aforementioned fourth period; the aforementioned first period, the aforementioned second period, the aforementioned third period and the aforementioned fourth period do not overlap.
  • the dimming film can flexibly adjust its own motion direction, speed and mode of motion (based on the drive module) according to the actual business needs, so that the dimming film can be gathered to the The light on the light-adjusting film hits a corresponding filter or a certain light-shielding film in the corresponding time period, so as to select different light filters in different time periods according to the demand, that is, finally, the shooting device can be used according to It is actually required to capture corresponding infrared images or visible light images at corresponding moments, which makes shooting very convenient and flexible.
  • the aforementioned dimmer is circular, the aforementioned infrared bandpass filter, the aforementioned infrared cut filter, and the aforementioned light-shielding plate are fan-shaped; the aforementioned drive module is used to drive the aforementioned dimmer to rotate.
  • the aforementioned dimmer is polygonal, the aforementioned infrared bandpass filter, the aforementioned infrared cut filter, and the aforementioned light-shielding plate are triangular; the aforementioned driving module is used to drive the aforementioned dimmer to rotate.
  • the aforementioned dimmer is rectangular, and the aforementioned infrared bandpass filter, the aforementioned infrared cutoff filter, and the aforementioned light shield are rectangular; the aforementioned drive module is used to drive the aforementioned dimmer to move.
  • the aforementioned infrared bandpass filter is adjacent to the aforementioned light-shielding sheet, and the aforementioned infrared cut-off filter is adjacent to the aforementioned light-shielding sheet.
  • the length of the first time period indicates the exposure time of the first infrared image
  • the length of the second time period indicates the exposure time of the visible light image
  • the length of the first period of time is related to the size of the shading sheet, and the shading sheet is adjacent to the infrared bandpass filter.
  • the light collected on the aforementioned dimmer is struck on the first infrared cut filter during the aforementioned second period;
  • the length of the aforementioned second period of time is related to the size of the second light-shielding sheet, and the aforementioned second light-shielding sheet is adjacent to the first infrared cut-off filter; the aforementioned first infrared cut-off filter is one of the aforementioned at least one infrared cut-off filter One; the second shading sheet is one of the at least one shading sheet; the first shading sheet is different or the same as the second shading sheet.
  • the length of the aforementioned first period of time or the length of the aforementioned second period of time is related to the moving speed of the aforementioned dimming film.
  • the moving speed of the dimmer chip is controlled by the driving module.
  • the end time of the first period is the start time of the third period; the end time of the second period is the start time of the fourth period.
  • the end time of the aforementioned first period is T0, and the end time of the aforementioned second period is T1;
  • the aforementioned drive module is also used to drive the movement of the aforementioned dimming sheet, so that the light gathered on the aforementioned dimming sheet is incident on the aforementioned infrared bandpass filter during the fifth period, so that the aforementioned imaging module obtains a second infrared image;
  • the aforementioned The end time of the fifth period is T2; wherein, T0 ⁇ T1 ⁇ T2; the aforementioned first infrared image, the aforementioned visible light image and the aforementioned second infrared image are obtained by shooting the same scene by the photographing device;
  • the foregoing photographing device further includes a processor, and the foregoing processor is configured to execute the method described in any one of the foregoing first aspects.
  • the aforementioned dimmer includes two aforementioned infrared bandpass filters, one aforementioned infrared cut filter and at least two aforementioned light shielding filters.
  • the aforementioned one infrared cut filter is located between the aforementioned two infrared bandpass filters.
  • an image processing device of the present application includes:
  • An acquisition unit configured to acquire a first infrared image, a visible light image, and a second infrared image; wherein, the aforementioned first infrared image, the aforementioned visible light image, and the aforementioned second infrared image are captured by the photographing device at time T0, T1, and T2, respectively The same scene is obtained, T0 ⁇ T1 ⁇ T2;
  • a computing unit configured to calculate a target infrared image based on the aforementioned first infrared image and the aforementioned second infrared image, where the aforementioned target infrared image includes a third infrared image and/or a fourth infrared image; the aforementioned third infrared image is the aforementioned first infrared image
  • the infrared image is converted from the aforementioned T0 moment to the image obtained at the aforementioned T1 moment
  • the aforementioned fourth infrared image is an image obtained by converting the aforementioned second infrared image from the aforementioned T2 moment to the aforementioned T1 moment;
  • the fusion unit is configured to fuse the aforementioned target infrared image and the aforementioned visible light image to obtain a fusion image.
  • the aforementioned calculation unit is specifically used for:
  • the aforementioned target infrared image is calculated and obtained.
  • the aforementioned target infrared image includes the aforementioned third infrared image; the aforementioned computing unit is specifically configured to:
  • the aforementioned third infrared image is obtained by performing optical flow reverse mapping based on the aforementioned optical flow F3 and the aforementioned first infrared image.
  • the aforementioned fusion unit is specifically used for:
  • the aforementioned fused image is obtained.
  • the aforementioned fusion unit is specifically used for:
  • the aforementioned target infrared image and the aforementioned visible light image are fused through the first neural network to obtain the aforementioned fused image;
  • the aforementioned first neural network includes a color extraction neural network and a texture extraction neural network, and the aforementioned color extraction neural network is used to extract the color of the aforementioned visible light image
  • the aforementioned texture extraction neural network is used to extract the texture features of the aforementioned target infrared image.
  • the resolution of the color extraction neural network is not higher than a preset first resolution threshold and the number of layers of the color extraction neural network is not lower than a preset first network depth threshold.
  • the resolution of the texture extraction neural network is higher than a preset second resolution threshold, and the layer number of the texture extraction neural network is lower than a preset second network depth threshold.
  • the operations performed by the aforementioned device are realized by an image processing model, and the aforementioned image processing model includes the aforementioned first neural network and the second neural network;
  • the aforementioned second neural network is used to obtain the optical flow F1 from the aforementioned first infrared image to the aforementioned second infrared image and the optical flow F2 from the aforementioned second infrared image to the aforementioned first infrared image; the aforementioned optical flow F1 and the aforementioned optical flow F2 is used to calculate and obtain the infrared image of the aforementioned target;
  • the aforementioned first neural network and the aforementioned second neural network included in the aforementioned image processing model are obtained through end-to-end training.
  • the training images of the aforementioned image processing model are collected in an environment where the illuminance is lower than a preset illuminance threshold.
  • the present application provides an image processing device, including a processor and a memory, configured to implement the method described in the above first aspect and its possible implementation manners.
  • the memory is coupled to the processor, and when the processor executes the computer program stored in the memory, the image processing apparatus can implement the method described in the first aspect or any possible implementation manner of the first aspect.
  • the device may further include a communication interface, which is used for the device to communicate with other devices.
  • the communication interface may be a transceiver, circuit, bus, module or other type of communication interface.
  • the communication interface includes a receiving interface and a sending interface, the receiving interface is used for receiving messages, and the sending interface is used for sending messages.
  • the device may include:
  • the target infrared image is calculated based on the aforementioned first infrared image and the aforementioned second infrared image, the aforementioned target infrared image includes a third infrared image and/or a fourth infrared image; the aforementioned third infrared image is obtained from the aforementioned first infrared image from the aforementioned T0 The moment is converted to the image obtained at the aforementioned T1 moment, and the aforementioned fourth infrared image is an image obtained by converting the aforementioned second infrared image from the aforementioned T2 moment to the aforementioned T1 moment;
  • the aforementioned target infrared image and the aforementioned visible light image are fused to obtain a fused image.
  • the computer program in the memory in this application can be stored in advance or can be stored after being downloaded from the Internet when using the device.
  • This application does not specifically limit the source of the computer program in the memory.
  • the coupling in the embodiments of the present application is an indirect coupling or connection between devices, units or modules, which may be in electrical, mechanical or other forms, and is used for information exchange between devices, units or modules.
  • the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any one of the above-mentioned first aspect and its possible implementation modes can be realized the method described.
  • the present application provides a computer program product, including a computer program.
  • the computer program When the computer program is executed by a processor, the computer is made to perform the method described in any one of the above first aspects.
  • the devices described in the third aspect and the fourth aspect provided above, the computer storage medium described in the fifth aspect, and the computer program product described in the sixth aspect are all used to implement any one of the above first aspects provided method. Therefore, the beneficial effects that it can achieve can refer to the beneficial effects in the corresponding method, and will not be repeated here.
  • Fig. 1 is a schematic diagram of the photographing device and its photographing principle provided by the embodiment of the present application;
  • FIG. 2A, FIG. 2B and FIG. 2C are structural schematic diagrams of the dimmer provided in the embodiment of the present application;
  • FIG. 2D is a schematic diagram of the image shooting moment provided by the embodiment of the present application.
  • FIG. 3 is a schematic structural diagram of a dimmer provided in an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of an image processing method provided in an embodiment of the present application.
  • FIG. 5 is a schematic diagram of the field of view space of the imaging device provided by the embodiment of the present application.
  • 6A and 6B are schematic structural diagrams of the image fusion neural network provided by the embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of an image processing model provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of images captured by the imaging device provided in the embodiment of the present application at different times;
  • FIG. 9 is a schematic diagram of a logical structure of an image processing device provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of a hardware structure of an image processing device provided by an embodiment of the present application.
  • Optical flow expresses the change of the image, and because it contains the information of the target's motion, it can be used by the observer to determine the motion of the target.
  • optical flow is the instantaneous speed of pixel movement of spatially moving objects on the imaging plane.
  • optical flow is generated due to the movement of the foreground object itself in the scene, the movement of the camera, or the joint movement of both.
  • optical flow is also digital.
  • the optical flow from a certain pixel of the first image to a certain pixel of the second image may be expressed as (u, v). If both the first image and the second image are in the same pixel coordinate system, for the sake of understanding, it is assumed that the time difference between the shooting moment of the first image and the shooting moment of the second image is very short, which can be regarded as a unit time difference, then , u represents the number of pixels that the certain pixel in the second image moves relative to the certain pixel in the first image in the horizontal direction, and v represents the number of pixels that the certain pixel in the second image moves vertically relative to the first image The number of pixels by which a certain pixel in an image is moved.
  • the optical flow method uses the changes of pixels in the image sequence in the time domain and the correlation between adjacent frames to find the correspondence between the previous frame and the current frame, thereby calculating the motion information of objects between adjacent frames.
  • Optical flow reverse mapping is an implementation of the optical flow method.
  • the reverse mapping of the optical flow usually refers to the known optical flow from the first image to the second image and the second image, and the first image is obtained by converting the second image through the optical flow.
  • the optical flow from a certain pixel point A of the first image to the pixel point A of the second image is expressed as (u, v), and the coordinates of the pixel point A in the second image are (x1, y1 ).
  • the coordinates of the pixel point A in the first image are defined as (x2, y2)
  • optical flow reverse mapping also includes other details of conventional processing, such as interpolation processing, etc., which will not be described here.
  • a heteromodal image generally refers to multiple images obtained by imaging separately based on light of different spectra (or frequencies).
  • the spectra (or frequencies) of infrared light and visible light are different, infrared images can be obtained based on infrared light imaging, and visible light images can be obtained based on visible light imaging. Then, the infrared image and the visible light image are images of different modes.
  • the expressions of heteromodal images are usually different.
  • an infrared image is usually a grayscale image, and the color of a pixel in the grayscale image is represented by a grayscale value, and the grayscale value ranges from 0 to 255.
  • the visible light image is a color image, and the colors of the pixels of the color image are represented by at least three color values. Each of the three color values ranges from 0 to 255.
  • Image registration usually refers to the process of matching and superimposing two or more acquired images. Image registration is usually implemented based on feature matching. Taking the registration of two images as an example, the image registration process is as follows: firstly, feature extraction is performed on the two images to be registered to obtain feature points, and the matching feature point pairs are found by performing similarity measurement; The matched feature point pairs obtain the coordinate transformation parameters of the image space; finally, the matching of the two images is completed by the coordinate transformation parameters.
  • a shooting technology solution combining visible light and infrared light imaging may be used.
  • the scheme obtains a visible light image based on visible light imaging and an infrared image based on infrared light imaging, and then fuses the visible light image and the infrared image to obtain a final output fusion image.
  • the fused image can combine the color information of the visible light image and the texture information of the infrared image, so the fused image should be a relatively clear color image.
  • the infrared image and the visible light image are images of different modalities, and the expressions of pixels in the images of different modalities are usually different, when using the method based on feature matching in the prior art When registering heteromodal images, the accuracy is usually lower. Especially in the case of relatively fast movement between the camera and the object to be photographed, the registration accuracy of heteromodal images based on feature matching will be further reduced. However, the low registration accuracy of the visible light image and the infrared image will cause problems such as ghosting in the final fused image, that is, the definition of the final fused image is still poor.
  • the present application provides a photographing device and an image processing method.
  • the photographing device 100 provided by the present application includes an infrared light emitter 101 , a lens 102 , a dimmer 103 and an imaging module 104 .
  • the infrared light emitter 101 can be used to emit infrared light, which will strike the subject 120 .
  • the lens 102 may be a convex lens, which is used to gather light incident on the lens 102 (for example, light reflected by the object 120 ) onto the dimmer sheet 103 .
  • the light collected on the dimmer sheet 103 can be a light beam or a light spot.
  • the dimmer 103 is located between the lens 102 and the imaging module 104 and can be used to select the light gathered by the lens 102 to adjust the light incident to the imaging module 104 .
  • the imaging module 104 may include a photoelectric conversion unit and an image processing unit.
  • the photoelectric conversion unit is used to receive the light passing through the dimmer 103 through the photosensitive surface, and convert the light image on the photosensitive surface into an electrical signal having a corresponding proportional relationship with the light image.
  • the image processing unit is used to process the converted electrical signal to obtain an image.
  • the photoelectric conversion unit may be a photosensitive element such as an image sensor, and the image processing unit may be an image signal processor (image signal processor) or the like.
  • the imaging module 104 may include one or more sensors. If a sensor is included, the sensor can either process infrared light to obtain an infrared image, or process visible light to obtain a visible light image. If multiple sensors are included, one of the sensors can be used to process infrared light to obtain an infrared image, and the other sensor can be used to process visible light to obtain a visible light image.
  • the shooting principle of the shooting device 100 As shown in FIG. 1 , after the infrared light emitted by the infrared light emitter 101 hits the object 120 to be photographed, it will be reflected (or scattered).
  • the reflected (or scattered) light is collected by the lens 102 of the photographing device 100 to the dimmer 103 , filtered by the dimmer 103 and then incident to the imaging module 104 .
  • the incident light is processed and imaged by the imaging module 104 .
  • the visible light in the natural environment and the reflected (or scattered) light after hitting the subject 120 will also be gathered to adjust Light sheet 103.
  • the light (the light collected on the dimmer 103 ) is also filtered by the dimmer 103 , and only the light allowed by the dimmer 103 can enter the imaging module 104 .
  • the dimmer 103 may include multiple light filters and at least one light-shielding film.
  • the plurality of filters include at least one infrared bandpass filter and at least one infrared cut filter.
  • the arbitrary infrared bandpass filter is used to allow infrared light to pass through and filter visible light
  • the arbitrary infrared cut filter is used to allow visible light to pass through and filter infrared light
  • the arbitrary shading film is used to prevent light from passing through , which filters both visible light and infrared light.
  • the above-mentioned photographing device 100 further includes a driving module, and the driving module is connected with the above-mentioned dimmer 103 .
  • the driving module can drive and control the movement of the dimmer 103, so that the light gathered on the dimmer 103 hits a filter or a shading at different time periods, so as to realize the dimming of the dimmer 103.
  • the light on sheet 103 is selected and controlled for purposes.
  • the structure of the dimmer 103 shown in Fig. 1 can be as shown in Fig. 2A, and this dimmer 103 comprises two infrared band-pass filters 1031 (respectively infrared band-pass filter 1031-1 and infrared band-pass filter 1031-1 filter 1031-2), an infrared cut filter 1032 and three light shields 1033 (respectively 1033-1, 1033-2 and 1033-3).
  • a shading sheet 1033 is arranged between any adjacent two of the above-mentioned three optical filters (two infrared bandpass optical filters 1031 and one infrared cut optical filter 1032) .
  • the structure of the dimmer 103 shown in FIG. 1 may also be as shown in FIG. 2B .
  • the dimmer 103 includes an infrared band-pass filter 1031, an infrared cut-off filter 1032 and two shading films 1033 (respectively 1033-1 and 1033-2).
  • the structure of the dimmer 103 shown in FIG. 1 may be as shown in FIG. 2C .
  • the dimmer 103 includes an infrared band-pass filter 1031 , an infrared cut-off filter 1032 and a shading film 1033 .
  • the propagation path of the light incident on the lens 102 after being collected by the lens 102 remains unchanged. Therefore, the light collected on the dimmer 103 usually hits a certain part of the dimmer 103. Physically fixed orientation (see Figure 1). In this way, when the dimming sheet 103 is driven by the drive module to rotate with the center point O of the dimming sheet 103, the light gathered to the dimming sheet 103 will be adjusted at different time periods (that is, time periods). In different fan-shaped areas on the light sheet 103.
  • the dimmer 103 can select and filter the light collected on the dimmer 103 .
  • the aforementioned driving module may be, for example, a driving device such as a motor, which is not limited in this embodiment of the present application.
  • the light gathered to the dimmer 103 hits the fan-shaped area corresponding to the infrared bandpass filter 1031-1 in the first period of time. Then, in the first time period, after the light collected on the dimmer 103 passes through the infrared bandpass filter 1031 - 1 , only infrared light can pass through and enter the imaging module 104 .
  • the length of the first period can be understood as the exposure time of infrared light (the length of the exposure time period).
  • the dimmer 103 is rotated, so that the light gathered on the dimmer 103 hits the fan-shaped area corresponding to the light shield 1033-2 during the second period.
  • the light shielding sheet 1033 - 2 prevents the light collected on the light adjusting sheet 103 from hitting the imaging module 104 . That is to say, during the second period, the dimmer 103 prevents any light (including visible light and infrared light) from incident on the imaging module 104 .
  • the imaging module 104 will also be triggered to process the infrared light received in the first period in the second period (passing through the dimming panel 103-2). Infrared light from sheet 103) and obtain an infrared image, for example, obtain a first infrared image.
  • the end moment of the first period can be understood as the shooting moment or imaging moment of the first infrared image.
  • the length of the above-mentioned second period may be referred to as the light-shielding duration of the light-shielding sheet 1033-2.
  • the dimmer 103 is rotated, so that the light collected on the dimmer 103 hits the corresponding fan-shaped area of the infrared cut filter 1032 in the third period.
  • the third period after the light collected on the dimmer 103 passes through the infrared cut filter 1032 , only visible light can pass through and enter the imaging module 104 .
  • the third period can be understood as the exposure time of visible light.
  • the light gathered to the dimmer 103 can hit the fan-shaped area corresponding to the dimmer 1033-3 in the fourth period.
  • the imaging module 104 can be triggered to process the visible light (visible light passing through the dimmer 103 ) received in the third period to obtain a visible light image in the fourth period, and the third The end moment of the period can be understood as the shooting moment of the available light image.
  • the above-mentioned length of the fourth period of time may be referred to as the light-shielding duration of the light-shielding sheet 1033-3.
  • the dimming sheet 103 can continue to rotate under the control of the driving module, so that the light gathered to the dimming sheet 103 hits the infrared bandpass filter 1031-2 and the shading sheet 1033 in the fifth period and the sixth period respectively.
  • -1 corresponds to the fan-shaped area, so that the camera can obtain the second infrared image.
  • the exposure time of the second infrared image is the length of the fifth time period
  • the shooting time of the second infrared image is the end time of the fifth time period, which will not be repeated here.
  • the dimmer sheet 103 can continue the above rotation under the control of the driving module, so that the photographing device can obtain an infrared image or a visible light image.
  • first to sixth periods of time may be consecutive, but not overlapping with each other. It should also be understood that the duration of each of the first to sixth time periods may be the same or different.
  • two infrared images and one visible light image can be obtained by rotating the dimming plate 103 once.
  • one infrared image and one visible light image can be obtained by one revolution of the dimmer sheet 103 .
  • two infrared images and one visible light image can also be obtained by driving the dimmer 103 to rotate one and a half times. Specifically, the dimmer 103 can be driven counterclockwise (as shown in FIG.
  • the driving module can drive the dimmer 103 to always move in one direction during the working process, for example, the driving module drives the dimmer 103 to always rotate clockwise, or Always rotate counterclockwise.
  • the driving module can flexibly control the direction of movement of the dimmer based on business requirements. For example, in the example shown in FIG. 2C , the driving module can control and drive the dimmer 103 to rotate clockwise sometimes and counterclockwise sometimes.
  • the driving module can drive the dimmer 103 to rotate clockwise, so that the light gathered on the dimmer 103 can hit the infrared band-pass filter 1031, the light-shielding film 1033, and the infrared cut-off filter 1032 in sequence; Then, the driving module can drive the dimmer 103 to rotate counterclockwise, so that the light collected on the dimmer 103 strikes the light shield 1033 and the infrared bandpass filter 1031 again in sequence. Then, the driving module can drive the dimming chip 103 to rotate clockwise again.
  • the photographing device can sequentially obtain an infrared image, a visible light image, an infrared image, and a visible light image, etc., which will not be repeated here.
  • the size of the shading plate can be used to adjust the exposure time of the infrared bandpass filter or the infrared cutoff filter. The following description will be made in conjunction with the example shown in FIG. 2A .
  • the exposure duration corresponding to the corresponding filter can be adjusted by adjusting the angle of the central angle corresponding to each sector.
  • adjusting the size of the central angle 1 corresponding to the infrared bandpass filter 1031-1 can adjust the infrared light exposure time corresponding to the infrared bandpass filter 1031-1, and adjust the corresponding infrared light exposure time of the infrared bandpass filter 1031-2.
  • the size of the central angle 2 can adjust the infrared light exposure time corresponding to the infrared band-pass filter 1031-2
  • the size of the central angle 3 corresponding to the infrared cut-off filter 1032 can adjust the visible light corresponding to the infrared cut-off filter 1032. exposure time.
  • the central angle of the light-shielding sheet 1033 is enlarged, the central angle of the optical filter (infrared bandpass optical filter 1031 and infrared cut-off optical filter 1032 are collectively referred to as optical filter)
  • optical filter infrared bandpass optical filter 1031 and infrared cut-off optical filter 1032 are collectively referred to as optical filter
  • the corresponding strain will be small. Therefore, the exposure time of the corresponding filter can also be adjusted by adjusting the size of the central angle of each light shield.
  • the central angle 1 of the infrared bandpass filter 1031-1 can be increased (or decreased) by reducing (or increasing) the central angle of the shading film 1033-1, so as to Increase (or decrease) the exposure time of the infrared light corresponding to the infrared bandpass filter 1031-1.
  • the central angle 2 of the infrared bandpass filter 1031-2 can be increased (or reduced) by reducing (or increasing) the central angle of the shading sheet 1033-3 to increase (or decrease) the infrared bandpass The exposure time of the infrared light corresponding to the filter 1031-2.
  • the central angle 3 of the infrared cut-off filter 1032 can be increased (or reduced) by reducing (or increasing) the central angle of the shading plate 1033-2, so as to increase (or reduce) the infrared cut-off filter 1032 corresponds to the exposure time of visible light.
  • the central angle 2 of the infrared bandpass filter 1031-2 can be increased (or decreased) by reducing (or increasing) the central angle of the shading plate 1033-1, so as to Increase (or decrease) the exposure time of the infrared light corresponding to the infrared bandpass filter 1031-2.
  • the central angle 3 of the infrared cut filter 1032 can be increased (or reduced) by reducing (or increasing) the central angle of the shading sheet 1033-3, so as to increase (or reduce) the corresponding Visible light exposure time.
  • the central angle 1 of the infrared bandpass filter 1031-1 can be increased (or decreased) by reducing (or increasing) the central angle of the shading sheet 1033-2 to increase (or decrease) the infrared bandpass filter
  • the exposure time of the infrared light corresponding to the slice 1031-1 The longer the exposure time of infrared light, the more details in the dark part of the image can be obtained, that is, the texture of the image is clearer. The longer the visible light exposure time, the more color information of the image can be obtained, that is, the color of the image is more natural.
  • the shading duration of the shading sheet and the exposure duration of each filter can be controlled by adjusting the size of the shading sheet. It should be noted that the exposure duration of each filter in the dimmer and the shading duration of each shade can also be adjusted by controlling the movement speed of the dimmer. For example, in the example of the circular dimmer shown in Figure 2A- Figure 2C, assuming that the rotation speed of the dimmer is t seconds, one circle is 360°, then 1° rotation requires t/360 Second. Then, if the fan-shaped central angle of a filter is ⁇ °, the exposure time corresponding to the filter is ( ⁇ *t)/360 seconds.
  • the moving speed of the dimming film can be controlled by the driving module.
  • the driving module can control the dimmer 103 to rotate at a certain speed at a constant speed. For example, 20 revolutions per second, 30 revolutions per second, or 50 revolutions per second, etc.
  • the driving module can control the dimming sheet 103 to rotate at the first speed in a certain period of time and at the second speed in another period of time according to business requirements.
  • the first speed For example, during the period of time when the light collected on the dimming film hits the filter, it rotates at the first speed; during the time period when the light collected on the dimming film hits the light shielding film, it rotates at the second speed; wherein The first speed is different from the second speed.
  • the shooting device can conveniently control the shooting moment of the image.
  • the following is based on the example described above when introducing the working principle of the dimmer shown in FIG. 2A , and will be introduced in conjunction with FIG. 2D .
  • the movement of the dimmer can be controlled based on the driving module, so that the above-mentioned first The end time of a period is T0, the end time of the third period is T1, and the end time of the fifth period is T2. That is to say, the photographing device 100 can conveniently photograph the above-mentioned first infrared image, visible light image and second infrared image.
  • the dimmer 103 in the photographing device 100 can flexibly adjust its own motion direction, speed and mode of motion (based on the drive module) according to actual business needs, so that the dimmer 103 can The light collected on the dimmer 103 hits a corresponding filter or a certain light-shielding film in a corresponding time period, so as to select different filters in different time periods according to requirements, that is, finally
  • the photographing device 100 can photograph corresponding infrared images or visible light images at corresponding moments according to actual needs, making photographing very convenient and flexible.
  • the dimmer 103 shown in FIG. 1 can also be polygonal, for example, it can be triangular, quadrangular or hexagonal, etc., correspondingly, the above-mentioned infrared bandpass filter 1031, infrared cutoff
  • the optical filter 1032 and the shading sheet 1033 can be triangular, quadrilateral or hexagonal respectively. It should be understood that the specific dimming function and working principle of the polygonal structure of the dimming sheet are similar to those of the above circular structure, and will not be repeated here.
  • the rotation (for example, rotation direction, rotation speed, etc.) of the dimmer 103 can also be driven and controlled based on the driving module, so that the shooting device 100 can capture corresponding infrared images or images at corresponding times according to actual needs. Visible light images will not be repeated here.
  • the dimmer 103 shown in FIG. 1 can also be rectangular, and correspondingly, the above-mentioned infrared bandpass filter 1031, infrared cutoff filter 1032 and shading sheet 1033 can also be rectangular, See, for example, FIG. 3 .
  • the driving module can drive the dimmer 103 to move during operation, so that the light collected on the dimmer 103 strikes a filter or a light shield at different time periods.
  • the shooting principle when the dimming sheet 103 is rectangular will be introduced below with reference to FIG. 3 .
  • the dimmer 103 shown in FIG. 3 can move in one direction (for example, the first direction), so that the light gathered to the dimmer 103 can be illuminated sequentially at different time intervals, labeled 1, 2, 3, 4 and 5 corresponding to the rectangular area.
  • the driving module can drive the dimmer 103 to move in the direction opposite to the above-mentioned first direction, so that the light collected on the dimmer 103 hits the rectangular areas corresponding to the labels 4, 3, 2 and 1 in sequence.
  • the light gathered to the dimmer 103 can be sequentially respectively in the first period, the second period, the third period, and the second period.
  • the fourth period and the fifth period are played on the infrared bandpass filter 1031-1, the shading sheet 1033-1, the infrared cut-off filter 1032, the shading sheet 1033-2 and the infrared bandpass filter 1031-2; after that, During the movement of the dimming sheet 103 in the opposite direction to the first direction, the light gathered to the dimming sheet 103 can hit the light shielding sheet 1033-2 in the sixth period, the seventh period and the eighth period respectively, On the infrared cut filter 1032 and the shading sheet 1033-1.
  • the photographing device 100 can process and obtain the first infrared image at the end of the first time period (or the beginning of the second time period), and obtain the first infrared image at the end of the third time period (or the beginning of the fourth time period).
  • the light image is processed to obtain the second infrared image at the end of the fifth period (or the beginning of the sixth period), and the second visible light image is obtained at the end of the seventh period (or the beginning of the eighth period). Subsequent processes are similar and will not be repeated here.
  • the length of the period during which the light gathered to the dimmer 103 hits each filter can be used to indicate the exposure time of the corresponding infrared image or visible light image.
  • the length of the first time period may be used to indicate the exposure time of the first infrared image
  • the length of the third time period may be used to indicate the exposure time of the first visible light image. Therefore, it can be understood that the width of each filter can affect the exposure time of the corresponding infrared image or visible light image. Therefore, when the overall width of the light-shielding sheet 103 is fixed, the exposure duration of the corresponding light-shielding sheet can be adjusted by adjusting the width of the rectangular area of each light-shielding sheet.
  • the width of the shading film 1033-1 can be narrowed (or widened) to increase (or reduce) the width of the infrared bandpass filter 1031-1 to increase (or reduce) the width of the infrared bandpass filter
  • the exposure time of the infrared light corresponding to the slice 1031-1 The same is true for other filters, which will not be repeated here.
  • each filter and the shading duration of each shading sheet can also be controlled by controlling the moving speed of the dimmer 103 , which will not be repeated here.
  • the moving speed of the dimmer 103 can also be controlled by the driving module. The application does not limit the magnitude of the moving speed of the dimmer 103 or whether the moving speed changes.
  • the dimmer 103 shown in FIG. 3 can also flexibly select and control the light gathered on the dimmer 103 according to business requirements, and can flexibly control the exposure time of various lights. , so that finally the photographing device 100 can photograph corresponding infrared images or visible light images at a corresponding time according to actual needs, making the photographing very convenient and flexible.
  • the above-mentioned dimmer 103 is not limited to the form described above, and can also be in other forms, as long as the dimmer including the above-mentioned light filter and light-shielding film falls within the protection scope of the present application.
  • the light filter and light-shielding film in the dimmer 103 are not limited to the shapes described above, and may also be in other shapes, such as circular or polygonal. It should also be noted that if the dimmer 103 is polygonal or rectangular, then the circular dimmer 103 shown in FIG. 1 should be replaced with a polygonal or rectangular dimmer 103 , which will not be repeated here.
  • the photographing device 100 provided in the present application may also include other components other than those shown in FIG. 1 , which is not limited in the present application.
  • the camera 100 includes a processor.
  • the processor may be used to execute the image processing method provided in the embodiment of the present application (for an example, refer to the description in FIG. 4 below, which will not be repeated here).
  • the shooting device can shoot the same scene based on the above-mentioned dimmer, driving module, imaging module and other modules, and obtain the first infrared image, the visible light image and the second infrared image respectively at T0 time, T1 time and T2 time, and then The final fused image is obtained by executing the image processing method provided by the embodiment of the present application based on the processor (see the description in FIG. 4 below for an example, which will not be repeated here).
  • the photographing device 100 may also include a casing (not shown in FIG. 1 ), and the above-mentioned infrared light emitter 101, lens 102, dimmer 103 and imaging module 104 may be exemplarily according to the relative positions shown in FIG. 1 fixed in the housing.
  • the photographing device 100 may also include a flashlight, a memory card, etc., which will not be repeated here.
  • the above-mentioned shooting device 100 can be any device with the above-mentioned shooting structure and functions, for example, it can be a camera, various cameras (such as monitoring or security cameras), or a smart phone, a tablet computer, a handheld computer, a smart wearable device (Including smart bracelets, smart watches and smart glasses, etc.) and other forms of user equipment (User Equipment, UE), mobile station (Mobile station, MS), terminal equipment (Terminal Equipment) and so on.
  • UE User Equipment
  • MS mobile station
  • Terminal Equipment Terminal Equipment
  • the subject of execution of the method may be an image processing device.
  • the image processing device may be a photographing device that captures images, or may be other devices with computing capabilities (such as a server, a processing chip, etc.) that are different from the photographing device.
  • the imaging module in the photographing device may send the captured image to a processor of the photographing device for processing after acquiring an image. If the execution subject is another device with computing capability, then, after the photographing device captures an image through the imaging module, it sends the captured image to the device with computing capability for processing.
  • Figure 4 is a schematic flow chart of the image processing method provided by the present application, which includes but is not limited to the following steps:
  • the above-mentioned "scene” refers to the shooting scene of the shooting device or the viewing space of shooting.
  • the viewing space (or shooting scene) includes one or more target objects to be photographed, and the target objects may be any objects in the viewing space, for example, animals, plants, vehicles, people and so on.
  • FIG. 5 In order to facilitate understanding of the viewing space, reference may be made to FIG. 5 by way of example.
  • the view space shown in FIG. 5 is similar to a polyhedron, that is, the space of the polyhedron formed by faces ABCD, sides AE, BH, CG, DF and face EFGH is the view space of the camera. Exemplarily, the surfaces ABCD and EFGH can move relative to each other.
  • FIG. 5 is only an example, and does not constitute a limitation to the embodiment of the present application.
  • the photographing device may be fixed, and the target object moves within the range of the field of view of the photographing device.
  • the photographing device may be fixed on a light pole, and the target object in the visual field captured by the photographing device may be a moving vehicle on the road.
  • the shooting device can keep its field of view range covering all or part of the field of view space (or shooting scene) during the moving process.
  • the shooting device may rotate around the stage to shoot, but the shooting angle of the shooting device is always facing the center of the stage, so that its field of view covers all or part of the shooting scene.
  • both the object of interest and the camera device in the field of view being photographed may be moving.
  • the image captured by the photographing device may include a complete target object in the captured field of view, or may only include a part of a certain target object.
  • the captured space contains a train
  • only a portion of the train may be included in the captured image. This can be adjusted according to actual needs, which is not limited in this application.
  • the shooting device shoots the same scene at T0 time, T1 time and T2 time respectively may mean that the field of view spaces captured by the shooting device at the three time points are completely the same, or It may be that the field of view spaces photographed by the photographing device at the three moments are partly the same.
  • the photographing device is stationary during the process of photographing three images, the field of view space photographed by the photographing device at the three moments may be completely the same.
  • the photographing device moves during the process of photographing the three images, the view spaces photographed by the photographing device at the three moments may only be partly the same.
  • the fusion of the infrared image and the visible light image needs to be realized based on the images captured at three moments, so at least one of the infrared images and the visible light image in the three captured images has part of the same content (otherwise, it cannot for fusion). Therefore, when the above-mentioned photographing device photographs the same scene at three moments, it may mean that the field of view spaces photographed by the photographing device at the three moments are partly the same.
  • the photographing device may be, for example, the photographing device 100 shown in FIG. 1 above.
  • the photographing device may also be a device comprising two photographing modules (for example, two sets of lenses and sensors are respectively provided), wherein one photographing module has the function of taking infrared images, and the other photographing module has the function of taking visible light Image function.
  • the infrared image capturing module can capture the first infrared image at T0 and the second infrared image at T2 through the preset configuration
  • the visible light capturing module can capture the visible light image at T1 .
  • the present application does not limit the specific form and structure of the photographing device.
  • the first infrared image can be captured by the photographing device , a visible light image and a second infrared image.
  • the execution subject is the above-mentioned other device with computing capability, then, after the photographing device obtains the first infrared image, the visible light image and the second infrared image, it can send the obtained images to The other device having computing capabilities.
  • the target infrared image includes a third infrared image and/or a fourth infrared image; the third infrared image is the conversion of the first infrared image from time T0 to The image obtained at time T1, and the fourth infrared image is an image obtained by converting the second infrared image from time T2 to time T1.
  • the image processing device obtains the above-mentioned first infrared image, visible light image and second infrared image, and obtains the shooting time T0 of the first infrared image, the shooting time T1 of the visible light image, and the shooting time of the second infrared image T2.
  • the image processing device may record the shooting moments of the above-mentioned first infrared image, visible light image and second infrared image, so as to obtain the T0, T1 and T2.
  • the shooting device may send the recorded T0, T1 and T2 to the image processing device.
  • the target infrared image including the third infrared image and the fourth infrared image As an example, the specific process of calculating the target infrared image based on the first infrared image and the second infrared image will be introduced below.
  • the image processing device calculates the optical flow F1 from the first infrared image to the second infrared image, and calculates the optical flow F2 from the second infrared image to the first infrared image.
  • the optical flow extraction neural network can be used to calculate the optical flow F1 and the optical flow F2, the input of the optical flow extraction neural network is the first infrared image and the second infrared image, and the output is the optical flow Flow F1 and Optical Flow F2.
  • the optical flow extraction neural network may be a Unet architecture neural network.
  • the neural network for extracting optical flow can be obtained by training a virtual data set disclosed by Scene Flow.
  • an existing optical flow calculation method may be used to calculate the above optical flow F1 and optical flow F2, and the present application does not limit the specific optical flow calculation method.
  • Existing optical flow calculation methods may be, for example, gradient-based methods, matching-based methods, frequency-domain (energy)-based methods, phase-based methods, Lucas-Kanada algorithms, and the like.
  • the optical flow F3 from the third infrared image
  • the optical flow F4 from the corresponding infrared image that is, the fourth infrared image
  • an optical flow reverse mapping method may be used to reversely map the first infrared image based on the optical flow F3 to obtain the third infrared image.
  • the above-mentioned fourth infrared image is obtained by performing reverse mapping on the above-mentioned second infrared image based on the optical flow F4.
  • the image processing device can obtain the above-mentioned target infrared image by means of optical flow reverse mapping based on the above-mentioned relationship between T0, T1 and T2, and the optical flow between the first infrared image and the second infrared image .
  • the calculation of the target infrared image based on the first infrared image and the second infrared image is not limited to the above-described method using optical flow reverse mapping.
  • the optical flow method in other implementation manners may also be used for calculation, which is not limited in the present application.
  • the converted third infrared image is the image corresponding to the first infrared image at time T1
  • the third infrared image can be understood as the image corresponding to the shooting scene at time T1
  • the above-mentioned visible light image is also the image corresponding to the shooting scene.
  • the image corresponding to the scene at time T1 then switching the first infrared image from time T0 to time T1 is equivalent to realizing the registration of the first infrared image and the visible light image.
  • image registration is generally directly performed on infrared images and visible light images based on feature matching. Since infrared images and visible light images are images of different modalities, processing is based on two different modal images.
  • the present application adopts the conversion between infrared images of the same modality (for example, based on the above-mentioned relationship between T0, T1 and T2, and the optical flow between the first infrared image and the second infrared image, the first infrared image Switching from time T0 to time T1) to realize the registration of the infrared image and the visible light image can improve the registration accuracy of the infrared image and the visible light image, thereby improving the quality of the final fused image.
  • the fusion of the visible light image and the infrared image of the target may be achieved through an image fusion neural network.
  • the image fusion neural network may include a color extraction neural network and a texture extraction neural network.
  • the color extraction neural network is used to extract the color features of the visible light image.
  • the texture extraction neural network is used to extract the texture features of the target infrared image. Then, image fusion is performed based on the extracted color features and texture features to obtain a fusion image.
  • the target infrared image including the third infrared image shows a schematic flowchart of the image fusion neural network.
  • the above visible light image is input to the color extraction neural network.
  • the color feature of the visible light image is extracted through the color extraction neural network, and the grayscale image of the visible light image is also extracted.
  • a color index table is constructed based on the extracted color features and the grayscale image.
  • the color index table may include the values of several colors contained in the visible light image and the index of each color in the several colors, so that the corresponding color value can be found in the color index table based on the index of the color.
  • the color value may be the value of the primary three primary colors RGB.
  • the color value may be RGB plus a constant value and so on.
  • the present application does not limit the specific expression of the color.
  • the texture feature of the third infrared image is extracted through the texture extraction neural network, and a texture guide map is generated based on the texture feature.
  • the texture guide map includes a color index for each pixel in the final output fused image.
  • the image fusion neural network After obtaining the above color index table and texture guide map, the image fusion neural network generates a fusion image based on the color index table and texture guide map. Specifically, based on the color index of each pixel in the texture guide map, look up the color value of the pixel in the color index table and fill the found color value into the corresponding position of the pixel to generate the fused image.
  • the above-mentioned color extraction neural network may be a small-scale deep neural network with a lower resolution.
  • the resolution of the color extraction neural network is not higher than a preset first resolution threshold, and the number of layers of the color extraction neural network is not lower than a preset first network depth threshold.
  • the aforementioned preset first resolution threshold may be, for example, a video graphics array (video graphics array, VGA) resolution or the like.
  • the low resolution may be, for example, a quarter video graphics array (quarter video graphics array, QVGA) resolution.
  • the low resolution may also be VGA resolution.
  • Using a low-resolution color extraction neural network can enhance the immunity to noise. However, if the accuracy of the extracted color boundary needs to be improved, the resolution of the color extraction neural network can be adaptively improved.
  • the aforementioned preset first network depth threshold may be 20, thus, the number of layers of the color extraction neural network may be 20-30 layers.
  • the above-mentioned texture extraction neural network is usually a relatively high-resolution shallow neural network.
  • the resolution of the texture extraction neural network is higher than a preset second resolution threshold, and the number of layers of the texture extraction neural network is lower than a preset second network depth threshold.
  • the preset second resolution threshold may be VGA resolution.
  • the preset second network depth threshold may be any integer between 5 and 10.
  • the resolution of the texture extraction neural network may be the resolution of the original image of the captured infrared image, and the number of layers of the texture extraction neural network may be 3 to 5 layers and so on.
  • the target infrared image including the third infrared image and the fourth infrared image shows a schematic flow chart of the image fusion neural network.
  • the image fusion neural network may include a color extraction neural network and a texture extraction neural network.
  • the color extraction neural network is used to extract the color features of the visible light image.
  • the texture extraction neural network is used to extract texture features of the third infrared image and extract texture features of the fourth infrared image. Then, image fusion is performed based on the extracted color features and the texture features of the above two infrared images to obtain a fusion image.
  • the color index table is obtained based on the visible light image through the color extraction neural network.
  • the process of generating the texture-guided map of the fusion image by the texture extraction neural network is slightly different: in the process, the texture extraction neural network performs texture fusion on the texture features of the third infrared image and the texture features of the fourth infrared image to obtain the texture of the fusion image. Texture guide map. Then, the fused image is obtained based on the obtained color index table and the texture guide map of the fused image, and this process will not be repeated.
  • the image fusion neural network provided by this application has better hardware adaptability than existing neural networks (eg, Unet neural network).
  • the general-purpose Unet network is usually used to process pixel-level tasks, and its computational complexity is 100K TOPS (TOPS means trillion operations per second, which is the abbreviation of Tera Operations Per Second).
  • TOPS means trillion operations per second, which is the abbreviation of Tera Operations Per Second.
  • FPS means the number of frames per second, which is the abbreviation of Frames Per Second
  • 8M*100K*30 24TOPS.
  • the resolution of the color extraction neural network can be 256*256, and the computing power requirement is 0.2TOPS; the resolution of the texture extraction neural network is 8M, and the computing power requirement is 1.2TOPS. It can be seen that the total computing power of the image fusion neural network provided by this application is less than 2TOPS, which is much smaller than that of the Unet network. That is, the image fusion neural network provided by this application requires far less hardware computing power than the Unet network, so it has better hardware adaptability.
  • the above-mentioned fusion of the target infrared image and the visible light image may also be achieved by using an existing image fusion technology, and this application does not limit the specific image fusion method.
  • the present application provides an image processing model to implement the above image processing method.
  • FIG. 7 shows a schematic structural diagram of the image processing model.
  • the image processing model 700 (it should be understood that the "image processing model” herein may also be referred to as “image processing algorithm”, or “image processing module”) includes an image acquisition module 710, an optical flow extraction neuron Network 720 , optical flow reverse mapping processing module 730 and image fusion neural network 740 . in:
  • the image acquisition module 710 is configured to acquire the above-mentioned first infrared image, visible light image and second infrared image. For specific acquisition, firstly, reference may be made to the corresponding description in the above step S401, which will not be repeated here.
  • the optical flow extraction neural network 720 is used to extract the optical flow of the first infrared image and the second infrared image. For specific implementation, reference may be made to the description in the above step S402, which will not be repeated here.
  • the optical flow reverse mapping processing module 730 is configured to perform image reverse mapping based on the extracted optical flow of the first infrared image and the second infrared image, so as to obtain the aforementioned target infrared image.
  • image reverse mapping based on the extracted optical flow of the first infrared image and the second infrared image, so as to obtain the aforementioned target infrared image.
  • the image fusion neural network 740 is used to fuse the above-mentioned visible light image and target infrared image to obtain a fusion image.
  • the entire image processing model can be end-to-end training. That is, during the entire training process, the input is three images (for example, the above-mentioned first infrared image, visible light image and second infrared image, and the three images are captured by the shooting device at the time T0, T1 and T2 respectively of the same scene obtained), the output is the fused image, and then the output fused image is fed back to each neural network for gradual correction of parameters.
  • This kind of end-to-end training can make the image fusion neural network fault-tolerant to the calculation error of the optical flow in the optical flow extraction neural network, and finally make the trained image processing model more robust.
  • the training images of the above-mentioned image processing model may be infrared images and visible light images collected in an environment where the illuminance is lower than a preset illuminance threshold.
  • the environment whose illuminance is lower than the preset illuminance threshold may be a low-illuminance environment.
  • the low-illuminance environment may be an environment with an illuminance below 10 lux (Lux). That is, the preset illumination threshold may be 10, for example.
  • the low-illuminance environment may be specifically determined according to an illuminance standard, and the preset illuminance threshold may be determined according to a low-illuminance value in the illuminance standard, which is not limited in the present application. Since the training images of the image processing model are taken in low-light environment, the image processing model trained in this way can learn the dark details, color and texture of the image, so that it can be fused to obtain a clear color image in a low-light environment.
  • this application first acquires the first infrared image, the visible light image and the second infrared image (these three images are obtained by the shooting device at T0 time, T1 time and T2 time respectively in the same scene), and then based on the two Infrared images and the shooting time information of the above three images, the optical flow method is used to convert the captured infrared images to the corresponding infrared images at the time when the visible light images are captured, so as to realize the registration of the captured infrared images and visible light images.
  • This application realizes the registration of infrared images and visible light images through the processing of infrared images of the same mode (based on two captured infrared images), which improves the registration accuracy of infrared images and visible light images, thus making the final fused image clearer .
  • the target infrared image in the shooting scene of a fast-moving object, includes the third infrared image and the fourth infrared image (that is, the scheme based on the fusion of three images), compared to the target infrared image Only the third infrared image is included in the image, or only the fourth infrared image is included in the target infrared image (that is, the scheme based on the fusion of two images), which can avoid the incomplete clear area in the fusion image, so that the color and Fusion images with richer details and more natural. This situation will be described in detail below with reference to FIG. 8 .
  • the position of the shooting device is fixed, and there is a target object moving along one direction in the shooting scene.
  • the target object includes six parts labeled 1, 2, 3, 4, 5 and 6. Since the photographing device has a limited shooting field angle range, it is assumed that the photographing device can only capture two parts of the above six parts of the target object in each shot. Then, with the continuous movement of the target object, the parts labeled 1 and 2 of the target object are captured at time T0, the parts labeled 2 and 3 of the target object are captured at time T1, and the target is captured at time T2 The parts of the object numbered 3 and 4.
  • the image obtained by shooting can be referred to FIG. 8 .
  • the first infrared image captured at time T0 is converted to time T1 to obtain a third infrared image corresponding to the first infrared image at time T1.
  • the second infrared image captured at the time T2 is converted to the time T1 to obtain a fourth infrared image corresponding to the second infrared image at the time T1.
  • the third infrared image retains the part marked 2 of the subject, and compared with the first infrared image, the third infrared image lacks the part marked 3 of the subject.
  • the third infrared image is an infrared image (mainly contributing texture features)
  • the target infrared image only includes the third infrared image, that is, only the third infrared image
  • the fused image will lack the clear texture features of the part labeled 3 of the object to be photographed, resulting in insufficient clarity in some areas of the fused image.
  • the size of the "partial area" may be related to the movement speed of the target object and the length of the shooting time interval of the above three images. If the movement of the target object is slow, or the shooting interval of the above three images is short, the above Unsharp areas will be smaller and will not affect the overall effect of the image.
  • the fourth infrared image includes the subject The part labeled 3, therefore, the fusion of the third infrared image, the visible light image captured at time T1 and the fourth infrared image can make the final fusion image obtain a complete and clear texture, even All areas of the obtained image are clear, so a clearer and more natural color image can be obtained compared to the fusion scheme based on the above two-frame images.
  • the image processing device includes hardware structures and/or software modules corresponding to each function.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
  • the embodiment of the present application can divide the device into functional modules according to the above method examples.
  • each functional module can be divided corresponding to each function, or two or more functions can be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. It should be noted that the division of modules in this embodiment of the present application is schematic, and is only a logical function division, and there may be other division methods in actual implementation.
  • FIG. 9 shows a specific logical structural diagram of a device, which may be the image processing device in the above method embodiment.
  • the image processing device 900 includes:
  • An acquisition unit 901 configured to acquire a first infrared image, a visible light image, and a second infrared image; wherein, the aforementioned first infrared image, the aforementioned visible light image, and the aforementioned second infrared image are obtained by the shooting device at time T0, T1, and T2, respectively.
  • the shooting device at time T0, T1, and T2, respectively.
  • the calculation unit 902 is configured to calculate a target infrared image based on the aforementioned first infrared image and the aforementioned second infrared image, where the aforementioned target infrared image includes a third infrared image and/or a fourth infrared image; the aforementioned third infrared image is the aforementioned first infrared image An infrared image is converted from the aforementioned T0 moment to the aforementioned image obtained at the aforementioned T1 moment, and the aforementioned fourth infrared image is an image obtained by converting the aforementioned second infrared image from the aforementioned T2 moment to the aforementioned T1 moment;
  • the fusion unit 903 is configured to fuse the aforementioned target infrared image and the aforementioned visible light image to obtain a fused image.
  • the foregoing computing unit 902 is specifically configured to:
  • the aforementioned target infrared image is calculated and obtained.
  • the aforementioned target infrared image includes the aforementioned third infrared image; the aforementioned computing unit 902 is specifically configured to:
  • the aforementioned third infrared image is obtained by performing optical flow reverse mapping based on the aforementioned optical flow F3 and the aforementioned first infrared image.
  • the foregoing fusion unit 903 is specifically used for:
  • the aforementioned fused image is obtained.
  • the foregoing fusion unit 903 is specifically used for:
  • the aforementioned target infrared image and the aforementioned visible light image are fused through the first neural network to obtain the aforementioned fused image;
  • the aforementioned first neural network includes a color extraction neural network and a texture extraction neural network, and the aforementioned color extraction neural network is used to extract the color of the aforementioned visible light image
  • the aforementioned texture extraction neural network is used to extract the texture features of the aforementioned target infrared image.
  • the resolution of the color extraction neural network is lower than a preset first resolution threshold and the number of layers of the color extraction neural network is higher than a preset first network depth threshold.
  • the resolution of the texture extraction neural network is higher than a preset second resolution threshold, and the layer number of the texture extraction neural network is lower than a preset second network depth threshold.
  • the operations performed by the aforementioned device are realized by an image processing model, and the aforementioned image processing model includes the aforementioned first neural network and the second neural network;
  • the aforementioned second neural network is used to obtain the optical flow F1 from the aforementioned first infrared image to the aforementioned second infrared image and the optical flow F2 from the aforementioned second infrared image to the aforementioned first infrared image; the aforementioned optical flow F1 and the aforementioned optical flow F2 is used to calculate and obtain the infrared image of the aforementioned target;
  • the aforementioned first neural network and the aforementioned second neural network included in the aforementioned image processing model are obtained through end-to-end training.
  • the training images of the aforementioned image processing model are collected in an environment where the illuminance is lower than a preset illuminance threshold.
  • FIG. 10 is a schematic diagram of a specific hardware structure of the device provided by the present application, and the device may be the image processing device described in the above-mentioned embodiments.
  • the image processing device 1000 includes: a processor 1001 , a memory 1002 and a communication interface 1003 .
  • the processor 1001 , the communication interface 1003 and the memory 1002 may be connected to each other or through a bus 1004 .
  • the memory 1002 is used to store computer programs and data of the image processing apparatus 1000, and the memory 1002 may include but not limited to random access memory (random access memory, RAM), read-only memory (read-only memory, ROM) , erasable programmable read-only memory (EPROM) or portable read-only memory (compact disc read-only memory, CD-ROM), etc.
  • random access memory random access memory
  • ROM read-only memory
  • EPROM erasable programmable read-only memory
  • portable read-only memory compact disc read-only memory, CD-ROM
  • the communication interface 1003 includes a sending interface and a receiving interface, and there may be multiple communication interfaces 1003, which are used to support the image processing apparatus 1000 to communicate, for example, to receive or send data or messages.
  • the processor 1001 may be a central processing unit, a general processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a transistor logic device, a hardware component or any combination thereof.
  • the processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and the like.
  • the processor 1001 can be used to read the program stored in the above-mentioned memory 1002, so that the image processing apparatus 1000 executes the image processing method described in the above-mentioned FIG. 4 and its specific embodiments.
  • the processor 1001 may be configured to read the program stored in the above-mentioned memory 1002, and perform the following operations: acquire a first infrared image, a visible light image, and a second infrared image; wherein, the first infrared image, The visible light image and the second infrared image are obtained by shooting the same scene at the time T0, T1 and T2 respectively by the shooting device, T0 ⁇ T1 ⁇ T2; the target infrared image is calculated based on the first infrared image and the second infrared image image, the target infrared image includes a third infrared image and/or a fourth infrared image; the third infrared image is an image obtained by converting the first infrared image from the T0 moment to the T1 moment, and the fourth infrared image is converting the second infrared image from the T2 time to the image obtained at the T1 time; fusing the target infrared image and the visible light image
  • the embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the above-mentioned any embodiment in FIG. 4 and its specific method embodiments. described method.
  • An embodiment of the present application further provides a computer program product.
  • the computer program product is read and executed by a computer, the method described in any one of the above-mentioned FIG. 4 and its specific method embodiments.
  • this application first acquires the first infrared image, the visible light image and the second infrared image (these three images are obtained by the shooting device at T0 time, T1 time and T2 time respectively in the same scene), and then based on the two Infrared images and the shooting time information of the above three images, the optical flow method is used to convert the captured infrared images to the corresponding infrared images at the time when the visible light images are captured, so as to realize the registration of the captured infrared images and visible light images.
  • This application realizes the registration of infrared images and visible light images through the processing of infrared images of the same mode (based on two captured infrared images), which improves the registration accuracy of infrared images and visible light images, thus making the final fused image clearer .

Abstract

Provided are an image processing method and a related apparatus: the method comprises: obtaining a first infrared image, a visible light image, and a second infrared image; wherein the first infrared image, the visible light image, and the second infrared image are obtained by photographing the same scene at the T0 moment, the T1 moment, and the T2 moment, respectively, and T0 < T1 < T2; calculating to obtain a target infrared image on the basis of the first infrared image and the second infrared image, the target infrared image comprising a third infrared image and/or a fourth infrared image; the third infrared image is an image obtained by converting the first infrared image from the T0 moment to the T1 moment, and the fourth infrared image is an image obtained by converting the second infrared image from the T2 moment to the T1 moment; fusing the target infrared image and the visible light image to obtain a fused image. In the present application, the registration precision of the infrared image and the visible light image are improved, thereby improving the quality of the fused image.

Description

图像处理方法及相关装置Image processing method and related device
本申请要求于2021年12月30日提交中国国家知识产权局、申请号为202111650872.9、申请名称为“一种基于红外光流的红外和可见光三帧融合装置”的中国专利申请的优先权,以及要求于2022年3月3日提交中国国家知识产权局、申请号为202210207925.8、申请名称为“图像处理方法及相关装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202111650872.9 and the application title "A Device for Three-Frame Fusion of Infrared and Visible Light Based on Infrared Optical Flow" submitted to the State Intellectual Property Office of China on December 30, 2021, and Priority is claimed to a Chinese patent application with application number 202210207925.8 and application title "Image Processing Method and Related Devices" filed with the State Intellectual Property Office of China on March 3, 2022, the entire contents of which are incorporated herein by reference.
技术领域technical field
本申请涉及图像处理技术领域,尤其涉及一种图像处理方法及相关装置。The present application relates to the technical field of image processing, and in particular to an image processing method and related devices.
背景技术Background technique
低照度环境下,基于可见光成像的彩色摄像机采集的图像通常较为模糊,基于红外光成像的红外摄像机采集的图像虽然清晰,但颜色却不是彩色的(红外摄像机拍摄得到的通常是灰度图像)。为了能在低照度环境下得到较清晰的彩色图像,业界通常采用结合可见光与红外光成像的技术方案。In a low-light environment, the image collected by a color camera based on visible light imaging is usually blurry, while the image collected by an infrared camera based on infrared imaging is clear, but the color is not in color (the image captured by an infrared camera is usually a grayscale image). In order to obtain a clearer color image in a low-light environment, the industry usually adopts a technical solution combining visible light and infrared light imaging.
结合可见光与红外光成像的技术方案通常为:基于可见光和红外光分别成像得到可见光图像和红外图像后,再对可见光图像和红外图像进行融合得到最终输出的融合图像。相关技术中,在对多个图像进行融合时,通常需要先对该多个图像进行基于特征匹配的图像配准,但这种图像配准方案在配准可见光图像和红外图像时,通常精度较差,从而导致对可见光图像和红外图像融合后的图像的清晰度较差。The technical scheme of combining visible light and infrared light imaging is usually: after visible light and infrared light are respectively imaged to obtain visible light image and infrared image, then the visible light image and infrared image are fused to obtain the final output fusion image. In related technologies, when multiple images are fused, image registration based on feature matching usually needs to be performed on the multiple images first, but this kind of image registration scheme usually has lower accuracy when registering visible light images and infrared images. Poor, resulting in poor clarity of the image after fusion of visible light image and infrared image.
发明内容Contents of the invention
本申请公开了一种图像处理方法及相关装置,能够基于获得的红外图像和可见光图像进行融合获得清晰的彩色图像。The present application discloses an image processing method and a related device, which can obtain a clear color image based on fusion of an obtained infrared image and a visible light image.
第一方面,本申请提供一种图像处理方法,该方法包括:In a first aspect, the present application provides an image processing method, the method comprising:
获取第一红外图像、可见光图像和第二红外图像;其中,前述第一红外图像、前述可见光图像和前述第二红外图像为拍摄装置分别在T0时刻、T1时刻和T2时刻拍摄同一个场景得到,T0<T1<T2;Acquiring a first infrared image, a visible light image, and a second infrared image; wherein, the aforementioned first infrared image, the aforementioned visible light image, and the aforementioned second infrared image are obtained by shooting the same scene at time T0, T1, and T2 respectively by the shooting device, T0<T1<T2;
基于前述第一红外图像和前述第二红外图像计算得到目标红外图像,前述目标红外图像包括第三红外图像和/或第四红外图像;前述第三红外图像为将前述第一红外图像从前述T0时刻转换到前述T1时刻获得的图像,前述第四红外图像为将前述第二红外图像从前述T2时刻转换到前述T1时刻获得的图像;The target infrared image is calculated based on the aforementioned first infrared image and the aforementioned second infrared image, the aforementioned target infrared image includes a third infrared image and/or a fourth infrared image; the aforementioned third infrared image is obtained from the aforementioned first infrared image from the aforementioned T0 The moment is converted to the image obtained at the aforementioned T1 moment, and the aforementioned fourth infrared image is an image obtained by converting the aforementioned second infrared image from the aforementioned T2 moment to the aforementioned T1 moment;
将前述目标红外图像和前述可见光图像融合,获得融合图像。The aforementioned target infrared image and the aforementioned visible light image are fused to obtain a fused image.
本申请首先获取第一红外图像、可见光图像和第二红外图像(该三幅图像是拍摄装置分别在T0时刻、T1时刻和T2时刻拍摄同一个场景得到的),然后基于该两个红外图像转换到拍摄可见光图像的时刻对应红外图像,以此来实现拍摄的红外图像与可见光图像的配准。相比于现有的基于对异模态的图像的处理(分别提取红外图像和可见光图像的特征点,并基于二者的特征点实现配准)来实现红外图像和可见光图像的配准方案,本申请通过同模态红外 图像的转换处理(基于拍摄的两个红外图像)来实现红外图像和可见光图像的配准,提高了红外图像和可见光图像的配准精度,从而使得最终融合的图像更清晰。特别是在低照度环境下,可以获得清晰自然的彩色图像。This application first acquires the first infrared image, the visible light image and the second infrared image (these three images are obtained by the shooting device at T0 time, T1 time and T2 time respectively in the same scene), and then based on the two infrared images conversion The infrared image is corresponding to the moment when the visible light image is captured, so as to realize the registration of the captured infrared image and the visible light image. Compared with the existing image processing based on different modalities (extracting the feature points of infrared images and visible light images respectively, and realizing registration based on the feature points of the two) to realize the registration scheme of infrared images and visible light images, This application realizes the registration of the infrared image and the visible light image through the conversion processing of the infrared image of the same mode (based on two captured infrared images), which improves the registration accuracy of the infrared image and the visible light image, so that the final fused image is more accurate. clear. Especially in low-light environments, clear and natural color images can be obtained.
一种可能的实施方式中,前述基于前述第一红外图像和前述第二红外图像计算得到目标红外图像,包括:In a possible implementation manner, the aforementioned calculation based on the aforementioned first infrared image and the aforementioned second infrared image to obtain the target infrared image includes:
采用光流法,根据前述T0,前述T1与前述T2三者的关系,以及前述第一红外图像和前述第二红外图像,计算得到前述目标红外图像。Using the optical flow method, according to the relationship between the aforementioned T0, the aforementioned T1 and the aforementioned T2, as well as the aforementioned first infrared image and the aforementioned second infrared image, the aforementioned target infrared image is calculated and obtained.
可选的,前述目标红外图像包括前述第三红外图像;前述采用光流法,根据前述T0,前述T1与前述T2三者的关系,以及前述第一红外图像和前述第二红外图像,计算得到前述目标红外图像,包括:Optionally, the aforementioned target infrared image includes the aforementioned third infrared image; the aforementioned adopts the optical flow method, and according to the relationship between the aforementioned T0, the aforementioned T1 and the aforementioned T2, as well as the aforementioned first infrared image and the aforementioned second infrared image, it is calculated to obtain The aforementioned target infrared images include:
计算从前述第一红外图像到前述第二红外图像的光流F1以及从前述第二红外图像到前述第一红外图像的光流F2;calculating an optical flow F1 from the aforementioned first infrared image to the aforementioned second infrared image and an optical flow F2 from the aforementioned second infrared image to the aforementioned first infrared image;
基于前述T0,前述T1与前述T2三者的关系、前述光流F1和前述光流F2计算光流F3,前述光流F3为从前述第三红外图像到前述第一红外图像的光流;Calculate the optical flow F3 based on the aforementioned T0, the relationship between the aforementioned T1 and the aforementioned T2, the aforementioned optical flow F1 and the aforementioned optical flow F2, and the aforementioned optical flow F3 is the optical flow from the aforementioned third infrared image to the aforementioned first infrared image;
基于前述光流F3和前述第一红外图像进行光流反向映射获得前述第三红外图像。The aforementioned third infrared image is obtained by performing optical flow reverse mapping based on the aforementioned optical flow F3 and the aforementioned first infrared image.
本申请基于上述两个红外图像和上述三个图像的拍摄时间信息,采用光流法将拍摄的红外图像,转换到拍摄可见光图像的时刻对应红外图像,以此来实现拍摄的红外图像与可见光图像的配准。相比于现有的基于对异模态的图像的处理(分别提取红外图像和可见光图像的特征点,并基于二者的特征点实现配准)来实现红外图像和可见光图像的配准方案,本申请通过同模态红外图像的处理(基于拍摄的两个红外图像)来实现红外图像和可见光图像的配准,提高了红外图像和可见光图像的配准精度。Based on the shooting time information of the above two infrared images and the above three images, this application uses the optical flow method to convert the captured infrared image to the corresponding infrared image at the time when the visible light image is captured, so as to realize the infrared image and visible light image registration. Compared with the existing image processing based on different modalities (extracting the feature points of infrared images and visible light images respectively, and realizing registration based on the feature points of the two) to realize the registration scheme of infrared images and visible light images, In the present application, the registration of the infrared image and the visible light image is realized by processing the infrared image of the same mode (based on two captured infrared images), and the registration accuracy of the infrared image and the visible light image is improved.
一种可能的实施方式中,前述将前述目标红外图像和前述可见光图像融合,获得融合图像,包括:In a possible implementation manner, the aforementioned fusion of the aforementioned target infrared image and the aforementioned visible light image to obtain a fused image includes:
提取前述可见光图像的颜色特征;Extracting the color features of the aforementioned visible light image;
提取前述目标红外图像的纹理特征;Extracting texture features of the aforementioned target infrared image;
基于前述颜色特征和前述纹理特征,获得前述融合图像。Based on the aforementioned color feature and the aforementioned texture feature, the aforementioned fused image is obtained.
本申请中可见光图像贡献颜色特征,上述转换后得到的红外图像贡献纹理特征,基于该颜色特征和纹理特征进行图像融合可以获得清晰自然的彩色图像。In this application, the visible light image contributes color features, and the infrared image obtained after the above conversion contributes texture features, and image fusion based on the color features and texture features can obtain a clear and natural color image.
一种可能的实施方式中,前述将前述目标红外图像和前述可见光图像融合,获得融合图像,包括:In a possible implementation manner, the aforementioned fusion of the aforementioned target infrared image and the aforementioned visible light image to obtain a fused image includes:
通过第一神经网络将前述目标红外图像和前述可见光图像融合,获得前述融合图像;前述第一神经网络包括颜色提取神经网络和纹理提取神经网络,前述颜色提取神经网络用于提取前述可见光图像的颜色特征;前述纹理提取神经网络用于提取前述目标红外图像的纹理特征。The aforementioned target infrared image and the aforementioned visible light image are fused through the first neural network to obtain the aforementioned fused image; the aforementioned first neural network includes a color extraction neural network and a texture extraction neural network, and the aforementioned color extraction neural network is used to extract the color of the aforementioned visible light image Features: the aforementioned texture extraction neural network is used to extract the texture features of the aforementioned target infrared image.
本申请通过训练好的神经网络来提取可见光图像的颜色特征和提取红外图像的纹理特征,可以使得提取的特征更精确,以使得融合后的图像更自然清晰。In this application, the trained neural network is used to extract the color features of visible light images and the texture features of infrared images, which can make the extracted features more accurate and make the fused images more natural and clear.
一种可能的实施方式中,前述颜色提取神经网络的分辨率不高于预设的第一分辨率阈值且前述颜色提取神经网络的层数不低于预设的第一网络深度阈值。In a possible implementation manner, the resolution of the color extraction neural network is not higher than a preset first resolution threshold and the number of layers of the color extraction neural network is not lower than a preset first network depth threshold.
一种可能的实施方式中,前述纹理提取神经网络的分辨率高于预设的第二分辨率阈值且前述纹理提取神经网络的层数低于预设的第二网络深度阈值。In a possible implementation manner, the resolution of the texture extraction neural network is higher than a preset second resolution threshold, and the layer number of the texture extraction neural network is lower than a preset second network depth threshold.
本申请提供的上述第一神经网络,由于该第一神经网络中的颜色提取神经网络的分辨率 低,并且第一神经网络中的纹理提取神经网络的层数低,那么,整个第一神经网络的算力要求比较低,相比于现有的神经网络(例如,Unet神经网络)算力要求高,本申请的方案具备更好的硬件适应能力。另外,由于该颜色提取神经网络的分辨率低,输入该颜色提取神经网络的可见光图像可以是下采样后的图像,下采样的过程中消除了部分噪声,下采样后的图像中的噪声减少,因而采用低分辨率的颜色提取神经网络可以增强对噪声的抗干扰性。For the above-mentioned first neural network provided by the present application, since the resolution of the color extraction neural network in the first neural network is low, and the number of layers of the texture extraction neural network in the first neural network is low, then the entire first neural network The computing power requirement is relatively low, compared with the existing neural network (for example, Unet neural network) which has high computing power requirement, the solution of this application has better hardware adaptability. In addition, due to the low resolution of the color extraction neural network, the visible light image input to the color extraction neural network may be a downsampled image, part of the noise is eliminated during the downsampling process, and the noise in the downsampled image is reduced. Therefore, the use of low-resolution color extraction neural network can enhance the anti-interference ability to noise.
一种可能的实施方式中,前述方法通过图像处理模型实现,前述图像处理模型包括前述第一神经网络和第二神经网络;In a possible implementation manner, the aforementioned method is implemented by an image processing model, and the aforementioned image processing model includes the aforementioned first neural network and the second neural network;
前述第二神经网络用于获取从前述第一红外图像到前述第二红外图像的光流F1和从前述第二红外图像到前述第一红外图像的光流F2;前述光流F1和前述光流F2用于计算获得前述目标红外图像;The aforementioned second neural network is used to obtain the optical flow F1 from the aforementioned first infrared image to the aforementioned second infrared image and the optical flow F2 from the aforementioned second infrared image to the aforementioned first infrared image; the aforementioned optical flow F1 and the aforementioned optical flow F2 is used to calculate and obtain the infrared image of the aforementioned target;
前述图像处理模型包括的前述第一神经网络和前述第二神经网络通过端到端训练得到。The aforementioned first neural network and the aforementioned second neural network included in the aforementioned image processing model are obtained through end-to-end training.
本申请中,端到端的训练可以使得第一神经网络可以容错第二神经网络(提取光流的神经网络)中光流的计算误差,最终使得训练出来的图像处理模型具备更强的鲁棒性。In this application, the end-to-end training can make the first neural network fault-tolerant to the calculation error of the optical flow in the second neural network (the neural network that extracts the optical flow), and finally makes the trained image processing model more robust .
一种可能的实施方式中,前述图像处理模型的训练图像是在照度低于预设的照度阈值的环境下采集得到的。In a possible implementation manner, the training images of the aforementioned image processing model are collected in an environment where the illuminance is lower than a preset illuminance threshold.
本申请中,由于图像处理模型的训练图像为低照度环境下拍摄得到,这样训练得到的图像处理模型可以学习到图像的暗部细节、颜色和纹理,从而可以融合得到低照度环境下清晰的彩色图像。In this application, since the training images of the image processing model are captured in a low-light environment, the image processing model trained in this way can learn the dark details, color and texture of the image, so that it can be fused to obtain a clear color image in a low-light environment .
第二方面,本申请提供一种拍摄装置,该拍摄装置包括镜片、调光片、驱动模块和成像模块;前述调光片位于前述镜片和前述成像模块之间,前述驱动模块与前述调光片连接;In a second aspect, the present application provides a photographing device, which includes a lens, a dimmer, a drive module, and an imaging module; the dimmer is located between the lens and the imaging module, and the driver module and the dimmer connect;
前述镜片用于将入射到前述镜片上的光聚集到前述调光片上;The aforementioned lens is used to gather the light incident on the aforementioned lens onto the aforementioned dimming sheet;
前述调光片包括红外带通滤光片、红外截止滤光片和遮光片,前述红外带通滤光片用于让红外光穿过且过滤可见光,前述红外截止滤光片用于让可见光穿过且过滤红外光,前述遮光片用于阻止光线穿过;The aforementioned dimmer includes an infrared bandpass filter, an infrared cutoff filter and a shading sheet, the aforementioned infrared bandpass filter is used to allow infrared light to pass through and filter visible light, and the aforementioned infrared cutoff filter is used to allow visible light to pass through and filter the infrared light, the aforementioned shading sheet is used to prevent the light from passing through;
前述驱动模块用于驱动前述调光片运动,以使得聚集到前述调光片上的光在第一时段入射到前述红外带通滤光片上,在第二时段入射到前述红外截止滤光片上,在第三时段和第四时段入射到前述遮光片上;The aforementioned driving module is used to drive the movement of the aforementioned dimmer, so that the light collected on the aforementioned dimmer is incident on the aforementioned infrared bandpass filter during the first period, and is incident on the aforementioned infrared cutoff filter during the second period. , incident on the aforementioned shading sheet during the third period and the fourth period;
前述成像模块用于在前述第一时段接收穿过前述红外带通滤光片的红外光,并在前述第三时段基于接收的红外光得到第一红外图像;以及用于在前述第二时段接收穿过前述红外截止滤光片的可见光,并在前述第四时段基于接收的可见光得到可见光图像;前述第一时段、前述第二时段、前述第三时段和前述第四时段不重叠。The aforementioned imaging module is used to receive the infrared light passing through the aforementioned infrared bandpass filter during the aforementioned first period, and to obtain a first infrared image based on the received infrared light during the aforementioned third period; and to receive the infrared image during the aforementioned second period Visible light passing through the aforementioned infrared cut filter, and obtaining a visible light image based on the received visible light in the aforementioned fourth period; the aforementioned first period, the aforementioned second period, the aforementioned third period and the aforementioned fourth period do not overlap.
本申请提供的拍摄装置中,调光片可以根据实际业务的需求来灵活调整自己的运动的方向、运动的速度和方式等(基于驱动模块),使得调光片能够根据需求将聚集到所述调光片上的光在对应的时段打在对应的某个滤光片或某个遮光片上,从而起到根据需求在不同的时间段选择不同的滤光片,即,最终可以使得拍摄装置可以根据实际需求在相应的时刻拍摄得到相应的红外图像或可见光图像,使得拍摄十分方便和灵活。In the photographing device provided by this application, the dimming film can flexibly adjust its own motion direction, speed and mode of motion (based on the drive module) according to the actual business needs, so that the dimming film can be gathered to the The light on the light-adjusting film hits a corresponding filter or a certain light-shielding film in the corresponding time period, so as to select different light filters in different time periods according to the demand, that is, finally, the shooting device can be used according to It is actually required to capture corresponding infrared images or visible light images at corresponding moments, which makes shooting very convenient and flexible.
一种可能的实施方式中,前述调光片为圆形,前述红外带通滤光片、前述红外截止滤光片和前述遮光片为扇形;前述驱动模块用于驱动前述调光片转动。In a possible implementation manner, the aforementioned dimmer is circular, the aforementioned infrared bandpass filter, the aforementioned infrared cut filter, and the aforementioned light-shielding plate are fan-shaped; the aforementioned drive module is used to drive the aforementioned dimmer to rotate.
一种可能的实施方式中,前述调光片为多边形,前述红外带通滤光片、前述红外截止滤光片和前述遮光片为三角形;前述驱动模块用于驱动前述调光片转动。In a possible implementation manner, the aforementioned dimmer is polygonal, the aforementioned infrared bandpass filter, the aforementioned infrared cut filter, and the aforementioned light-shielding plate are triangular; the aforementioned driving module is used to drive the aforementioned dimmer to rotate.
一种可能的实施方式中,前述调光片为矩形,前述红外带通滤光片、前述红外截止滤光 片和前述遮光片为矩形;前述驱动模块用于驱动前述调光片移动。In a possible implementation manner, the aforementioned dimmer is rectangular, and the aforementioned infrared bandpass filter, the aforementioned infrared cutoff filter, and the aforementioned light shield are rectangular; the aforementioned drive module is used to drive the aforementioned dimmer to move.
一种可能的实施方式中,前述红外带通滤光片与前述遮光片相邻,前述红外截止滤光片与前述遮光片相邻。In a possible implementation manner, the aforementioned infrared bandpass filter is adjacent to the aforementioned light-shielding sheet, and the aforementioned infrared cut-off filter is adjacent to the aforementioned light-shielding sheet.
一种可能的实施方式中,前述第一时段的长度指示前述第一红外图像的曝光时长;前述第二时段的长度指示前述可见光图像的曝光时长。In a possible implementation manner, the length of the first time period indicates the exposure time of the first infrared image; the length of the second time period indicates the exposure time of the visible light image.
一种可能的实施方式中,前述第一时段的长短与遮光片的大小相关,前述遮光片与红外带通滤光片相邻。In a possible implementation manner, the length of the first period of time is related to the size of the shading sheet, and the shading sheet is adjacent to the infrared bandpass filter.
一种可能的实施方式中,聚集到前述调光片上的光在前述第二时段打在第一红外截止滤光片上;In a possible implementation manner, the light collected on the aforementioned dimmer is struck on the first infrared cut filter during the aforementioned second period;
前述第二时段的长短与第二遮光片的大小相关,前述第二遮光片与第一红外截止滤光片相邻;前述第一红外截止滤光片为前述至少一个红外截止虑光片中的一个;前述第二遮光片为前述至少一个遮光片中的一个;前述第一遮光片与前述第二遮光片不同或相同。The length of the aforementioned second period of time is related to the size of the second light-shielding sheet, and the aforementioned second light-shielding sheet is adjacent to the first infrared cut-off filter; the aforementioned first infrared cut-off filter is one of the aforementioned at least one infrared cut-off filter One; the second shading sheet is one of the at least one shading sheet; the first shading sheet is different or the same as the second shading sheet.
一种可能的实施方式中,前述第一时段的长短或前述第二时段的长短与前述调光片的运动速度相关。In a possible implementation manner, the length of the aforementioned first period of time or the length of the aforementioned second period of time is related to the moving speed of the aforementioned dimming film.
一种可能的实施方式中,前述调光片的运动速度由前述驱动模块控制。In a possible implementation manner, the moving speed of the dimmer chip is controlled by the driving module.
一种可能的实施方式中,前述第一时段的结束时刻为前述第三时段的开始时刻;前述第二时段的结束时刻为前述第四时段的开始时刻。In a possible implementation manner, the end time of the first period is the start time of the third period; the end time of the second period is the start time of the fourth period.
一种可能的实施方式中,前述第一时段的结束时刻为T0,前述第二时段的结束时刻为T1;In a possible implementation manner, the end time of the aforementioned first period is T0, and the end time of the aforementioned second period is T1;
前述驱动模块还用于驱动前述调光片运动,以使得聚集到前述调光片上的光在第五时段入射到前述红外带通滤光片上,以使得前述成像模块得到第二红外图像;前述第五时段的结束时刻为T2;其中,T0<T1<T2;前述第一红外图像、前述可见光图像和前述第二红外图像为拍摄装置拍摄同一个场景得到;The aforementioned drive module is also used to drive the movement of the aforementioned dimming sheet, so that the light gathered on the aforementioned dimming sheet is incident on the aforementioned infrared bandpass filter during the fifth period, so that the aforementioned imaging module obtains a second infrared image; the aforementioned The end time of the fifth period is T2; wherein, T0<T1<T2; the aforementioned first infrared image, the aforementioned visible light image and the aforementioned second infrared image are obtained by shooting the same scene by the photographing device;
前述拍摄装置还包括处理器,前述处理器用于执行上述第一方面任意一项所述的方法。The foregoing photographing device further includes a processor, and the foregoing processor is configured to execute the method described in any one of the foregoing first aspects.
一种可能的实施方式中,前述调光片包括两个前述红外带通滤光片,一个前述红外截止滤光片和至少两个前述遮光片。In a possible implementation manner, the aforementioned dimmer includes two aforementioned infrared bandpass filters, one aforementioned infrared cut filter and at least two aforementioned light shielding filters.
一种可能的实施方式中,前述一个红外截止滤光片位于前述两个红外带通滤光片之间。In a possible implementation manner, the aforementioned one infrared cut filter is located between the aforementioned two infrared bandpass filters.
第三方面、本申请一种图像处理装置,该装置包括:In the third aspect, an image processing device of the present application, the device includes:
获取单元,用于获取第一红外图像、可见光图像和第二红外图像;其中,前述第一红外图像、前述可见光图像和前述第二红外图像为拍摄装置分别在T0时刻、T1时刻和T2时刻拍摄同一个场景得到,T0<T1<T2;An acquisition unit, configured to acquire a first infrared image, a visible light image, and a second infrared image; wherein, the aforementioned first infrared image, the aforementioned visible light image, and the aforementioned second infrared image are captured by the photographing device at time T0, T1, and T2, respectively The same scene is obtained, T0<T1<T2;
计算单元,用于基于前述第一红外图像和前述第二红外图像计算得到目标红外图像,前述目标红外图像包括第三红外图像和/或第四红外图像;前述第三红外图像为将前述第一红外图像从前述T0时刻转换到前述T1时刻获得的图像,前述第四红外图像为将前述第二红外图像从前述T2时刻转换到前述T1时刻获得的图像;A computing unit, configured to calculate a target infrared image based on the aforementioned first infrared image and the aforementioned second infrared image, where the aforementioned target infrared image includes a third infrared image and/or a fourth infrared image; the aforementioned third infrared image is the aforementioned first infrared image The infrared image is converted from the aforementioned T0 moment to the image obtained at the aforementioned T1 moment, and the aforementioned fourth infrared image is an image obtained by converting the aforementioned second infrared image from the aforementioned T2 moment to the aforementioned T1 moment;
融合单元,用于将前述目标红外图像和前述可见光图像融合,获得融合图像。The fusion unit is configured to fuse the aforementioned target infrared image and the aforementioned visible light image to obtain a fusion image.
一种可能的实施方式中,前述计算单元具体用于:In a possible implementation manner, the aforementioned calculation unit is specifically used for:
采用光流法,根据前述T0,前述T1与前述T2三者的关系,以及前述第一红外图像和前述第二红外图像,计算得到前述目标红外图像。Using the optical flow method, according to the relationship between the aforementioned T0, the aforementioned T1 and the aforementioned T2, as well as the aforementioned first infrared image and the aforementioned second infrared image, the aforementioned target infrared image is calculated and obtained.
一种可能的实施方式中,前述目标红外图像包括前述第三红外图像;前述计算单元具体用于:In a possible implementation manner, the aforementioned target infrared image includes the aforementioned third infrared image; the aforementioned computing unit is specifically configured to:
计算从前述第一红外图像到前述第二红外图像的光流F1以及从前述第二红外图像到前 述第一红外图像的光流F2;Calculate the optical flow F1 from the aforementioned first infrared image to the aforementioned second infrared image and the optical flow F2 from the aforementioned second infrared image to the aforementioned first infrared image;
基于前述T0,前述T1与前述T2三者的关系、前述光流F1和前述光流F2计算光流F3,前述光流F3为从前述第三红外图像到前述第一红外图像的光流;Calculate the optical flow F3 based on the aforementioned T0, the relationship between the aforementioned T1 and the aforementioned T2, the aforementioned optical flow F1 and the aforementioned optical flow F2, and the aforementioned optical flow F3 is the optical flow from the aforementioned third infrared image to the aforementioned first infrared image;
基于前述光流F3和前述第一红外图像进行光流反向映射获得前述第三红外图像。The aforementioned third infrared image is obtained by performing optical flow reverse mapping based on the aforementioned optical flow F3 and the aforementioned first infrared image.
一种可能的实施方式中,前述融合单元具体用于:In a possible implementation manner, the aforementioned fusion unit is specifically used for:
提取前述可见光图像的颜色特征;Extracting the color features of the aforementioned visible light image;
提取前述目标红外图像的纹理特征;Extracting texture features of the aforementioned target infrared image;
基于前述颜色特征和前述纹理特征,获得前述融合图像。Based on the aforementioned color feature and the aforementioned texture feature, the aforementioned fused image is obtained.
一种可能的实施方式中,前述融合单元具体用于:In a possible implementation manner, the aforementioned fusion unit is specifically used for:
通过第一神经网络将前述目标红外图像和前述可见光图像融合,获得前述融合图像;前述第一神经网络包括颜色提取神经网络和纹理提取神经网络,前述颜色提取神经网络用于提取前述可见光图像的颜色特征;前述纹理提取神经网络用于提取前述目标红外图像的纹理特征。The aforementioned target infrared image and the aforementioned visible light image are fused through the first neural network to obtain the aforementioned fused image; the aforementioned first neural network includes a color extraction neural network and a texture extraction neural network, and the aforementioned color extraction neural network is used to extract the color of the aforementioned visible light image Features: the aforementioned texture extraction neural network is used to extract the texture features of the aforementioned target infrared image.
一种可能的实施方式中,前述颜色提取神经网络的分辨率不高于预设的第一分辨率阈值且前述颜色提取神经网络的层数不低于预设的第一网络深度阈值。In a possible implementation manner, the resolution of the color extraction neural network is not higher than a preset first resolution threshold and the number of layers of the color extraction neural network is not lower than a preset first network depth threshold.
一种可能的实施方式中,前述纹理提取神经网络的分辨率高于预设的第二分辨率阈值且前述纹理提取神经网络的层数低于预设的第二网络深度阈值。In a possible implementation manner, the resolution of the texture extraction neural network is higher than a preset second resolution threshold, and the layer number of the texture extraction neural network is lower than a preset second network depth threshold.
一种可能的实施方式中,前述装置执行的操作通过图像处理模型实现,前述图像处理模型包括前述第一神经网络和第二神经网络;In a possible implementation manner, the operations performed by the aforementioned device are realized by an image processing model, and the aforementioned image processing model includes the aforementioned first neural network and the second neural network;
前述第二神经网络用于获取从前述第一红外图像到前述第二红外图像的光流F1和从前述第二红外图像到前述第一红外图像的光流F2;前述光流F1和前述光流F2用于计算获得前述目标红外图像;The aforementioned second neural network is used to obtain the optical flow F1 from the aforementioned first infrared image to the aforementioned second infrared image and the optical flow F2 from the aforementioned second infrared image to the aforementioned first infrared image; the aforementioned optical flow F1 and the aforementioned optical flow F2 is used to calculate and obtain the infrared image of the aforementioned target;
前述图像处理模型包括的前述第一神经网络和前述第二神经网络通过端到端训练得到。The aforementioned first neural network and the aforementioned second neural network included in the aforementioned image processing model are obtained through end-to-end training.
一种可能的实施方式中,前述图像处理模型的训练图像是在照度低于预设的照度阈值的环境下采集得到的。In a possible implementation manner, the training images of the aforementioned image processing model are collected in an environment where the illuminance is lower than a preset illuminance threshold.
第四方面,本申请提供一种图像处理装置,包括处理器和存储器,用于实现上述第一方面及其可能的实施方式描述的方法。该存储器与处理器耦合,处理器执行存储器中存储的计算机程序时,可以使得该图像处理装置实现上述第一方面或第一方面任一种可能的实现方式所述的方法。In a fourth aspect, the present application provides an image processing device, including a processor and a memory, configured to implement the method described in the above first aspect and its possible implementation manners. The memory is coupled to the processor, and when the processor executes the computer program stored in the memory, the image processing apparatus can implement the method described in the first aspect or any possible implementation manner of the first aspect.
该装置还可以包括通信接口,通信接口用于该装置与其它装置进行通信,示例性的,通信接口可以是收发器、电路、总线、模块或其它类型的通信接口。该通信接口包括接收接口和发送接口,该接收接口用于接收消息,该发送接口用于发送消息。The device may further include a communication interface, which is used for the device to communicate with other devices. Exemplarily, the communication interface may be a transceiver, circuit, bus, module or other type of communication interface. The communication interface includes a receiving interface and a sending interface, the receiving interface is used for receiving messages, and the sending interface is used for sending messages.
在一种可能的实现中,该装置可以包括:In one possible implementation, the device may include:
存储器,用于存储计算机程序;memory for storing computer programs;
处理器,用于读取该存储器中的计算机程序执行如下操作:A processor for reading a computer program in the memory to perform the following operations:
获取第一红外图像、可见光图像和第二红外图像;其中,前述第一红外图像、前述可见光图像和前述第二红外图像为拍摄装置分别在T0时刻、T1时刻和T2时刻拍摄同一个场景得到,T0<T1<T2;Acquiring a first infrared image, a visible light image, and a second infrared image; wherein, the aforementioned first infrared image, the aforementioned visible light image, and the aforementioned second infrared image are obtained by shooting the same scene at time T0, T1, and T2 respectively by the shooting device, T0<T1<T2;
基于前述第一红外图像和前述第二红外图像计算得到目标红外图像,前述目标红外图像包括第三红外图像和/或第四红外图像;前述第三红外图像为将前述第一红外图像从前述T0时刻转换到前述T1时刻获得的图像,前述第四红外图像为将前述第二红外图像从前述T2时 刻转换到前述T1时刻获得的图像;The target infrared image is calculated based on the aforementioned first infrared image and the aforementioned second infrared image, the aforementioned target infrared image includes a third infrared image and/or a fourth infrared image; the aforementioned third infrared image is obtained from the aforementioned first infrared image from the aforementioned T0 The moment is converted to the image obtained at the aforementioned T1 moment, and the aforementioned fourth infrared image is an image obtained by converting the aforementioned second infrared image from the aforementioned T2 moment to the aforementioned T1 moment;
将前述目标红外图像和前述可见光图像融合,获得融合图像。The aforementioned target infrared image and the aforementioned visible light image are fused to obtain a fused image.
需要说明的是,本申请中存储器中的计算机程序可以预先存储也可以使用该装置时从互联网下载后存储,本申请对于存储器中计算机程序的来源不进行具体限定。本申请实施例中的耦合是装置、单元或模块之间的间接耦合或连接,其可以是电性,机械或其它的形式,用于装置、单元或模块之间的信息交互。It should be noted that the computer program in the memory in this application can be stored in advance or can be stored after being downloaded from the Internet when using the device. This application does not specifically limit the source of the computer program in the memory. The coupling in the embodiments of the present application is an indirect coupling or connection between devices, units or modules, which may be in electrical, mechanical or other forms, and is used for information exchange between devices, units or modules.
第五方面,本申请提供一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行时,实现上述第一方面及其可能的实施方式中任意一项所述的方法。In a fifth aspect, the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any one of the above-mentioned first aspect and its possible implementation modes can be realized the method described.
第六方面,本申请提供一种计算机程序产品,包括计算机程序,当该计算机程序被处理器执行时,使得该计算机执行如上述第一方面任意一项所述的方法。In a sixth aspect, the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, the computer is made to perform the method described in any one of the above first aspects.
可以理解地,上述提供的第三方面和第四方面所述的装置、第五方面所述的计算机存储介质以及第六方面所述的计算机程序产品均用于执行上述第一方面中任一项所提供的方法。因此,其所能达到的有益效果可参考对应方法中的有益效果,此处不再赘述。It can be understood that the devices described in the third aspect and the fourth aspect provided above, the computer storage medium described in the fifth aspect, and the computer program product described in the sixth aspect are all used to implement any one of the above first aspects provided method. Therefore, the beneficial effects that it can achieve can refer to the beneficial effects in the corresponding method, and will not be repeated here.
附图说明Description of drawings
下面将对本申请实施例中所需要使用的附图作介绍。The drawings that need to be used in the embodiments of the present application will be introduced below.
图1所示为本申请实施例提供的拍摄装置及其拍摄原理的示意图;Fig. 1 is a schematic diagram of the photographing device and its photographing principle provided by the embodiment of the present application;
图2A、图2B和图2C为本申请实施例提供的调光片的结构示意图;FIG. 2A, FIG. 2B and FIG. 2C are structural schematic diagrams of the dimmer provided in the embodiment of the present application;
图2D为本申请实施例提供的图像拍摄时刻的示意图;FIG. 2D is a schematic diagram of the image shooting moment provided by the embodiment of the present application;
图3为本申请实施例提供的调光片的结构示意图;FIG. 3 is a schematic structural diagram of a dimmer provided in an embodiment of the present application;
图4为本申请实施例提供的图像处理方法的流程示意图;FIG. 4 is a schematic flowchart of an image processing method provided in an embodiment of the present application;
图5为本申请实施例提供的拍摄装置的视野的空间的示意图;FIG. 5 is a schematic diagram of the field of view space of the imaging device provided by the embodiment of the present application;
图6A和图6B为本申请实施例提供的图像融合神经网络的结构示意图;6A and 6B are schematic structural diagrams of the image fusion neural network provided by the embodiment of the present application;
图7为本申请实施例提供的图像处理模型的结构示意图;FIG. 7 is a schematic structural diagram of an image processing model provided by an embodiment of the present application;
图8为本申请实施例提供的拍摄装置在不同时刻拍摄图像的示意图;FIG. 8 is a schematic diagram of images captured by the imaging device provided in the embodiment of the present application at different times;
图9为本申请实施例提供的图像处理装置的逻辑结构示意图;FIG. 9 is a schematic diagram of a logical structure of an image processing device provided by an embodiment of the present application;
图10为本申请实施例提供的图像处理装置的硬件结构示意图。FIG. 10 is a schematic diagram of a hardware structure of an image processing device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面结合附图对本申请的实施例进行描述。Embodiments of the present application are described below in conjunction with the accompanying drawings.
下面首先介绍本申请涉及到的技术术语的概念。The concepts of the technical terms involved in this application are firstly introduced below.
1.光流。1. Optical flow.
宏观上,当人的眼睛观察运动物体时,物体的景象在人眼的视网膜上形成一系列连续变化的图像,这一系列连续变化的信息不断“流过”视网膜,好像一种光的“流”,故称之为光流(optical flow)。光流表达了图像的变化,由于它包含了目标运动的信息,因此可被观察者用来确定目标的运动情况。Macroscopically, when the human eye observes a moving object, the scene of the object forms a series of continuously changing images on the retina of the human eye. This series of continuously changing information continuously "flows" through the retina, like a "flow" of light. ", so it is called optical flow. Optical flow expresses the change of the image, and because it contains the information of the target's motion, it can be used by the observer to determine the motion of the target.
微观上,光流是空间运动物体在成像平面上的像素运动的瞬时速度。一般而言,光流是由于场景中前景目标本身的移动、相机的运动,或者两者的共同运动所产生的。Microscopically, optical flow is the instantaneous speed of pixel movement of spatially moving objects on the imaging plane. Generally speaking, optical flow is generated due to the movement of the foreground object itself in the scene, the movement of the camera, or the joint movement of both.
光流的表示也是数字化的。示例性地,第一图像的某个像素到第二图像的某个像素的光流可以表示为(u,v)。若第一图像和第二图像都处于同一个像素坐标系中,为了便于理解, 假设第一图像的拍摄时刻和第二图像的拍摄时刻之间的时间差很短,可以看成是单位时间差,那么,u表示第二图像中的该某个像素在水平方向上相对于第一图像中的该某个像素移动的像素数,v表示第二图像中的该某个像素在垂直方向上相对于第一图像中的该某个像素移动的像素数。The representation of optical flow is also digital. Exemplarily, the optical flow from a certain pixel of the first image to a certain pixel of the second image may be expressed as (u, v). If both the first image and the second image are in the same pixel coordinate system, for the sake of understanding, it is assumed that the time difference between the shooting moment of the first image and the shooting moment of the second image is very short, which can be regarded as a unit time difference, then , u represents the number of pixels that the certain pixel in the second image moves relative to the certain pixel in the first image in the horizontal direction, and v represents the number of pixels that the certain pixel in the second image moves vertically relative to the first image The number of pixels by which a certain pixel in an image is moved.
2.光流法。2. Optical flow method.
光流法是利用图像序列中像素在时间域上的变化以及相邻帧之间的相关性来找到上一帧跟当前帧之间的对应关系,从而计算出相邻帧之间物体的运动信息的一种方法。The optical flow method uses the changes of pixels in the image sequence in the time domain and the correlation between adjacent frames to find the correspondence between the previous frame and the current frame, thereby calculating the motion information of objects between adjacent frames. a method of
3.光流反向映射。3. Optical flow reverse mapping.
光流反向映射属于光流法的一种实现方式。光流的反向映射通常指的是已知第一图像到第二图像的光流以及第二图像,通过该光流将该第二图像进行转换获得该第一图像。例如,假设该第一图像的某个像素点A到该第二图像的像素点A的光流表示为(u,v),且该像素点A在第二图像中的坐标为(x1,y1)。那么,如果定义该像素点A在第一图像中的坐标为(x2,y2),则,x2=x1-u,y2=y1-v。这里只是简单地示例一下,以便于理解光流反向映射的原理,具体实现中,光流反向映射还包括其它细节的常规处理,例如插值处理等等,此处不赘述。Optical flow reverse mapping is an implementation of the optical flow method. The reverse mapping of the optical flow usually refers to the known optical flow from the first image to the second image and the second image, and the first image is obtained by converting the second image through the optical flow. For example, assume that the optical flow from a certain pixel point A of the first image to the pixel point A of the second image is expressed as (u, v), and the coordinates of the pixel point A in the second image are (x1, y1 ). Then, if the coordinates of the pixel point A in the first image are defined as (x2, y2), then x2=x1-u, y2=y1-v. Here is just a simple example to understand the principle of optical flow reverse mapping. In the specific implementation, optical flow reverse mapping also includes other details of conventional processing, such as interpolation processing, etc., which will not be described here.
4.异模态图像。4. Different modal images.
异模态图像通常指的是基于不同光谱(或频率)的光分别成像得到的多个图像。例如,红外光和可见光的光谱(或频率)不同,基于红外光成像可以得到红外图像,基于可见光成像可以得到可见光图像。那么,红外图像和可见光图像即为异模态的图像。异模态图像的表达方式通常是不同的。例如,红外图像通常为灰度图像,灰度图像的像素的颜色通过灰度值来表示,灰度值的取值范围为0到255。可见光图像为彩色图像,彩色图像的像素的颜色至少通过三个颜色值来表示。该三个颜色值的每个颜色值的取值范围为0到255。A heteromodal image generally refers to multiple images obtained by imaging separately based on light of different spectra (or frequencies). For example, the spectra (or frequencies) of infrared light and visible light are different, infrared images can be obtained based on infrared light imaging, and visible light images can be obtained based on visible light imaging. Then, the infrared image and the visible light image are images of different modes. The expressions of heteromodal images are usually different. For example, an infrared image is usually a grayscale image, and the color of a pixel in the grayscale image is represented by a grayscale value, and the grayscale value ranges from 0 to 255. The visible light image is a color image, and the colors of the pixels of the color image are represented by at least three color values. Each of the three color values ranges from 0 to 255.
5.图像配准。5. Image registration.
图像配准(Image registration)通常是指将获取的两幅或多幅图像进行匹配、叠加的过程。图像配准通常采用基于特征匹配的方式来实现。以两幅图像的配准为例,该图像配准的方式流程如下:首先对两幅待配准的图像进行特征提取得到特征点,并通过进行相似性度量找到匹配的特征点对;然后通过匹配的特征点对得到图像空间坐标变换参数;最后由坐标变换参数完成对两幅图像的匹配。Image registration usually refers to the process of matching and superimposing two or more acquired images. Image registration is usually implemented based on feature matching. Taking the registration of two images as an example, the image registration process is as follows: firstly, feature extraction is performed on the two images to be registered to obtain feature points, and the matching feature point pairs are found by performing similarity measurement; The matched feature point pairs obtain the coordinate transformation parameters of the image space; finally, the matching of the two images is completed by the coordinate transformation parameters.
为了在低照度环境下拍摄获得较清晰的彩色图像(即,信噪比比较高的彩色图像),可采用结合可见光与红外光成像的拍摄技术方案。该方案通过既基于可见光成像得到可见光图像,又基于红外光成像得到红外图像,再融合该可见光图像和红外图像得到最终输出的融合图像。在理论上,该融合图像可以结合上述可见光图像的颜色信息和红外图像的纹理信息,因而,该融合图像应该是较为清晰的彩色图像。但是,在上述融合的过程中,由于红外图像和可见光图像为异模态图像,而异模态图像中的像素的表达方式通常是不同的,因此,当采用现有技术中基于特征匹配的方式对异模态图像进行配准时,精度通常较低。尤其是在摄像机与被拍摄对象之间相对快速移动的情况下,采用基于特征匹配的方式对异模态图像进行配准的精度会进一步降低。而可见光图像与红外图像的配准精度低会使得最后融合得到的图像出现重影等问题,即,导致最终的融合图像的清晰度仍然较差。In order to obtain a clearer color image (that is, a color image with a relatively high signal-to-noise ratio) in a low-light environment, a shooting technology solution combining visible light and infrared light imaging may be used. The scheme obtains a visible light image based on visible light imaging and an infrared image based on infrared light imaging, and then fuses the visible light image and the infrared image to obtain a final output fusion image. In theory, the fused image can combine the color information of the visible light image and the texture information of the infrared image, so the fused image should be a relatively clear color image. However, in the above-mentioned fusion process, since the infrared image and the visible light image are images of different modalities, and the expressions of pixels in the images of different modalities are usually different, when using the method based on feature matching in the prior art When registering heteromodal images, the accuracy is usually lower. Especially in the case of relatively fast movement between the camera and the object to be photographed, the registration accuracy of heteromodal images based on feature matching will be further reduced. However, the low registration accuracy of the visible light image and the infrared image will cause problems such as ghosting in the final fused image, that is, the definition of the final fused image is still poor.
为了解决上述技术问题,本申请提供了一种拍摄装置和一种图像处理方法。In order to solve the above technical problems, the present application provides a photographing device and an image processing method.
下面首先介绍一下本申请提供的拍摄装置及其拍摄原理,示例性地,参见图1。如图1 所示,本申请提供的拍摄装置100包括红外光发射器101、镜片102、调光片103和成像模块104。Firstly, the photographing device and its photographing principle provided by the present application will be introduced below, for example, refer to FIG. 1 . As shown in FIG. 1 , the photographing device 100 provided by the present application includes an infrared light emitter 101 , a lens 102 , a dimmer 103 and an imaging module 104 .
红外光发射器101可以用于发射红外光,该红外光会打到被拍摄对象120上。The infrared light emitter 101 can be used to emit infrared light, which will strike the subject 120 .
镜片102可以是凸透镜,用于将入射到该镜片102中的光(例如,被拍摄对象120反射的光)聚集到调光片103上。聚集在调光片103上的光可以是一个光束或一个光点。The lens 102 may be a convex lens, which is used to gather light incident on the lens 102 (for example, light reflected by the object 120 ) onto the dimmer sheet 103 . The light collected on the dimmer sheet 103 can be a light beam or a light spot.
调光片103位于镜片102和成像模块104之间,可以用于对镜片102聚集过来的光进行选择,从而调节入射到成像模块104的光。The dimmer 103 is located between the lens 102 and the imaging module 104 and can be used to select the light gathered by the lens 102 to adjust the light incident to the imaging module 104 .
成像模块104可以包括光电转换单元和图像处理单元。其中,光电转换单元用于通过感光面接收通过调光片103的光,并将感光面上的光像转换为与光像成相应比例关系的电信号。图像处理单元用于处理上述转换得到的电信号进而得到图像。示例性地,该光电转换单元例如可以是图像传感器等感光元件,该图像处理单元可以是图像信号处理器(image signal processor)等。The imaging module 104 may include a photoelectric conversion unit and an image processing unit. Wherein, the photoelectric conversion unit is used to receive the light passing through the dimmer 103 through the photosensitive surface, and convert the light image on the photosensitive surface into an electrical signal having a corresponding proportional relationship with the light image. The image processing unit is used to process the converted electrical signal to obtain an image. Exemplarily, the photoelectric conversion unit may be a photosensitive element such as an image sensor, and the image processing unit may be an image signal processor (image signal processor) or the like.
在本申请实施例中,一种可能的实现中,上述成像模块104可以包括一个或多个传感器。若包括一个传感器,那么,该传感器既可以处理红外光得到红外图像,也可以处理可见光得到可见光图像。若包括多个传感器,那么其中的一个传感器可以用于处理红外光得到红外图像,另一个传感器可以用于处理可见光得到可见光图像。In the embodiment of the present application, in a possible implementation, the imaging module 104 may include one or more sensors. If a sensor is included, the sensor can either process infrared light to obtain an infrared image, or process visible light to obtain a visible light image. If multiple sensors are included, one of the sensors can be used to process infrared light to obtain an infrared image, and the other sensor can be used to process visible light to obtain a visible light image.
另外,关于拍摄装置100的拍摄原理,如图1所示,红外光发射器101发射出的红外光打到被拍摄对象120之后,会发生反射(或散射)。该反射(或散射)的光经拍摄装置100的镜片102聚集到调光片103,经调光片103滤光后入射到成像模块104。该入射的光经成像模块104处理成像。此外,应理解,除了红外光发射器101发射的红外光之外,自然环境中的可见光打到被拍摄对象120后反射(或散射)的光,也会经拍摄装置100的镜片102聚集到调光片103。这些光(聚集到调光片103上的光)同样经调光片103滤光,调光片103允许通过的光才能入射到成像模块104。In addition, regarding the shooting principle of the shooting device 100 , as shown in FIG. 1 , after the infrared light emitted by the infrared light emitter 101 hits the object 120 to be photographed, it will be reflected (or scattered). The reflected (or scattered) light is collected by the lens 102 of the photographing device 100 to the dimmer 103 , filtered by the dimmer 103 and then incident to the imaging module 104 . The incident light is processed and imaged by the imaging module 104 . In addition, it should be understood that, in addition to the infrared light emitted by the infrared light emitter 101, the visible light in the natural environment and the reflected (or scattered) light after hitting the subject 120 will also be gathered to adjust Light sheet 103. The light (the light collected on the dimmer 103 ) is also filtered by the dimmer 103 , and only the light allowed by the dimmer 103 can enter the imaging module 104 .
下面对调光片的结构和工作原理进行具体描述。The structure and working principle of the dimmer will be described in detail below.
调光片103可以包括多个滤光片和至少一个遮光片。其中,该多个滤光片包括至少一个红外带通滤光片和至少一个红外截止滤光片。该任意一个红外带通滤光片用于让红外光穿过且过滤可见光;该任意一个红外截止滤光片用于让可见光穿过且过滤红外光;该任意一个遮光片用于阻止光穿过,即既过滤可见光和又过滤红外光。The dimmer 103 may include multiple light filters and at least one light-shielding film. Wherein, the plurality of filters include at least one infrared bandpass filter and at least one infrared cut filter. The arbitrary infrared bandpass filter is used to allow infrared light to pass through and filter visible light; the arbitrary infrared cut filter is used to allow visible light to pass through and filter infrared light; the arbitrary shading film is used to prevent light from passing through , which filters both visible light and infrared light.
应理解,上述拍摄装置100还包括驱动模块,驱动模块与上述调光片103连接。该驱动模块可以驱动和控制该调光片103的运动,以使得聚集到该调光片103上的光在不同的时段打在一个滤光片上或者一个遮光片上,从而实现对聚集到调光片103上的光进行选择和控制的目的。It should be understood that the above-mentioned photographing device 100 further includes a driving module, and the driving module is connected with the above-mentioned dimmer 103 . The driving module can drive and control the movement of the dimmer 103, so that the light gathered on the dimmer 103 hits a filter or a shading at different time periods, so as to realize the dimming of the dimmer 103. The light on sheet 103 is selected and controlled for purposes.
在一种可能的实施方式中,调光和图2C对这种实施方式下调光片103的几种结构对进行具体介绍。In a possible implementation manner, several structural pairs of the dimming sheet 103 in this implementation manner are specifically introduced in light adjustment and FIG. 2C .
图1中所示的调光片103的结构可以如图2A所示,该调光片103包括两个红外带通滤光片1031(分别为红外带通滤光片1031-1和红外带通滤光片1031-2)、一个红外截止滤光片1032和三个遮光片1033(分别为1033-1,1033-2和1033-3)。在图2A所示的例子中,上述三个滤光片(两个红外带通滤光片1031和一个红外截止滤光片1032)的任意相邻的两者之间均设置有一个遮光片1033。The structure of the dimmer 103 shown in Fig. 1 can be as shown in Fig. 2A, and this dimmer 103 comprises two infrared band-pass filters 1031 (respectively infrared band-pass filter 1031-1 and infrared band-pass filter 1031-1 filter 1031-2), an infrared cut filter 1032 and three light shields 1033 (respectively 1033-1, 1033-2 and 1033-3). In the example shown in Figure 2A, a shading sheet 1033 is arranged between any adjacent two of the above-mentioned three optical filters (two infrared bandpass optical filters 1031 and one infrared cut optical filter 1032) .
图1中所示的调光片103的结构还可以如图2B所示。该调光片103包括一个红外带通滤光片1031、一个红外截止滤光片1032和两个遮光片1033(分别为1033-1和1033-2)。The structure of the dimmer 103 shown in FIG. 1 may also be as shown in FIG. 2B . The dimmer 103 includes an infrared band-pass filter 1031, an infrared cut-off filter 1032 and two shading films 1033 (respectively 1033-1 and 1033-2).
图1中所示的调光片103的结构可以如图2C所示。该调光片103包括一个红外带通滤光片1031、一个红外截止滤光片1032和一个遮光片1033。The structure of the dimmer 103 shown in FIG. 1 may be as shown in FIG. 2C . The dimmer 103 includes an infrared band-pass filter 1031 , an infrared cut-off filter 1032 and a shading film 1033 .
下面以图2A所示的结构为例,并结合图2D,对调光片103和拍摄装置的工作原理进行介绍。Taking the structure shown in FIG. 2A as an example, and referring to FIG. 2D , the working principles of the dimming sheet 103 and the photographing device will be introduced.
在拍摄装置工作的过程中,入射到镜片102上的光经该镜片102聚集后的传播路径不变,因而,聚集到调光片103上的光通常会打到调光片103上的某个物理固定的方位上(参见图1所示)。这样,当调光片103在驱动模块的驱动下,以调光片103的中心点O旋转中心旋转时,会使得聚集到调光片103的光在不同的时段(即时间段)打到调光片103上不同的扇形区域中。并且,由于聚集到调光片103上的光束或光斑的面积通常较小,因而聚集到调光片103的光在一个时段中通常只打到调光片103上一个的扇形区域中。而不同的扇形区域对应的不同的滤光片或遮光片,因此通过上述方式,调光片103可以对聚集到调光片103上的光进行选择和过滤。具体实现时,上述驱动模块例如可以是电机等驱动装置,本申请实施例对此不做限制。During the working process of the photographing device, the propagation path of the light incident on the lens 102 after being collected by the lens 102 remains unchanged. Therefore, the light collected on the dimmer 103 usually hits a certain part of the dimmer 103. Physically fixed orientation (see Figure 1). In this way, when the dimming sheet 103 is driven by the drive module to rotate with the center point O of the dimming sheet 103, the light gathered to the dimming sheet 103 will be adjusted at different time periods (that is, time periods). In different fan-shaped areas on the light sheet 103. Moreover, since the area of the light beam or light spot collected on the dimming sheet 103 is generally small, the light collected on the dimming sheet 103 usually only hits one fan-shaped area on the dimming sheet 103 in a period of time. Different fan-shaped areas correspond to different light filters or light-shielding plates. Therefore, through the above-mentioned method, the dimmer 103 can select and filter the light collected on the dimmer 103 . During specific implementation, the aforementioned driving module may be, for example, a driving device such as a motor, which is not limited in this embodiment of the present application.
例如,在图2A和图2D中,首先,该聚集到调光片103的光在第一时段打到红外带通滤光片1031-1对应的扇形区域。那么,在该第一时段中,聚集到调光片103的光经过该红外带通滤光片1031-1后,只有红外光可以通过并入射到成像模块104中。其中,该第一时段的长度可以理解为红外光的曝光时长(曝光时间段的长度)。然后,在第一时段结束后,假设该调光片103经过旋转,使得聚集到调光片103的光在第二时段打在遮光片1033-2对应的扇形区域上。那么,在该第二时段中,遮光片1033-2阻止了聚集到调光片103的光打到成像模块104上。也就是说,在第二时段中,调光片103会阻止任何光(包括可见光和红外光)入射到成像模块104上。这也意味着,当聚集到调光片103的光打在遮光片1033-2上时(即当第二时段开始时),可以相当于快门,会导致上述第一时段中的红外光的曝光结束,因此,上述第二时段的开始时刻可以理解为第一时段的结束时刻。应理解,当聚集到调光片103的光打在遮光片1033-2上时,还会触发成像模块104在第二时段中处理在第一时段中接收到的红外光(穿过该调光片103的红外光)并得到红外图像,例如,得到第一红外图像。其中,第一时段的结束时刻可以理解为该第一红外图像的拍摄时刻或成像时刻。其中,上述第二时段的长度可以称为遮光片1033-2的遮光时长。For example, in FIG. 2A and FIG. 2D , firstly, the light gathered to the dimmer 103 hits the fan-shaped area corresponding to the infrared bandpass filter 1031-1 in the first period of time. Then, in the first time period, after the light collected on the dimmer 103 passes through the infrared bandpass filter 1031 - 1 , only infrared light can pass through and enter the imaging module 104 . Wherein, the length of the first period can be understood as the exposure time of infrared light (the length of the exposure time period). Then, after the end of the first period, it is assumed that the dimmer 103 is rotated, so that the light gathered on the dimmer 103 hits the fan-shaped area corresponding to the light shield 1033-2 during the second period. Then, in the second time period, the light shielding sheet 1033 - 2 prevents the light collected on the light adjusting sheet 103 from hitting the imaging module 104 . That is to say, during the second period, the dimmer 103 prevents any light (including visible light and infrared light) from incident on the imaging module 104 . This also means that when the light collected on the dimming film 103 hits the light shielding film 1033-2 (that is, when the second period begins), it can be equivalent to a shutter, which will cause the exposure of infrared light in the above-mentioned first period. Therefore, the start moment of the above-mentioned second period can be understood as the end moment of the first period. It should be understood that when the light collected on the dimming sheet 103 hits the light shielding sheet 1033-2, the imaging module 104 will also be triggered to process the infrared light received in the first period in the second period (passing through the dimming panel 103-2). Infrared light from sheet 103) and obtain an infrared image, for example, obtain a first infrared image. Wherein, the end moment of the first period can be understood as the shooting moment or imaging moment of the first infrared image. Wherein, the length of the above-mentioned second period may be referred to as the light-shielding duration of the light-shielding sheet 1033-2.
接着,当第二时段结束后,该调光片103经过旋转,使得聚集到调光片103的光在第三时段打在红外截止滤光片1032对应的扇形区域。那么,在该第三时段中,聚集到调光片103的光经过该红外截止滤光片1032后,只有可见光可以通过并入射到成像模块104中。同理,该第三时段可以理解为可见光的曝光时长。紧接着,当该调光片103继续旋转时,可以使得聚集到调光片103的光在第四时段打在遮光片1033-3对应的扇形区域。同理,当第四时段开始时,可以触发成像模块104在该第四时段中,处理在上述第三时段中接收到的可见光(穿过该调光片103的可见光)得到可见光图像,第三时段的结束时刻可以理解为该可将光图像的拍摄时刻。同理,上述第四时段的长度可以称为遮光片1033-3的遮光时长。Then, when the second period is over, the dimmer 103 is rotated, so that the light collected on the dimmer 103 hits the corresponding fan-shaped area of the infrared cut filter 1032 in the third period. Then, in the third period, after the light collected on the dimmer 103 passes through the infrared cut filter 1032 , only visible light can pass through and enter the imaging module 104 . Similarly, the third period can be understood as the exposure time of visible light. Next, when the dimmer 103 continues to rotate, the light gathered to the dimmer 103 can hit the fan-shaped area corresponding to the dimmer 1033-3 in the fourth period. Similarly, when the fourth period starts, the imaging module 104 can be triggered to process the visible light (visible light passing through the dimmer 103 ) received in the third period to obtain a visible light image in the fourth period, and the third The end moment of the period can be understood as the shooting moment of the available light image. Similarly, the above-mentioned length of the fourth period of time may be referred to as the light-shielding duration of the light-shielding sheet 1033-3.
然后,该调光片103可以在驱动模块的控制下继续旋转,使得聚集到调光片103的光分别在第五时段和第六时段打在红外带通滤光片1031-2和遮光片1033-1对应的扇形区域,从而使得拍摄装置得到第二红外图像。应理解,该第二红外图像的曝光时长为该第五时段的长 度,该第二红外图像的拍摄时刻为该第五时段的结束时刻,不再赘述。Then, the dimming sheet 103 can continue to rotate under the control of the driving module, so that the light gathered to the dimming sheet 103 hits the infrared bandpass filter 1031-2 and the shading sheet 1033 in the fifth period and the sixth period respectively. -1 corresponds to the fan-shaped area, so that the camera can obtain the second infrared image. It should be understood that the exposure time of the second infrared image is the length of the fifth time period, and the shooting time of the second infrared image is the end time of the fifth time period, which will not be repeated here.
再然后,该调光片103可以在驱动模块的控制下,继续上述的旋转,使得拍摄装置得到红外图像或可见光图像。Then, the dimmer sheet 103 can continue the above rotation under the control of the driving module, so that the photographing device can obtain an infrared image or a visible light image.
应理解,上述第一时段至第六时段中的几个时段可以是连续的,但是互相不重叠的。也应理解,上述第一时段至第六时段中的每个时段的时长可以是相同的,也可以是各不相同的。It should be understood that some of the above first to sixth periods of time may be consecutive, but not overlapping with each other. It should also be understood that the duration of each of the first to sixth time periods may be the same or different.
基于上述的介绍可知,对如图2A所示的例子,调光片103旋转一圈即可获得两个红外图像和一个可见光图像。对于图2B所示的例子,调光片103旋转一圈即可获得一个红外图像和一个可见光图像。当然,对于图2B的例子,也可以通过驱动调光片103旋转一圈半的方式获得两个红外图像和一个可见光图像。具体的,可以驱动调光片103逆时针方向(如图2B所示)旋转一圈半,那么聚集到调光片103上的光可以依次打到红外带通滤光片1031、遮光片1033-2、红外截止滤光片1032、遮光片1033-1、红外带通滤光片1031和遮光片1033-2。那么,基于前面的描述可知,图2B所示的调光片103旋转一圈半的过程中可以获得两个红外图像和一个可见光图像。Based on the above introduction, it can be known that, for the example shown in FIG. 2A , two infrared images and one visible light image can be obtained by rotating the dimming plate 103 once. For the example shown in FIG. 2B , one infrared image and one visible light image can be obtained by one revolution of the dimmer sheet 103 . Of course, for the example in FIG. 2B , two infrared images and one visible light image can also be obtained by driving the dimmer 103 to rotate one and a half times. Specifically, the dimmer 103 can be driven counterclockwise (as shown in FIG. 2B ) to rotate one and a half times, then the light gathered on the dimmer 103 can hit the infrared bandpass filter 1031, the shading film 1033- 2. Infrared cut-off filter 1032, shading sheet 1033-1, infrared bandpass filter 1031, and shading sheet 1033-2. Then, based on the foregoing description, it can be seen that two infrared images and one visible light image can be obtained during the process of the dimming sheet 103 shown in FIG. 2B rotating one and a half times.
在上述图2A和图2B所述的例子中,驱动模块可以驱动调光片103在工作的过程中始终沿一个方向运动,例如,驱动模块驱动调光片103一直沿着顺时针方向旋转,或者一直沿着逆时针旋转。在实际实现时,调光片103在工作的过程中,驱动模块可以基于业务的需求,对调光片的运动的方向进行灵活的控制。例如,在图2C所示的例子中,驱动模块可以控制和驱动调光片103时而顺时针旋转,时而逆时针旋转。具体地,驱动模块可以驱动调光片103顺时针方向旋转,使得聚集到调光片103上的光可以依次打到红外带通滤光片1031、遮光片1033、红外截止滤光片1032上;然后,驱动模块可以驱动调光片103沿逆时针方向旋转,使得聚集到调光片103上的光依次再次打到遮光片1033、红外带通滤光片1031上。再然后,驱动模块可以驱动调光片103再次顺时针方向旋转。应理解,在调光片103的上述运动过程中,拍摄装置可以依次得到红外图像,可见光图像,红外图像以及可见光图像等,不再赘述。In the example described above in FIG. 2A and FIG. 2B , the driving module can drive the dimmer 103 to always move in one direction during the working process, for example, the driving module drives the dimmer 103 to always rotate clockwise, or Always rotate counterclockwise. In actual implementation, when the dimmer 103 is working, the driving module can flexibly control the direction of movement of the dimmer based on business requirements. For example, in the example shown in FIG. 2C , the driving module can control and drive the dimmer 103 to rotate clockwise sometimes and counterclockwise sometimes. Specifically, the driving module can drive the dimmer 103 to rotate clockwise, so that the light gathered on the dimmer 103 can hit the infrared band-pass filter 1031, the light-shielding film 1033, and the infrared cut-off filter 1032 in sequence; Then, the driving module can drive the dimmer 103 to rotate counterclockwise, so that the light collected on the dimmer 103 strikes the light shield 1033 and the infrared bandpass filter 1031 again in sequence. Then, the driving module can drive the dimming chip 103 to rotate clockwise again. It should be understood that during the above-mentioned movement process of the dimmer 103 , the photographing device can sequentially obtain an infrared image, a visible light image, an infrared image, and a visible light image, etc., which will not be repeated here.
在一种实施方式中,遮光片的大小可以用于调节红外带通滤光片或红外截止滤光片的曝光时长。下面结合图2A所示的例子进行说明。In one embodiment, the size of the shading plate can be used to adjust the exposure time of the infrared bandpass filter or the infrared cutoff filter. The following description will be made in conjunction with the example shown in FIG. 2A .
如图2A所示,可以通过调节各扇形对应的圆心角的角度即可调节对应滤光片对应的曝光时长。例如,调节红外带通滤光片1031-1对应的圆心角1的大小可以调节该红外带通滤光片1031-1对应的红外光曝光时长,调节红外带通滤光片1031-2对应的圆心角2的大小可以调节该红外带通滤光片1031-2对应的红外光曝光时长,调节红外截止滤光片1032对应的圆心角3的大小可以调节该红外截止滤光片1032对应的可见光曝光时长。由于各扇形的圆心角总和是360°,那么,如果调大遮光片1033的圆心角,滤光片(红外带通滤光片1031和红外截止滤光片1032统称为滤光片)的圆心角就会对应变小,因此,也可以通过调节各遮光片的圆心角的大小来调节对应的滤光片的曝光时长。As shown in FIG. 2A , the exposure duration corresponding to the corresponding filter can be adjusted by adjusting the angle of the central angle corresponding to each sector. For example, adjusting the size of the central angle 1 corresponding to the infrared bandpass filter 1031-1 can adjust the infrared light exposure time corresponding to the infrared bandpass filter 1031-1, and adjust the corresponding infrared light exposure time of the infrared bandpass filter 1031-2. The size of the central angle 2 can adjust the infrared light exposure time corresponding to the infrared band-pass filter 1031-2, and the size of the central angle 3 corresponding to the infrared cut-off filter 1032 can adjust the visible light corresponding to the infrared cut-off filter 1032. exposure time. Because the sum of the central angles of each sector is 360 °, then, if the central angle of the light-shielding sheet 1033 is enlarged, the central angle of the optical filter (infrared bandpass optical filter 1031 and infrared cut-off optical filter 1032 are collectively referred to as optical filter) The corresponding strain will be small. Therefore, the exposure time of the corresponding filter can also be adjusted by adjusting the size of the central angle of each light shield.
举例来说(可以参见图2A),可以通过调小(或调大)遮光片1033-1的圆心角来增大(或减小)红外带通滤光片1031-1的圆心角1,以增加(或减少)红外带通滤光片1031-1对应的红外光的曝光时长。或者,可以通过调小(或调大)遮光片1033-3的圆心角来增大(或减小)红外带通滤光片1031-2的圆心角2,以增加(或减少)红外带通滤光片1031-2对应的红外光的曝光时长。再或者,可以通过调小(或调大)遮光片1033-2的圆心角来增大(或减小)红外截止滤光片1032的圆心角3,以增加(或减少)红外截止滤光片1032对应的可见光的曝光时长。For example (see FIG. 2A ), the central angle 1 of the infrared bandpass filter 1031-1 can be increased (or decreased) by reducing (or increasing) the central angle of the shading film 1033-1, so as to Increase (or decrease) the exposure time of the infrared light corresponding to the infrared bandpass filter 1031-1. Alternatively, the central angle 2 of the infrared bandpass filter 1031-2 can be increased (or reduced) by reducing (or increasing) the central angle of the shading sheet 1033-3 to increase (or decrease) the infrared bandpass The exposure time of the infrared light corresponding to the filter 1031-2. Alternatively, the central angle 3 of the infrared cut-off filter 1032 can be increased (or reduced) by reducing (or increasing) the central angle of the shading plate 1033-2, so as to increase (or reduce) the infrared cut-off filter 1032 corresponds to the exposure time of visible light.
再举例来说,在图2A中,可以通过调小(或调大)遮光片1033-1的圆心角来增大(或减小)红外带通滤光片1031-2的圆心角2,以增加(或减少)红外带通滤光片1031-2对应的红外光的曝光时长。可以通过调小(或调大)遮光片1033-3的圆心角来增大(或减小)红外截止滤光片1032的圆心角3,以增加(或减少)红外截止滤光片1032对应的可见光的曝光时长。可以通过调小(或调大)遮光片1033-2的圆心角来增大(或减小)红外带通滤光片1031-1的圆心角1,以增加(或减少)红外带通滤光片1031-1对应的红外光的曝光时长。红外光曝光时长越长,可以获得图像更多的暗部细节,即图像的纹理更清晰。可见光曝光时长越长,可以获得图像更多的颜色信息,即图像的颜色更自然。For another example, in FIG. 2A, the central angle 2 of the infrared bandpass filter 1031-2 can be increased (or decreased) by reducing (or increasing) the central angle of the shading plate 1033-1, so as to Increase (or decrease) the exposure time of the infrared light corresponding to the infrared bandpass filter 1031-2. The central angle 3 of the infrared cut filter 1032 can be increased (or reduced) by reducing (or increasing) the central angle of the shading sheet 1033-3, so as to increase (or reduce) the corresponding Visible light exposure time. The central angle 1 of the infrared bandpass filter 1031-1 can be increased (or decreased) by reducing (or increasing) the central angle of the shading sheet 1033-2 to increase (or decrease) the infrared bandpass filter The exposure time of the infrared light corresponding to the slice 1031-1. The longer the exposure time of infrared light, the more details in the dark part of the image can be obtained, that is, the texture of the image is clearer. The longer the visible light exposure time, the more color information of the image can be obtained, that is, the color of the image is more natural.
上文介绍了可以通过调节遮光片的大小来控制遮光片的遮光时长和各个滤光片的曝光时长。需要说明的是,调光片中各个滤光片的曝光时长以及各个遮光片的遮光时长,还可以通过控制调光片运动速度来调节。例如,在图2A-图2C所示的圆形形状的调光片的例子中,假设调光片的旋转速度为t秒转一圈,一圈为360°,那么转1°需要t/360秒。那么,若一个滤光片的扇形圆心角为θ°,则该滤光片对应的曝光时长为(θ*t)/360秒。同理,若一个遮光片的扇形圆心角为φ°,则该遮光片的遮光时长为(φ*t)/360秒。其中,调光片的运动速度可以通过驱动模块来控制。具体地,驱动模块可以控制调光片103以某个速度匀速旋转。例如,一秒转20圈、一秒转30圈或者一秒转50圈等等。或者,驱动模块可以根据业务需求控制调光片103在某个时间段以第一速度旋转,在另一个时间段以第二速度旋转等。例如,在聚集到调光片上的光打在滤光片的时间段中,以第一速度旋转;在聚集到调光片上的光打在遮光片的时间段中,以第二速度旋转;其中第一速度不同于第二速度。It was introduced above that the shading duration of the shading sheet and the exposure duration of each filter can be controlled by adjusting the size of the shading sheet. It should be noted that the exposure duration of each filter in the dimmer and the shading duration of each shade can also be adjusted by controlling the movement speed of the dimmer. For example, in the example of the circular dimmer shown in Figure 2A-Figure 2C, assuming that the rotation speed of the dimmer is t seconds, one circle is 360°, then 1° rotation requires t/360 Second. Then, if the fan-shaped central angle of a filter is θ°, the exposure time corresponding to the filter is (θ*t)/360 seconds. Similarly, if the fan-shaped central angle of a shading sheet is φ°, the shading duration of the shading sheet is (φ*t)/360 seconds. Wherein, the moving speed of the dimming film can be controlled by the driving module. Specifically, the driving module can control the dimmer 103 to rotate at a certain speed at a constant speed. For example, 20 revolutions per second, 30 revolutions per second, or 50 revolutions per second, etc. Or, the driving module can control the dimming sheet 103 to rotate at the first speed in a certain period of time and at the second speed in another period of time according to business requirements. For example, during the period of time when the light collected on the dimming film hits the filter, it rotates at the first speed; during the time period when the light collected on the dimming film hits the light shielding film, it rotates at the second speed; wherein The first speed is different from the second speed.
应理解,在通过调整遮光片的大小,或者控制调光片的运动速度来调节各个滤光片的曝光时长以及各个遮光片的遮光时长的基础上,拍摄装置可以便捷地控制图像的拍摄时刻。下面基于前面在介绍图2A所示的调光片的工作原理时所描述的例子,并结合图2D进行介绍。如图2D所示,假设拍摄装置需要分别在T0时刻、T1时刻和T2时刻拍摄得到第一红外图像,可见光图像和第二红外图像,则可以基于驱动模块控制调光片的运动,使得上述第一时段的结束时刻为T0,上述第三时段的结束时刻为T1,上述第五时段的结束时刻为T2。也就是说,拍摄装置100可以便捷地拍摄得到上述第一红外图像、可见光图像和第二红外图像。It should be understood that on the basis of adjusting the exposure duration of each filter and the shading duration of each shading sheet by adjusting the size of the shading sheet or controlling the moving speed of the shading sheet, the shooting device can conveniently control the shooting moment of the image. The following is based on the example described above when introducing the working principle of the dimmer shown in FIG. 2A , and will be introduced in conjunction with FIG. 2D . As shown in Figure 2D, assuming that the shooting device needs to capture the first infrared image, the visible light image and the second infrared image at T0 time, T1 time and T2 time respectively, the movement of the dimmer can be controlled based on the driving module, so that the above-mentioned first The end time of a period is T0, the end time of the third period is T1, and the end time of the fifth period is T2. That is to say, the photographing device 100 can conveniently photograph the above-mentioned first infrared image, visible light image and second infrared image.
基于上述描述可知,拍摄装置100中的调光片103可以根据实际业务的需求来灵活调整自己的运动的方向、运动的速度和方式等(基于驱动模块),使得调光片103能够根据需求将聚集到所述调光片103上的光在对应的时段打在对应的某个滤光片或某个遮光片上,从而起到根据需求在不同的时间段选择不同的滤光片,即,最终可以使得拍摄装置100可以根据实际需求在相应的时刻拍摄得到相应的红外图像或可见光图像,使得拍摄十分方便和灵活。Based on the above description, it can be seen that the dimmer 103 in the photographing device 100 can flexibly adjust its own motion direction, speed and mode of motion (based on the drive module) according to actual business needs, so that the dimmer 103 can The light collected on the dimmer 103 hits a corresponding filter or a certain light-shielding film in a corresponding time period, so as to select different filters in different time periods according to requirements, that is, finally The photographing device 100 can photograph corresponding infrared images or visible light images at corresponding moments according to actual needs, making photographing very convenient and flexible.
一种可能的实现方式中,图1中所示的调光片103还可以是多边形,例如,可以是三角形,四边形或六边形等,相应地,上述红外带通滤光片1031、红外截止滤光片1032和遮光片1033可以分别为三角形,四边形或六边形。应理解,多边形结构的调光片的具体调光功能和工作原理与上述圆形结构的类似,此处不再赘述。在这些实现方式下,同样可以基于驱动模块驱动和控制调光片103的旋转(例如,旋转方向,旋转速度等),使得拍摄装置100可以根据实际需求在相应的时刻拍摄得到相应的红外图像或可见光图像,不再赘述。In a possible implementation, the dimmer 103 shown in FIG. 1 can also be polygonal, for example, it can be triangular, quadrangular or hexagonal, etc., correspondingly, the above-mentioned infrared bandpass filter 1031, infrared cutoff The optical filter 1032 and the shading sheet 1033 can be triangular, quadrilateral or hexagonal respectively. It should be understood that the specific dimming function and working principle of the polygonal structure of the dimming sheet are similar to those of the above circular structure, and will not be repeated here. In these implementations, the rotation (for example, rotation direction, rotation speed, etc.) of the dimmer 103 can also be driven and controlled based on the driving module, so that the shooting device 100 can capture corresponding infrared images or images at corresponding times according to actual needs. Visible light images will not be repeated here.
一种可能的实施方式中,图1中所示的调光片103还可以是矩形,相应地,上述红外带通滤光片1031、红外截止滤光片1032和遮光片1033也可以是矩形,例如可参见图3。在这种实施方式下,驱动模块可以驱动该调光片103在工作的过程中移动,以使得聚集到该调光片103上的光在不同的时段打在一个滤光片上或者一个遮光片上。In a possible implementation manner, the dimmer 103 shown in FIG. 1 can also be rectangular, and correspondingly, the above-mentioned infrared bandpass filter 1031, infrared cutoff filter 1032 and shading sheet 1033 can also be rectangular, See, for example, FIG. 3 . In this embodiment, the driving module can drive the dimmer 103 to move during operation, so that the light collected on the dimmer 103 strikes a filter or a light shield at different time periods.
下面结合图3对调光片103为矩形时的拍摄原理进行介绍。The shooting principle when the dimming sheet 103 is rectangular will be introduced below with reference to FIG. 3 .
在驱动模块的驱动下,图3所示的调光片103可以沿一个方向(比如,第一方向)移动,使得聚集到调光片103的光在不同的时段再依次打在标号为1、2、3、4和5对应的矩形区域上。之后,驱动模块可以驱动调光片103再以与上述第一方向相反的方向移动,使得聚集到调光片103的光再依次打在标号为4、3、2和1对应的矩形区域上。通过驱动模块的上述驱动和控制,假设在调光片103沿第一方向移动的过程中,可以使得聚集到调光片103的光依次分别在第一时段,第二时段,第三时段,第四时段和第五时段打在红外带通滤光片1031-1,遮光片1033-1,红外截止滤光片1032,遮光片1033-2和红外带通滤光片1031-2上;之后,在调光片103沿与第一方向相反的方向移动的过程中,可以使得聚集到调光片103的光依次分别在第六时段,第七时段和第八时段打在遮光片1033-2,红外截止滤光片1032和遮光片1033-1上。因此,在上述过程中,可以使得拍摄装置100在第一时段结束(或第二时段开始)时处理得到第一红外图像,在第三时段结束(或第四时段开始)时处理得到第一可将光图像,在五时段结束(或第六时段开始)时处理得到第二红外图像,在第七时段结束(或第八时段开始)时处理得到第二可见光图像等。之后的过程类似,不再赘述。Driven by the driving module, the dimmer 103 shown in FIG. 3 can move in one direction (for example, the first direction), so that the light gathered to the dimmer 103 can be illuminated sequentially at different time intervals, labeled 1, 2, 3, 4 and 5 corresponding to the rectangular area. Afterwards, the driving module can drive the dimmer 103 to move in the direction opposite to the above-mentioned first direction, so that the light collected on the dimmer 103 hits the rectangular areas corresponding to the labels 4, 3, 2 and 1 in sequence. Through the above-mentioned driving and control of the driving module, it is assumed that during the movement of the dimmer 103 in the first direction, the light gathered to the dimmer 103 can be sequentially respectively in the first period, the second period, the third period, and the second period. The fourth period and the fifth period are played on the infrared bandpass filter 1031-1, the shading sheet 1033-1, the infrared cut-off filter 1032, the shading sheet 1033-2 and the infrared bandpass filter 1031-2; after that, During the movement of the dimming sheet 103 in the opposite direction to the first direction, the light gathered to the dimming sheet 103 can hit the light shielding sheet 1033-2 in the sixth period, the seventh period and the eighth period respectively, On the infrared cut filter 1032 and the shading sheet 1033-1. Therefore, in the above process, the photographing device 100 can process and obtain the first infrared image at the end of the first time period (or the beginning of the second time period), and obtain the first infrared image at the end of the third time period (or the beginning of the fourth time period). The light image is processed to obtain the second infrared image at the end of the fifth period (or the beginning of the sixth period), and the second visible light image is obtained at the end of the seventh period (or the beginning of the eighth period). Subsequent processes are similar and will not be repeated here.
同样地,聚集到调光片103的光打在各个滤光片上的时段的长度可以用于指示对应的红外图像或可见光图像的曝光时长。例如,在上述例子中,第一时段的长度可以用于指示第一红外图像的曝光时长,第三时段的长度可以用于指示第一可见光图像的曝光时长等。因此,可以理解,各个滤光片的宽度可以影响对应的红外图像或可见光图像的曝光时长。因此,在调光片103整体宽度固定的情况下,可以通过调节各遮光片的矩形区域的宽度来调节对应的滤光片的曝光时长。以图3为例,可以调窄(或调宽)遮光片1033-1的宽度来增加(或减少)红外带通滤光片1031-1的宽度,以增加(或减少)红外带通滤光片1031-1对应的红外光的曝光时长。其它的滤光片同理,此处不再赘述。Likewise, the length of the period during which the light gathered to the dimmer 103 hits each filter can be used to indicate the exposure time of the corresponding infrared image or visible light image. For example, in the above example, the length of the first time period may be used to indicate the exposure time of the first infrared image, and the length of the third time period may be used to indicate the exposure time of the first visible light image. Therefore, it can be understood that the width of each filter can affect the exposure time of the corresponding infrared image or visible light image. Therefore, when the overall width of the light-shielding sheet 103 is fixed, the exposure duration of the corresponding light-shielding sheet can be adjusted by adjusting the width of the rectangular area of each light-shielding sheet. Taking Fig. 3 as an example, the width of the shading film 1033-1 can be narrowed (or widened) to increase (or reduce) the width of the infrared bandpass filter 1031-1 to increase (or reduce) the width of the infrared bandpass filter The exposure time of the infrared light corresponding to the slice 1031-1. The same is true for other filters, which will not be repeated here.
同理,同样可以通过控制调光片103的移动速度来控制各个滤光片的曝光时长和各个遮光片的遮光时长,此处不赘述。调光片103的移动速度同样可以由驱动模块来控制。本申请对调光片103的移动速度的大小或移动速度是否变化不做限定。Similarly, the exposure duration of each filter and the shading duration of each shading sheet can also be controlled by controlling the moving speed of the dimmer 103 , which will not be repeated here. The moving speed of the dimmer 103 can also be controlled by the driving module. The application does not limit the magnitude of the moving speed of the dimmer 103 or whether the moving speed changes.
基于上述描述可知,对图3所示的调光片103同样可以灵活地根据业务的需求对聚集到所述调光片103上的光进行选择和控制,并能灵活控制各种光的曝光时长,因而最终可以使得拍摄装置100可以根据实际需求在相应的时间拍摄得到相应的红外图像或可见光图像,使得拍摄十分方便和灵活。Based on the above description, it can be seen that the dimmer 103 shown in FIG. 3 can also flexibly select and control the light gathered on the dimmer 103 according to business requirements, and can flexibly control the exposure time of various lights. , so that finally the photographing device 100 can photograph corresponding infrared images or visible light images at a corresponding time according to actual needs, making the photographing very convenient and flexible.
需要说明的是,上述调光片103不限于上述介绍的形态,还可以是其它的形态,只要包括上述滤光片和遮光片的调光装置均属于本申请保护的范围。调光片103中的滤光片和遮光片也不限于上述介绍的形状,还可以是其它的形状,例如圆形或多边形等等。还需说明的是,若调光片103为多边形或矩形,那么,图1中所示的圆形调光片103对应替换为多边形或矩形的调光片103,此处不再赘述。It should be noted that the above-mentioned dimmer 103 is not limited to the form described above, and can also be in other forms, as long as the dimmer including the above-mentioned light filter and light-shielding film falls within the protection scope of the present application. The light filter and light-shielding film in the dimmer 103 are not limited to the shapes described above, and may also be in other shapes, such as circular or polygonal. It should also be noted that if the dimmer 103 is polygonal or rectangular, then the circular dimmer 103 shown in FIG. 1 should be replaced with a polygonal or rectangular dimmer 103 , which will not be repeated here.
另外,本申请提供的拍摄装置100还可以包括除图1所示的其它部件,本申请对此不做 限定。例如,拍摄装置100包括处理器。该处理器可以用于执行本申请实施例提供的图像处理方法(可以示例性参见下面图4的描述,此处不赘述)。具体地,拍摄装置可以基于上述调光片、驱动模块和成像模块等模块拍摄同一场景,且分别在T0时刻、T1时刻和T2时刻拍摄得到第一红外图像,可见光图像和第二红外图像,然后基于处理器执行该本申请实施例提供的图像处理方法得到最终的融合图像(可以示例性参见下面图4的描述,此处不赘述)。再例如,拍摄装置100还可以包括壳体(图1中未画出),上述红外光发射器101、镜片102、调光片103和成像模块104可以示例性地按照图1所示的相对位置固定在所述壳体内。又例如,拍摄装置100还可以包括闪光灯、存储卡等等,不再赘述。In addition, the photographing device 100 provided in the present application may also include other components other than those shown in FIG. 1 , which is not limited in the present application. For example, the camera 100 includes a processor. The processor may be used to execute the image processing method provided in the embodiment of the present application (for an example, refer to the description in FIG. 4 below, which will not be repeated here). Specifically, the shooting device can shoot the same scene based on the above-mentioned dimmer, driving module, imaging module and other modules, and obtain the first infrared image, the visible light image and the second infrared image respectively at T0 time, T1 time and T2 time, and then The final fused image is obtained by executing the image processing method provided by the embodiment of the present application based on the processor (see the description in FIG. 4 below for an example, which will not be repeated here). For another example, the photographing device 100 may also include a casing (not shown in FIG. 1 ), and the above-mentioned infrared light emitter 101, lens 102, dimmer 103 and imaging module 104 may be exemplarily according to the relative positions shown in FIG. 1 fixed in the housing. For another example, the photographing device 100 may also include a flashlight, a memory card, etc., which will not be repeated here.
上述拍摄装置100可以是任意具备上述拍摄结构和功能的设备,例如,可以是照相机、各类摄像机(如监控或安防类摄像机)、还可以是智能手机、平板电脑、掌上电脑、智能可穿戴设备(包括智能手环、智能手表和智能眼镜等)等各种形式的用户设备(User Equipment,UE)、移动台(Mobile station,MS)、终端设备(Terminal Equipment)等等。The above-mentioned shooting device 100 can be any device with the above-mentioned shooting structure and functions, for example, it can be a camera, various cameras (such as monitoring or security cameras), or a smart phone, a tablet computer, a handheld computer, a smart wearable device (Including smart bracelets, smart watches and smart glasses, etc.) and other forms of user equipment (User Equipment, UE), mobile station (Mobile station, MS), terminal equipment (Terminal Equipment) and so on.
下面介绍本申请提供的一种图像处理方法。该方法的执行主体可以是图像处理装置。在实际实施时,该图像处理装置可以是拍摄图像的拍摄装置,也可以是不同于拍摄装置的其他具有计算能力的装置(例如服务器、处理芯片等)。示例性的,若执行主体为该拍摄装置,那么,该拍摄装置中的成像模块在采集得到图像后,可以将该采集的图像发送给拍摄装置的处理器进行处理。若该执行主体为其他具有计算能力的装置,那么,该拍摄装置通过成像模块采集得到图像后,将该采集的图像发送给该具有计算能力的装置来处理。An image processing method provided by this application is introduced below. The subject of execution of the method may be an image processing device. In actual implementation, the image processing device may be a photographing device that captures images, or may be other devices with computing capabilities (such as a server, a processing chip, etc.) that are different from the photographing device. Exemplarily, if the subject of execution is the photographing device, the imaging module in the photographing device may send the captured image to a processor of the photographing device for processing after acquiring an image. If the execution subject is another device with computing capability, then, after the photographing device captures an image through the imaging module, it sends the captured image to the device with computing capability for processing.
参见图4,图4为本申请提供的图像处理方法的流程示意图,该方法包括但不限于如下步骤:Referring to Figure 4, Figure 4 is a schematic flow chart of the image processing method provided by the present application, which includes but is not limited to the following steps:
S401、获取第一红外图像、可见光图像和第二红外图像;其中,该第一红外图像、该可见光图像和该第二红外图像是该拍摄装置分别在T0时刻、T1时刻和T2时刻拍摄同一个场景得到,T0<T1<T2。S401. Acquire a first infrared image, a visible light image, and a second infrared image; wherein, the first infrared image, the visible light image, and the second infrared image are the same image captured by the shooting device at T0, T1, and T2 respectively The scene is obtained, T0<T1<T2.
上述“场景”指的是拍摄装置的拍摄场景或拍摄的视野空间。该视野空间(或拍摄场景)内包括一个或多个被拍摄的目标对象,该目标对象可以是该视野空间中的任意对象,比如,可以是动物、植物、车辆、人等等。为了便于理解该视野空间,可以示例性地参见图5。图5中所示的视野空间类似于多面体,即面ABCD、边AE、BH、CG、DF和面EFGH构成的多面体的空间即为拍摄装置的视野空间。示例性地,面ABCD和面EFGH可以相对运动。图5仅为一个示例,不构成对本申请实施例的限制。The above-mentioned "scene" refers to the shooting scene of the shooting device or the viewing space of shooting. The viewing space (or shooting scene) includes one or more target objects to be photographed, and the target objects may be any objects in the viewing space, for example, animals, plants, vehicles, people and so on. In order to facilitate understanding of the viewing space, reference may be made to FIG. 5 by way of example. The view space shown in FIG. 5 is similar to a polyhedron, that is, the space of the polyhedron formed by faces ABCD, sides AE, BH, CG, DF and face EFGH is the view space of the camera. Exemplarily, the surfaces ABCD and EFGH can move relative to each other. FIG. 5 is only an example, and does not constitute a limitation to the embodiment of the present application.
其中,上述视野空间中的目标对象和拍摄装置之间可以是相对运动的。在一种情况下,可能是拍摄装置固定不动,该目标对象在拍摄装置的视场角范围内移动。例如,在交通监控的场景中,拍摄装置可以固定在灯杆上,拍摄装置所拍摄的视野空间中的目标对象可以是路面上移动的车辆。另一种可能的情况下,还可能是目标对象不动,拍摄装置移动。在这种情况下拍摄装置在移动的过程中能保持其视场角范围覆盖该视野空间(或拍摄场景)的全部或部分。例如,在环绕拍摄的场景中,拍摄装置可能环绕舞台转动拍摄,但拍摄装置的拍摄角度始终对着舞台中央,使得其视场角范围覆盖拍摄场景的全部或部分。还有些情况下,被拍摄的视野空间中的目标对象和拍摄装置可能都在移动。同样地,在这个过程中,需要保持拍摄装置的视场角范围能覆盖该拍摄场景或视野空间的全部或部分。Wherein, there may be relative motion between the target object in the above-mentioned view space and the photographing device. In one case, it may be that the photographing device is fixed, and the target object moves within the range of the field of view of the photographing device. For example, in a traffic monitoring scene, the photographing device may be fixed on a light pole, and the target object in the visual field captured by the photographing device may be a moving vehicle on the road. In another possible situation, it is also possible that the target object does not move, but the photographing device moves. In this case, the shooting device can keep its field of view range covering all or part of the field of view space (or shooting scene) during the moving process. For example, in a surrounding shooting scene, the shooting device may rotate around the stage to shoot, but the shooting angle of the shooting device is always facing the center of the stage, so that its field of view covers all or part of the shooting scene. In other cases, both the object of interest and the camera device in the field of view being photographed may be moving. Likewise, in this process, it is necessary to keep the viewing angle range of the shooting device to cover all or part of the shooting scene or viewing space.
应理解,由于在该方法中,需要对拍摄的红外图像和可见光图像进行融合,因此,It should be understood that since in this method, the captured infrared image and the visible light image need to be fused, therefore,
需说明的是,在该实施例中,拍摄装置拍摄的图像中,可以包括拍摄的视野空间中某个 完整的目标对象,也可以只包括某个目标对象的一部分。例如,如果该拍摄空间中包含火车,则拍摄的图像中可能只包括火车的一部分。这可以根据实际的需求来调整,本申请对此不做限定。It should be noted that, in this embodiment, the image captured by the photographing device may include a complete target object in the captured field of view, or may only include a part of a certain target object. For example, if the captured space contains a train, only a portion of the train may be included in the captured image. This can be adjusted according to actual needs, which is not limited in this application.
还需说明的是,在该步骤中,上述“拍摄装置分别在T0时刻、T1时刻和T2时刻拍摄同一个场景”,可以是拍摄装置在该三个时刻拍摄的视野空间是完全相同的,也可以是拍摄装置在该三个时刻拍摄的视野空间是部分相同的。比如,当拍摄装置在拍摄三幅图像的过程中固定不动时,则拍摄装置在该三个时刻拍摄的视野空间可以是完全相同的。当拍摄装置在拍摄三幅图像的过程中有运动时,则拍摄装置在该三个时刻拍摄的视野空间可能只有部分相同。这是因为在该方法中,需要基于三个时刻拍摄的图像实现红外图像和可见光图像的融合,所以,拍摄的三个图像中的至少一个红外图像和可见光图像存在一部分相同的内容(否则,无法进行融合)。所以,上述拍摄装置在三个时刻拍摄同一个场景可以是拍摄装置在该三个时刻拍摄的视野空间是部分相同的。It should also be noted that, in this step, the above-mentioned "the shooting device shoots the same scene at T0 time, T1 time and T2 time respectively" may mean that the field of view spaces captured by the shooting device at the three time points are completely the same, or It may be that the field of view spaces photographed by the photographing device at the three moments are partly the same. For example, when the photographing device is stationary during the process of photographing three images, the field of view space photographed by the photographing device at the three moments may be completely the same. When the photographing device moves during the process of photographing the three images, the view spaces photographed by the photographing device at the three moments may only be partly the same. This is because in this method, the fusion of the infrared image and the visible light image needs to be realized based on the images captured at three moments, so at least one of the infrared images and the visible light image in the three captured images has part of the same content (otherwise, it cannot for fusion). Therefore, when the above-mentioned photographing device photographs the same scene at three moments, it may mean that the field of view spaces photographed by the photographing device at the three moments are partly the same.
示例性地,该拍摄装置例如可以是上述图1所示的拍摄装置100。在一种实施方式下,该拍摄装置还可以是包括两个拍摄模块的装置(例如,分别设置两套镜头和传感器),其中一个拍摄模块具备拍摄红外图像的功能,另一个拍摄模块具备拍摄可见光图像的功能。在这种实现下,可以通过预设的配置,使得红外图像拍摄模块在T0时刻拍摄得到第一红外图像并在T2时刻拍摄得到第二红外图像,并且使得可见光拍摄模块在T1时刻拍摄得到可见光图像。在具体实现中,本申请对该拍摄装置具体的形态和结构不做限制。Exemplarily, the photographing device may be, for example, the photographing device 100 shown in FIG. 1 above. In one embodiment, the photographing device may also be a device comprising two photographing modules (for example, two sets of lenses and sensors are respectively provided), wherein one photographing module has the function of taking infrared images, and the other photographing module has the function of taking visible light Image function. In this implementation, the infrared image capturing module can capture the first infrared image at T0 and the second infrared image at T2 through the preset configuration, and the visible light capturing module can capture the visible light image at T1 . In a specific implementation, the present application does not limit the specific form and structure of the photographing device.
在具体实现中,对于上述获取第一红外图像、可见光图像和第二红外图像,一种可能的实现方式中,若执行主体为该拍摄装置,那么,可以通过拍摄装置拍摄得到该第一红外图像、可见光图像和第二红外图像。另一种可能的实施方式中,若该执行主体为上述其他具有计算能力的装置,那么,拍摄装置拍摄获得该第一红外图像、可见光图像和第二红外图像后,可以将获得的图像发送给该其他具有计算能力的装置。In a specific implementation, for the above acquisition of the first infrared image, visible light image and second infrared image, in a possible implementation manner, if the execution subject is the photographing device, then the first infrared image can be captured by the photographing device , a visible light image and a second infrared image. In another possible implementation, if the execution subject is the above-mentioned other device with computing capability, then, after the photographing device obtains the first infrared image, the visible light image and the second infrared image, it can send the obtained images to The other device having computing capabilities.
S402、基于第一红外图像和第二红外图像计算得到目标红外图像,该目标红外图像包括第三红外图像和/或第四红外图像;第三红外图像为将第一红外图像从T0时刻转换到T1时刻获得的图像,第四红外图像为将第二红外图像从T2时刻转换到T1时刻获得的图像。S402. Calculate and obtain a target infrared image based on the first infrared image and the second infrared image, the target infrared image includes a third infrared image and/or a fourth infrared image; the third infrared image is the conversion of the first infrared image from time T0 to The image obtained at time T1, and the fourth infrared image is an image obtained by converting the second infrared image from time T2 to time T1.
在具体实现中,图像处理装置获得上述第一红外图像、可见光图像和第二红外图像,并且获知第一红外图像的拍摄时刻T0、该可见光图像的拍摄时刻T1以及该第二红外图像的拍摄时刻T2。示例性地,若该图像处理装置为该拍摄装置,那么,图像处理装置可以记录下上述第一红外图像、可见光图像和第二红外图像的拍摄时刻,从而获得该T0、T1和T2。或者,示例性地,若该图像处理装置为不同于该拍摄装置的其他具备计算能力的处理装置,那么,拍摄装置可以将记录的该T0、T1和T2发送给该图像处理装置。In a specific implementation, the image processing device obtains the above-mentioned first infrared image, visible light image and second infrared image, and obtains the shooting time T0 of the first infrared image, the shooting time T1 of the visible light image, and the shooting time of the second infrared image T2. Exemplarily, if the image processing device is the photographing device, the image processing device may record the shooting moments of the above-mentioned first infrared image, visible light image and second infrared image, so as to obtain the T0, T1 and T2. Or, for example, if the image processing device is a processing device with computing capability different from the shooting device, then the shooting device may send the recorded T0, T1 and T2 to the image processing device.
下面以目标红外图像包括第三红外图像和第四红外图像为例,介绍上述基于第一红外图像和该第二红外图像计算得到目标红外图像的具体过程。Taking the target infrared image including the third infrared image and the fourth infrared image as an example, the specific process of calculating the target infrared image based on the first infrared image and the second infrared image will be introduced below.
具体的,图像处理装置计算上述第一红外图像到第二红外图像的光流F1,以及计算从第二红外图像到第一红外图像的光流F2。Specifically, the image processing device calculates the optical flow F1 from the first infrared image to the second infrared image, and calculates the optical flow F2 from the second infrared image to the first infrared image.
一种可能的实施方式中,可以采用光流提取神经网络来计算该光流F1和光流F2,该光流提取神经网络的输入为该第一红外图像和第二红外图像,输出即为该光流F1和光流F2。示例性地,该光流提取神经网络可以是Unet架构的神经网络。示例性地,该光流提取神经网络可以通过场景流(Scene Flow)公开的虚拟数据集训练得到。In a possible implementation, the optical flow extraction neural network can be used to calculate the optical flow F1 and the optical flow F2, the input of the optical flow extraction neural network is the first infrared image and the second infrared image, and the output is the optical flow Flow F1 and Optical Flow F2. Exemplarily, the optical flow extraction neural network may be a Unet architecture neural network. Exemplarily, the neural network for extracting optical flow can be obtained by training a virtual data set disclosed by Scene Flow.
另一种可能的实施方式中,可以采用现有的光流计算方法来计算上述光流F1和光流F2, 本申请对具体的光流计算方法不做限制。现有的光流计算方法例如可以为基于梯度的方法、基于匹配的方法、基于频域(能量)的方法、基于相位的方法或Lucas-Kanada算法等等。In another possible implementation manner, an existing optical flow calculation method may be used to calculate the above optical flow F1 and optical flow F2, and the present application does not limit the specific optical flow calculation method. Existing optical flow calculation methods may be, for example, gradient-based methods, matching-based methods, frequency-domain (energy)-based methods, phase-based methods, Lucas-Kanada algorithms, and the like.
进一步地,由于T0<T1<T2,且T0,T1和T2之间的关系满足T1=(1-k)*T0+k*T2。其中,0<k<1。在获得上述光流F1和光流F2后,图像处理装置可以基于该光流F1、光流F2以及上述T1=(1-k)*T0+k*T2来计算T1时刻对应的红外图像(即上述第三红外图像)到第一红外图像的光流F3,以及计算T1时刻对应的红外图像(即上述第四红外图像)到第二红外图像的光流F4。示例性地:Further, since T0<T1<T2, and the relationship between T0, T1 and T2 satisfies T1=(1-k)*T0+k*T2. Among them, 0<k<1. After obtaining the above optical flow F1 and optical flow F2, the image processing device can calculate the infrared image corresponding to the time T1 based on the optical flow F1, the optical flow F2 and the above T1=(1-k)*T0+k*T2 (that is, The optical flow F3 from the third infrared image) to the first infrared image, and the optical flow F4 from the corresponding infrared image (that is, the fourth infrared image) to the second infrared image at time T1 is calculated. Exemplarily:
F3=-(1-k)*k*F1+k 2*F2 F3=-(1-k)*k*F1+k 2 *F2
F4=(1-k) 2*F1-k*(1-k)*F2 F4=(1-k) 2 *F1-k*(1-k)*F2
例如,假设上述k=1/2,那么,F3=0.25*(F2-F1),F4=0.25*(F1-F2)。For example, assuming the above k=1/2, then F3=0.25*(F2-F1), F4=0.25*(F1-F2).
获得上述光流F3和光流F4后,可以采用光流反向映射的方法,基于该光流F3对上述第一红外图像进行反向映射得到上述第三红外图像。同理,基于光流F4对上述第二红外图像进行反向映射得到上述第四红外图像。After the optical flow F3 and the optical flow F4 are obtained, an optical flow reverse mapping method may be used to reversely map the first infrared image based on the optical flow F3 to obtain the third infrared image. Similarly, the above-mentioned fourth infrared image is obtained by performing reverse mapping on the above-mentioned second infrared image based on the optical flow F4.
由上述过程可知,图像处理装置可以基于上述T0,T1和T2之间的关系,以及第一红外图像与第二红外图像之间的光流,采用光流反向映射的方式获得上述目标红外图像。需要说明的是,上述基于第一红外图像和第二红外图像计算上述目标红外图像不限于上述介绍的采用光流反向映射的方法。还可以采用其它实现方式的光流法来计算,本申请对此不做限制。It can be seen from the above process that the image processing device can obtain the above-mentioned target infrared image by means of optical flow reverse mapping based on the above-mentioned relationship between T0, T1 and T2, and the optical flow between the first infrared image and the second infrared image . It should be noted that the calculation of the target infrared image based on the first infrared image and the second infrared image is not limited to the above-described method using optical flow reverse mapping. The optical flow method in other implementation manners may also be used for calculation, which is not limited in the present application.
在上述过程中,由于转换后的第三红外图像为第一红外图像在T1时刻对应的图像,即第三红外图像可以理解为拍摄场景在T1时刻对应的图像,而上述可见光图像也为该拍摄场景在T1时刻对应的图像,那么,将第一红外图像从T0时刻转换到T1时刻相当于实现了第一红外图像与该可见光图像的配准。而现有的技术方案中,一般直接对红外图像和可见光图像采用基于特征匹配的方式来进行图像配准,由于红外图像和可见光图像为异模态的图像,基于两个异模态图像进行处理(提取两者的特征点)来实现配准的准确度较差。而本申请采用同模态的红外图像之间的转换(例如,基于上述T0,T1和T2之间的关系,以及第一红外图像和第二红外图像之间的光流,将第一红外图像从T0时刻转换到T1时刻)来实现红外图像和可见光图像配准,可以提升红外图像和可见光图像的配准精度,从而提升最终融合的图像的质量。In the above process, since the converted third infrared image is the image corresponding to the first infrared image at time T1, that is, the third infrared image can be understood as the image corresponding to the shooting scene at time T1, and the above-mentioned visible light image is also the image corresponding to the shooting scene. The image corresponding to the scene at time T1, then switching the first infrared image from time T0 to time T1 is equivalent to realizing the registration of the first infrared image and the visible light image. However, in the existing technical solutions, image registration is generally directly performed on infrared images and visible light images based on feature matching. Since infrared images and visible light images are images of different modalities, processing is based on two different modal images. (extracting the feature points of the two) to achieve registration accuracy is poor. However, the present application adopts the conversion between infrared images of the same modality (for example, based on the above-mentioned relationship between T0, T1 and T2, and the optical flow between the first infrared image and the second infrared image, the first infrared image Switching from time T0 to time T1) to realize the registration of the infrared image and the visible light image can improve the registration accuracy of the infrared image and the visible light image, thereby improving the quality of the final fused image.
S403、将上述目标红外图像和该可见光图像融合,获得融合图像。S403. Fusion the target infrared image and the visible light image to obtain a fusion image.
一种可能的实现方式中,可以通过图像融合神经网络来实现该可见光图像和目标红外图像的融合。该图像融合神经网络可以包括颜色提取神经网络和纹理提取神经网络。其中,该颜色提取神经网络用于提取可见光图像的颜色特征。该纹理提取神经网络用于提取目标红外图像的纹理特征。然后,再基于提取得到的颜色特征和纹理特征进行图像融合,获得融合图像。In a possible implementation manner, the fusion of the visible light image and the infrared image of the target may be achieved through an image fusion neural network. The image fusion neural network may include a color extraction neural network and a texture extraction neural network. Wherein, the color extraction neural network is used to extract the color features of the visible light image. The texture extraction neural network is used to extract the texture features of the target infrared image. Then, image fusion is performed based on the extracted color features and texture features to obtain a fusion image.
下面结合图6A和图6B,分别对目标红外图像中只包括第三红外图像的情况,以及目标红外图像中包括第三红外图像和第四红外图像的情况进行详细介绍。In the following, with reference to FIG. 6A and FIG. 6B , the case where only the third infrared image is included in the target infrared image, and the case where the target infrared image includes the third infrared image and the fourth infrared image are respectively introduced in detail.
示例性地参见图6A,以目标红外图像包含第三红外图像为例,示出了该图像融合神经网络的流程示意图。如图6A所示,将上述可见光图像输入到颜色提取神经网络。然后,通过该颜色提取神经网络提取该可见光图像的颜色特征,另外提取该可见光图像的灰度图。然后,基于该提取的颜色特征和灰度图构建颜色索引表。具体的,颜色索引表可以包括可见光图像中包含的若干种颜色的值以及该若干种颜色中每种颜色的索引,使得可以基于颜色的索引在 该颜色索引表中查找到对应的颜色值。示例性地,该颜色值可以是原三原色RGB的值。或者,示例性的,该颜色值可以是RGB加上一个常数的值等等。本申请对该颜色的具体表示不做限制。Referring to FIG. 6A exemplarily, taking the target infrared image including the third infrared image as an example, it shows a schematic flowchart of the image fusion neural network. As shown in FIG. 6A , the above visible light image is input to the color extraction neural network. Then, the color feature of the visible light image is extracted through the color extraction neural network, and the grayscale image of the visible light image is also extracted. Then, a color index table is constructed based on the extracted color features and the grayscale image. Specifically, the color index table may include the values of several colors contained in the visible light image and the index of each color in the several colors, so that the corresponding color value can be found in the color index table based on the index of the color. Exemplarily, the color value may be the value of the primary three primary colors RGB. Or, exemplary, the color value may be RGB plus a constant value and so on. The present application does not limit the specific expression of the color.
另外,如图6A所示,将上述第三红外图像输入到纹理提取神经网络后,通过该纹理提取神经网络提取该第三红外图像的纹理特征,并基于该纹理特征生成纹理引导图。该纹理引导图包括最终输出的融合图像中的每个像素的颜色索引。In addition, as shown in FIG. 6A , after the third infrared image is input into the texture extraction neural network, the texture feature of the third infrared image is extracted through the texture extraction neural network, and a texture guide map is generated based on the texture feature. The texture guide map includes a color index for each pixel in the final output fused image.
获得上述颜色索引表和纹理引导图后,图像融合神经网络基于该颜色索引表和纹理引导图生成融合图像。具体的,可以基于纹理引导图中的每个像素的颜色索引,在颜色索引表中查找该像素的颜色值并将查找到的颜色值填充到该像素对应的位置处生成该融合图像。After obtaining the above color index table and texture guide map, the image fusion neural network generates a fusion image based on the color index table and texture guide map. Specifically, based on the color index of each pixel in the texture guide map, look up the color value of the pixel in the color index table and fill the found color value into the corresponding position of the pixel to generate the fused image.
示例性地,上述颜色提取神经网络可以是较低分辨率的小型深度神经网络。一种可能的实现中,该颜色提取神经网络的分辨率不高于预设的第一分辨率阈值,该颜色提取神经网络的层数不低于预设的第一网络深度阈值。Exemplarily, the above-mentioned color extraction neural network may be a small-scale deep neural network with a lower resolution. In a possible implementation, the resolution of the color extraction neural network is not higher than a preset first resolution threshold, and the number of layers of the color extraction neural network is not lower than a preset first network depth threshold.
上述预设的第一分辨率阈值例如可以是视频图形阵列(video graphics array,VGA)分辨率等。示例性地,该低分辨率例如可以是四分之一视频图形阵列(quarter video graphics array,QVGA)分辨率。或者,示例性地,该低分辨率也可以是VGA分辨率。采用低分辨率的颜色提取神经网络可以增强对噪声的抗干扰性。但是若需要提高提取的色彩边界的准确性可以适应性地提高颜色提取神经网络的分辨率。上述预设的第一网络深度阈值可以是20,这样,该颜色提取神经网络的层数可以是20-30层。The aforementioned preset first resolution threshold may be, for example, a video graphics array (video graphics array, VGA) resolution or the like. Exemplarily, the low resolution may be, for example, a quarter video graphics array (quarter video graphics array, QVGA) resolution. Or, exemplarily, the low resolution may also be VGA resolution. Using a low-resolution color extraction neural network can enhance the immunity to noise. However, if the accuracy of the extracted color boundary needs to be improved, the resolution of the color extraction neural network can be adaptively improved. The aforementioned preset first network depth threshold may be 20, thus, the number of layers of the color extraction neural network may be 20-30 layers.
示例性地,上述纹理提取神经网络通常是较高分辨率浅层神经网络。一种可能的实施方式中,该纹理提取神经网络的分辨率高于预设的第二分辨率阈值,该纹理提取神经网络的层数低于预设的第二网络深度阈值。示例性地,该预设的第二分辨率阈值可以是VGA分辨率。该预设的第二网络深度阈值可以是5至10之间的任意整数。示例性地,纹理提取神经网络的分辨率可以是拍摄得到的红外图像的原图的分辨率,该纹理提取神经网络的层数可以是3至5层等等。Exemplarily, the above-mentioned texture extraction neural network is usually a relatively high-resolution shallow neural network. In a possible implementation manner, the resolution of the texture extraction neural network is higher than a preset second resolution threshold, and the number of layers of the texture extraction neural network is lower than a preset second network depth threshold. Exemplarily, the preset second resolution threshold may be VGA resolution. The preset second network depth threshold may be any integer between 5 and 10. Exemplarily, the resolution of the texture extraction neural network may be the resolution of the original image of the captured infrared image, and the number of layers of the texture extraction neural network may be 3 to 5 layers and so on.
应理解,对于目标红外图像中只包括第四红外图像的情况,可以采用上述同样的方式得到最终的融合图像,此处不赘述。It should be understood that, for the case where only the fourth infrared image is included in the target infrared image, the same manner as above can be used to obtain the final fused image, which will not be repeated here.
如图6B所示,以目标红外图像包含第三红外图像和第四红外图像为例,示出了该图像融合神经网络的流程示意图。As shown in FIG. 6B , taking the target infrared image including the third infrared image and the fourth infrared image as an example, it shows a schematic flow chart of the image fusion neural network.
同理,该图像融合神经网络可以包括颜色提取神经网络和纹理提取神经网络。其中,该颜色提取神经网络用于提取可见光图像的颜色特征。该纹理提取神经网络用于提取第三红外图像的纹理特征以及提取第四红外图像的纹理特征。然后,再基于提取得到的颜色特征和上述两个红外图像的纹理特征进行图像融合,获得融合图像。Similarly, the image fusion neural network may include a color extraction neural network and a texture extraction neural network. Wherein, the color extraction neural network is used to extract the color features of the visible light image. The texture extraction neural network is used to extract texture features of the third infrared image and extract texture features of the fourth infrared image. Then, image fusion is performed based on the extracted color features and the texture features of the above two infrared images to obtain a fusion image.
同理,在图6B中,通过颜色提取神经网络基于可见光图像获取颜色索引表。但纹理提取神经网络生成融合图像的纹理引导图的处理过程稍有不同:在过程中,纹理提取神经网络对第三红外图像的纹理特征和第四红外图像的纹理特征进行纹理融合得到融合图像的纹理引导图。然后,基于获得的颜色索引表和融合图像的纹理引导图得到融合图像,该过程不再赘述。Similarly, in FIG. 6B , the color index table is obtained based on the visible light image through the color extraction neural network. However, the process of generating the texture-guided map of the fusion image by the texture extraction neural network is slightly different: in the process, the texture extraction neural network performs texture fusion on the texture features of the third infrared image and the texture features of the fourth infrared image to obtain the texture of the fusion image. Texture guide map. Then, the fused image is obtained based on the obtained color index table and the texture guide map of the fused image, and this process will not be repeated.
本申请提供的图像融合神经网络,相比于现有的神经网络(例如,Unet神经网络)具备更好的硬件适应能力。具体的,通用Unet网络通常被用来处理像素级任务,其算力复杂度为100K TOPS(TOPS表示每秒万亿次操作,是Tera Operations Per Second的缩写)。对于4K图像,30FPS(FPS表示每秒传输帧数,是Frames Per Second的缩写)下Unet网络的理论算力要求约为8M*100K*30=24TOPS。而本申请提供的图像融合神经网络中,颜色提取神经网 络的分辨率可以是为256*256,算力要求为0.2TOPS;纹理提取神经网络的分辨率为8M,算力要求为1.2TOPS。可见,本申请提供的图像融合神经网络的总算力小于2TOPS,远远小于Unet网络。即本申请提供的图像融合神经网络对硬件算力的要求远远小于Unet网络,从而具备更好的硬件适应能力。The image fusion neural network provided by this application has better hardware adaptability than existing neural networks (eg, Unet neural network). Specifically, the general-purpose Unet network is usually used to process pixel-level tasks, and its computational complexity is 100K TOPS (TOPS means trillion operations per second, which is the abbreviation of Tera Operations Per Second). For 4K images, the theoretical computing power requirement of the Unet network under 30FPS (FPS means the number of frames per second, which is the abbreviation of Frames Per Second) is about 8M*100K*30=24TOPS. In the image fusion neural network provided by this application, the resolution of the color extraction neural network can be 256*256, and the computing power requirement is 0.2TOPS; the resolution of the texture extraction neural network is 8M, and the computing power requirement is 1.2TOPS. It can be seen that the total computing power of the image fusion neural network provided by this application is less than 2TOPS, which is much smaller than that of the Unet network. That is, the image fusion neural network provided by this application requires far less hardware computing power than the Unet network, so it has better hardware adaptability.
一种可能的实施方式中,上述目标红外图像和可见光图像的融合也可以采用现有的图像融合技术来实现融合,本申请对具体的图像融合方式不做限制。In a possible implementation manner, the above-mentioned fusion of the target infrared image and the visible light image may also be achieved by using an existing image fusion technology, and this application does not limit the specific image fusion method.
一种可能的实施方式中,本申请提供了一种图像处理模型来实现上述图像处理方法。示例性地,可以参见图7,示出了该图像处理模型的结构示意图。如图7所示,该图像处理模型700(应理解,此处的“图像处理模型”也可以称为“图像处理算法”,或者“图像处理模块”)包括图像获取模块710、光流提取神经网络720、光流反向映射处理模块730和图像融合神经网络740。其中:In a possible implementation manner, the present application provides an image processing model to implement the above image processing method. For example, refer to FIG. 7 , which shows a schematic structural diagram of the image processing model. As shown in FIG. 7 , the image processing model 700 (it should be understood that the "image processing model" herein may also be referred to as "image processing algorithm", or "image processing module") includes an image acquisition module 710, an optical flow extraction neuron Network 720 , optical flow reverse mapping processing module 730 and image fusion neural network 740 . in:
图像获取模块710用于获取上述第一红外图像、可见光图像和第二红外图像。具体的获取首先可以参考上述步骤S401中对应的描述,此处不再赘述。The image acquisition module 710 is configured to acquire the above-mentioned first infrared image, visible light image and second infrared image. For specific acquisition, firstly, reference may be made to the corresponding description in the above step S401, which will not be repeated here.
光流提取神经网络720用于提取上述第一红外图像和第二红外图像的光流。具体的实现可以参考上述步骤S402中的描述,此处不再赘述。The optical flow extraction neural network 720 is used to extract the optical flow of the first infrared image and the second infrared image. For specific implementation, reference may be made to the description in the above step S402, which will not be repeated here.
光流反向映射处理模块730用于基于上述提取到的第一红外图像和第二红外图像的光流进行图像的反向映射,以获得前述的目标红外图像。具体的实现可以参考上述步骤S402中的描述,此处不再赘述。The optical flow reverse mapping processing module 730 is configured to perform image reverse mapping based on the extracted optical flow of the first infrared image and the second infrared image, so as to obtain the aforementioned target infrared image. For specific implementation, reference may be made to the description in the above step S402, which will not be repeated here.
图像融合神经网络740用于对上述的可见光图像和目标红外图像进行融合获得融合图像。具体的实现可以参考上述步骤S403中的描述,此处不再赘述。The image fusion neural network 740 is used to fuse the above-mentioned visible light image and target infrared image to obtain a fusion image. For specific implementation, reference may be made to the description in the above step S403, which will not be repeated here.
在具体实现中,由于上述图像处理模型包括的光流提取神经网络和图像融合神经网络之间的光流反向映射处理模块中的处理操作是线性可微的,所以该整个图像处理模型可以进行端到端的训练得到。即整个训练过程中,输入为三个图像(例如,上述第一红外图像、可见光图像和第二红外图像,且该三个图像是拍摄装置分别在T0时刻、T1时刻和T2时刻拍摄同一个场景得到),输出即为融合后的图像,然后通过输出的融合图像反馈到各个神经网络中进行参数的逐渐修正。这种端到端的训练可以使得图像融合神经网络可以容错光流提取神经网络中光流的计算误差,最终使得训练出来的图像处理模型具备更强的鲁棒性。In a specific implementation, since the processing operations in the optical flow reverse mapping processing module between the optical flow extraction neural network and the image fusion neural network included in the above image processing model are linearly differentiable, the entire image processing model can be end-to-end training. That is, during the entire training process, the input is three images (for example, the above-mentioned first infrared image, visible light image and second infrared image, and the three images are captured by the shooting device at the time T0, T1 and T2 respectively of the same scene obtained), the output is the fused image, and then the output fused image is fed back to each neural network for gradual correction of parameters. This kind of end-to-end training can make the image fusion neural network fault-tolerant to the calculation error of the optical flow in the optical flow extraction neural network, and finally make the trained image processing model more robust.
一种可能的实施方式中,上述图像处理模型的训练图像可以是在照度低于预设的照度阈值的环境下采集得到的红外图像和可见光图像。照度低于预设的照度阈值的环境可以是低照度的环境。示例性地,该低照度环境可以是照度在10勒克斯(Lux)以下的环境。即该预设的照度阈值例如可以是10。或者,该低照度环境具体可以根据照度的标准来确定,那么该预设的照度阈值可以根据照度的标准中低照度的值来确定,本申请对此不做限制。由于图像处理模型的训练图像为低照度环境下拍摄得到,这样训练得到的图像处理模型可以学习到图像的暗部细节、颜色和纹理,从而可以融合得到低照度环境下清晰的彩色图像。In a possible implementation manner, the training images of the above-mentioned image processing model may be infrared images and visible light images collected in an environment where the illuminance is lower than a preset illuminance threshold. The environment whose illuminance is lower than the preset illuminance threshold may be a low-illuminance environment. Exemplarily, the low-illuminance environment may be an environment with an illuminance below 10 lux (Lux). That is, the preset illumination threshold may be 10, for example. Alternatively, the low-illuminance environment may be specifically determined according to an illuminance standard, and the preset illuminance threshold may be determined according to a low-illuminance value in the illuminance standard, which is not limited in the present application. Since the training images of the image processing model are taken in low-light environment, the image processing model trained in this way can learn the dark details, color and texture of the image, so that it can be fused to obtain a clear color image in a low-light environment.
综上所述,本申请首先获取第一红外图像、可见光图像和第二红外图像(该三幅图像是拍摄装置分别在T0时刻、T1时刻和T2时刻拍摄同一个场景得到的),然后基于两个红外图像和上述三个图像的拍摄时间信息,采用光流法将拍摄的红外图像,转换到拍摄可见光图像的时刻对应红外图像,以此来实现拍摄的红外图像与可见光图像的配准。相比于现有的基于对异模态的图像的处理(分别提取红外图像和可见光图像的特征点,并基于二者的特征点实现配准)来实现红外图像和可见光图像的配准方案,本申请通过同模态红外图像的处理(基 于拍摄的两个红外图像)来实现红外图像和可见光图像的配准,提高了红外图像和可见光图像的配准精度,从而使得最终融合的图像更清晰。To sum up, this application first acquires the first infrared image, the visible light image and the second infrared image (these three images are obtained by the shooting device at T0 time, T1 time and T2 time respectively in the same scene), and then based on the two Infrared images and the shooting time information of the above three images, the optical flow method is used to convert the captured infrared images to the corresponding infrared images at the time when the visible light images are captured, so as to realize the registration of the captured infrared images and visible light images. Compared with the existing image processing based on different modalities (extracting the feature points of infrared images and visible light images respectively, and realizing registration based on the feature points of the two) to realize the registration scheme of infrared images and visible light images, This application realizes the registration of infrared images and visible light images through the processing of infrared images of the same mode (based on two captured infrared images), which improves the registration accuracy of infrared images and visible light images, thus making the final fused image clearer .
另外,本申请提供的上述方案中,在快速移动物体的拍摄场景下,目标红外图像包括第三红外图像和第四红外图像的方案(即基于三个图像融合的方案),相比于目标红外图像中只包括第三红外图像,或者目标红外图像中只包括第四红外图像的方案(即基于两个图像融合的方案),可以避免融合图像中清晰区域不完整的情况,从而可以获得色彩和细节更丰富更自然的融合图像。下面结合图8对该情况进行详细说明。In addition, in the above scheme provided by the present application, in the shooting scene of a fast-moving object, the target infrared image includes the third infrared image and the fourth infrared image (that is, the scheme based on the fusion of three images), compared to the target infrared image Only the third infrared image is included in the image, or only the fourth infrared image is included in the target infrared image (that is, the scheme based on the fusion of two images), which can avoid the incomplete clear area in the fusion image, so that the color and Fusion images with richer details and more natural. This situation will be described in detail below with reference to FIG. 8 .
如图8所示,假设拍摄装置的位置固定不变,拍摄场景中存在沿着一个方向运动的目标对象。示例性地,假设该目标对象包括标号为1、2、3、4、5和6的六个部分。由于拍摄装置的拍摄视场角范围有限,假设该拍摄装置每次拍摄只能拍摄到目标对象的上述六个部分中的两个部分。那么,随着目标对象的不断运动,在T0时刻拍摄到了目标对象的标号为1和2的部分,在T1时刻拍摄到了该目标对象的标号为2和3的部分,在T2时刻拍摄到了该目标对象的标号为3和4的部分。T0时刻和T1时刻之间以及T1时刻和T2时刻之间存在遮光片遮挡的时间段。由于目标对象在运动,那么,被遮光片遮挡的时间段前后拍摄得到的两个图像中,该目标对象出现位移,导致该两个图像中的一个图像相比于另一个图像缺失了该目标对象的一部分。具体拍摄得到的图像可以参见图8。As shown in FIG. 8 , it is assumed that the position of the shooting device is fixed, and there is a target object moving along one direction in the shooting scene. Exemplarily, it is assumed that the target object includes six parts labeled 1, 2, 3, 4, 5 and 6. Since the photographing device has a limited shooting field angle range, it is assumed that the photographing device can only capture two parts of the above six parts of the target object in each shot. Then, with the continuous movement of the target object, the parts labeled 1 and 2 of the target object are captured at time T0, the parts labeled 2 and 3 of the target object are captured at time T1, and the target is captured at time T2 The parts of the object numbered 3 and 4. There is a period of time during which the shading sheet is blocked between the time T0 and the time T1 and between the time T1 and the time T2. Since the target object is moving, the target object appears to be displaced in the two images captured before and after the time period covered by the shading sheet, causing one of the two images to lack the target object compared to the other image a part of. The image obtained by shooting can be referred to FIG. 8 .
然后,基于前述的描述,将T0时刻拍摄的第一红外图像转换到T1时刻得到第一红外图像在T1时刻对应的第三红外图像。并且,将T2时刻拍摄的第二红外图像转换到T1时刻得到第二红外图像在T1时刻对应的第四红外图像。在图8中可以看到,该第三红外图像保留了被拍摄对象的标号为2的部分,相比于第一红外图像,该第三红外图像缺少了被拍摄对象的标号为3的部分。另外,由于该第三红外图像为红外图像(主要贡献的是纹理特征),因此,若采用两个图像的融合方案,例如,假设目标红外图像中只包括第三红外图像,即只将该第三红外图像和T1时刻拍摄到的可见光图像进行融合,那么,融合得到的图像将缺少被拍摄对象的标号为3的部分的清晰的纹理特征,导致融合得到的图像的部分区域不够清晰。应理解,该“部分区域”的大小可以与目标对象的运动速度和上述三个图像的拍摄时间间隔长短相关,如果目标对象的运动较缓慢,或者上述三个图像的拍摄间隔较短,则上述不清晰的区域就会较小,不会影响图像的整体效果。Then, based on the foregoing description, the first infrared image captured at time T0 is converted to time T1 to obtain a third infrared image corresponding to the first infrared image at time T1. Moreover, the second infrared image captured at the time T2 is converted to the time T1 to obtain a fourth infrared image corresponding to the second infrared image at the time T1. As can be seen in FIG. 8 , the third infrared image retains the part marked 2 of the subject, and compared with the first infrared image, the third infrared image lacks the part marked 3 of the subject. In addition, since the third infrared image is an infrared image (mainly contributing texture features), if a fusion scheme of two images is adopted, for example, assuming that the target infrared image only includes the third infrared image, that is, only the third infrared image If the three-infrared image is fused with the visible light image captured at time T1, the fused image will lack the clear texture features of the part labeled 3 of the object to be photographed, resulting in insufficient clarity in some areas of the fused image. It should be understood that the size of the "partial area" may be related to the movement speed of the target object and the length of the shooting time interval of the above three images. If the movement of the target object is slow, or the shooting interval of the above three images is short, the above Unsharp areas will be smaller and will not affect the overall effect of the image.
若采用前文所述的三个图像(即,目标红外图像中包含第三红外图像和第四红外图像)的融合方案,那么,在图8中可以看到,第四红外图像包括了被拍摄对象的标号为3的部分,因此,将该第三红外图像、T1时刻拍摄得到的可见光图像以及该第四红外图像这三个图像进行融合,可以使得最终的融合图像获取完整的清晰的纹理,即使得图像的所有区域都清晰,因而相比上述基于两帧图像的融合方案可以获得更加清晰自然的彩色图像。If the above-mentioned fusion scheme of the three images (that is, the target infrared image contains the third infrared image and the fourth infrared image) is adopted, then, as can be seen in Fig. 8, the fourth infrared image includes the subject The part labeled 3, therefore, the fusion of the third infrared image, the visible light image captured at time T1 and the fourth infrared image can make the final fusion image obtain a complete and clear texture, even All areas of the obtained image are clear, so a clearer and more natural color image can be obtained compared to the fusion scheme based on the above two-frame images.
上述对本申请实施例提供的图像处理方法进行了介绍。可以理解的是,图像处理装置为了实现上述对应的功能,其包含了执行各个功能相应的硬件结构和/或软件模块。结合本文中所公开的实施例描述的各示例的单元及步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用使用不同方法来实现所描述的功能,但这种实现不应认为超出本申请的范围。The above describes the image processing method provided by the embodiment of the present application. It can be understood that, in order to realize the above-mentioned corresponding functions, the image processing device includes hardware structures and/or software modules corresponding to each function. Combining the units and steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
本申请实施例可以根据上述方法示例对设备进行功能模块的划分,例如,可以对应各个 功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。The embodiment of the present application can divide the device into functional modules according to the above method examples. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. It should be noted that the division of modules in this embodiment of the present application is schematic, and is only a logical function division, and there may be other division methods in actual implementation.
在采用对应各个功能划分各个功能模块的情况下,图9示出了装置的一种具体的逻辑结构示意图,该装置可以是上述方法实施例中的图像处理装置。该图像处理装置900包括:In the case of dividing each functional module corresponding to each function, FIG. 9 shows a specific logical structural diagram of a device, which may be the image processing device in the above method embodiment. The image processing device 900 includes:
获取单元901,用于获取第一红外图像、可见光图像和第二红外图像;其中,前述第一红外图像、前述可见光图像和前述第二红外图像为拍摄装置分别在T0时刻、T1时刻和T2时刻拍摄同一个场景得到,T0<T1<T2;An acquisition unit 901, configured to acquire a first infrared image, a visible light image, and a second infrared image; wherein, the aforementioned first infrared image, the aforementioned visible light image, and the aforementioned second infrared image are obtained by the shooting device at time T0, T1, and T2, respectively. Shoot the same scene to get, T0<T1<T2;
计算单元902,用于基于前述第一红外图像和前述第二红外图像计算得到目标红外图像,前述目标红外图像包括第三红外图像和/或第四红外图像;前述第三红外图像为将前述第一红外图像从前述T0时刻转换到前述T1时刻获得的图像,前述第四红外图像为将前述第二红外图像从前述T2时刻转换到前述T1时刻获得的图像;The calculation unit 902 is configured to calculate a target infrared image based on the aforementioned first infrared image and the aforementioned second infrared image, where the aforementioned target infrared image includes a third infrared image and/or a fourth infrared image; the aforementioned third infrared image is the aforementioned first infrared image An infrared image is converted from the aforementioned T0 moment to the aforementioned image obtained at the aforementioned T1 moment, and the aforementioned fourth infrared image is an image obtained by converting the aforementioned second infrared image from the aforementioned T2 moment to the aforementioned T1 moment;
融合单元903,用于将前述目标红外图像和前述可见光图像融合,获得融合图像。The fusion unit 903 is configured to fuse the aforementioned target infrared image and the aforementioned visible light image to obtain a fused image.
一种可能的实施方式中,前述计算单元902具体用于:In a possible implementation manner, the foregoing computing unit 902 is specifically configured to:
采用光流法,根据前述T0,前述T1与前述T2三者的关系,以及前述第一红外图像和前述第二红外图像,计算得到前述目标红外图像。Using the optical flow method, according to the relationship between the aforementioned T0, the aforementioned T1 and the aforementioned T2, as well as the aforementioned first infrared image and the aforementioned second infrared image, the aforementioned target infrared image is calculated and obtained.
一种可能的实施方式中,前述目标红外图像包括前述第三红外图像;前述计算单元902具体用于:In a possible implementation manner, the aforementioned target infrared image includes the aforementioned third infrared image; the aforementioned computing unit 902 is specifically configured to:
计算从前述第一红外图像到前述第二红外图像的光流F1以及从前述第二红外图像到前述第一红外图像的光流F2;calculating an optical flow F1 from the aforementioned first infrared image to the aforementioned second infrared image and an optical flow F2 from the aforementioned second infrared image to the aforementioned first infrared image;
基于前述T0,前述T1与前述T2三者的关系、前述光流F1和前述光流F2计算光流F3,前述光流F3为从前述第三红外图像到前述第一红外图像的光流;Calculate the optical flow F3 based on the aforementioned T0, the relationship between the aforementioned T1 and the aforementioned T2, the aforementioned optical flow F1 and the aforementioned optical flow F2, and the aforementioned optical flow F3 is the optical flow from the aforementioned third infrared image to the aforementioned first infrared image;
基于前述光流F3和前述第一红外图像进行光流反向映射获得前述第三红外图像。The aforementioned third infrared image is obtained by performing optical flow reverse mapping based on the aforementioned optical flow F3 and the aforementioned first infrared image.
一种可能的实施方式中,前述融合单元903具体用于:In a possible implementation manner, the foregoing fusion unit 903 is specifically used for:
提取前述可见光图像的颜色特征;Extracting the color features of the aforementioned visible light image;
提取前述目标红外图像的纹理特征;Extracting texture features of the aforementioned target infrared image;
基于前述颜色特征和前述纹理特征,获得前述融合图像。Based on the aforementioned color feature and the aforementioned texture feature, the aforementioned fused image is obtained.
一种可能的实施方式中,前述融合单元903具体用于:In a possible implementation manner, the foregoing fusion unit 903 is specifically used for:
通过第一神经网络将前述目标红外图像和前述可见光图像融合,获得前述融合图像;前述第一神经网络包括颜色提取神经网络和纹理提取神经网络,前述颜色提取神经网络用于提取前述可见光图像的颜色特征;前述纹理提取神经网络用于提取前述目标红外图像的纹理特征。The aforementioned target infrared image and the aforementioned visible light image are fused through the first neural network to obtain the aforementioned fused image; the aforementioned first neural network includes a color extraction neural network and a texture extraction neural network, and the aforementioned color extraction neural network is used to extract the color of the aforementioned visible light image Features: the aforementioned texture extraction neural network is used to extract the texture features of the aforementioned target infrared image.
一种可能的实施方式中,前述颜色提取神经网络的分辨率低于预设的第一分辨率阈值且前述颜色提取神经网络的层数高于预设的第一网络深度阈值。In a possible implementation manner, the resolution of the color extraction neural network is lower than a preset first resolution threshold and the number of layers of the color extraction neural network is higher than a preset first network depth threshold.
一种可能的实施方式中,前述纹理提取神经网络的分辨率高于预设的第二分辨率阈值且前述纹理提取神经网络的层数低于预设的第二网络深度阈值。In a possible implementation manner, the resolution of the texture extraction neural network is higher than a preset second resolution threshold, and the layer number of the texture extraction neural network is lower than a preset second network depth threshold.
一种可能的实施方式中,前述装置执行的操作通过图像处理模型实现,前述图像处理模型包括前述第一神经网络和第二神经网络;In a possible implementation manner, the operations performed by the aforementioned device are realized by an image processing model, and the aforementioned image processing model includes the aforementioned first neural network and the second neural network;
前述第二神经网络用于获取从前述第一红外图像到前述第二红外图像的光流F1和从前述第二红外图像到前述第一红外图像的光流F2;前述光流F1和前述光流F2用于计算获得前 述目标红外图像;The aforementioned second neural network is used to obtain the optical flow F1 from the aforementioned first infrared image to the aforementioned second infrared image and the optical flow F2 from the aforementioned second infrared image to the aforementioned first infrared image; the aforementioned optical flow F1 and the aforementioned optical flow F2 is used to calculate and obtain the infrared image of the aforementioned target;
前述图像处理模型包括的前述第一神经网络和前述第二神经网络通过端到端训练得到。The aforementioned first neural network and the aforementioned second neural network included in the aforementioned image processing model are obtained through end-to-end training.
一种可能的实施方式中,前述图像处理模型的训练图像是在照度低于预设的照度阈值的环境下采集得到的。In a possible implementation manner, the training images of the aforementioned image processing model are collected in an environment where the illuminance is lower than a preset illuminance threshold.
图9所示装置900中各个单元的具体操作以及有益效果可以参见上述图4及其具体的方法实施例中对应的描述,此处不再赘述。For specific operations and beneficial effects of each unit in the apparatus 900 shown in FIG. 9 , refer to the corresponding descriptions in FIG. 4 and its specific method embodiment above, and details are not repeated here.
图10所示为本申请提供的装置的一种具体的硬件结构示意图,该装置可以是上述实施例所述的图像处理装置。该图像处理装置1000包括:处理器1001、存储器1002和通信接口1003。处理器1001、通信接口1003以及存储器1002可以相互连接或者通过总线1004相互连接。FIG. 10 is a schematic diagram of a specific hardware structure of the device provided by the present application, and the device may be the image processing device described in the above-mentioned embodiments. The image processing device 1000 includes: a processor 1001 , a memory 1002 and a communication interface 1003 . The processor 1001 , the communication interface 1003 and the memory 1002 may be connected to each other or through a bus 1004 .
示例性的,存储器1002用于存储图像处理装置1000的计算机程序和数据,存储器1002可以包括但不限于是随机存储记忆体(random access memory,RAM)、只读存储器(read-only memory,ROM)、可擦除可编程只读存储器(erasable programmable read only memory,EPROM)或便携式只读存储器(compact disc read-only memory,CD-ROM)等。Exemplarily, the memory 1002 is used to store computer programs and data of the image processing apparatus 1000, and the memory 1002 may include but not limited to random access memory (random access memory, RAM), read-only memory (read-only memory, ROM) , erasable programmable read-only memory (EPROM) or portable read-only memory (compact disc read-only memory, CD-ROM), etc.
通信接口1003包括发送接口和接收接口,通信接口1003的个数可以为多个,用于支持图像处理装置1000进行通信,例如接收或发送数据或消息等。The communication interface 1003 includes a sending interface and a receiving interface, and there may be multiple communication interfaces 1003, which are used to support the image processing apparatus 1000 to communicate, for example, to receive or send data or messages.
示例性的,处理器1001可以是中央处理器单元、通用处理器、数字信号处理器、专用集成电路、现场可编程门阵列或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,数字信号处理器和微处理器的组合等等。处理器1001可以用于读取上述存储器1002中存储的程序,使得图像处理装置1000执行如上述图4及其具体的实施例中所述的图像处理方法。Exemplarily, the processor 1001 may be a central processing unit, a general processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and the like. The processor 1001 can be used to read the program stored in the above-mentioned memory 1002, so that the image processing apparatus 1000 executes the image processing method described in the above-mentioned FIG. 4 and its specific embodiments.
一种可能的实施方式中,处理器1001可以用于读取上述存储器1002中存储的程序,执行如下操作:获取第一红外图像、可见光图像和第二红外图像;其中,该第一红外图像、该可见光图像和该第二红外图像为拍摄装置分别在T0时刻、T1时刻和T2时刻拍摄同一个场景得到,T0<T1<T2;基于该第一红外图像和该第二红外图像计算得到目标红外图像,该目标红外图像包括第三红外图像和/或第四红外图像;该第三红外图像为将该第一红外图像从该T0时刻转换到该T1时刻获得的图像,该第四红外图像为将该第二红外图像从该T2时刻转换到该T1时刻获得的图像;将该目标红外图像和该可见光图像融合,获得融合图像。In a possible implementation manner, the processor 1001 may be configured to read the program stored in the above-mentioned memory 1002, and perform the following operations: acquire a first infrared image, a visible light image, and a second infrared image; wherein, the first infrared image, The visible light image and the second infrared image are obtained by shooting the same scene at the time T0, T1 and T2 respectively by the shooting device, T0<T1<T2; the target infrared image is calculated based on the first infrared image and the second infrared image image, the target infrared image includes a third infrared image and/or a fourth infrared image; the third infrared image is an image obtained by converting the first infrared image from the T0 moment to the T1 moment, and the fourth infrared image is converting the second infrared image from the T2 time to the image obtained at the T1 time; fusing the target infrared image and the visible light image to obtain a fused image.
图10所示图像处理装置1000中各个单元的具体操作以及有益效果可以参见上述图4及其具体的方法实施例中对应的描述此处不再赘述。For the specific operations and beneficial effects of each unit in the image processing apparatus 1000 shown in FIG. 10 , refer to the corresponding description in FIG. 4 and its specific method embodiment above, and will not repeat them here.
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行以实现上述图4及其具体的方法实施例中任一实施例所述的方法。The embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the above-mentioned any embodiment in FIG. 4 and its specific method embodiments. described method.
本申请实施例还提供一种计算机程序产品,当该计算机程序产品被计算机读取并执行时,上述图4及其具体的方法实施例中任一实施例所述的方法。An embodiment of the present application further provides a computer program product. When the computer program product is read and executed by a computer, the method described in any one of the above-mentioned FIG. 4 and its specific method embodiments.
综上所述,本申请首先获取第一红外图像、可见光图像和第二红外图像(该三幅图像是拍摄装置分别在T0时刻、T1时刻和T2时刻拍摄同一个场景得到的),然后基于两个红外图像和上述三个图像的拍摄时间信息,采用光流法将拍摄的红外图像,转换到拍摄可见光图像的时刻对应红外图像,以此来实现拍摄的红外图像与可见光图像的配准。相比于现有的基于对异模态的图像的处理(分别提取红外图像和可见光图像的特征点,并基于二者的特征点实现配准)来实现红外图像和可见光图像的配准方案,本申请通过同模态红外图像的处理(基 于拍摄的两个红外图像)来实现红外图像和可见光图像的配准,提高了红外图像和可见光图像的配准精度,从而使得最终融合的图像更清晰。To sum up, this application first acquires the first infrared image, the visible light image and the second infrared image (these three images are obtained by the shooting device at T0 time, T1 time and T2 time respectively in the same scene), and then based on the two Infrared images and the shooting time information of the above three images, the optical flow method is used to convert the captured infrared images to the corresponding infrared images at the time when the visible light images are captured, so as to realize the registration of the captured infrared images and visible light images. Compared with the existing image processing based on different modalities (extracting the feature points of infrared images and visible light images respectively, and realizing registration based on the feature points of the two) to realize the registration scheme of infrared images and visible light images, This application realizes the registration of infrared images and visible light images through the processing of infrared images of the same mode (based on two captured infrared images), which improves the registration accuracy of infrared images and visible light images, thus making the final fused image clearer .
最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, rather than limiting them; although the application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: It is still possible to modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the various embodiments of the present application. scope.

Claims (32)

  1. 一种图像处理方法,其特征在于,所述方法包括:An image processing method, characterized in that the method comprises:
    获取第一红外图像、可见光图像和第二红外图像;其中,所述第一红外图像、所述可见光图像和所述第二红外图像为拍摄装置分别在T0时刻、T1时刻和T2时刻拍摄同一个场景得到,T0<T1<T2;Acquiring a first infrared image, a visible light image, and a second infrared image; wherein, the first infrared image, the visible light image, and the second infrared image are the same image captured by the shooting device at T0, T1, and T2, respectively. The scene is obtained, T0<T1<T2;
    基于所述第一红外图像和所述第二红外图像计算得到目标红外图像,所述目标红外图像包括第三红外图像和/或第四红外图像;所述第三红外图像为将所述第一红外图像从所述T0时刻转换到所述T1时刻获得的图像,所述第四红外图像为将所述第二红外图像从所述T2时刻转换到所述T1时刻获得的图像;A target infrared image is calculated based on the first infrared image and the second infrared image, and the target infrared image includes a third infrared image and/or a fourth infrared image; the third infrared image is the first infrared image The infrared image is converted from the T0 moment to the image obtained at the T1 moment, and the fourth infrared image is an image obtained by converting the second infrared image from the T2 moment to the T1 moment;
    将所述目标红外图像和所述可见光图像融合,获得融合图像。The target infrared image and the visible light image are fused to obtain a fused image.
  2. 根据权利要求1所述的方法,其特征在于,所述基于所述第一红外图像和所述第二红外图像计算得到目标红外图像,包括:The method according to claim 1, wherein the calculation of the target infrared image based on the first infrared image and the second infrared image comprises:
    采用光流法,根据所述T0,所述T1与所述T2三者的关系,以及所述第一红外图像和所述第二红外图像,计算得到所述目标红外图像。The infrared image of the target is calculated and obtained according to the T0, the relationship between the T1 and the T2, and the first infrared image and the second infrared image by using an optical flow method.
  3. 根据权利要求2所述的方法,其特征在于,所述目标红外图像包括所述第三红外图像;The method according to claim 2, wherein the target infrared image comprises the third infrared image;
    所述采用光流法,根据所述T0,所述T1与所述T2三者的关系,以及所述第一红外图像和所述第二红外图像,计算得到所述目标红外图像,包括:The optical flow method is used to calculate the target infrared image according to the T0, the relationship between the T1 and the T2, and the first infrared image and the second infrared image, including:
    计算从所述第一红外图像到所述第二红外图像的光流F1以及从所述第二红外图像到所述第一红外图像的光流F2;calculating an optical flow F1 from the first infrared image to the second infrared image and an optical flow F2 from the second infrared image to the first infrared image;
    基于所述T0,所述T1与所述T2三者的关系、所述光流F1和所述光流F2计算光流F3,所述光流F3为从所述第三红外图像到所述第一红外图像的光流;Based on the relationship among T0, T1 and T2, the optical flow F1 and the optical flow F2, the optical flow F3 is calculated, and the optical flow F3 is from the third infrared image to the first infrared image. Optical flow of an infrared image;
    基于所述光流F3和所述第一红外图像进行光流反向映射获得所述第三红外图像。Performing optical flow reverse mapping based on the optical flow F3 and the first infrared image to obtain the third infrared image.
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述将所述目标红外图像和所述可见光图像融合,获得融合图像,包括:The method according to any one of claims 1-3, wherein the merging the target infrared image and the visible light image to obtain a fused image comprises:
    提取所述可见光图像的颜色特征;extracting color features of the visible light image;
    提取所述目标红外图像的纹理特征;Extracting texture features of the target infrared image;
    基于所述颜色特征和所述纹理特征,获得所述融合图像。The fused image is obtained based on the color feature and the texture feature.
  5. 根据权利要求4所述的方法,其特征在于,所述将所述目标红外图像和所述可见光图像融合,获得融合图像,包括:The method according to claim 4, wherein said merging said target infrared image and said visible light image to obtain a fused image comprises:
    通过第一神经网络将所述目标红外图像和所述可见光图像融合,获得所述融合图像;所述第一神经网络包括颜色提取神经网络和纹理提取神经网络,所述颜色提取神经网络用于提取所述可见光图像的颜色特征;所述纹理提取神经网络用于提取所述目标红外图像的纹理特征。The target infrared image and the visible light image are fused by a first neural network to obtain the fused image; the first neural network includes a color extraction neural network and a texture extraction neural network, and the color extraction neural network is used to extract The color feature of the visible light image; the texture extraction neural network is used to extract the texture feature of the target infrared image.
  6. 根据权利要求5所述的方法,其特征在于,所述颜色提取神经网络的分辨率不高于预设的第一分辨率阈值且所述颜色提取神经网络的层数不低于预设的第一网络深度阈值。The method according to claim 5, wherein the resolution of the color extraction neural network is not higher than the preset first resolution threshold and the number of layers of the color extraction neural network is not lower than the preset first resolution threshold A network depth threshold.
  7. 根据权利要求5或6所述的方法,其特征在于,所述纹理提取神经网络的分辨率高于预设的第二分辨率阈值且所述纹理提取神经网络的层数低于预设的第二网络深度阈值。The method according to claim 5 or 6, wherein the resolution of the texture extraction neural network is higher than the preset second resolution threshold and the number of layers of the texture extraction neural network is lower than the preset second resolution threshold Two network depth thresholds.
  8. 根据权利要求5-7任意一项所述的方法,其特征在于,所述方法通过图像处理模型实现,所述图像处理模型包括所述第一神经网络和第二神经网络;The method according to any one of claims 5-7, wherein the method is implemented by an image processing model, and the image processing model includes the first neural network and the second neural network;
    所述第二神经网络用于获取从所述第一红外图像到所述第二红外图像的光流F1和从所述第二红外图像到所述第一红外图像的光流F2;所述光流F1和所述光流F2用于计算获得所述目标红外图像;The second neural network is used to obtain an optical flow F1 from the first infrared image to the second infrared image and an optical flow F2 from the second infrared image to the first infrared image; The flow F1 and the optical flow F2 are used to calculate and obtain the infrared image of the target;
    所述图像处理模型包括的所述第一神经网络和所述第二神经网络通过端到端训练得到。The first neural network and the second neural network included in the image processing model are obtained through end-to-end training.
  9. 根据权利要求8所述的方法,其特征在于,所述图像处理模型的训练图像是在照度低于预设的照度阈值的环境下采集得到的。The method according to claim 8, characterized in that, the training images of the image processing model are collected in an environment where the illuminance is lower than a preset illuminance threshold.
  10. 一种拍摄装置,其特征在于,所述拍摄装置包括镜片、调光片、驱动模块和成像模块;所述调光片位于所述镜片和所述成像模块之间,所述驱动模块与所述调光片连接;A photographing device, characterized in that the photographing device comprises a lens, a dimmer, a driving module, and an imaging module; the dimmer is located between the lens and the imaging module, and the driving module is connected to the imaging module. Dimmer connection;
    所述镜片用于将入射到所述镜片上的光聚集到所述调光片上;The lens is used to gather the light incident on the lens onto the dimmer sheet;
    所述调光片包括红外带通滤光片、红外截止滤光片和遮光片,所述红外带通滤光片用于让红外光穿过且过滤可见光,所述红外截止滤光片用于让可见光穿过且过滤红外光,所述遮光片用于阻止光线穿过;The dimmer includes an infrared bandpass filter, an infrared cutoff filter and a shading sheet, the infrared bandpass filter is used to allow infrared light to pass through and filter visible light, and the infrared cutoff filter is used to Let visible light pass through and filter infrared light, and the shading sheet is used to prevent light from passing through;
    所述驱动模块用于驱动所述调光片运动,以使得聚集到所述调光片上的光在第一时段入射到所述红外带通滤光片上,在第二时段入射到所述红外截止滤光片上,在第三时段和第四时段入射到所述遮光片上;The driving module is used to drive the dimmer to move, so that the light collected on the dimmer is incident on the infrared bandpass filter during the first period, and incident on the infrared bandpass filter during the second period. On the cut-off filter, it is incident on the light-shielding film during the third period and the fourth period;
    所述成像模块用于在所述第一时段接收穿过所述红外带通滤光片的红外光,并在所述第三时段基于接收的红外光得到第一红外图像;以及用于在所述第二时段接收穿过所述红外截止滤光片的可见光,并在所述第四时段基于接收的可见光得到可见光图像;所述第一时段、所述第二时段、所述第三时段和所述第四时段不重叠。The imaging module is used to receive infrared light passing through the infrared bandpass filter during the first period, and obtain a first infrared image based on the received infrared light during the third period; receiving visible light passing through the infrared cut filter in the second period, and obtaining a visible light image based on the received visible light in the fourth period; the first period, the second period, the third period and The fourth time periods do not overlap.
  11. 根据权利要求10所述的拍摄装置,其特征在于,所述调光片为圆形,所述红外带通滤光片、所述红外截止滤光片和所述遮光片为扇形;所述驱动模块用于驱动所述调光片转动。The photographing device according to claim 10, wherein the dimmer is circular, the infrared band-pass filter, the infrared cut-off filter and the light shield are fan-shaped; the driving The module is used to drive the dimmer to rotate.
  12. 根据权利要求10所述的拍摄装置,其特征在于,所述调光片为多边形,所述红外带通滤光片、所述红外截止滤光片和所述遮光片为三角形或四边形;所述驱动模块用于驱动所述调光片转动。The photographing device according to claim 10, wherein the dimmer is polygonal, and the infrared bandpass filter, the infrared cut-off filter and the light-shielding film are triangular or quadrilateral; The driving module is used to drive the dimmer to rotate.
  13. 根据权利要求10所述的拍摄装置,其特征在于,所述调光片为矩形,所述红外带通滤光片、所述红外截止滤光片和所述遮光片为矩形;所述驱动模块用于驱动所述调光片移动。The photographing device according to claim 10, wherein the dimmer is a rectangle, the infrared bandpass filter, the infrared cut-off filter and the light shield are rectangles; the driving module Used to drive the dimmer to move.
  14. 根据权利要求10-13任一项所述的拍摄装置,其特征在于,所述红外带通滤光片与所述遮光片相邻,所述红外截止滤光片与所述遮光片相邻。The photographing device according to any one of claims 10-13, wherein the infrared bandpass filter is adjacent to the light-shielding sheet, and the infrared cut-off filter is adjacent to the light-shielding sheet.
  15. 根据权利要求10-14任一项所述的拍摄装置,其特征在于,所述第一时段的长度指示所述第一红外图像的曝光时长;所述第二时段的长度指示所述可见光图像的曝光时长。The photographing device according to any one of claims 10-14, wherein the length of the first time period indicates the exposure time of the first infrared image; the length of the second time period indicates the exposure time of the visible light image exposure time.
  16. 根据权利要求10-15任一项所述的拍摄装置,其特征在于,所述第一时段的长短与所述遮光片的大小相关,所述遮光片与所述红外带通滤光片相邻。The photographing device according to any one of claims 10-15, wherein the length of the first period of time is related to the size of the shading sheet, and the shading sheet is adjacent to the infrared bandpass filter .
  17. 根据权利要求10-16任一项所述的拍摄装置,其特征在于,所述第一时段的长短或所述第二时段的长短与所述调光片的运动速度相关。The photographing device according to any one of claims 10-16, characterized in that, the length of the first time period or the length of the second time period is related to the moving speed of the dimming film.
  18. 根据权利要求10-17任一项所述的拍摄装置,其特征在于,所述调光片的运动速度由所述驱动模块控制。The photographing device according to any one of claims 10-17, characterized in that the moving speed of the dimmer is controlled by the driving module.
  19. 根据权利要求10-18任一项所述的拍摄装置,其特征在于,所述第一时段的结束时刻为所述第三时段的开始时刻;所述第二时段的结束时刻为所述第四时段的开始时刻。The photographing device according to any one of claims 10-18, wherein the end time of the first period is the start time of the third time period; the end time of the second time period is the start time of the fourth time period. The start moment of the period.
  20. 根据权利要求10-19任意一项所述的拍摄装置,其特征在于,The photographing device according to any one of claims 10-19, characterized in that,
    所述第一时段的结束时刻为T0,所述第二时段的结束时刻为T1;The end time of the first period is T0, and the end time of the second period is T1;
    所述驱动模块还用于驱动所述调光片运动,以使得聚集到所述调光片上的光在第五时段入射到所述红外带通滤光片上,以使得所述成像模块得到第二红外图像;所述第五时段的结束时刻为T2;其中,T0<T1<T2;所述第一红外图像、所述可见光图像和所述第二红外图像为拍摄装置拍摄同一个场景得到;The driving module is also used to drive the dimmer to move, so that the light collected on the dimmer is incident on the infrared bandpass filter during the fifth period, so that the imaging module can obtain the first Two infrared images; the end time of the fifth period is T2; wherein, T0<T1<T2; the first infrared image, the visible light image and the second infrared image are obtained by shooting the same scene by the shooting device;
    所述拍摄装置还包括处理器,所述处理器用于执行如权利要求1-9任意一项所述的方法。The photographing device further includes a processor configured to execute the method according to any one of claims 1-9.
  21. 根据权利要求10-20任意一项所述的拍摄装置,其特征在于,所述调光片包括两个所述红外带通滤光片,一个所述红外截止滤光片和至少两个所述遮光片。The photographing device according to any one of claims 10-20, wherein the dimmer includes two infrared bandpass filters, one infrared cut filter and at least two of the infrared filters. Blackout film.
  22. 一种图像处理装置,其特征在于,所述装置包括:An image processing device, characterized in that the device comprises:
    获取单元,用于获取第一红外图像、可见光图像和第二红外图像;其中,所述第一红外图像、所述可见光图像和所述第二红外图像为拍摄装置分别在T0时刻、T1时刻和T2时刻拍摄同一个场景得到,T0<T1<T2;An acquisition unit, configured to acquire a first infrared image, a visible light image, and a second infrared image; wherein, the first infrared image, the visible light image, and the second infrared image are obtained by the photographing device at time T0, T1, and Take the same scene at T2, T0<T1<T2;
    计算单元,用于基于所述第一红外图像和所述第二红外图像计算得到目标红外图像,所述目标红外图像包括第三红外图像和/或第四红外图像;所述第三红外图像为将所述第一红外图像从所述T0时刻转换到所述T1时刻获得的图像,所述第四红外图像为将所述第二红外图像从所述T2时刻转换到所述T1时刻获得的图像;A calculation unit, configured to calculate a target infrared image based on the first infrared image and the second infrared image, where the target infrared image includes a third infrared image and/or a fourth infrared image; the third infrared image is The image obtained by converting the first infrared image from the moment T0 to the moment T1, and the fourth infrared image is an image obtained by converting the second infrared image from the moment T2 to the moment T1 ;
    融合单元,用于将所述目标红外图像和所述可见光图像融合,获得融合图像。a fusion unit, configured to fuse the target infrared image and the visible light image to obtain a fusion image.
  23. 根据权利要求22所述的装置,其特征在于,所述计算单元具体用于:The device according to claim 22, wherein the computing unit is specifically used for:
    采用光流法,根据所述T0,所述T1与所述T2三者的关系,以及所述第一红外图像和所述第二红外图像,计算得到所述目标红外图像。The infrared image of the target is calculated and obtained according to the T0, the relationship between the T1 and the T2, and the first infrared image and the second infrared image by using an optical flow method.
  24. 根据权利要求23所述的装置,其特征在于,所述目标红外图像包括所述第三红外图像;所述计算单元具体用于:The device according to claim 23, wherein the target infrared image comprises the third infrared image; the calculation unit is specifically used for:
    计算从所述第一红外图像到所述第二红外图像的光流F1以及从所述第二红外图像到所述第一红外图像的光流F2;calculating an optical flow F1 from the first infrared image to the second infrared image and an optical flow F2 from the second infrared image to the first infrared image;
    基于所述T0,所述T1与所述T2三者的关系、所述光流F1和所述光流F2计算光流F3,所述光流F3为从所述第三红外图像到所述第一红外图像的光流;Based on the relationship among T0, T1 and T2, the optical flow F1 and the optical flow F2, the optical flow F3 is calculated, and the optical flow F3 is from the third infrared image to the first infrared image. Optical flow of an infrared image;
    基于所述光流F3和所述第一红外图像进行光流反向映射获得所述第三红外图像。Performing optical flow reverse mapping based on the optical flow F3 and the first infrared image to obtain the third infrared image.
  25. 根据权利要求22-24任一项所述的装置,其特征在于,所述融合单元具体用于:The device according to any one of claims 22-24, wherein the fusion unit is specifically used for:
    提取所述可见光图像的颜色特征;extracting color features of the visible light image;
    提取所述目标红外图像的纹理特征;Extracting texture features of the target infrared image;
    基于所述颜色特征和所述纹理特征,获得所述融合图像。The fused image is obtained based on the color feature and the texture feature.
  26. 根据权利要求25所述的装置,其特征在于,所述融合单元具体用于:The device according to claim 25, wherein the fusion unit is specifically used for:
    通过第一神经网络将所述目标红外图像和所述可见光图像融合,获得所述融合图像;所述第一神经网络包括颜色提取神经网络和纹理提取神经网络,所述颜色提取神经网络用于提取所述可见光图像的颜色特征;所述纹理提取神经网络用于提取所述目标红外图像的纹理特征。The target infrared image and the visible light image are fused by a first neural network to obtain the fused image; the first neural network includes a color extraction neural network and a texture extraction neural network, and the color extraction neural network is used to extract The color feature of the visible light image; the texture extraction neural network is used to extract the texture feature of the target infrared image.
  27. 根据权利要求26所述的装置,其特征在于,所述颜色提取神经网络的分辨率不高于预设的第一分辨率阈值且所述颜色提取神经网络的层数不低于预设的第一网络深度阈值。The device according to claim 26, wherein the resolution of the color extraction neural network is not higher than the preset first resolution threshold and the number of layers of the color extraction neural network is not lower than the preset first resolution threshold A network depth threshold.
  28. 根据权利要求26或27所述的装置,其特征在于,所述纹理提取神经网络的分辨率高于预设的第二分辨率阈值且所述纹理提取神经网络的层数低于预设的第二网络深度阈值。The device according to claim 26 or 27, wherein the resolution of the texture extraction neural network is higher than the preset second resolution threshold and the number of layers of the texture extraction neural network is lower than the preset second resolution threshold Two network depth thresholds.
  29. 根据权利要求26-28任意一项所述的装置,其特征在于,所述装置执行的操作通过图像处理模型实现,所述图像处理模型包括所述第一神经网络和第二神经网络;The device according to any one of claims 26-28, wherein the operations performed by the device are implemented by an image processing model, and the image processing model includes the first neural network and the second neural network;
    所述第二神经网络用于获取从所述第一红外图像到所述第二红外图像的光流F1和从所述第二红外图像到所述第一红外图像的光流F2;所述光流F1和所述光流F2用于计算获得所述目标红外图像;The second neural network is used to obtain an optical flow F1 from the first infrared image to the second infrared image and an optical flow F2 from the second infrared image to the first infrared image; The flow F1 and the optical flow F2 are used to calculate and obtain the infrared image of the target;
    所述图像处理模型包括的所述第一神经网络和所述第二神经网络通过端到端训练得到。The first neural network and the second neural network included in the image processing model are obtained through end-to-end training.
  30. 根据权利要求29所述的装置,其特征在于,所述图像处理模型的训练图像是在照度低于预设的照度阈值的环境下采集得到的。The device according to claim 29, wherein the training images of the image processing model are collected in an environment where the illuminance is lower than a preset illuminance threshold.
  31. 一种图像处理装置,其特征在于,包括处理器和存储器;其中,所述存储器用于存储计算机程序,所述处理器用于调用所述计算机程序,以使得所述装置执行如权利要求1-9任一项所述的方法。An image processing device, characterized in that it includes a processor and a memory; wherein the memory is used to store a computer program, and the processor is used to call the computer program, so that the device executes claims 1-9 any one of the methods described.
  32. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时,实现权利要求1-9任意一项所述的方法。A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1-9 is implemented.
PCT/CN2022/139807 2021-12-30 2022-12-17 Image processing method and related apparatus WO2023125087A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202111650872.9 2021-12-30
CN202111650872 2021-12-30
CN202210207925.8A CN116433729A (en) 2021-12-30 2022-03-03 Image processing method and related device
CN202210207925.8 2022-03-03

Publications (1)

Publication Number Publication Date
WO2023125087A1 true WO2023125087A1 (en) 2023-07-06

Family

ID=86997700

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/139807 WO2023125087A1 (en) 2021-12-30 2022-12-17 Image processing method and related apparatus

Country Status (1)

Country Link
WO (1) WO2023125087A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170237887A1 (en) * 2014-11-13 2017-08-17 Panasonic Intellectual Property Management Co. Ltd. Imaging device and imaging method
CN108449555A (en) * 2018-05-04 2018-08-24 北京化工大学 Image interfusion method and system
CN110691176A (en) * 2018-07-04 2020-01-14 南昌欧菲生物识别技术有限公司 Filter assembly, camera module, image capturing device and electronic device
CN110798623A (en) * 2019-10-15 2020-02-14 华为技术有限公司 Monocular camera, image processing system, and image processing method
CN113114926A (en) * 2021-03-10 2021-07-13 杭州海康威视数字技术股份有限公司 Image processing method and device and camera
CN113177905A (en) * 2021-05-21 2021-07-27 浙江大华技术股份有限公司 Image acquisition method, device, equipment and medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170237887A1 (en) * 2014-11-13 2017-08-17 Panasonic Intellectual Property Management Co. Ltd. Imaging device and imaging method
CN108449555A (en) * 2018-05-04 2018-08-24 北京化工大学 Image interfusion method and system
CN110691176A (en) * 2018-07-04 2020-01-14 南昌欧菲生物识别技术有限公司 Filter assembly, camera module, image capturing device and electronic device
CN110798623A (en) * 2019-10-15 2020-02-14 华为技术有限公司 Monocular camera, image processing system, and image processing method
CN113114926A (en) * 2021-03-10 2021-07-13 杭州海康威视数字技术股份有限公司 Image processing method and device and camera
CN113177905A (en) * 2021-05-21 2021-07-27 浙江大华技术股份有限公司 Image acquisition method, device, equipment and medium

Similar Documents

Publication Publication Date Title
US11877086B2 (en) Method and system for generating at least one image of a real environment
CN107925751B (en) System and method for multiple views noise reduction and high dynamic range
TWI692967B (en) Image device
US9918065B2 (en) Depth-assisted focus in multi-camera systems
US11790504B2 (en) Monitoring method and apparatus
US9544574B2 (en) Selecting camera pairs for stereoscopic imaging
TWI503786B (en) Mobile device and system for generating panoramic video
EP3997662A1 (en) Depth-aware photo editing
US20140286566A1 (en) Cooperative photography
US10708486B2 (en) Generation of a depth-artificial image by determining an interpolated supplementary depth through interpolation based on the original depths and a detected edge
EP4085302A1 (en) System and method of capturing and generating panoramic three-dimensional images
JP2012195668A (en) Image processing device, image processing method, and program
WO2011014421A2 (en) Methods, systems, and computer-readable storage media for generating stereoscopic content via depth map creation
WO2021083082A1 (en) Light path switching method and monitoring module
WO2018121401A1 (en) Splicing method for panoramic video images, and panoramic camera
CN204168378U (en) A kind of panoramic shooting system
JP2011223294A (en) Imaging apparatus
US20230033956A1 (en) Estimating depth based on iris size
WO2023125087A1 (en) Image processing method and related apparatus
Popovic et al. Design and implementation of real-time multi-sensor vision systems
TWI504936B (en) Image processing device
WO2022078036A1 (en) Camera and control method therefor
CN116433729A (en) Image processing method and related device
CN112104796B (en) Image processing method and device, electronic equipment and computer readable storage medium
Popovic et al. State-of-the-art multi-camera systems

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: 22914341

Country of ref document: EP

Kind code of ref document: A1