WO2024002186A1 - Image fusion method and apparatus, and storage medium - Google Patents

Image fusion method and apparatus, and storage medium Download PDF

Info

Publication number
WO2024002186A1
WO2024002186A1 PCT/CN2023/103334 CN2023103334W WO2024002186A1 WO 2024002186 A1 WO2024002186 A1 WO 2024002186A1 CN 2023103334 W CN2023103334 W CN 2023103334W WO 2024002186 A1 WO2024002186 A1 WO 2024002186A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
target
preset
infrared image
visible light
Prior art date
Application number
PCT/CN2023/103334
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
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2024002186A1 publication Critical patent/WO2024002186A1/en

Links

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/28Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • 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 disclosure relates to the field of image processing technology, and in particular, to an image fusion method, device and storage medium.
  • the visible light image captured by the 2D camera can adapt to the visual habits of the human eye, but is easily affected by occlusion, environmental brightness, etc.; the infrared image captured by the infrared camera can be imaged according to the temperature data in the environment, and will not be affected by occlusion, environment, etc. Brightness interference. Therefore, fusing visible light images with infrared images can combine the advantages of both and provide convenience for production and life. However, there are technical problems with the complicated fusion process when fusing visible light images and infrared images.
  • Embodiments of the present disclosure provide an image fusion method, device and storage medium.
  • embodiments of the present disclosure provide an image fusion method, which includes: acquiring a visible light image of a target object, where the target object is set with a preset marker object; acquiring an infrared image of the target object; and determining based on a preset feature extraction algorithm.
  • the image and the infrared image are fused to obtain the target image.
  • inventions of the present disclosure also provide an image fusion device.
  • the image fusion device includes a processing memory, a computer program stored in the memory and executable by the processor, and a data bus used to realize connection communication between the processor and the memory, wherein when the computer program is executed by the processor, the implementation of the present disclosure is implemented Any of the image fusion methods provided in the example.
  • embodiments of the present disclosure also provide a storage medium for computer-readable storage.
  • the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the following: Any image fusion method provided by the embodiments of the present disclosure.
  • Figure 1 is a schematic flowchart of the steps of an image fusion method provided by an embodiment of the present disclosure
  • Figure 2 is a schematic diagram of a scene for implementing the image fusion method provided by an embodiment of the present disclosure
  • Figure 3 is a schematic flowchart of sub-steps of an image fusion method provided by an embodiment of the present disclosure
  • Figure 4 is a schematic flowchart of sub-steps of an image fusion method provided by an embodiment of the present disclosure
  • Figure 5 is a schematic flowchart of sub-steps of an image fusion method provided by an embodiment of the present disclosure
  • Figure 6 is a schematic flowchart of sub-steps of an image fusion method provided by an embodiment of the present disclosure.
  • FIG. 7 is a schematic structural block diagram of an image fusion device provided by an embodiment of the present disclosure.
  • Visible light images captured by 2D cameras can adapt to human visual habits, but are easily affected by occlusion, environmental brightness, etc. Visible light images captured in environments with low air visibility or insufficient lighting cannot well reflect the environment. Object information; infrared graphics captured by infrared cameras can be imaged according to the temperature data in the environment and will not be interfered by occlusion and ambient brightness. However, infrared images cannot reflect the background information in the environment and do not conform to the visual habits of the human eye. Therefore, fusing visible light images with infrared images can combine the advantages of both and provide convenience for production and life. However, in some cases, pulse coupled neural networks or convolutional neural networks are usually used to fuse visible light images and infrared images. Not only is the process more complicated, but the interpretability and portability are also poor. There is an urgent need for a simpler and more capable method. Widely applicable visible light image and infrared image fusion method.
  • Embodiments of the present disclosure provide an image fusion method, device and storage medium.
  • the image fusion method can be applied to mobile terminals, which can be electronic devices such as mobile phones, tablet computers, notebook computers, desktop computers, personal digital assistants, and wearable devices.
  • FIG. 1 is a schematic flow chart of an image fusion method provided by an embodiment of the present disclosure.
  • the image fusion method includes steps S101 to S105.
  • Step S101 Obtain a visible light image of the target object, and the target object is set with a preset marking object.
  • a visible light image of a target object is acquired through a preset 2D camera.
  • the target object may be a production workshop, for example. Multiple 2D cameras are set up in the production workshop to acquire top-down images of the production workshop from multiple angles.
  • the image fusion method provided by the present disclosure generates a target image used to reflect the overall production situation of the production workshop.
  • the image fusion method provided by this disclosure can also be applied to other scenarios,
  • the target object can also be a port, warehouse, etc., which is not limited here.
  • the visible light image may be a photo of the target object captured by a 2D camera, or may be an image frame intercepted from a video of the target object captured by the 2D camera.
  • the target object may be an object with a certain temperature, so that the target object can be significantly distinguished from the background area in the infrared image.
  • the target object can be set according to the actual situation.
  • it can be a container containing hot water.
  • the target object is not limited to this.
  • the target object is a steel production workshop, it can be set in the steel production workshop.
  • a device for placing heated steel balls, with the heated steel balls as the target object, and the target object is not limited here.
  • the preset marking objects include multiple marking objects, and the plurality of marking objects are arranged in at least two directions, and at least two directions intersect.
  • FIG. 2 is a schematic diagram of a scene for implementing the image fusion method provided by an embodiment of the present disclosure.
  • the method of setting mark objects can be applied to target objects with a larger area, and has wider applicability, and This reduces the number of tag objects that need to be set and reduces implementation costs.
  • Step S102 Obtain the infrared image of the target object.
  • the infrared image may be acquired through customer premise equipment (CPE).
  • CPE customer premise equipment
  • the CPE that accesses the wireless signal or wired broadband signal provided by the operator communicates with the preset infrared camera, and the infrared image captured by the infrared camera is acquired through the CPE.
  • the shooting angle of the infrared camera can also be adjusted through the CPE.
  • the infrared image of the target object is acquired through a preset infrared camera.
  • the target object can be a production workshop. Multiple infrared cameras are set up in the production workshop.
  • the target object can also be a port, a warehouse, etc., No limitation is made here.
  • the infrared image may be a photo of the target object captured by an infrared camera, or may be an image frame intercepted from a video of the target object captured by the infrared camera.
  • the order of acquiring the visible light image and the infrared image is not limited here.
  • the visible light image may be acquired first, and then the infrared image may be acquired; the infrared image may be acquired first, and then the visible light image may be acquired; or the visible light image may be acquired first, and then the visible light image may be acquired simultaneously.
  • Visible light images and infrared images the order in which visible light images and infrared images are acquired is not limited here.
  • step S102 includes: acquiring an original infrared image of the target object; performing distortion correction on the original infrared image based on a preset distortion correction algorithm to obtain an infrared image.
  • the original infrared image acquired through an infrared camera usually has relatively obvious distortion.
  • the original infrared image needs to be corrected for distortion.
  • the distortion of the infrared image includes radial distortion and tangential distortion.
  • the radial distortion is caused by the light bending more far away from the center of the lens than near the center.
  • the radial distortion occurs along the lens. Distribution in the radial direction, the distortion at the center of the optical axis of the imager is 0. The farther away from the center of the optical axis of the imager, the more serious the radial distortion; tangential distortion is caused by the inability of the lens and the sensor plane or the image plane to be completely parallel when the camera is assembled. distortion.
  • FIG. 3 is a schematic flowchart of sub-steps of an image fusion method provided by an embodiment of the present disclosure.
  • distortion correction is performed on the original infrared image based on a preset distortion correction algorithm to obtain an infrared image, including steps S1021 to S1023: Step S1021, projecting the original infrared image to a normalized normalized plane to obtain the original infrared image on the normalized plane; step S1022, based on the preset radial distortion coefficient and the preset tangential distortion coefficient, perform radial distortion correction and correction on the original infrared image on the normalized plane. Tangential distortion is corrected to obtain an infrared image on the normalized plane; step S1023, project the infrared image on the normalized plane to the pixel plane to obtain an infrared image.
  • the radial distortion coefficient and the tangential distortion coefficient can be obtained by calibrating the infrared camera in advance, and the method of determining the radial distortion coefficient and the tangential distortion coefficient will not be described in detail here.
  • the coordinates of the pixels in the original infrared image are x, y, and z.
  • the original infrared image is projected onto the normalized plane to obtain the original infrared image on the normalized plane.
  • the projection parameters can be determined through the internal parameter matrix of the infrared camera and will not be described in detail here.
  • Step S103 Determine the first position corresponding to the marked object in the infrared image based on a preset feature extraction algorithm.
  • the first position corresponding to the marked object in the infrared image can be determined through a preset feature extraction algorithm.
  • step S103 includes: acquiring the brightness channel image of the infrared image, determining the brightness area position in the infrared image based on the preset brightness threshold; fitting the brightness area position, and determining the corresponding position of the marked object in the infrared image. First position.
  • the infrared image is converted into HSV space, where H, S, and V respectively represent the hue (Hue), saturation (Saturation), and brightness (Value) of the image.
  • the V channel value of the infrared image is separated to obtain a brightness channel image, so as to determine the corresponding mark object in the infrared image based on the brightness channel image. first position.
  • determining the first position corresponding to the marked object in the infrared image based on a preset brightness threshold includes: binarizing the pixels of the brightness channel image based on the preset brightness threshold; Binarization results determine the location of the brightness area in the infrared image.
  • a brightness threshold capable of extracting the brightness of the marked object from the brightness channel image is determined in advance based on the actual situation, and the pixels of the brightness channel image are binarized based on the preset brightness threshold.
  • the gray value of the pixel is determined to be 255; if the brightness value of the pixel in the brightness channel image is less than the brightness threshold, the gray value of the pixel is determined to be 255.
  • the gray value of the pixel is determined to be 0, and the binary image corresponding to the brightness channel image is obtained, in which the pixel with a gray value of 255 is the brightness area position.
  • a straight line can be performed on the brightness area position. Fitting and filtering the positions of brightness areas with poor fitting properties to prevent objects with higher temperatures in other areas of the target object from affecting the accuracy of the first position determined in step S103. The method of straight line fitting will not be described in detail here.
  • step S103 may be implemented through OpenCV.
  • the cvCvtColor function is called to convert the infrared image into HSV space
  • the cvSplit function is called to separate the V channel of the infrared image
  • the threshold function is called to binarize the brightness channel image according to the preset brightness threshold.
  • Step S104 Determine the second position corresponding to the marked object in the visible light image based on a preset target matching algorithm.
  • the corresponding position of the acquired visible light image also contains an image of the marked object. Based on the target matching algorithm, the second position of the marked object in the visible light image can be determined. .
  • FIG. 4 is a schematic flowchart of sub-steps of an image fusion method provided by an embodiment of the present disclosure.
  • step S104 includes step S1041-step S1043: Step S1041, based on the preset target matching algorithm, determine the targets of multiple areas in the preset marked object template image and the visible light image Matching degree; step S1042, determine the target area position in the visible light image according to the target matching degree of multiple areas; step S1043, fit the target area position, and determine the second position corresponding to the marked object in the visible light image.
  • the target matching algorithm may be implemented based on image matching technology.
  • multiple visible light images of the marked object in the target object are obtained in advance as the marked object template image, and matching is performed in the visible light image of the target object according to the marked object template image.
  • the size of the marker object template image as the figure window size
  • slide the marker object template image on the visible light image of the target object according to the preset figure window movement step and determine the targets of multiple areas in the marker object template image and the visible light image.
  • the matching degree is determined, and the area whose target matching degree is greater than the preset matching degree is determined as the target area position, and then the second position corresponding to the marked object in the visible light image is determined.
  • the target matching degree may be determined based on the Euclidean distance between the marked object template image and the multiple areas in the visible light image: the Euclidean distance between the marked object template image and the multiple areas in the visible light image. The greater the distance, the greater the target matching degree.
  • the target matching degree can also be determined based on other methods, which is not limited here.
  • the marker object template image size is smaller than the visible light image size of the target object.
  • straight line fitting can be performed on the target area position in the visible light image, and the target area positions in the visible light image with poor fitting properties can be filtered.
  • the straight line fitting method will not be described in detail here.
  • step S104 may be implemented through OpenCV.
  • the matchTemplate function is called to determine the target matching degree between the marked object template image and multiple areas of the visible light image, and then the cv2.minMaxLoc function is called to determine the position of the target area with the largest target matching degree.
  • Step S105 According to the first position and the second position, the visible light image and the infrared image are fused based on a preset image fusion algorithm to obtain the target image.
  • an image transformation matrix for perspective transformation of the infrared image to the same coordinates as the visible light image is determined.
  • it is not limited to this. It may also be determined to transform the visible light image into a perspective image.
  • the image perspective is transformed into an image transformation matrix that has the same coordinates as the infrared image, which is not limited here.
  • FIG. 5 is a schematic flowchart of sub-steps of an image fusion method provided by an embodiment of the present disclosure.
  • step S105 includes step S1051-step S1053: step S1051, determine the image transformation matrix according to the first position and the second position; step S1052, according to the image transformation matrix, combine the infrared image with The visible light image is transformed to the same coordinates; step S1053, the visible light image and the infrared image at the same coordinates are fused to obtain the target image.
  • the optimal single mapping transformation matrix for transforming the infrared image and the visible light image to the same coordinates can be determined, that is, Determine the image transformation matrix.
  • the infrared image and the visible light image are transformed to the same coordinates, as follows:
  • the 3 ⁇ 3 matrix is the image transformation matrix, [u, v, w] represents the coordinates of the pixel points in the infrared image, [X, Y, Z] represents the coordinate points of the infrared image under the coordinates of the visible light image.
  • the visible light image and the infrared image at the same coordinate are superimposed on each other to obtain the target image.
  • step S105 may be implemented through OpenCV.
  • the findHomography function is called to calculate the coordinate matrix of the pixel point corresponding to the first position and the coordinate matrix of the pixel point corresponding to the second position to obtain the image transformation matrix; warpPerspective is called to combine the infrared image and visible light according to the image transformation matrix. The image is transformed to the same coordinates; the addWeighted function is called to fuse the infrared image and the visible light image.
  • the image fusion method further includes: acquiring at least one target image; and splicing the target images based on the overlapping area of the at least one target image based on a preset image splicing algorithm to obtain a global target image.
  • multiple 2D cameras and multiple infrared cameras can be respectively set up to obtain visible light images and infrared images, and each visible light image and infrared image can be acquired.
  • the images are respectively fused to obtain at least one target image, and then the target images are spliced to obtain a global target image with a wider field of view.
  • a 2D camera and red When using external cameras, adjust the positions of the 2D camera and the infrared camera so that the visible light images acquired by adjacent 2D cameras include overlapping areas, and the infrared images acquired by adjacent infrared cameras include overlapping areas.
  • FIG. 6 is a schematic flowchart of sub-steps of an image fusion method provided by an embodiment of the present disclosure.
  • the target images are spliced based on a preset image splicing algorithm to obtain a global target image, including steps S1061-step S1063: step S1061 , the overlapping region includes a first overlapping sub-region and a second overlapping sub-region, the first splicing sequence is determined for the first overlapping sub-region, and the second splicing sequence is determined for the second overlapping sub-region; step S1062, determine the first splicing sequence according to the first overlapping sub-region.
  • the first splicing weight of an overlapping sub-region is determined according to the second splicing sequence; the second splicing weight of the second overlapping sub-region is determined according to the first splicing weight; Step S1063: Process the first sub-overlapping region according to the first splicing weight, and process the first sub-overlapping region according to the second splicing weight.
  • the second overlapping sub-region is processed to obtain the global target image.
  • the central axis of the overlapping area can be determined, and the overlapping area can be divided into a left overlapping area and a right overlapping area according to the central axis.
  • the region constructs an arithmetic increasing sequence, and constructs an arithmetic decreasing sequence for the overlapping area on the right.
  • the arithmetic increasing sequence weights the pixels in the left overlapping area
  • the arithmetic decreasing sequence weights the pixels in the right overlapping area.
  • the splicing process between two adjacent target images is similar to the above method and will not be described again here.
  • the image fusion method obtains a visible light image of a target object, which is set with a preset marked object; obtains an infrared image of the target object; and determines the corresponding third position of the marked object in the infrared image based on the preset feature extraction algorithm.
  • First position based on the preset target matching algorithm, determine the second position corresponding to the marked object in the visible light image; based on the first position and the second position, based on the preset image fusion algorithm, fuse the visible light image and the infrared image to obtain target image. It reduces the complexity of fusion of visible light images and infrared images, and can be applied to target objects in diverse scenes.
  • FIG. 7 is a schematic structural block diagram of an image fusion device provided by an embodiment of the present disclosure.
  • the image fusion device 300 includes a processor 301 and a memory 302.
  • the processor 301 and the memory 302 are connected through a bus 303, which is, for example, an I2C (Inter-integrated Circuit) bus.
  • I2C Inter-integrated Circuit
  • the processor 301 is used to provide computing and control capabilities to support the operation of the entire image fusion device.
  • the processor 301 can be a central processing unit (Central Processing Unit, CPU).
  • the processor 301 can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC). ), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general processor may be a microprocessor or the processor may be any conventional processor.
  • the memory 302 may be a Flash chip, a read-only memory (ROM, Read-Only Memory) disk, an optical disk, a USB disk, a mobile hard disk, or the like.
  • ROM read-only memory
  • the memory 302 may be a Flash chip, a read-only memory (ROM, Read-Only Memory) disk, an optical disk, a USB disk, a mobile hard disk, or the like.
  • FIG. 7 is only a block diagram of a partial structure related to the embodiment of the present disclosure, and does not constitute a limitation on the image fusion device to which the embodiment of the present disclosure is applied.
  • the image fusion device may include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
  • the processor is used to run a computer program stored in the memory, and implement any image fusion method provided by the embodiments of the present disclosure when executing the computer program.
  • the processor is used to run a computer program stored in the memory, and implement the following steps when executing the computer program: obtain a visible light image of a target object, where the target object is set with a preset marking object; obtain an infrared image of the target object image; based on the preset feature extraction algorithm, determine the first position corresponding to the marked object in the infrared image; based on the preset target matching algorithm, determine the second position corresponding to the marked object in the visible light image; based on the first position and the second position , Based on the preset image fusion algorithm, the visible light image and the infrared image are fused to obtain the target image.
  • the processor when implemented, is used to: obtain an original infrared image of the target object; and perform distortion correction on the original infrared image based on a preset distortion correction algorithm to obtain an infrared image.
  • the processor when acquiring the infrared image of the target object, is used to: project the original infrared image onto the normalized plane to obtain the original infrared image on the normalized plane; based on the preset Radial distortion coefficient and preset tangential distortion coefficient, perform radial distortion correction and tangential distortion correction on the original infrared image on the normalized plane, and obtain the infrared image on the normalized plane; The infrared image is projected onto the pixel plane to obtain the infrared image.
  • the processor when the processor performs distortion correction on the original infrared image based on the preset distortion correction algorithm to obtain the infrared image, it is used to: obtain the brightness channel image of the infrared image; based on the preset brightness threshold, A first position corresponding to the marked object in the infrared image is determined.
  • the processor when the processor implements a preset feature extraction algorithm and determines the first position corresponding to the marked object in the infrared image, it is used to: obtain the brightness channel image of the infrared image, based on the preset brightness threshold, Determine the position of the brightness area in the infrared image; fit the position of the brightness area to determine the first position corresponding to the marked object in the infrared image.
  • the processor determines the position of the brightness area in the infrared image based on a preset brightness threshold, and is used to: binarize the pixels of the brightness channel image based on the preset brightness threshold; The binarization result of the pixel points determines the location of the brightness area in the infrared image.
  • the processor when the processor determines the second position of the marked object in the visible light image based on the preset target matching algorithm, the processor is configured to: determine the preset marked object based on the preset target matching algorithm. The target matching degree between the template image and multiple areas in the visible light image; determine the target area position in the visible light image based on the target matching degree in the multiple areas; fit the target area position to determine the second location corresponding to the marked object in the visible light image Location.
  • the processor when the processor fuses the visible light image and the infrared image according to the first position and the second position based on a preset image fusion algorithm to obtain the target image, it is used to: according to the first position and the second position, In the second position, the image transformation matrix is determined; according to the image transformation matrix, the infrared image and the visible light image are transformed to the same coordinates; the visible light image and the infrared image at the same coordinates are fused to obtain the target image.
  • the processor when implementing the image fusion method, is also configured to: determine the image transformation matrix according to the first position and the second position; transform the infrared image and the visible light image to the same coordinates according to the image transformation matrix; The visible light image and the infrared image at the same coordinates are fused to obtain the target image.
  • the processor implements the preset based on the overlapping area of at least one target image.
  • the image splicing algorithm is used to splice the target image to obtain the global target image: the overlapping area includes the first overlapping sub-area and the second overlapping sub-area, the first splicing sequence is determined for the first overlapping sub-area, and the first splicing sequence is determined for the first overlapping sub-area.
  • the second overlapping sub-region determines the second splicing sequence; the first splicing weight of the first overlapping sub-region is determined according to the first splicing sequence, and the second splicing weight of the second overlapping sub-region is determined according to the second splicing sequence; the first splicing weight is determined according to the first splicing weight.
  • the first sub-overlapping area is processed, and the second overlapping sub-area is processed according to the second splicing weight to obtain the global target image.
  • the processor when implementing the image fusion method, is also configured to: set a marking object based on a preset marking area in the target object, and the intersection angle between the marking areas is a preset angle.
  • Embodiments of the present disclosure also provide a storage medium for computer-readable storage.
  • the storage medium stores one or more programs.
  • the one or more programs can be executed by one or more processors to implement the embodiments of the present disclosure.
  • the storage medium may be an internal storage unit of the image fusion device in the aforementioned embodiment, such as a hard disk or memory of the image fusion device.
  • the storage medium can also be an external storage device of the image fusion device, such as a plug-in hard disk, smart memory card (Smart Media Card, SMC), secure digital (SD) card, flash memory card (Flash) equipped on the image fusion device. Card) etc.
  • Such software may be distributed on computer-readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media).
  • computer storage media includes volatile and nonvolatile media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. removable, removable and non-removable media.
  • computer Storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disk (DVD) or other optical disk storage, magnetic cassettes, tapes, disk storage or other magnetic storage devices, or may be used Any other medium that stores the desired information and can be accessed by a computer.
  • communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media .
  • Embodiments of the present disclosure provide an image fusion method, device and storage medium to obtain a visible light image of a target object, where the target object is set with a preset marker object; obtain an infrared image of the target object; and determine the infrared image based on a preset feature extraction algorithm.
  • the embodiments of the present disclosure reduce the complexity of the fusion of visible light images and infrared images.
  • the present disclosure also provides a solution for splicing target images to obtain a global target image, making this method suitable for target objects with a wider area and more diverse application scenarios. ization, which improves the diversity of usage scenarios and can adapt to different types of target objects.

