Scene monitoring near-infrared image colorization processing method
Patent Information
- Application Number
- CN202310551356.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-17
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-05-17
AI Technical Summary
[0004]本发明所要解决的技术问题是:提供一种场景监控的近红外图像彩色化处理方法用于解决市面上的商业监控相机为了能够实现在夜间拍摄到彩色图像,通过增加照明的方式来提高环境亮度,浪费电能、影响人们的正常生活;通过提高硬件配置,价格较高且在无光环境下仍是呈现黑白图像等技术问题
[0056]本发明采用Gabor滤波器组分别对可见光彩色图像和近红外灰度图像提取纹理特征;将纹理特征与亮度信息构成特征向量,采用K-Means聚类对像素打上类别标签;再分别将可见光彩色图像和近红外灰度图像横向和纵向等分成N个子区域,针对可见光彩色图像构建“区域-类别-纹理-亮度-颜色”特征查找表,针对近红外灰度图像构建“区域-类别-纹理-亮度”特征查找表。根据区域位置和类别标签的约束条件,计算可见光彩色图像与近红外灰度图像的“纹理-亮度”特征的余弦相似度,依据相似度最大原则找到颜色映射关系。最后根据映射关系给对应近红外灰度图像子区域进行颜色赋值,对于匹配不上的根据类别标签的所属关系进行颜色传播即可得到彩色近红外监控图像。本发明以白天的可见光彩色图像作为参考,实现夜间监控图像彩色化,使夜间监控图像更加符合人眼视觉感受,进而增值了监控相机功能。制作成本低,还相应克服了背景技术中增加照明浪费电能、影响正常生活以及提高硬件配置的监控在无光环境下仍呈现黑白图像的缺陷。
Smart Images