Abstract

Embodiments of the present disclosure relate to the field of image processing, and provide an image fusion method and apparatus, and a storage medium. The method comprises: obtaining a visible light image of a target object, the target object being provided with a preset marked object; obtaining an infrared image of the target object; on the basis of a preset feature extraction algorithm, determining a first position corresponding to the marked object in the infrared image; on the basis of a preset target matching algorithm, determining a second position corresponding to the marked object in the visible light image; and according to the first position and the second position and on the basis of a preset image fusion algorithm, fusing the visible light image and the infrared image to obtain a target image.

Description

图像融合方法、装置及存储介质Image fusion method, device and storage medium
相关申请的交叉引用Cross-references to related applications
本公开要求享有2022年06月28日提交的名称为“图像融合方法、装置及存储介质”的中国专利申请CN202210742455.5的优先权,其全部内容通过引用并入本公开中。This disclosure claims priority to Chinese patent application CN202210742455.5 titled "Image Fusion Method, Device and Storage Medium" submitted on June 28, 2022, the entire content of which is incorporated into this disclosure by reference.
技术领域Technical field
本公开涉及图像处理技术领域,尤其涉及一种图像融合方法、装置及存储介质。The present disclosure relates to the field of image processing technology, and in particular, to an image fusion method, device and storage medium.
背景技术Background technique
通过2D摄像头拍摄的可见光图像能与人眼视觉习惯相适应,但容易受遮挡、环境亮度等的影响;通过红外摄像头拍摄的红外图形能够根据环境中的温度数据进行成像,不会受到遮挡、环境亮度的干扰。因此,将可见光图像进行红外图像进行融合能够结合二者的优势,为生产和生活提供便利。然而,对可见光图像和红外图像进行融合时存在融合过程较为复杂的技术问题。The visible light image captured by the 2D camera can adapt to the visual habits of the human eye, but is easily affected by occlusion, environmental brightness, etc.; the infrared image captured by the infrared camera can be imaged according to the temperature data in the environment, and will not be affected by occlusion, environment, etc. Brightness interference. Therefore, fusing visible light images with infrared images can combine the advantages of both and provide convenience for production and life. However, there are technical problems with the complicated fusion process when fusing visible light images and infrared images.
发明内容Contents of the invention
本公开实施例提供一种图像融合方法、装置及存储介质。Embodiments of the present disclosure provide an image fusion method, device and storage medium.
第一方面,本公开实施例提供一种图像融合方法,包括:获取目标对象的可见光图像,目标对象设置有预设的标记对象;获取目标对象的红外图像;基于预设的特征提取算法,确定红外图像中标记对象对应的第一位置;基于预设的目标匹配算法,确定可见光图像中标记对象对应的第二位置;根据第一位置和第二位置,基于预设的图像融合算法,对可见光图像和红外图像进行融合,得到目标图像。In a first aspect, embodiments of the present disclosure provide an image fusion method, which includes: acquiring a visible light image of a target object, where the target object is set with a preset marker object; acquiring an infrared image of the target object; and determining based on a preset feature extraction algorithm. The first position corresponding to the marked object in the infrared image; based on the preset target matching algorithm, determine the second position corresponding to the marked object in the visible light image; based on the first position and the second position, based on the preset image fusion algorithm, determine the visible light The image and the infrared image are fused to obtain the target image.
第二方面,本公开实施例还提供一种图像融合装置,图像融合装置包括处理 器、存储器、存储在存储器上并可被处理器执行的计算机程序以及用于实现处理器和存储器之间的连接通信的数据总线,其中所述计算机程序被处理器执行时,实现如本公开实施例提供的任一项图像融合方法。In a second aspect, embodiments of the present disclosure also provide an image fusion device. The image fusion device includes a processing memory, a computer program stored in the memory and executable by the processor, and a data bus used to realize connection communication between the processor and the memory, wherein when the computer program is executed by the processor, the implementation of the present disclosure is implemented Any of the image fusion methods provided in the example.
第三方面,本公开实施例还提供一种存储介质,用于计算机可读存储,存储介质存储有一个或者多个程序,一个或者多个程序可被一个或者多个处理器执行,以实现如本公开实施例提供的任一项图像融合方法。In a third aspect, embodiments of the present disclosure also provide a storage medium for computer-readable storage. The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the following: Any image fusion method provided by the embodiments of the present disclosure.
附图说明Description of drawings
为了更清楚地说明本公开实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings needed to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present disclosure, which are of great significance to this field. Ordinary technicians can also obtain other drawings based on these drawings without exerting creative work.
图1为本公开实施例提供的一种图像融合方法的步骤流程示意图;Figure 1 is a schematic flowchart of the steps of an image fusion method provided by an embodiment of the present disclosure;
图2为实施本公开实施例提供的图像融合方法的一场景示意图;Figure 2 is a schematic diagram of a scene for implementing the image fusion method provided by an embodiment of the present disclosure;
图3为本公开实施例提供的一种图像融合方法的子步骤流程示意图;Figure 3 is a schematic flowchart of sub-steps of an image fusion method provided by an embodiment of the present disclosure;
图4为本公开实施例提供的一种图像融合方法的子步骤流程示意图;Figure 4 is a schematic flowchart of sub-steps of an image fusion method provided by an embodiment of the present disclosure;
图5为本公开实施例提供的一种图像融合方法的子步骤流程示意图;Figure 5 is a schematic flowchart of sub-steps of an image fusion method provided by an embodiment of the present disclosure;
图6为本公开实施例提供的一种图像融合方法的子步骤流程示意图;以及Figure 6 is a schematic flowchart of sub-steps of an image fusion method provided by an embodiment of the present disclosure; and
图7为本公开实施例提供的一种图像融合装置的结构示意框图。FIG. 7 is a schematic structural block diagram of an image fusion device provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。The technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in this disclosure, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this disclosure.
附图中所示的流程图仅是示例说明,不是必须包括所有的内容和操作/步骤, 也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解、组合或部分合并,因此实际执行的顺序有可能根据实际情况改变。The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all contents and operations/steps. Nor do they have to be performed in the order described. For example, some operations/steps can also be decomposed, combined or partially merged, so the actual order of execution may change based on actual conditions.
应当理解,在此本公开说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本公开。如在本公开说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。It should be understood that the terminology used in the description of the disclosure is for the purpose of describing particular embodiments only and is not intended to limit the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly dictates otherwise.
通过2D摄像头拍摄的可见光图像能与人眼视觉习惯相适应,但容易受遮挡、环境亮度等的影响,在空气能见度低或者光照不足的环境中拍摄到的可见光图像无法很好地反映环境中的物体信息;通过红外摄像头拍摄的红外图形能够根据环境中的温度数据进行成像,不会受到遮挡、环境亮度的干扰,但红外图像无法反映环境中的背景信息,也不符合人眼的视觉习惯。因此,将可见光图像进行红外图像进行融合能够结合二者的优势,为生产和生活提供便利。然而,一些情形中通常通过脉冲耦合神经网络还是采用卷积神经网络对可见光图像和红外图像进行融合,不仅过程较为复杂,可解释性和可移植性也较差,亟需一种较为简单且能够广泛适用的可见光图像和红外图像融合方法。Visible light images captured by 2D cameras can adapt to human visual habits, but are easily affected by occlusion, environmental brightness, etc. Visible light images captured in environments with low air visibility or insufficient lighting cannot well reflect the environment. Object information; infrared graphics captured by infrared cameras can be imaged according to the temperature data in the environment and will not be interfered by occlusion and ambient brightness. However, infrared images cannot reflect the background information in the environment and do not conform to the visual habits of the human eye. Therefore, fusing visible light images with infrared images can combine the advantages of both and provide convenience for production and life. However, in some cases, pulse coupled neural networks or convolutional neural networks are usually used to fuse visible light images and infrared images. Not only is the process more complicated, but the interpretability and portability are also poor. There is an urgent need for a simpler and more capable method. Widely applicable visible light image and infrared image fusion method.
本公开实施例提供一种图像融合方法、装置及存储介质。其中,该图像融合方法可应用于移动终端中,该移动终端可以为手机、平板电脑、笔记本电脑、台式电脑、个人数字助理和穿戴式设备等电子设备。Embodiments of the present disclosure provide an image fusion method, device and storage medium. Among them, the image fusion method can be applied to mobile terminals, which can be electronic devices such as mobile phones, tablet computers, notebook computers, desktop computers, personal digital assistants, and wearable devices.
下面结合附图,对本公开的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。Some embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. The following embodiments and features in the embodiments may be combined with each other without conflict.
请参照图1,图1为本公开实施例提供的一种图像融合方法的步骤流程示意图。Please refer to FIG. 1 , which is a schematic flow chart of an image fusion method provided by an embodiment of the present disclosure.
如图1所示,该图像融合方法包括步骤S101至步骤S105。As shown in Figure 1, the image fusion method includes steps S101 to S105.
步骤S101、获取目标对象的可见光图像,目标对象设置有预设的标记对象。Step S101: Obtain a visible light image of the target object, and the target object is set with a preset marking object.
在一示例性实施例中,通过预设的2D摄像头获取目标对象的可见光图像,目标对象例如可以是生产车间,在生产车间设置多路2D摄像头,获取生产车间多个角度的俯视图像,以便通过本公开提供的图像融合方法生成用于反映生产车间整体生产情况的目标图像。本公开提供的图像融合方法也可以应用于其他场景, 例如目标对象也可以是港口、仓库等,在此不做限定。In an exemplary embodiment, a visible light image of a target object is acquired through a preset 2D camera. The target object may be a production workshop, for example. Multiple 2D cameras are set up in the production workshop to acquire top-down images of the production workshop from multiple angles. The image fusion method provided by the present disclosure generates a target image used to reflect the overall production situation of the production workshop. The image fusion method provided by this disclosure can also be applied to other scenarios, For example, the target object can also be a port, warehouse, etc., which is not limited here.
在一示例性实施例中,可见光图像可以是2D摄像头拍摄的目标对象的照片,也可以是从2D摄像头摄制的目标对象视频中截取的图像帧。In an exemplary embodiment, the visible light image may be a photo of the target object captured by a 2D camera, or may be an image frame intercepted from a video of the target object captured by the 2D camera.
在一示例性实施例中,目标对象可以是具有一定温度的物体,以便目标对象能够在红外图像中与背景区域显著地区分开来。In an exemplary embodiment, the target object may be an object with a certain temperature, so that the target object can be significantly distinguished from the background area in the infrared image.
在一示例性实施例中,目标对象可以根据实际情况设置,例如可以是装有热水的容器,当然也不限于此,例如,若目标对象时钢铁生产车间,可以在钢铁生产车间中可以设置用于放置加热钢球的装置,以加热钢球作为目标对象,在此不对目标对象进行限定。In an exemplary embodiment, the target object can be set according to the actual situation. For example, it can be a container containing hot water. Of course, it is not limited to this. For example, if the target object is a steel production workshop, it can be set in the steel production workshop. A device for placing heated steel balls, with the heated steel balls as the target object, and the target object is not limited here.
在一些实施方式中,预设的标记对象包括多个,且多个标记对象在至少两个方向上排布,至少两个方向相交。In some embodiments, the preset marking objects include multiple marking objects, and the plurality of marking objects are arranged in at least two directions, and at least two directions intersect.
请参照图2,图2为实施本公开实施例提供的图像融合方法的一场景示意图。Please refer to FIG. 2 , which is a schematic diagram of a scene for implementing the image fusion method provided by an embodiment of the present disclosure.
在一示例性实施例中,如图2所示,可以在目标对象中设置相交于同一位置的四个标记区域,标记区域之间的相交角度为45°,即标记区域在目标对象中呈“米”字形分布。相较于在目标对象以棋盘格的形式、每隔一定距离分别设置标记对象,本公开实施例提供的设置标记对象的方法能够适用于面积更大的目标对象,具有较为广泛的适用性,并且减少了需要设置的标记对象的数量,降低了实施成本。In an exemplary embodiment, as shown in Figure 2, four marking areas that intersect at the same position can be set in the target object. The intersection angle between the marking areas is 45°, that is, the marking areas are in the shape of " "meter" shape distribution. Compared with setting mark objects on the target object in the form of a checkerboard at certain distances, the method of setting mark objects provided by the embodiments of the present disclosure can be applied to target objects with a larger area, and has wider applicability, and This reduces the number of tag objects that need to be set and reduces implementation costs.
步骤S102、获取目标对象的红外图像。Step S102: Obtain the infrared image of the target object.
在一示例性实施例中,红外图像可以通过客户前置设备获取(Customer Premise Equipment,CPE)。在一示例性实施例中,接入运营商提供的无线信号或有线宽带信号的CPE与预设的红外摄像头通信连接,通过CPE获取红外摄像头拍摄的红外图像。In an exemplary embodiment, the infrared image may be acquired through customer premise equipment (CPE). In an exemplary embodiment, the CPE that accesses the wireless signal or wired broadband signal provided by the operator communicates with the preset infrared camera, and the infrared image captured by the infrared camera is acquired through the CPE.
在一示例性实施例中,还可以通过CPE对红外摄像头的拍摄角度进行调整。In an exemplary embodiment, the shooting angle of the infrared camera can also be adjusted through the CPE.
在一示例性实施例中,通过预设的红外摄像头获取目标对象的红外图像,类似地,目标对象可以是生产车间,在生产车间设置多路红外摄像头,目标对象也可以是港口、仓库等,在此不做限定。 In an exemplary embodiment, the infrared image of the target object is acquired through a preset infrared camera. Similarly, the target object can be a production workshop. Multiple infrared cameras are set up in the production workshop. The target object can also be a port, a warehouse, etc., No limitation is made here.
在一示例性实施例中,红外图像可以是红外摄像头拍摄的目标对象的照片,也可以是从红外摄像头摄制的目标对象视频中截取的图像帧。In an exemplary embodiment, the infrared image may be a photo of the target object captured by an infrared camera, or may be an image frame intercepted from a video of the target object captured by the infrared camera.
在一示例性实施例中,获取可见光图像和红外图像的顺序在此不做限定,可以是先获取可见光图像,再获取红外图像;也可以是先获取红外图像,再获取可见光图像;或者同时获取可见光图像和红外图像,在此不对获取可见光图像和获取红外图像的顺序做限定。In an exemplary embodiment, the order of acquiring the visible light image and the infrared image is not limited here. The visible light image may be acquired first, and then the infrared image may be acquired; the infrared image may be acquired first, and then the visible light image may be acquired; or the visible light image may be acquired first, and then the visible light image may be acquired simultaneously. Visible light images and infrared images, the order in which visible light images and infrared images are acquired is not limited here.
在一些实施方式中,步骤S102包括:获取目标对象的原始红外图像;基于预设的畸变校正算法,对原始红外图像进行畸变校正,得到红外图像。In some implementations, step S102 includes: acquiring an original infrared image of the target object; performing distortion correction on the original infrared image based on a preset distortion correction algorithm to obtain an infrared image.
在一示例性实施例中,通过红外摄像头获取的原始红外图像通常具有较为明显的畸变,为了提高目标图像的质量,需要对原始红外图像进行畸变校正。In an exemplary embodiment, the original infrared image acquired through an infrared camera usually has relatively obvious distortion. In order to improve the quality of the target image, the original infrared image needs to be corrected for distortion.
在一示例性实施例中,红外图像的畸变包括径向畸变和切向畸变,径向畸变是由于光线在远离透镜中心的地方比靠近中心的地方更加弯曲而产生的畸变,径向畸变沿透镜半径方向分布,成像仪光轴中心的畸变为0,距离成像仪光轴中心越远,径向畸变越严重;切向畸变是由于相机组装时透镜与传感器平面或图像平面无法完全平行而产生的畸变。In an exemplary embodiment, the distortion of the infrared image includes radial distortion and tangential distortion. The radial distortion is caused by the light bending more far away from the center of the lens than near the center. The radial distortion occurs along the lens. Distribution in the radial direction, the distortion at the center of the optical axis of the imager is 0. The farther away from the center of the optical axis of the imager, the more serious the radial distortion; tangential distortion is caused by the inability of the lens and the sensor plane or the image plane to be completely parallel when the camera is assembled. distortion.
请参照图3,图3为本公开实施例提供的一种图像融合方法的子步骤流程示意图。Please refer to FIG. 3 , which is a schematic flowchart of sub-steps of an image fusion method provided by an embodiment of the present disclosure.
如图3所示,在一些实施方式中,基于预设的畸变校正算法,对原始红外图像进行畸变校正,得到红外图像,包括步骤S1021至步骤S1023:步骤S1021、将原始红外图像投影到归一化平面,得到归一化平面上的原始红外图像;步骤S1022、基于预设的径向畸变系数和预设的切向畸变系数,对归一化平面上的原始红外图像进行径向畸变校正和切向畸变校正,得到归一化平面上的红外图像;步骤S1023、将归一化平面上的红外图像投影到像素平面,得到红外图像。As shown in Figure 3, in some implementations, distortion correction is performed on the original infrared image based on a preset distortion correction algorithm to obtain an infrared image, including steps S1021 to S1023: Step S1021, projecting the original infrared image to a normalized normalized plane to obtain the original infrared image on the normalized plane; step S1022, based on the preset radial distortion coefficient and the preset tangential distortion coefficient, perform radial distortion correction and correction on the original infrared image on the normalized plane. Tangential distortion is corrected to obtain an infrared image on the normalized plane; step S1023, project the infrared image on the normalized plane to the pixel plane to obtain an infrared image.
在一示例性实施例中,径向畸变系数和切向畸变系数可以通过预先对红外摄像头进行标定得到,在此对确定径向畸变系数和切向畸变系数的方法不做赘述。In an exemplary embodiment, the radial distortion coefficient and the tangential distortion coefficient can be obtained by calibrating the infrared camera in advance, and the method of determining the radial distortion coefficient and the tangential distortion coefficient will not be described in detail here.
在一示例性实施例中,原始红外图像中像素点的坐标为x、y、z,将原始红外图像投影到归一化平面,得到归一化平面上的原始红外图像,归一化平面上的原始红外图像中像素点的坐标为x’、y’,其中,x’=x/z、y’=y/z。 In an exemplary embodiment, the coordinates of the pixels in the original infrared image are x, y, and z. The original infrared image is projected onto the normalized plane to obtain the original infrared image on the normalized plane. The coordinates of the pixels in the original infrared image are x', y', where x'=x/z, y'=y/z.
在一示例性实施例中,根据径向畸变系数k1、k2和切向畸变系数p1、p2,对归一化平面上的原始红外图像进行径向畸变校正和切向畸变校正,有:x″=x′·(1+k1·r2+k2·r4)+2·p1·x′·y′+p2·(r2+2x′2);y″=y′·(1+k1·r2+k2·r4)+2·p1·x′·y′+p2·(r2+2y′2),其中r为归一化平面上的原始红外图像中像素点的极坐标,r2=x′2+y′2,x”、y”为归一化平面上红外图像中像素点的坐标。In an exemplary embodiment, radial distortion correction and tangential distortion correction are performed on the original infrared image on the normalized plane according to the radial distortion coefficients k 1 and k 2 and the tangential distortion coefficients p 1 and p 2 , There are: x″=x′·(1+k 1 ·r 2 +k 2 ·r 4 )+2·p 1 ·x′·y′+p 2 ·(r 2 +2x′ 2 ); y″= y′·(1+k 1 ·r 2 +k 2 ·r 4 )+2·p 1 ·x′·y′+p 2 ·(r 2 +2y′ 2 ), where r is on the normalized plane The polar coordinates of the pixels in the original infrared image are r 2 =x′ 2 +y′ 2 , x”, y” are the coordinates of the pixels in the infrared image on the normalized plane.
在一示例性实施例中,将归一化平面上的红外图像投影到像素平面,得到像素点在红外图像上的正确位置,有:u=fx·x″+cx;v=fy·y″+cy,其中,u、v为像素屏幕上红外图像中像素点的坐标,cx和cy是红外摄像头的投影参数。投影参数可以通过红外摄像头的内参矩阵确定,在此不做赘述。In an exemplary embodiment, the infrared image on the normalized plane is projected onto the pixel plane to obtain the correct position of the pixel point on the infrared image, as follows: u=f x ·x″+c x ; v=f y ·y″+c y , where u and v are the coordinates of the pixels in the infrared image on the pixel screen, c x and cy are the projection parameters of the infrared camera. The projection parameters can be determined through the internal parameter matrix of the infrared camera and will not be described in detail here.
步骤S103、基于预设的特征提取算法,确定红外图像中标记对象对应的第一位置。Step S103: Determine the first position corresponding to the marked object in the infrared image based on a preset feature extraction algorithm.
在一示例性实施例中,由于具有一定温度的目标对象在红外图像中具有亮度较高的特点,通过预设的特征提取算法,能够确定红外图像中标记对象对应的第一位置。In an exemplary embodiment, since target objects with a certain temperature have higher brightness in infrared images, the first position corresponding to the marked object in the infrared image can be determined through a preset feature extraction algorithm.
在一些实施方式中,步骤S103包括:获取红外图像的亮度通道图像,基于预设的亮度阈值,确定红外图像中的亮度区域位置;对亮度区域位置进行拟合,确定红外图像中标记对象对应的第一位置。In some embodiments, step S103 includes: acquiring the brightness channel image of the infrared image, determining the brightness area position in the infrared image based on the preset brightness threshold; fitting the brightness area position, and determining the corresponding position of the marked object in the infrared image. First position.
在一示例性实施例中,将红外图像转换到HSV空间,其中,H、S、V分别表示图像的色调(Hue)、饱和度(Saturation)和亮度(Value)。H通道一般用角度度量,取值范围为0°-360°;S通道取值范围为0.0-1.0,S=0时表示只有灰度;V通道取值范围为0.0-1.0,取0.0时表示黑色,取1.0时表示白色。In an exemplary embodiment, the infrared image is converted into HSV space, where H, S, and V respectively represent the hue (Hue), saturation (Saturation), and brightness (Value) of the image. The H channel is generally measured in angle, and the value range is 0°-360°; the S channel value range is 0.0-1.0, and when S=0, it means only grayscale; the V channel value range is 0.0-1.0, and when it is 0.0, it means Black, 1.0 means white.
在一示例性实施例中,确定红外图像H通道,S通道,V通道的数值后,将红外图像的V通道数值分离出来,得到亮度通道图像,以便根据亮度通道图像确定红外图像中标记对象对应的第一位置。In an exemplary embodiment, after determining the values of the H channel, S channel, and V channel of the infrared image, the V channel value of the infrared image is separated to obtain a brightness channel image, so as to determine the corresponding mark object in the infrared image based on the brightness channel image. first position.
在一些实施方式中,基于预设的亮度阈值,确定红外图像中标记对象对应的第一位置,包括:基于预设的亮度阈值,对亮度通道图像的像素点进行二值化;根据像素点的二值化结果,确定红外图像中的亮度区域位置。 In some embodiments, determining the first position corresponding to the marked object in the infrared image based on a preset brightness threshold includes: binarizing the pixels of the brightness channel image based on the preset brightness threshold; Binarization results determine the location of the brightness area in the infrared image.
在一示例性实施例中,预先根据实际情况确定能够将标记对象的亮度在亮度通道图像中提取出来的亮度阈值,基于预设的亮度阈值,对亮度通道图像的像素点进行二值化。在一示例性实施例中,若亮度通道图像的像素点亮度数值大于或等于亮度阈值,将该像素点的灰度值确定为255;若亮度通道图像的像素点亮度数值小于亮度阈值,将该像素点的灰度值确定为0,得到亮度通道图像对应的二值化图像,其中灰度值为255的像素点为亮度区域位置。In an exemplary embodiment, a brightness threshold capable of extracting the brightness of the marked object from the brightness channel image is determined in advance based on the actual situation, and the pixels of the brightness channel image are binarized based on the preset brightness threshold. In an exemplary embodiment, if the brightness value of a pixel in the brightness channel image is greater than or equal to the brightness threshold, the gray value of the pixel is determined to be 255; if the brightness value of the pixel in the brightness channel image is less than the brightness threshold, the gray value of the pixel is determined to be 255. The gray value of the pixel is determined to be 0, and the binary image corresponding to the brightness channel image is obtained, in which the pixel with a gray value of 255 is the brightness area position.
在一示例性实施例中,由于标记对象在至少两个方向上排布,即处于同一方向上的标记对象大致呈一条直线,为了提高确定第一位置的准确度,可以对亮度区域位置进行直线拟合,过滤拟合性较差的亮度区域位置,以避免目标对象中其他区域出现温度较高的物体影响步骤S103确定的第一位置的准确度,直线拟合的方法在此不做赘述。In an exemplary embodiment, since the marked objects are arranged in at least two directions, that is, the marked objects in the same direction are approximately in a straight line, in order to improve the accuracy of determining the first position, a straight line can be performed on the brightness area position. Fitting and filtering the positions of brightness areas with poor fitting properties to prevent objects with higher temperatures in other areas of the target object from affecting the accuracy of the first position determined in step S103. The method of straight line fitting will not be described in detail here.
在一示例性实施例中,步骤S103可以通过OpenCV实现。在一示例性实施例中,调用cvCvtColor函数将红外图像转换到HSV空间,调用cvSplit函数将红外图像的V通道分离出来,再调用threshold函数根据预设的亮度阈值对亮度通道图像进行二值化。In an exemplary embodiment, step S103 may be implemented through OpenCV. In an exemplary embodiment, the cvCvtColor function is called to convert the infrared image into HSV space, the cvSplit function is called to separate the V channel of the infrared image, and the threshold function is called to binarize the brightness channel image according to the preset brightness threshold.
步骤S104、基于预设的目标匹配算法,确定可见光图像中标记对象对应的第二位置。Step S104: Determine the second position corresponding to the marked object in the visible light image based on a preset target matching algorithm.
在一示例性实施例中,由于目标对象设置有标记对象,获取到的可见光图像的对应位置中也包含有标记对象的图像,基于目标匹配算法,能够确定标记对象在可见光图像中的第二位置。In an exemplary embodiment, since the target object is provided with a marked object, the corresponding position of the acquired visible light image also contains an image of the marked object. Based on the target matching algorithm, the second position of the marked object in the visible light image can be determined. .
请参照图4,图4为本公开实施例提供的一种图像融合方法的子步骤流程示意图。Please refer to FIG. 4 , which is a schematic flowchart of sub-steps of an image fusion method provided by an embodiment of the present disclosure.
如图4所示,在一些实施方式中,步骤S104包括步骤S1041-步骤S1043:步骤S1041、基于预设的目标匹配度算法,确定预设的标记对象模板图像与可见光图像中多个区域的目标匹配度;步骤S1042、根据多个区域的目标匹配度,确定可见光图像中的目标区域位置;步骤S1043、对目标区域位置进行拟合,确定可见光图像中标记对象对应的第二位置。As shown in Figure 4, in some embodiments, step S104 includes step S1041-step S1043: Step S1041, based on the preset target matching algorithm, determine the targets of multiple areas in the preset marked object template image and the visible light image Matching degree; step S1042, determine the target area position in the visible light image according to the target matching degree of multiple areas; step S1043, fit the target area position, and determine the second position corresponding to the marked object in the visible light image.
在一示例性实施例中,目标匹配度算法可以是基于图像匹配技术实现的。在 一示例性实施例中,预先获取标记对象在目标对象中的多张可见光图像作为标记对象模板图像,根据标记对象模板图像在目标对象的可见光图像中进行匹配。例如,将标记对象模板图像的尺寸作为图窗尺寸,根据预设的图窗移动步长在目标对象的可见光图像上滑动标记对象模板图像,确定标记对象模板图像与可见光图像中多个区域的目标匹配度,并将目标匹配度大于预设匹配度的区域确定为目标区域位置,进而确定可见光图像中标记对象对应的第二位置。In an exemplary embodiment, the target matching algorithm may be implemented based on image matching technology. exist In an exemplary embodiment, multiple visible light images of the marked object in the target object are obtained in advance as the marked object template image, and matching is performed in the visible light image of the target object according to the marked object template image. For example, use the size of the marker object template image as the figure window size, slide the marker object template image on the visible light image of the target object according to the preset figure window movement step, and determine the targets of multiple areas in the marker object template image and the visible light image. The matching degree is determined, and the area whose target matching degree is greater than the preset matching degree is determined as the target area position, and then the second position corresponding to the marked object in the visible light image is determined.
在一示例性实施例中,目标匹配度可以根据标记对象模板图像与可见光图像中多个区域之间的欧几里得距离确定:标记对象模板图像与可见光图像中多个区域之间的欧几里得距离越大,目标匹配度也就越大。当然也不限于此,目标匹配度也可以是根据其他方法确定的,在此不做限定。In an exemplary embodiment, the target matching degree may be determined based on the Euclidean distance between the marked object template image and the multiple areas in the visible light image: the Euclidean distance between the marked object template image and the multiple areas in the visible light image. The greater the distance, the greater the target matching degree. Of course, it is not limited to this, and the target matching degree can also be determined based on other methods, which is not limited here.
在一示例性实施例中,标记对象模板图像尺寸小于目标对象的可见光图像尺寸。In an exemplary embodiment, the marker object template image size is smaller than the visible light image size of the target object.
在一示例性实施例中,与步骤S103类似,为了提高确定第二位置的准确度,可以对可见光图像中的目标区域位置进行直线拟合,过滤可见光图像中拟合性较差的目标区域位置,以避免目标对象中其他区域出现与标记对象类似形态的物体影响步骤S103确定的第二位置的准确度,直线拟合的方法在此不做赘述。In an exemplary embodiment, similar to step S103, in order to improve the accuracy of determining the second position, straight line fitting can be performed on the target area position in the visible light image, and the target area positions in the visible light image with poor fitting properties can be filtered. In order to avoid the appearance of objects similar to the marked object in other areas of the target object from affecting the accuracy of the second position determined in step S103, the straight line fitting method will not be described in detail here.
在一示例性实施例中,步骤S104可以是通过OpenCV实现的。在一示例性实施例中,调用matchTemplate函数确定标记对象模板图像与可见光图像多个区域的目标匹配度,再调用cv2.minMaxLoc函数确定其中目标匹配度最大的目标区域的位置。In an exemplary embodiment, step S104 may be implemented through OpenCV. In an exemplary embodiment, the matchTemplate function is called to determine the target matching degree between the marked object template image and multiple areas of the visible light image, and then the cv2.minMaxLoc function is called to determine the position of the target area with the largest target matching degree.
步骤S105、根据第一位置和第二位置,基于预设的图像融合算法,对可见光图像和红外图像进行融合,得到目标图像。Step S105: According to the first position and the second position, the visible light image and the infrared image are fused based on a preset image fusion algorithm to obtain the target image.
在一示例性实施例中,根据第一位置和第二位置的像素点坐标,确定将红外图像透视变换到与可见光图像统一坐标的图像变换矩阵,当然也不限于此,也可以是确定将可见光图像透视变换到与红外图像统一坐标的图像变换矩阵,在此不做限定。In an exemplary embodiment, based on the pixel point coordinates of the first position and the second position, an image transformation matrix for perspective transformation of the infrared image to the same coordinates as the visible light image is determined. Of course, it is not limited to this. It may also be determined to transform the visible light image into a perspective image. The image perspective is transformed into an image transformation matrix that has the same coordinates as the infrared image, which is not limited here.
请参照图5,图5为本公开实施例提供的一种图像融合方法的子步骤流程示意图。 Please refer to FIG. 5 , which is a schematic flowchart of sub-steps of an image fusion method provided by an embodiment of the present disclosure.
如图5所示,在一些实施方式中,步骤S105包括步骤S1051-步骤S1053:步骤S1051、根据第一位置和第二位置,确定图像变换矩阵;步骤S1052、根据图像变换矩阵,将红外图像与可见光图像变换到同一坐标;步骤S1053、对同一坐标下的可见光图像和红外图像进行融合,得到目标图像。As shown in Figure 5, in some embodiments, step S105 includes step S1051-step S1053: step S1051, determine the image transformation matrix according to the first position and the second position; step S1052, according to the image transformation matrix, combine the infrared image with The visible light image is transformed to the same coordinates; step S1053, the visible light image and the infrared image at the same coordinates are fused to obtain the target image.
在一示例性实施例中,根据第一位置对应像素点的坐标矩阵和第二位置对应像素点的坐标矩阵,可以确定将红外图像与可见光图像变换到同一坐标的最优单映射变换矩阵,即确定图像变换矩阵。In an exemplary embodiment, according to the coordinate matrix of the pixel point corresponding to the first position and the coordinate matrix of the pixel point corresponding to the second position, the optimal single mapping transformation matrix for transforming the infrared image and the visible light image to the same coordinates can be determined, that is, Determine the image transformation matrix.
在一示例性实施例中,根据图像变换矩阵,将红外图像与可见光图像变换到同一坐标,有:其中的3×3矩阵为图像变换矩阵,[u,v,w]表示红外图像中像素点的坐标,[X,Y,Z]表示对红外图像在可见光图像的坐标下的坐标点。In an exemplary embodiment, according to the image transformation matrix, the infrared image and the visible light image are transformed to the same coordinates, as follows: The 3×3 matrix is the image transformation matrix, [u, v, w] represents the coordinates of the pixel points in the infrared image, [X, Y, Z] represents the coordinate points of the infrared image under the coordinates of the visible light image.
在一示例性实施例中,根据图像变换矩阵,将红外图像与可见光图像变换到同一坐标后,对同一坐标下的可见光图像和红外图像相互叠加,得到目标图像。In an exemplary embodiment, after the infrared image and the visible light image are transformed to the same coordinate according to the image transformation matrix, the visible light image and the infrared image at the same coordinate are superimposed on each other to obtain the target image.
在一示例性实施例中,步骤S105可以是通过OpenCV实现的。在一示例性实施例中,调用findHomography函数对第一位置对应像素点的坐标矩阵和第二位置对应像素点的坐标矩阵进行计算,得到图像变换矩阵;调用warpPerspective根据图像变换矩阵将红外图像与可见光图像变换到同一坐标;调用addWeighted函数对红外图像和可见光图像进行融合。In an exemplary embodiment, step S105 may be implemented through OpenCV. In an exemplary embodiment, the findHomography function is called to calculate the coordinate matrix of the pixel point corresponding to the first position and the coordinate matrix of the pixel point corresponding to the second position to obtain the image transformation matrix; warpPerspective is called to combine the infrared image and visible light according to the image transformation matrix. The image is transformed to the same coordinates; the addWeighted function is called to fuse the infrared image and the visible light image.
在一些实施方式中,图像融合方法还包括:获取至少一张目标图像;根据至少一张目标图像的重叠区域,基于预设的图像拼接算法,对目标图像进行拼接,得到全局目标图像。In some embodiments, the image fusion method further includes: acquiring at least one target image; and splicing the target images based on the overlapping area of the at least one target image based on a preset image splicing algorithm to obtain a global target image.
在一示例性实施例中,为了使图像融合方法能够适用于更大面积的目标对象,可以通过分别设置多路2D摄像头和多路红外摄像头获取可见光图像和红外图像,对各路可见光图像和红外图像分别进行融合后得到至少一张目标图像,再对目标图像进行拼接得到视野较为宽广的全局目标图像。In an exemplary embodiment, in order to make the image fusion method applicable to a larger area of target objects, multiple 2D cameras and multiple infrared cameras can be respectively set up to obtain visible light images and infrared images, and each visible light image and infrared image can be acquired. The images are respectively fused to obtain at least one target image, and then the target images are spliced to obtain a global target image with a wider field of view.
在一示例性实施例中,为了便于对目标图像进行拼接,设置2D摄像头和红 外摄像头时,调整2D摄像头和红外摄像头的位置,使相邻2D摄像头获取到的可见光图像之间包括重叠区域,相邻红外摄像头获取到的红外图像之间包括重叠区域。In an exemplary embodiment, in order to facilitate stitching of target images, a 2D camera and red When using external cameras, adjust the positions of the 2D camera and the infrared camera so that the visible light images acquired by adjacent 2D cameras include overlapping areas, and the infrared images acquired by adjacent infrared cameras include overlapping areas.
请参照图6,图6为本公开实施例提供的一种图像融合方法的子步骤流程示意图。Please refer to FIG. 6 , which is a schematic flowchart of sub-steps of an image fusion method provided by an embodiment of the present disclosure.
如图6所示,在一些实施方式中,根据至少一张目标图像的重叠区域,基于预设的图像拼接算法,对目标图像进行拼接,得到全局目标图像,包括步骤S1061-步骤S1063:步骤S1061、重叠区域包括第一重叠子区域和第二重叠子区域,针对第一重叠子区域确定第一拼接数列,针对第二重叠子区域确定第二拼接数列;步骤S1062、根据第一拼接数列确定第一重叠子区域的第一拼接权重,根据第二拼接数列确定第二重叠子区域的第二拼接权重;步骤S1063、根据第一拼接权重对第一子重叠区域进行处理,根据第二拼接权重对第二重叠子区域进行处理,得到全局目标图像。As shown in Figure 6, in some embodiments, based on the overlapping area of at least one target image, the target images are spliced based on a preset image splicing algorithm to obtain a global target image, including steps S1061-step S1063: step S1061 , the overlapping region includes a first overlapping sub-region and a second overlapping sub-region, the first splicing sequence is determined for the first overlapping sub-region, and the second splicing sequence is determined for the second overlapping sub-region; step S1062, determine the first splicing sequence according to the first overlapping sub-region. The first splicing weight of an overlapping sub-region is determined according to the second splicing sequence; the second splicing weight of the second overlapping sub-region is determined according to the first splicing weight; Step S1063: Process the first sub-overlapping region according to the first splicing weight, and process the first sub-overlapping region according to the second splicing weight. The second overlapping sub-region is processed to obtain the global target image.
在一示例性实施例中,以左右相邻的两张目标图像为例,可以确定重叠区域的中心轴,根据中心轴将重叠区域划分为左侧重叠区域和右侧重叠区域,针对左侧重叠区域构造等差递增数列,针对右侧重叠区域构造等差递减数列,根据等差递增数列对左侧重叠区域的像素点的权重,根据等差递减数列对右侧重叠区域的像素点的权重,实现左右相邻的两张目标图像之间的拼接。In an exemplary embodiment, taking two adjacent target images on the left and right as an example, the central axis of the overlapping area can be determined, and the overlapping area can be divided into a left overlapping area and a right overlapping area according to the central axis. For the left overlapping area, The region constructs an arithmetic increasing sequence, and constructs an arithmetic decreasing sequence for the overlapping area on the right. The arithmetic increasing sequence weights the pixels in the left overlapping area, and the arithmetic decreasing sequence weights the pixels in the right overlapping area. Realize the splicing between two adjacent target images on the left and right.
在一示例性实施例中,上下相邻的两张目标图像之间的拼接过程与上述方法类似,此处不再赘述。In an exemplary embodiment, the splicing process between two adjacent target images is similar to the above method and will not be described again here.
上述实施例提供的图像融合方法,获取目标对象的可见光图像,目标对象设置有预设的标记对象;获取目标对象的红外图像;基于预设的特征提取算法,确定红外图像中标记对象对应的第一位置;基于预设的目标匹配算法,确定可见光图像中标记对象对应的第二位置;根据第一位置和第二位置,基于预设的图像融合算法,对可见光图像和红外图像进行融合,得到目标图像。降低了可见光图像与红外图像融合的复杂度,能够适用于多样化场景的目标对象。The image fusion method provided by the above embodiments obtains a visible light image of a target object, which is set with a preset marked object; obtains an infrared image of the target object; and determines the corresponding third position of the marked object in the infrared image based on the preset feature extraction algorithm. First position; based on the preset target matching algorithm, determine the second position corresponding to the marked object in the visible light image; based on the first position and the second position, based on the preset image fusion algorithm, fuse the visible light image and the infrared image to obtain target image. It reduces the complexity of fusion of visible light images and infrared images, and can be applied to target objects in diverse scenes.
请参阅图7,图7为本公开实施例提供的一种图像融合装置的结构示意性框图。 Please refer to FIG. 7 , which is a schematic structural block diagram of an image fusion device provided by an embodiment of the present disclosure.
如图7所示,图像融合装置300包括处理器301和存储器302,处理器301和存储器302通过总线303连接,该总线比如为I2C(Inter-integrated Circuit)总线。As shown in Figure 7, the image fusion device 300 includes a processor 301 and a memory 302. The processor 301 and the memory 302 are connected through a bus 303, which is, for example, an I2C (Inter-integrated Circuit) bus.
在一示例性实施例中,处理器301用于提供计算和控制能力,支撑整个图像融合装置的运行。处理器301可以是中央处理单元(Central Processing Unit,CPU),该处理器301还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。In an exemplary embodiment, the processor 301 is used to provide computing and control capabilities to support the operation of the entire image fusion device. The processor 301 can be a central processing unit (Central Processing Unit, CPU). The processor 301 can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC). ), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general processor may be a microprocessor or the processor may be any conventional processor.
在一示例性实施例中,存储器302可以是Flash芯片、只读存储器(ROM,Read-Only Memory)磁盘、光盘、U盘或移动硬盘等。In an exemplary embodiment, the memory 302 may be a Flash chip, a read-only memory (ROM, Read-Only Memory) disk, an optical disk, a USB disk, a mobile hard disk, or the like.
本领域技术人员可以理解,图7中示出的结构,仅仅是与本公开实施例相关的部分结构的框图,并不构成对本公开实施例所应用于其上的图像融合装置的限定,具体的图像融合装置可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in Figure 7 is only a block diagram of a partial structure related to the embodiment of the present disclosure, and does not constitute a limitation on the image fusion device to which the embodiment of the present disclosure is applied. Specifically, The image fusion device may include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
其中,处理器用于运行存储在存储器中的计算机程序,并在执行计算机程序时实现本公开实施例提供的任意一种图像融合方法。Wherein, the processor is used to run a computer program stored in the memory, and implement any image fusion method provided by the embodiments of the present disclosure when executing the computer program.
在一实施例中,处理器用于运行存储在存储器中的计算机程序,并在执行计算机程序时实现如下步骤:获取目标对象的可见光图像,目标对象设置有预设的标记对象;获取目标对象的红外图像;基于预设的特征提取算法,确定红外图像中标记对象对应的第一位置;基于预设的目标匹配算法,确定可见光图像中标记对象对应的第二位置;根据第一位置和第二位置,基于预设的图像融合算法,对可见光图像和红外图像进行融合,得到目标图像。In one embodiment, the processor is used to run a computer program stored in the memory, and implement the following steps when executing the computer program: obtain a visible light image of a target object, where the target object is set with a preset marking object; obtain an infrared image of the target object image; based on the preset feature extraction algorithm, determine the first position corresponding to the marked object in the infrared image; based on the preset target matching algorithm, determine the second position corresponding to the marked object in the visible light image; based on the first position and the second position , Based on the preset image fusion algorithm, the visible light image and the infrared image are fused to obtain the target image.
在一实施例中,处理器在实现时,用于实现:获取目标对象的原始红外图像;基于预设的畸变校正算法,对原始红外图像进行畸变校正,得到红外图像。In one embodiment, when implemented, the processor is used to: obtain an original infrared image of the target object; and perform distortion correction on the original infrared image based on a preset distortion correction algorithm to obtain an infrared image.
在一实施例中,处理器在实现获取目标对象的红外图像时,用于实现:将原始红外图像投影到归一化平面,得到归一化平面上的原始红外图像;基于预设的 径向畸变系数和预设的切向畸变系数,对归一化平面上的原始红外图像进行径向畸变校正和切向畸变校正,得到归一化平面上的红外图像;将归一化平面上的红外图像投影到像素平面,得到红外图像。In one embodiment, when acquiring the infrared image of the target object, the processor is used to: project the original infrared image onto the normalized plane to obtain the original infrared image on the normalized plane; based on the preset Radial distortion coefficient and preset tangential distortion coefficient, perform radial distortion correction and tangential distortion correction on the original infrared image on the normalized plane, and obtain the infrared image on the normalized plane; The infrared image is projected onto the pixel plane to obtain the infrared image.
在一实施例中,处理器在实现基于预设的畸变校正算法,对原始红外图像进行畸变校正,得到红外图像时,用于实现:获取红外图像的亮度通道图像;基于预设的亮度阈值,确定红外图像中标记对象对应的第一位置。In one embodiment, when the processor performs distortion correction on the original infrared image based on the preset distortion correction algorithm to obtain the infrared image, it is used to: obtain the brightness channel image of the infrared image; based on the preset brightness threshold, A first position corresponding to the marked object in the infrared image is determined.
在一实施例中,处理器在实现基于预设的特征提取算法,确定红外图像中标记对象对应的第一位置时,用于实现:获取红外图像的亮度通道图像,基于预设的亮度阈值,确定红外图像中的亮度区域位置;对亮度区域位置进行拟合,确定红外图像中标记对象对应的第一位置。In one embodiment, when the processor implements a preset feature extraction algorithm and determines the first position corresponding to the marked object in the infrared image, it is used to: obtain the brightness channel image of the infrared image, based on the preset brightness threshold, Determine the position of the brightness area in the infrared image; fit the position of the brightness area to determine the first position corresponding to the marked object in the infrared image.
在一实施例中,处理器在实现基于预设的亮度阈值,确定红外图像中的亮度区域位置,用于实现:基于预设的亮度阈值,对亮度通道图像的像素点进行二值化;根据像素点的二值化结果,确定红外图像中的亮度区域位置。In one embodiment, the processor determines the position of the brightness area in the infrared image based on a preset brightness threshold, and is used to: binarize the pixels of the brightness channel image based on the preset brightness threshold; The binarization result of the pixel points determines the location of the brightness area in the infrared image.
在一实施例中,处理器在实现基于预设的目标匹配算法,确定标记对象在可见光图像中的第二位置时,用于实现:基于预设的目标匹配度算法,确定预设的标记对象模板图像与可见光图像中多个区域的目标匹配度;根据多个区域的目标匹配度,确定可见光图像中的目标区域位置;对目标区域位置进行拟合,确定可见光图像中标记对象对应的第二位置。In one embodiment, when the processor determines the second position of the marked object in the visible light image based on the preset target matching algorithm, the processor is configured to: determine the preset marked object based on the preset target matching algorithm. The target matching degree between the template image and multiple areas in the visible light image; determine the target area position in the visible light image based on the target matching degree in the multiple areas; fit the target area position to determine the second location corresponding to the marked object in the visible light image Location.
在一实施例中,处理器在实现根据第一位置和第二位置,基于预设的图像融合算法,对可见光图像和红外图像进行融合,得到目标图像时,用于实现:根据第一位置和第二位置,确定图像变换矩阵;根据图像变换矩阵,将红外图像与可见光图像变换到同一坐标;对同一坐标下的可见光图像和红外图像进行融合,得到目标图像。In one embodiment, when the processor fuses the visible light image and the infrared image according to the first position and the second position based on a preset image fusion algorithm to obtain the target image, it is used to: according to the first position and the second position, In the second position, the image transformation matrix is determined; according to the image transformation matrix, the infrared image and the visible light image are transformed to the same coordinates; the visible light image and the infrared image at the same coordinates are fused to obtain the target image.
在一实施例中,处理器在实现图像融合方法时,还用于实现:根据第一位置和第二位置,确定图像变换矩阵;根据图像变换矩阵,将红外图像与可见光图像变换到同一坐标;对同一坐标下的可见光图像和红外图像进行融合,得到目标图像。In one embodiment, when implementing the image fusion method, the processor is also configured to: determine the image transformation matrix according to the first position and the second position; transform the infrared image and the visible light image to the same coordinates according to the image transformation matrix; The visible light image and the infrared image at the same coordinates are fused to obtain the target image.
在一实施例中,处理器在实现根据至少一张目标图像的重叠区域,基于预设 的图像拼接算法,对目标图像进行拼接,得到全局目标图像时,用于实现:重叠区域包括第一重叠子区域和第二重叠子区域,针对第一重叠子区域确定第一拼接数列,针对第二重叠子区域确定第二拼接数列;根据第一拼接数列确定第一重叠子区域的第一拼接权重,根据第二拼接数列确定第二重叠子区域的第二拼接权重;根据第一拼接权重对第一子重叠区域进行处理,根据第二拼接权重对第二重叠子区域进行处理,得到全局目标图像。In one embodiment, the processor implements the preset based on the overlapping area of at least one target image. The image splicing algorithm is used to splice the target image to obtain the global target image: the overlapping area includes the first overlapping sub-area and the second overlapping sub-area, the first splicing sequence is determined for the first overlapping sub-area, and the first splicing sequence is determined for the first overlapping sub-area. The second overlapping sub-region determines the second splicing sequence; the first splicing weight of the first overlapping sub-region is determined according to the first splicing sequence, and the second splicing weight of the second overlapping sub-region is determined according to the second splicing sequence; the first splicing weight is determined according to the first splicing weight. The first sub-overlapping area is processed, and the second overlapping sub-area is processed according to the second splicing weight to obtain the global target image.
在一实施例中,处理器在实现图像融合方法时,还用于实现:基于目标对象中预设的标记区域设置标记对象,标记区域之间的相交角度为预设角度。In one embodiment, when implementing the image fusion method, the processor is also configured to: set a marking object based on a preset marking area in the target object, and the intersection angle between the marking areas is a preset angle.
需要说明的是,所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的图像融合装置的具体工作过程,可以参考前述图像融合方法实施例中的对应过程,在此不再赘述。It should be noted that those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the image fusion device described above can be referred to the corresponding process in the foregoing image fusion method embodiment, and will not be described here. Again.
本公开实施例还提供一种存储介质,用于计算机可读存储,存储介质存储有一个或者多个程序,一个或者多个程序可被一个或者多个处理器执行,以实现如本公开实施例提供的任一项图像融合方法的步骤。Embodiments of the present disclosure also provide a storage medium for computer-readable storage. The storage medium stores one or more programs. The one or more programs can be executed by one or more processors to implement the embodiments of the present disclosure. Provides steps for any of the image fusion methods.
其中,存储介质可以是前述实施例图像融合装置的内部存储单元,例如图像融合装置的硬盘或内存。存储介质也可以是图像融合装置的外部存储设备,例如图像融合装置上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。The storage medium may be an internal storage unit of the image fusion device in the aforementioned embodiment, such as a hard disk or memory of the image fusion device. The storage medium can also be an external storage device of the image fusion device, such as a plug-in hard disk, smart memory card (Smart Media Card, SMC), secure digital (SD) card, flash memory card (Flash) equipped on the image fusion device. Card) etc.
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机 存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。Those of ordinary skill in the art can understand that all or some steps, systems, and functional modules/units in the devices disclosed above can be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may consist of several physical components. Components execute cooperatively. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit . Such software may be distributed on computer-readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). As is known to those of ordinary skill in the art, the term computer storage media includes volatile and nonvolatile media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. removable, removable and non-removable media. computer Storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, Digital Versatile Disk (DVD) or other optical disk storage, magnetic cassettes, tapes, disk storage or other magnetic storage devices, or may be used Any other medium that stores the desired information and can be accessed by a computer. Additionally, it is known to those of ordinary skill in the art that communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media .
本公开实施例提供一种图像融合方法、装置及存储介质,获取目标对象的可见光图像,目标对象设置有预设的标记对象;获取目标对象的红外图像;基于预设的特征提取算法,确定红外图像中标记对象对应的第一位置;基于预设的目标匹配算法,确定可见光图像中标记对象对应的第二位置;根据第一位置和第二位置,基于预设的图像融合算法,对可见光图像和红外图像进行融合,得到目标图像。本公开实施例降低了可见光图像与红外图像融合的复杂度,本公开还提供了对目标图像进行拼接得到全局目标图像的方案,使该方法适用于面积更广阔的目标对象,应用场景也更加多样化,提高了使用场景的多样性,能够适应不同类型的目标对象。Embodiments of the present disclosure provide an image fusion method, device and storage medium to obtain a visible light image of a target object, where the target object is set with a preset marker object; obtain an infrared image of the target object; and determine the infrared image based on a preset feature extraction algorithm. The first position corresponding to the marked object in the image; based on the preset target matching algorithm, determine the second position corresponding to the marked object in the visible light image; based on the first position and the second position, based on the preset image fusion algorithm, determine the visible light image Fusion with infrared images to obtain the target image. The embodiments of the present disclosure reduce the complexity of the fusion of visible light images and infrared images. The present disclosure also provides a solution for splicing target images to obtain a global target image, making this method suitable for target objects with a wider area and more diverse application scenarios. ization, which improves the diversity of usage scenarios and can adapt to different types of target objects.
上述本公开实施例序号仅仅为了描述,不代表实施例的优劣。以上,仅为本公开的具体实施方式,但本公开的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应以权利要求的保护范围为准。 The above serial numbers of the embodiments of the present disclosure are only for description and do not represent the advantages and disadvantages of the embodiments. The above are only specific embodiments of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person familiar with the technical field can easily think of various equivalent modifications or modifications within the technical scope disclosed in the present disclosure. Substitutions, these modifications or substitutions should be covered by the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.

Claims (12)

  1. 一种图像融合方法,包括:An image fusion method including:
    获取目标对象的可见光图像,所述目标对象设置有预设的标记对象;Obtaining a visible light image of a target object, where the target object is set with a preset marking object;
    获取所述目标对象的红外图像;Obtain an infrared image of the target object;
    基于预设的特征提取算法,确定所述红外图像中所述标记对象对应的第一位置;Based on a preset feature extraction algorithm, determine the first position corresponding to the marked object in the infrared image;
    基于预设的目标匹配算法,确定所述可见光图像中所述标记对象对应的第二位置;Based on a preset target matching algorithm, determine the second position corresponding to the marked object in the visible light image;
    根据所述第一位置和所述第二位置,基于预设的图像融合算法,对所述可见光图像和所述红外图像进行融合,得到目标图像。According to the first position and the second position, the visible light image and the infrared image are fused based on a preset image fusion algorithm to obtain a target image.
  2. 根据权利要求1所述的图像融合方法,其中,所述获取所述目标对象的红外图像,包括:The image fusion method according to claim 1, wherein said obtaining the infrared image of the target object includes:
    获取所述目标对象的原始红外图像;Obtain the original infrared image of the target object;
    基于预设的畸变校正算法,对所述原始红外图像进行畸变校正,得到所述红外图像。Based on a preset distortion correction algorithm, distortion correction is performed on the original infrared image to obtain the infrared image.
  3. 根据权利要求2所述的图像融合方法,其中,所述基于预设的畸变校正算法,对所述原始红外图像进行畸变校正,得到所述红外图像,包括:The image fusion method according to claim 2, wherein the distortion correction is performed on the original infrared image based on a preset distortion correction algorithm to obtain the infrared image, including:
    将所述原始红外图像投影到归一化平面,得到归一化平面上的原始红外图像;Project the original infrared image onto the normalized plane to obtain the original infrared image on the normalized plane;
    基于预设的径向畸变系数和预设的切向畸变系数,对所述归一化平面上的原始红外图像进行径向畸变校正和切向畸变校正,得到所述归一化平面上的红外图像;Based on the preset radial distortion coefficient and the preset tangential distortion coefficient, radial distortion correction and tangential distortion correction are performed on the original infrared image on the normalized plane to obtain the infrared image on the normalized plane. image;
    将所述归一化平面上的红外图像投影到像素平面,得到所述红外图像。The infrared image on the normalized plane is projected onto the pixel plane to obtain the infrared image.
  4. 根据权利要求1所述的图像融合方法,其中,所述基于预设的特征提取算法,确定所述红外图像中所述标记对象对应的第一位置,包括:The image fusion method according to claim 1, wherein the determining the first position corresponding to the marked object in the infrared image based on a preset feature extraction algorithm includes:
    获取所述红外图像的亮度通道图像,基于预设的亮度阈值,确定所述红外图像中的亮度区域位置; Obtain the brightness channel image of the infrared image, and determine the position of the brightness area in the infrared image based on a preset brightness threshold;
    对所述亮度区域位置进行拟合,确定所述红外图像中所述标记对象对应的第一位置。The brightness area position is fitted to determine the first position corresponding to the marked object in the infrared image.
  5. 根据权利要求4所述的图像融合方法,其中,所述基于预设的亮度阈值,确定所述红外图像中的亮度区域位置,包括:The image fusion method according to claim 4, wherein determining the brightness area position in the infrared image based on a preset brightness threshold includes:
    基于预设的亮度阈值,对所述亮度通道图像的像素点进行二值化;Binarize the pixels of the brightness channel image based on a preset brightness threshold;
    根据所述像素点的二值化结果,确定所述红外图像中的亮度区域位置。According to the binarization result of the pixel point, the position of the brightness area in the infrared image is determined.
  6. 根据权利要求1所述的图像融合方法,其中,所述基于预设的目标匹配算法,确定所述可见光图像中所述标记对象对应的第二位置,包括:The image fusion method according to claim 1, wherein the determining the second position corresponding to the marked object in the visible light image based on a preset target matching algorithm includes:
    基于预设的目标匹配度算法,确定预设的标记对象模板图像与所述可见光图像中多个区域的目标匹配度;Based on a preset target matching algorithm, determine the target matching degree between the preset marked object template image and multiple areas in the visible light image;
    根据所述多个区域的目标匹配度,确定所述可见光图像中的目标区域位置;Determine the position of the target area in the visible light image according to the target matching degree of the multiple areas;
    对所述目标区域位置进行拟合,确定所述可见光图像中所述标记对象对应的第二位置。The position of the target area is fitted to determine the second position corresponding to the marked object in the visible light image.
  7. 根据权利要求1所述的图像融合方法,其中,所述根据所述第一位置和所述第二位置,基于预设的图像融合算法,对所述可见光图像和所述红外图像进行融合,得到目标图像,包括:The image fusion method according to claim 1, wherein the visible light image and the infrared image are fused based on a preset image fusion algorithm according to the first position and the second position to obtain Target images, including:
    根据所述第一位置和所述第二位置,确定图像变换矩阵;Determine an image transformation matrix according to the first position and the second position;
    根据所述图像变换矩阵,将所述红外图像与所述可见光图像变换到同一坐标;According to the image transformation matrix, transform the infrared image and the visible light image to the same coordinates;
    对同一坐标下的可见光图像和红外图像进行融合,得到所述目标图像。The visible light image and the infrared image at the same coordinates are fused to obtain the target image.
  8. 根据权利要求1所述的图像融合方法,其中,所述图像融合方法还包括:The image fusion method according to claim 1, wherein the image fusion method further includes:
    获取至少一张所述目标图像;Obtain at least one target image;
    根据至少一张所述目标图像的重叠区域,基于预设的图像拼接算法,对所述目标图像进行拼接,得到全局目标图像。According to the overlapping area of at least one of the target images, the target images are spliced based on a preset image splicing algorithm to obtain a global target image.
  9. 根据权利要求8所述的图像融合方法,其中,所述根据至少一张所述目标图像的重叠区域,基于预设的图像拼接算法,对所述目标图像进行拼接,得到全局目标图像,包括: The image fusion method according to claim 8, wherein the target images are spliced based on the overlapping area of at least one of the target images and based on a preset image splicing algorithm to obtain a global target image, including:
    所述重叠区域包括第一重叠子区域和第二重叠子区域,针对所述第一重叠子区域确定第一拼接数列,针对所述第二重叠子区域确定第二拼接数列;The overlapping region includes a first overlapping sub-region and a second overlapping sub-region, a first splicing sequence is determined for the first overlapping sub-region, and a second splicing sequence is determined for the second overlapping sub-region;
    根据所述第一拼接数列确定所述第一重叠子区域的第一拼接权重,根据所述第二拼接数列确定所述第二重叠子区域的第二拼接权重;Determine the first splicing weight of the first overlapping sub-region according to the first splicing sequence, and determine the second splicing weight of the second overlapping sub-region according to the second splicing sequence;
    根据所述第一拼接权重对所述第一子重叠区域进行处理,根据所述第二拼接权重对所述第二重叠子区域进行处理,得到所述全局目标图像。The first sub-overlapping region is processed according to the first splicing weight, and the second overlapping sub-region is processed according to the second splicing weight to obtain the global target image.
  10. 权利要求1-9任一项所述的图像融合方法,其中,所述预设的标记对象包括多个,且多个所述标记对象在至少两个方向上排布,所述至少两个方向相交。The image fusion method according to any one of claims 1 to 9, wherein the preset marking objects include a plurality of marking objects, and the plurality of marking objects are arranged in at least two directions, and the at least two directions intersect.
  11. 一种图像融合装置,包括处理器、存储器、存储在所述存储器上并可被所述处理器执行的计算机程序以及用于实现所述处理器和所述存储器之间的连接通信的数据总线,其中所述计算机程序被所述处理器执行时,实现如权利要求1至10中任一项所述的图像融合方法的步骤。An image fusion device, including a processor, a memory, a computer program stored on the memory and executable by the processor, and a data bus for realizing connection communication between the processor and the memory, When the computer program is executed by the processor, the steps of the image fusion method according to any one of claims 1 to 10 are implemented.
  12. 一种存储介质,用于计算机可读存储,所述存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现权利要求1至10中任一项所述的图像融合方法的步骤。 A storage medium for computer-readable storage, the storage medium stores one or more programs, the one or more programs can be executed by one or more processors to implement any of claims 1 to 10 One step of the image fusion method.