Figure CN116614715B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of digital image processing technology, and in particular relates to a method for colorizing near-infrared images for scene monitoring. Background Technology
[0002] In recent years, surveillance cameras have been widely used in the security field. Commercial surveillance cameras on the market are typically based on silicon sensors. This type of camera is sensitive to light wavelengths of approximately 400nm to 1000nm, a band encompassing visible and near-infrared light. Therefore, it can capture color images during the day and obtain black-and-white images at night or in low-light conditions. To achieve color image capture at night, commercial cameras generally increase ambient brightness by adding lighting; however, this wastes energy and can disrupt daily life. Another approach is to improve hardware configuration to produce color images in low-light or dimly lit environments, but this method is more expensive and still produces black-and-white images in complete darkness.
[0003] Therefore, there is an urgent need for a new technical solution to address this problem. Summary of the Invention
[0004] The technical problem to be solved by this invention is to provide a near-infrared image colorization processing method for scene monitoring to solve the technical problems of commercial surveillance cameras on the market that, in order to achieve color images at night, they increase ambient brightness by adding lighting, which wastes electricity and affects people's normal life; and that by improving hardware configuration, the price is high and the images are still presented in black and white in the dark.
[0005] A method for colorizing near-infrared images in scene monitoring includes the following steps, which are performed sequentially:
[0006] Step 1: Feature Calculation
[0007] Acquire the texture features and corresponding category labels of visible light color images and near-infrared grayscale images in the monitoring scene;
[0008] Step 2: Construct a feature lookup table
[0009] A feature lookup table of "region-category-texture-brightness-color" is constructed for daytime visible light color images, and a feature lookup table of "region-category-texture-brightness" is constructed for nighttime near-infrared grayscale images;
[0010] Step 3: Feature Matching
[0011] Establish a matching relationship between near-infrared grayscale images and visible light color images under set constraints;
[0012] Step 4: Colorization of Near-Infrared Grayscale Image
[0013] Color values are assigned to near-infrared grayscale images based on matching relationships. For areas in the near-infrared grayscale images that do not match, color propagation is performed before color assignment, thus obtaining a colorized near-infrared grayscale image.
[0014] The method for obtaining the texture features and corresponding category labels of the visible light color image and near-infrared grayscale image in step one is as follows:
[0015] S101. For visible light color images:
[0016] 1) Calculate texture features of visible light color images using Gabor filter banks.
[0017] Convert the RGB color space of a visible light color image to the Lab color space, where the L channel represents the grayscale value of the visible light color image. Texture features are characterized using a Gabor filter bank G with c scales and d directions. extract:
[0018]
[0019] 2) Texture features With grayscale value These features are considered as pixels, forming the feature vector corresponding to each pixel. That is, the "texture-luminosity" feature vector;
[0020] 3) K-Means clustering is applied to the "texture-luminance" feature vector to classify each pixel into K categories, resulting in a corresponding category label map. The masks for each category label are as follows: k represents the k-th category;
[0021] S102. For near-infrared grayscale images:
[0022] 1) The texture features of the near-infrared grayscale image are obtained by calculating the Gabor filter bank G.
[0023]
[0024] 2) Texture features With grayscale value These features are considered as pixels, forming the feature vector corresponding to each pixel. That is, the "texture-luminosity" feature vector;
[0025] 3) K-Means clustering is applied to the "texture-luminance" feature vector to classify each pixel into K categories, and each pixel is labeled with a category label. The masks for each category label are as follows:
[0026] The specific method for constructing the feature lookup table in step two is as follows:
[0027] S201. Divide both the visible light color image and the near-infrared grayscale image into N equal square sub-regions along both the horizontal and vertical axes. For the near-infrared grayscale image, obtain the region features of all pixels in each square sub-region. And used as the center coordinates of the corresponding square sub-region, for a visible light color image, the regional features of the square sub-region are obtained as follows: in This represents the x-coordinate of the center point of a square sub-region in a near-infrared grayscale image. This represents the ordinate of the center point of a square sub-region in a near-infrared grayscale image. This represents the x-coordinate of the center point of a square sub-region in a visible light color image. The ordinate of the center point of a square sub-region in a visible light color image;
[0028] S202. Establish the feature lookup table Lut for near-infrared grayscale images. NIR In the feature lookup table of the near-infrared grayscale image, each row corresponds to the feature of a sub-region, and the first item of each row is the regional feature of a sub-region. The second item is the category mask to which this sub-region belongs. The third term is the mean of the texture features of this sub-region. The fourth item is the average brightness of this sub-region.
[0029] Therefore, the features of each sub-region are represented as follows:
[0030]
[0031] By concatenating the features of all sub-regions, a feature lookup table for the near-infrared grayscale image is constructed:
[0032]
[0033] S203. Establish a feature lookup table (Lut) for visible light color images. RGB In the feature lookup table for visible color images, the first item in each row is the region feature of a sub-region. The second item is the category mask to which this sub-region belongs. The third term is the mean of the texture features of this sub-region. The fourth characteristic is the brightness feature, which is the average brightness of the L channel in this sub-region. The fifth item indicates that the color feature is determined by the average color values of the a and b channels in the sub-region. express:
[0034]
[0035] Among them, a avg The color mean of channel a; b avg is the color mean of the b channel; S is the number of pixels in the sub-region, and W and H are the width and height of the image; a(x,y) represents the width and height of the image. The value of channel a in the region; b(x,y) represents the value of channel a in the region. The value of the b channel in the region; x, y are the horizontal and vertical coordinates of the pixels; Let m be the m-th sub-region of a visible light color image, where m = 0, 1, ..., N-1. The feature representation of each sub-region is as follows:
[0036]
[0037] This constitutes a feature lookup table for visible light color images:
[0038]
[0039] The specific steps of feature matching in step three are as follows:
[0040] S301. Apply constraints based on positional characteristics: α is the maximum search distance used to constrain the matching range, while also imposing constraints based on the category label: all sub-regions within the search range must belong to the same category label;
[0041] S302. Under these two constraints, traverse the feature lookup tables of the visible light color image and the near-infrared grayscale image, and calculate the cosine similarity S between the two images based on their "texture-brightness" features. n,m And establish a mapping relationship;
[0042]
[0043] Where F A F represents the "texture-luminance" feature of the nth sub-region in a near-infrared grayscale image. B The texture-luminance feature of the m-th sub-region in a visible light color image;
[0044] S303. When the cosine similarity is greater than the threshold β, the two sub-regions are determined to be similar; when there are multiple sub-regions whose cosine similarity is greater than the threshold, the sub-region with the highest similarity is selected to establish a mapping relationship.
[0045]
[0046] The specific steps for colorizing the near-infrared grayscale image in step four are as follows:
[0047] S401. When f(n) = m, if the "texture-brightness" feature of the sub-region of the visible light color image matches the "texture-brightness" feature of the sub-region of the near-infrared grayscale image, then the color of the "texture-brightness" feature of the sub-region of the visible light color image is assigned to the sub-region of the near-infrared grayscale image. The specific color assignment method is as follows:
[0048] Based on the mapping relationship f(n), the color features of the visible light color image are assigned to the a and b channels of the near-infrared grayscale image:
[0049]
[0050]
[0051] Where (x,y) are the coordinates of the nth sub-region in the near-infrared grayscale image, and (p,q) are the coordinates of the mth sub-region in the visible light color image;
[0052] S402. When f(n) = Nan, if the "texture-brightness" features of the sub-regions of the visible light color image do not match the "texture-brightness" features of the sub-regions of the near-infrared grayscale image, then color propagation is performed. The specific method of color propagation is as follows:
[0053] Based on the feature lookup table for near-infrared grayscale images, look up the second item for the category feature. Find the sub-regions in the near-infrared grayscale image that are the same as category k and assign their "texture-brightness" feature color to the sub-regions in the non-matching near-infrared grayscale image.
[0054] S403 converts the Lab color space of near-infrared grayscale images to the RGB color space, enabling the colorization of near-infrared grayscale images in monitoring scenarios.
[0055] Through the above design scheme, the present invention can bring the following beneficial effects:
[0056] This invention employs a Gabor filter bank to extract texture features from visible light color images and near-infrared grayscale images, respectively. Texture features and brightness information are combined to form feature vectors, and K-Means clustering is used to assign category labels to pixels. The visible light color image and near-infrared grayscale image are then divided into N equal sub-regions horizontally and vertically. A "region-category-texture-brightness-color" feature lookup table is constructed for both the visible light color image and the near-infrared grayscale image. Based on the constraints of region location and category labels, the cosine similarity of the "texture-brightness" features between the visible light color image and the near-infrared grayscale image is calculated, and a color mapping relationship is found based on the principle of maximizing similarity. Finally, color values are assigned to the corresponding near-infrared grayscale image sub-regions according to the mapping relationship. For those that do not match, color propagation is performed based on the category label relationship to obtain a color near-infrared surveillance image. This invention uses daytime visible light color images as a reference to achieve colorization of nighttime surveillance images, making them more visually appealing to the human eye and thus enhancing the functionality of surveillance cameras. It has low production costs and overcomes the shortcomings of previous technologies, such as wasting electricity by adding lighting, affecting normal life, and still displaying black and white images in the absence of light when the hardware configuration is improved. Attached Figure Description
[0057] The present invention will be further described below with reference to the accompanying drawings and specific embodiments:
[0058] Figure 1 This is a flowchart of the near-infrared image colorization processing method for scene monitoring according to the present invention. Detailed Implementation
[0059] The technical solutions of the present invention will be further described below with reference to the accompanying drawings of the embodiments. These embodiments are merely some, not all, of the present invention. Other embodiments obtained based on the embodiments of the present invention without innovative work are all within the protection scope of the present invention.
[0060] The embodiments of the present invention relate to a method for colorizing near-infrared grayscale images for scene monitoring, such as... Figure 1 As shown, it includes the following steps:
[0061] Step 1: Image Acquisition
[0062] The system collects daytime visible light color images and nighttime near-infrared grayscale images captured by fixed surveillance cameras. Both the visible light color images and the near-infrared grayscale images belong to similar scenes.
[0063] Step 2: Preprocessing
[0064] Preprocessing is performed on the visible light color image and the near-infrared grayscale image respectively. The visible light color image is converted from the RGB color space to the Lab color space. The brightness of the near-infrared grayscale image is remapped according to the brightness of the visible light color image, and the remapping formula is shown in equation (1):
[0065]
[0066] Among them, L NIR This represents the grayscale value of the near-infrared grayscale image after brightness remapping. This represents the grayscale value of each pixel in the near-infrared grayscale image before remapping. The standard deviation of a near-infrared grayscale image is represented by... The standard deviation of a visible light color image is represented by... This represents the mean value of a near-infrared grayscale image. This represents the mean of the visible light color image. Preprocessing yields an image with clear texture details and a consistent brightness range, preparing it for subsequent feature calculations and lookup table construction.
[0067] Step 3: Feature Calculation
[0068] 3.1 Constructing the Filter
[0069] By extracting texture features and combining them with brightness information to construct feature vectors, pixel-level classification of different target categories can be achieved, since similar categories of targets have similar texture features and brightness, while different categories of targets differ. The specific steps are as follows:
[0070] First, construct a Gabor filter bank with c scales and d directions:
[0071]
[0072] In a filter bank consisting of c*d Gabor filters, one of them has a scale of c. i 、There is d j The complex representation of a Gabor filter in each direction is:
[0073]
[0074] wavelength direction Phase offset ψ = 0, standard deviation σ i =0.56λ i The aspect ratio γ = 0.5, x′ j =xcosθ j +ysinθ j y′ j =-xsinθ j +ycosθj .
[0075] 3.2 Calculating features for visible light color images:
[0076] (1) Convert the RGB color space of the visible light color image to the Lab color space, where the L channel represents the grayscale value of the visible light color image. Texture features were extracted using a Gabor filter bank G with c scales and d directions. As shown in equation (4). The longer the wavelength, the larger the receptive field of the Gabor filter, and the coarser the texture features that can be extracted. The more directions, the more directions of texture can be extracted. Using a multi-scale, multi-directional Gabor filter bank can adapt well to target features of various sizes and directions.
[0077]
[0078] in, It is length and width Feature maps of the same c*d dimensions.
[0079] (2) Texture features With grayscale value These features are considered as pixels, forming the feature vector corresponding to each pixel. This refers to "texture-luminosity". The specific method involves analyzing the texture feature map... With grayscale value The feature map is obtained by concatenating the features along the channel direction, resulting in a c*d+1 dimensional feature map. This feature map is then used as the feature vector corresponding to each pixel to facilitate subsequent classification.
[0080] (3) For the eigenvector K-Means clustering is used to classify each pixel into K categories, and the number of pixels in each category is counted. Based on the number of pixels, pixels are reclassified into 0 to K-1 categories from highest to lowest. The segmentation mask for each category is as follows:
[0081] 3.3 Calculating features for near-infrared grayscale images:
[0082] (1) The texture features of the near-infrared grayscale image are calculated using the Gabor filter bank G.
[0083]
[0084] (2) Texture features With grayscale value These features are considered as pixels, forming the feature vector corresponding to each pixel. That is, "texture-brightness".
[0085] (3) K-Means clustering was applied to the "texture-brightness" feature vectors, and the number of pixels in each category was counted. Based on the number of pixels, the data was reclassified into 0 to K-1 categories from high to low, resulting in the mask for the near-infrared grayscale image.
[0086] Step 4: Construct the lookup table
[0087] Using a lookup table construction method, a "region-category-texture-brightness-color" feature lookup table is constructed for daytime visible light color images, and a "region-category-texture-brightness" feature lookup table is constructed for nighttime near-infrared grayscale images. The specific steps are as follows;
[0088] 4.1 Divide the area
[0089] Both the visible light color image and the near-infrared grayscale image are divided into N square sub-regions. While classification based on texture features and brightness can distinguish between different categories of targets, it is difficult to differentiate between different objects within the same category. These objects not only have different colors but are also often distributed in different locations within the image. Therefore, the image is divided into N equal sub-regions along both the horizontal and vertical axes. For the near-infrared grayscale image, the region features of all pixels in each sub-region are then analyzed. These are the center coordinates of the square sub-region. For a visible light color image, the regional features of the square sub-region are obtained as follows: in This represents the x-coordinate of the center point of a square sub-region in a near-infrared grayscale image. This represents the ordinate of the center point of a square sub-region in a near-infrared grayscale image. This represents the x-coordinate of the center point of a square sub-region in a visible light color image. The ordinate represents the center point of a square sub-region in a visible light color image.
[0090] 4.2 Establishing a feature lookup table (Lut) for near-infrared grayscale images NIR
[0091] Each row in the feature lookup table of a near-infrared grayscale image represents the feature of each sub-region, with the first item in each row being the region feature. The second item is the category mask to which this sub-region belongs. The third term is the mean of the texture features of this sub-region. The fourth item is the average brightness of this sub-region.
[0092] The features of each sub-region of the near-infrared grayscale image are calculated as shown in equations (6) and (7). Then the features of the nth sub-region can be established as shown in equation (8).
[0093]
[0094]
[0095]
[0096] Where x and y are the horizontal and vertical coordinates of the pixel; S represents the nth sub-region of the near-infrared grayscale image, where n = 0, 1, ..., N-1; and S is the number of pixels in the sub-region. W and H are the width and height of the image, respectively; This is the value of the near-infrared grayscale image after Gabor filtering; The L channel value of the near-infrared grayscale image;
[0097] By concatenating the features of all sub-regions, a feature lookup table for the near-infrared grayscale image can be constructed, as shown in equation (9).
[0098]
[0099] 4.3 Establishing a feature lookup table (Lut) for visible light color images RGB
[0100] The first item in each row of the feature lookup table for visible color images is the region feature. The second item is the category mask to which this sub-region belongs. The third term is the mean of the texture features of this sub-region. The fourth luminance characteristic is the mean value of the L-pass in the sub-region. The fifth color feature is the mean of channel a and channel b in the sub-region.
[0101] For visible light color images, the feature calculations for each sub-region are as follows: (10), (11), (12):
[0102]
[0103]
[0104]
[0105] in, Let m be the m-th sub-region of the visible light color image, where m = 0, 1, ..., N-1. The characteristics of each sub-region can be represented as:
[0106]
[0107] This allows us to construct a feature lookup table for visible light color images:
[0108]
[0109] Step 5: Feature Matching
[0110] Due to the unique fixed installation method of surveillance cameras, the monitoring scenes during the day and night are basically the same or similar. Therefore, the sub-region features of the near-infrared grayscale image can be matched with similar features in the corresponding sub-regions or adjacent regions of the visible light color image during the day. The steps are as follows:
[0111] In practice, it is necessary to traverse the feature lookup tables for visible light color images and near-infrared grayscale images. Due to the special nature of monitoring, constraints need to be applied based on location features.
[0112]
[0113] in, This represents the position of the nth sub-region of the near-infrared grayscale image. Let α be the location of the m-th sub-region of the visible light color image, and let α be the maximum search distance used to constrain the matching range.
[0114] Simultaneously, constraints are imposed based on category labels, meaning that all sub-regions within the search range must belong to the same category label. in Let n be the category of the nth sub-region of the near-infrared grayscale image. Let m be the category of the m-th sub-region of the visible light color image.
[0115] Under the above constraints, the feature lookup tables of visible light color images and near-infrared grayscale images are traversed. The cosine similarity between the two images is calculated based on their "texture-brightness" features as a similarity measure. The cosine similarity formula is given in equation (16), where F... A F represents the feature of the nth sub-region in a near-infrared grayscale image. B Let m be the feature of the m-th sub-region in the visible light color image.
[0116]
[0117]
[0118]
[0119] These represent the texture and brightness features of the nth sub-region in the near-infrared grayscale image, respectively. These represent the texture and brightness features of the m-th sub-region in a visible light color image, respectively.
[0120] If the cosine similarity is greater than the threshold β, the two sub-regions are considered similar. If there are multiple sub-regions with a similarity greater than the threshold, then the one with the largest similarity is selected to establish the mapping relationship f(n), as shown in equation (19).
[0121]
[0122] Step Six: Colorization of Near-Infrared Grayscale Image
[0123] 6.1 If a match is found, i.e., f(n) = m, then the color is assigned:
[0124] The single-channel near-infrared grayscale image is expanded into three channels: L, a, and b. Then, according to the mapping relationship, the color features of the visible light color image are assigned to the a and b channels of the near-infrared grayscale image, as shown in equations (20) and (21).
[0125]
[0126]
[0127] Where (x,y) are the coordinates of the nth sub-region in the near-infrared grayscale image, and (p,q) are the coordinates of the mth sub-region in the visible light color image.
[0128] 6.2 If no match is found, i.e., when f(n) = Nan, then color propagation...
[0129] Based on the category characteristics of the second item in the lookup table Find the sub-regions with the same category k in the near-infrared grayscale image after color assignment, and assign color according to equation (22).
[0130]
[0131] in, Indicates the category of the undyed sub-region. This indicates the category of the sub-region in the near-infrared grayscale image after color assignment.
[0132] 6.3 Color Space Conversion
[0133] Convert the Lab color space of near-infrared grayscale images to the RGB color space to achieve colorization of near-infrared grayscale images for monitoring.
Claims
1. A method for colorizing near-infrared images in scene monitoring, characterized by: The steps include the following steps, and the following steps are performed in sequence: Step 1: Feature Calculation Acquire the texture features and corresponding category labels of visible light color images and near-infrared grayscale images in the monitoring scene; Step 2: Construct a feature lookup table Construct a "region-category-texture-brightness-color" feature lookup table for daytime visible light color images, and construct a "region-category-texture-brightness" feature lookup table for nighttime near-infrared grayscale images; Step 3: Feature Matching Establish a matching relationship between near-infrared grayscale images and visible light color images under set constraints; Step 4: Colorization of Near-Infrared Grayscale Image Color values are assigned to the near-infrared grayscale image based on the matching relationship. For areas in the near-infrared grayscale image that cannot be matched, color propagation is performed before color assignment, thus obtaining a colorized near-infrared grayscale image. The method for obtaining the texture features and corresponding category labels of the visible light color image and near-infrared grayscale image in step one is as follows: S101. For visible light color images: 1) Calculate texture features of visible light color images using Gabor filter banks. ; Convert the RGB color space of a visible light color image to the Lab color space, where the L channel represents the grayscale value of the visible light color image. Texture features are then performed using a Gabor filter bank G with c scales and d directions. extract: ; 2) Texture features With grayscale value These features are considered as pixels, forming the feature vector corresponding to each pixel. That is, the "texture-brightness" feature vector; 3) K-Means clustering is applied to the "texture-luminance" feature vector to classify each pixel into... The corresponding category label images are obtained from each category, and the masks for each category label are as follows: , Indicates the first One category; S102. For near-infrared grayscale images: 1) The texture features of the near-infrared grayscale image are obtained by calculating the Gabor filter bank G. : ; 2) Texture features With grayscale value These features are considered as pixels, forming the feature vector corresponding to each pixel. That is, the "texture-brightness" feature vector; 3) K-Means clustering is applied to the "texture-luminance" feature vector to classify each pixel into... Within each category, each pixel is labeled with a category tag, and the masks for each category tag are as follows: ; The specific method for constructing the feature lookup table in step two is as follows: S201. Divide both the visible light color image and the near-infrared grayscale image into N equal square sub-regions along both the horizontal and vertical axes. For the near-infrared grayscale image, obtain the regional features of each square sub-region. For visible light color images, the regional features of the square sub-regions are obtained as follows: ;in This represents the x-coordinate of the center point of a square sub-region in a near-infrared grayscale image. This represents the ordinate of the center point of a square sub-region in a near-infrared grayscale image. This represents the x-coordinate of the center point of a square sub-region in a visible light color image. The ordinate of the center point of a square sub-region in a visible light color image; S202. Establish a feature lookup table for near-infrared grayscale images. In the feature lookup table of the near-infrared grayscale image, each row corresponds to the feature of a sub-region, and the first item of each row is the regional feature of a sub-region. The second item is the category mask to which the sub-region belongs. The third term is the mean of the texture features of this sub-region. The fourth item is the average brightness of this sub-region. ; Therefore, the features of each sub-region are represented as follows: ; By concatenating the features of all sub-regions, a feature lookup table for the near-infrared grayscale image is constructed: ; S203. Establish a feature lookup table for visible light color images. In the feature lookup table for visible color images, the first item in each row is the region feature of a sub-region. The second item is the category mask to which the sub-region belongs. The third term is the mean of the texture features of this sub-region. The fourth item is the brightness characteristic, which is the average brightness of the L channel in this sub-region. The fifth item indicates that the color feature is determined by the average color values of the a and b channels in the sub-region. express: , in, The average color value of channel a; The color mean of the b channel; The number of pixels in the sub-region, and , and The width and height of the image; Indicates in The value of channel a in the region; Indicates in The value of channel b in the region; represents the x and y coordinates of the pixel; For visible light color images Sub-regions The features of each sub-region are represented as follows: ; This constitutes a feature lookup table for visible light color images: ; The specific steps of feature matching in step three are as follows: S301. Apply constraints based on positional characteristics: , To constrain the maximum search distance for matching range, and also to impose constraints based on category labels: all sub-regions within the search range must belong to the same category label; S302. Under these two constraints, traverse the feature lookup tables of the visible light color image and the near-infrared grayscale image, and calculate the cosine similarity between the two images based on their "texture-brightness" features. And establish a mapping relationship; , in The first in the near-infrared grayscale image The "texture-brightness" characteristics of each sub-region The first in a visible light color image The "texture-brightness" characteristics of each sub-region; S303, When the cosine similarity is greater than the threshold If the cosine similarity of two sub-regions is greater than the threshold, then the sub-region with the highest similarity is selected to establish a mapping relationship. ; The specific steps for colorizing the near-infrared grayscale image in step four are as follows: S401, in When the "texture-brightness" feature of a sub-region of the visible light color image matches the "texture-brightness" feature of a sub-region of the near-infrared grayscale image, the color of the "texture-brightness" feature of the visible light color image is assigned to the sub-region of the near-infrared grayscale image. The specific color assignment method is as follows: According to the mapping relationship Assign color features from the visible light color image to the a and b channels of the near-infrared grayscale image: , in, The first in the near-infrared grayscale image The coordinates of each sub-region The first in a visible light color image The coordinates of each sub-region; S402, in When the "texture-brightness" features of a sub-region of a visible light color image do not match the "texture-brightness" features of a sub-region of a near-infrared grayscale image, color propagation is performed. The specific method of color propagation is as follows: Based on the feature lookup table for near-infrared grayscale images, look up the second item for the category feature. Find the category in the near-infrared grayscale image after color assignment. The same sub-region is assigned its "texture-brightness" feature color to the sub-region of the mismatched near-infrared grayscale image; S403 converts the Lab color space of near-infrared grayscale images to the RGB color space, enabling the colorization of near-infrared grayscale images in monitoring scenarios.
Citation Information
Patent Citations
Gray level image colorization system and method based on GLCM
CN104376529A
Multidimensional data association rule based image color migration method
CN107566821A