PCT/CN2023/103334 2022-06-28 2023-06-28 Image fusion method and apparatus, and storage medium WO2024002186A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210742455.5A CN117350919A (en) 2022-06-28 2022-06-28 Image fusion method, device and storage medium
CN202210742455.5 2022-06-28

Publications (1)

Publication Number Publication Date
WO2024002186A1 true WO2024002186A1 (en) 2024-01-04

Family

ID=89359988

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/103334 WO2024002186A1 (en) 2022-06-28 2023-06-28 Image fusion method and apparatus, and storage medium

Country Status (2)

Country Link
CN (1) CN117350919A (en)
WO (1) WO2024002186A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117745537A (en) * 2024-02-21 2024-03-22 微牌科技(浙江)有限公司 Tunnel equipment temperature detection method, device, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109063701A (en) * 2018-08-08 2018-12-21 合肥英睿系统技术有限公司 Labeling method, device, equipment and the storage medium of target in a kind of infrared image
CN111738970A (en) * 2020-06-19 2020-10-02 无锡英菲感知技术有限公司 Image fusion method and device and computer readable storage medium
CN112258579A (en) * 2020-11-12 2021-01-22 Oppo广东移动通信有限公司 Image processing method, image processing device, electronic equipment and computer readable storage medium
US20220138912A1 (en) * 2020-01-20 2022-05-05 Tencent Technology (Shenzhen) Company Limited Image dehazing method, apparatus, and device, and computer storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109063701A (en) * 2018-08-08 2018-12-21 合肥英睿系统技术有限公司 Labeling method, device, equipment and the storage medium of target in a kind of infrared image
US20220138912A1 (en) * 2020-01-20 2022-05-05 Tencent Technology (Shenzhen) Company Limited Image dehazing method, apparatus, and device, and computer storage medium
CN111738970A (en) * 2020-06-19 2020-10-02 无锡英菲感知技术有限公司 Image fusion method and device and computer readable storage medium
CN112258579A (en) * 2020-11-12 2021-01-22 Oppo广东移动通信有限公司 Image processing method, image processing device, electronic equipment and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
GUI-WEN REN: "Study of Lnfrared and Visible Light Dual Camera Calibration Method Based on Open CV ", SCIENCE TECHNOLOGY AND ENGINEERING, vol. 16, no. 3, 28 January 2016 (2016-01-28), pages 211 - 214, XP093119307 *

Also Published As

Publication number Publication date
CN117350919A (en) 2024-01-05

Similar Documents

Publication Publication Date Title
US20210366124A1 (en) Graphical fiducial marker identification
WO2019105262A1 (en) Background blur processing method, apparatus, and device
WO2020259271A1 (en) Image distortion correction method and apparatus
WO2022100242A1 (en) Image processing method and apparatus, electronic device, and computer-readable storage medium
CN109479082B (en) Image processing method and apparatus
US10872436B2 (en) Spatial positioning method, spatial positioning device, spatial positioning system and computer readable storage medium
WO2020252920A1 (en) Picture correction method and apparatus, computer device and computer-readable storage medium
US11282232B2 (en) Camera calibration using depth data
WO2022095596A1 (en) Image alignment method, image alignment apparatus and terminal device
WO2022170844A1 (en) Video annotation method, apparatus and device, and computer readable storage medium
WO2022143283A1 (en) Camera calibration method and apparatus, and computer device and storage medium
KR102383129B1 (en) Method for correcting image based on category and recognition rate of objects included image and electronic device for the same
WO2017088637A1 (en) Method and apparatus for locating image edge in natural background
WO2024002186A1 (en) Image fusion method and apparatus, and storage medium
CN111368717A (en) Sight line determining method and device, electronic equipment and computer readable storage medium
WO2020024576A1 (en) Camera calibration method and apparatus, electronic device, and computer-readable storage medium
CN112233189B (en) Multi-depth camera external parameter calibration method and device and storage medium
CN106845508A (en) The methods, devices and systems of release in a kind of detection image
CN112470192A (en) Dual-camera calibration method, electronic device and computer-readable storage medium
CN112507767B (en) Face recognition method and related computer system
US20210375000A1 (en) Systems and Methods for Image Capture Calibration
CN109785390B (en) Method and device for image correction
US9122935B2 (en) Object detection method, storage medium, integrated circuit, and object detection apparatus
CN109785225B (en) Method and device for correcting image
CN111353945A (en) Fisheye image correction method, fisheye image correction device and storage medium

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

Country of ref document: EP

Kind code of ref document: A1