CN115511972A - Calculation method of correction matrix, non-uniformity correction method and related device - Google Patents
Calculation method of correction matrix, non-uniformity correction method and related device Download PDFInfo
- Publication number
- CN115511972A CN115511972A CN202211078874.XA CN202211078874A CN115511972A CN 115511972 A CN115511972 A CN 115511972A CN 202211078874 A CN202211078874 A CN 202211078874A CN 115511972 A CN115511972 A CN 115511972A
- Authority
- CN
- China
- Prior art keywords
- data
- channel
- multispectral image
- correction matrix
- multispectral
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/80—Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
Abstract
Description
技术领域technical field
本申请属于多光谱技术领域,尤其涉及一种校正矩阵的计算方法、多光谱图像的非均匀性误差校正方法、校正矩阵的计算装置、多光谱图像的非均匀性误差校正装置、终端及计算机可读存储介质。The present application belongs to the field of multispectral technology, and in particular relates to a method for calculating a correction matrix, a method for correcting a non-uniformity error of a multispectral image, a device for calculating a correction matrix, a device for correcting a nonuniformity error for a multispectral image, a terminal and a computer Read storage media.
背景技术Background technique
多光谱图像传感器比RGB传感器的通道数更多,但由于制作工艺也更加复杂,由于制作工艺(例如滤光片涂布不均匀)等原因,导致多光谱图像传感器的不同的空间位置处的相同通道,其对光谱的响应曲线不一致,表现为多光谱图像传感器在空域上的响应的非均匀性,进而导致生成的多光谱图像具有非均匀性误差。The multispectral image sensor has more channels than the RGB sensor, but due to the more complicated manufacturing process, due to the manufacturing process (such as uneven coating of optical filters), the same channel at different spatial positions of the multispectral image sensor Channels, whose response curves to the spectrum are inconsistent, manifest as the non-uniformity of the response of the multi-spectral image sensor in the spatial domain, which in turn leads to non-uniformity errors in the generated multi-spectral image.
发明内容Contents of the invention
本申请实施例提供了一种校正矩阵的计算方法、多光谱图像的非均匀性误差校正方法、校正矩阵的计算装置、多光谱图像的非均匀性误差校正装置、终端及计算机可读存储介质,可以解决上述问题。The embodiment of the present application provides a method for calculating a correction matrix, a method for correcting a non-uniformity error of a multispectral image, a device for calculating a correction matrix, a device for correcting a nonuniformity error for a multispectral image, a terminal, and a computer-readable storage medium, The above problems can be solved.
第一方面,本申请实施例提供了校正矩阵的计算方法,校正矩阵用于校正多光谱图像传感器的非均匀性误差,包括:获取白板的标定多光谱图像,并获取标定多光谱图像中每个通道的第一数据,标定多光谱图像由多光谱图像传感器采集得到;获取多光谱图像传感器中的参考位置;其中,多光谱图像传感器在参考位置处的实际多通道响应曲线与理想多通道响应曲线之间的重合度大于预设阈值;根据参考位置确定标定多光谱图像中的参考区域,并获取参考区域中每个通道的第二数据;根据第一数据和所述第二数据,计算每个通道对应的校正矩阵。In the first aspect, the embodiment of the present application provides a calculation method of the correction matrix, which is used to correct the non-uniformity error of the multispectral image sensor, including: acquiring the calibrated multispectral image of the whiteboard, and obtaining each of the calibrated multispectral images The first data of the channel, the calibration multi-spectral image is collected by the multi-spectral image sensor; the reference position in the multi-spectral image sensor is obtained; wherein, the actual multi-channel response curve and the ideal multi-channel response curve of the multi-spectral image sensor at the reference position The coincidence degree between them is greater than the preset threshold value; determine the reference area in the calibration multispectral image according to the reference position, and obtain the second data of each channel in the reference area; according to the first data and the second data, calculate each Correction matrix corresponding to the channel.
在一些实施例中,获取标定多光谱图像中每个通道的第一数据,包括:提取标定多光谱图像中每个通道对应的通道子图像,并提取每张通道子图像中各个像素点的数据,得到每个通道的第一数据;其中,第一数据以矩阵形式表示。在一些实施例中,参考区域包括一个或多个参考像素点,当参考像素点的数量为多个时,获取参考区域中每个通道的第二数据,包括:分别提取多个参考像素点中每个通道的数据;对每个通道的多个数据进行求平均值,得到参考区域中每个通道的第二数据。In some embodiments, obtaining the first data of each channel in the calibrated multispectral image includes: extracting the channel subimage corresponding to each channel in the calibrated multispectral image, and extracting the data of each pixel in each channel subimage , to obtain the first data of each channel; wherein, the first data is expressed in matrix form. In some embodiments, the reference area includes one or more reference pixel points. When the number of reference pixel points is multiple, obtaining the second data of each channel in the reference area includes: respectively extracting the plurality of reference pixel points Data for each channel; multiple data for each channel are averaged to obtain second data for each channel in the reference region.
在一些实施例中,标定多光谱图像的数量为一张,根据第一数据和第二数据,计算每个通道对应的校正矩阵,包括:将每个通道的第一数据和第二数据相除,得到每个通道对应的校正矩阵。在一些实施例中,标定多光谱图像的数量多张,多张标定多光谱图像分别是多光谱图像传感器距离白板多个距离时采集的白板的多光谱图像,根据第一数据和第二数据,计算每个通道对应的目标校正矩阵,包括:获取每张标定多光谱图像中的每个通道的第一数据,得到多个第一数据;对多个第一数据进行求和或求均值,得到第三数据;获取每张标定多光谱图像的第二数据,得到多个第二数据;对多个第二数据进行求和或求均值,得到第四数据;将第三数据和第四数据相除,得到多光谱图像传感器中每个通道对应的校正矩阵。In some embodiments, the number of calibrated multispectral images is one, and calculating the correction matrix corresponding to each channel according to the first data and the second data includes: dividing the first data and the second data of each channel , to get the correction matrix corresponding to each channel. In some embodiments, the number of calibrated multispectral images is multiple, and the multiple calibrated multispectral images are multispectral images of the whiteboard collected when the multispectral image sensor is at multiple distances from the whiteboard. According to the first data and the second data, Calculating the target correction matrix corresponding to each channel includes: obtaining the first data of each channel in each calibrated multispectral image to obtain multiple first data; summing or averaging multiple first data to obtain The third data; obtain the second data of each calibrated multispectral image to obtain a plurality of second data; sum or average the plurality of second data to obtain the fourth data; compare the third data and the fourth data The correction matrix corresponding to each channel in the multispectral image sensor is obtained.
第二方面,本申请实施例提供了一种多光谱图像的非均匀性误差校正方法,包括:获取初始多光谱图像;根据预设的校正矩阵对初始多光谱图像进行非均匀性校正,得到目标多光谱图像;其中,校正矩阵通过上述第一方面中的校正矩阵的计算方法计算得到。In the second aspect, the embodiment of the present application provides a method for correcting non-uniformity errors of multispectral images, including: acquiring an initial multispectral image; performing nonuniformity correction on the initial multispectral image according to a preset correction matrix to obtain the target A multispectral image; wherein, the correction matrix is calculated by the calculation method of the correction matrix in the first aspect above.
在一些实施例中,校正矩阵包括每个通道对应的子校正矩阵,根据预设的校正矩阵对初始多光谱图像进行非均匀性校正,得到目标多光谱图像,包括:根据每个通道对应的子校正矩阵分别对初始多光谱图像中每个通道的数据进行校正,得到目标多光谱图像。In some embodiments, the correction matrix includes a sub-correction matrix corresponding to each channel, and the non-uniformity correction is performed on the initial multispectral image according to the preset correction matrix to obtain the target multispectral image, including: according to the sub-correction matrix corresponding to each channel The correction matrix corrects the data of each channel in the initial multispectral image respectively to obtain the target multispectral image.
第三方面,本申请实施例提供了一种校正矩阵的计算装置,包括:第一获取单元、第二获取单元、处理单元及计算单元。第一获取单元用于获取白板的标定多光谱图像,并获取标定多光谱图像中每个通道的第一数据,标定多光谱图像由多光谱图像传感器采集得到;第二获取单元用于获取多光谱图像传感器中的参考位置;其中,多光谱图像传感器在参考位置处的实际多通道响应曲线与理想多通道响应曲线之间的重合度大于预设阈值;处理单元用于根据参考位置确定标定多光谱图像中的参考区域,并获取参考区域中每个通道的第二数据;计算单元用于根据第一数据和第二数据,计算每个通道对应的校正矩阵。In a third aspect, an embodiment of the present application provides a correction matrix calculation device, including: a first acquisition unit, a second acquisition unit, a processing unit, and a calculation unit. The first acquisition unit is used to acquire the calibrated multispectral image of the whiteboard, and acquires the first data of each channel in the calibrated multispectral image, and the calibrated multispectral image is collected by the multispectral image sensor; the second acquisition unit is used to acquire the multispectral image A reference position in the image sensor; wherein, the coincidence degree between the actual multi-channel response curve and the ideal multi-channel response curve of the multi-spectral image sensor at the reference position is greater than a preset threshold; the processing unit is used to determine the calibration multi-spectrum according to the reference position The reference area in the image, and acquire the second data of each channel in the reference area; the calculation unit is used to calculate the correction matrix corresponding to each channel according to the first data and the second data.
第四方面,本申请实施例提供了一种多光谱图像的非均匀性误差校正装置,包括获取单元及非均匀性校正单元。获取单元用于获取初始多光谱图像;非均匀性校正单元用于根据预设的校正矩阵对初始多光谱图像进行非均匀性校正,得到目标多光谱图像;其中,校正矩阵通过第一方面中的校正矩阵的计算方法计算得到。In a fourth aspect, an embodiment of the present application provides a non-uniformity error correction device for a multispectral image, including an acquisition unit and a non-uniformity correction unit. The acquisition unit is used to acquire the initial multispectral image; the non-uniformity correction unit is used to perform non-uniformity correction on the initial multispectral image according to the preset correction matrix to obtain the target multispectral image; wherein, the correction matrix is passed through the first aspect The calculation method of the correction matrix is calculated.
第五方面,本申请实施例提供了一种终端,包括多光谱图像传感器及处理器。多光谱图像传感器用于采集多光谱图像。在一个实施例中,处理器用于接收多光谱图像后执行第一方面中的校正矩阵的计算方法。在另一个实施例中,处理器用于接收多光谱图像后执行第二方面中的多光谱图像的非均匀性误差校正方法。In a fifth aspect, an embodiment of the present application provides a terminal, including a multispectral image sensor and a processor. A multispectral image sensor is used to acquire multispectral images. In one embodiment, the processor is configured to execute the calculation method of the correction matrix in the first aspect after receiving the multispectral image. In another embodiment, the processor is configured to execute the non-uniformity error correction method of the multispectral image in the second aspect after receiving the multispectral image.
第六方面,本申请实施例提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机程序。在一个实施例中,计算机程序被处理器执行时实现如上述第一方面中的校正矩阵的计算方法。在另一个实施例中,计算机程序被处理器执行时实现如上述第二方面中的多光谱图像的非均匀性误差校正方法。In a sixth aspect, the embodiment of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium. In one embodiment, when the computer program is executed by the processor, the calculation method of the correction matrix in the first aspect above is realized. In another embodiment, when the computer program is executed by the processor, the method for correcting the non-uniformity error of the multispectral image as in the second aspect above is realized.
本申请实施例中,通过获取白板的标定多光谱图像及提取标定多光谱图像中每个通道的数据以及参考区域中每个通道对应的数据,计算每个通道的校正矩阵,从而得到每个通道的校正矩阵,进而可根据校正矩阵采集到的多光谱图像进行非均匀性误差校正,减小了由于多光谱图像传感器的非均匀性带来的误差,得到的目标多光谱图像更加真实。In the embodiment of the present application, by obtaining the calibrated multispectral image of the whiteboard and extracting the data of each channel in the calibrated multispectral image and the data corresponding to each channel in the reference area, the correction matrix of each channel is calculated, so as to obtain the The correction matrix, and then the non-uniformity error correction can be performed according to the multi-spectral image collected by the correction matrix, which reduces the error caused by the non-uniformity of the multi-spectral image sensor, and the obtained target multi-spectral image is more real.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the accompanying drawings that need to be used in the descriptions of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings in the following description are only for the present application For some embodiments, those of ordinary skill in the art can also obtain other drawings based on these drawings without paying creative efforts.
图1是本申请第一实施例提供的终端的结构示意图;FIG. 1 is a schematic structural diagram of a terminal provided in a first embodiment of the present application;
图2是从9通道多光谱图像中提取得到的9张通道子图像示意图;Fig. 2 is a schematic diagram of 9 channel sub-images extracted from 9-channel multispectral images;
图3是本申请第二实施例提供的一种多光谱图像传感器的非均匀性误差校正方法的流程示意图;FIG. 3 is a schematic flowchart of a non-uniformity error correction method for a multispectral image sensor provided in the second embodiment of the present application;
图4是本申请第三实施例提供的一种校正矩阵的计算方法的流程示意图;FIG. 4 is a schematic flowchart of a calculation method of a correction matrix provided in the third embodiment of the present application;
图5是本申请第四实施例提供的多光谱图像的非均匀性误差校正装置的示意图;FIG. 5 is a schematic diagram of a non-uniformity error correction device for a multispectral image provided in a fourth embodiment of the present application;
图6是本申请第五实施例提供的校正矩阵的计算装置的示意图。Fig. 6 is a schematic diagram of a calculation device for a correction matrix provided by a fifth embodiment of the present application.
具体实施方式detailed description
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, specific details such as specific system structures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and/or components, but does not exclude one or more other Presence or addition of features, wholes, steps, operations, elements, components and/or collections thereof.
还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should also be understood that the term "and/or" used in the description of the present application and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。As used in this specification and the appended claims, the term "if" may be construed, depending on the context, as "when" or "once" or "in response to determining" or "in response to detecting ". Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be construed, depending on the context, to mean "once determined" or "in response to the determination" or "once detected [the described condition or event] ]” or “in response to detection of [described condition or event]”.
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。In addition, in the description of the specification and appended claims of the present application, the terms "first", "second", "third" and so on are only used to distinguish descriptions, and should not be understood as indicating or implying relative importance.
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。Reference to "one embodiment" or "some embodiments" or the like in the specification of the present application means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in other embodiments," etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean "one or more but not all embodiments" unless specifically stated otherwise. The terms "including", "comprising", "having" and variations thereof mean "including but not limited to", unless specifically stated otherwise.
图1是本申请第一实施例提供的终端的示意图。该实施例的终端包括处理器11、存储器12、多光谱相机13以及存储在存储器11中并可在处理器11上运行的计算机程序14。处理器11分别与存储器12及多光谱相机13连接,处理器11可存储数据至存储器12,例如图像;处理器11也可调用存储器12内的数据,例如计算机程序14、图像等,处理器11也可控制多光谱相机13拍摄图像。FIG. 1 is a schematic diagram of a terminal provided in a first embodiment of the present application. The terminal in this embodiment includes a processor 11 , a
终端1可包括但不仅限于处理器11、存储器12及多光谱相机13。本领域技术人员可以理解,图1仅仅是终端1的示例,并不构成对终端1的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如终端1还可以包括输入输出接口、网络接入接口、总线等;再例如,终端1可不包括存储器12,计算机程序14烧录在处理器11内,或存储器12为云端存储器。The terminal 1 may include but not limited to a processor 11 , a
处理器11可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 11 can be a central processing unit (Central Processing Unit, CPU), and can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
存储器12可以是终端1的内部存储单元,例如终端1的硬盘或内存。存储器12也可以是终端1的外部存储设备,例如终端1上配备的插接式硬盘,智能存储卡(Smart MediaCard,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,终端1还可以既包括终端1的内部存储单元也包括外部存储设备。存储器12用于存储计算机程序14以及执行程序所需的数据,例如校正矩阵、多光谱图像等。存储器11还可以用于暂时地存储已经输出或者将要输出的数据。The
多光谱相机13用于采集被检测对象的多光谱图像,采集到的多光谱图像可存储在存储器12内,也可直接传输至处理器11。多光谱相机13可接收至少4个不同波段的光线然后生成多光谱图像,例如,多光谱相机13可接收4个、5个、6个、7个、8个、9个、16个或更多个不同波段的光线然后生成图像。The
图2示出了从多光谱图像中提取得到的9个通道对应的子图像的示意图。图2对应的实施例中,多光谱相机13能接收9个不同波段的光线并生成多光谱图像,该多光谱图像可称之为9通道多光谱图像。将9通道多光谱图像中每个像素点对应的一通道数据提取出来得到的图像为一通道子图像,同理可得到二通道子图像至九通道子图像,图2中的ch1、ch2、ch3、ch4、ch5、ch6、ch7、ch8及ch9分别为提取得到的一通道子图像、二通道子图像、三通道子图像、四通道子图像、五通道子图像、六通道子图像、七通道子图像、八通道子图像、九通道子图像。Fig. 2 shows a schematic diagram of sub-images corresponding to 9 channels extracted from a multi-spectral image. In the embodiment corresponding to FIG. 2 , the
具体地,多光谱相机13包括透镜及多光谱图像传感器,透镜用于会聚光线至多光谱图像传感器,多光谱图像传感器接收光线后生成对应的多光谱图像。多光谱图像传感器包括滤光片阵列及像素阵列,滤光片阵列用于过滤光线,像素阵列用于接收过滤后的光线并将其转换为电信号,滤光片阵列包括多种不同中心波长的滤光片,进而使得多光谱图像传感器实现多通道成像,由于制作工艺(例如,滤光片涂布不均匀)等原因导致多光谱图像传感器的不同空间位置处的相同通道对同一波段的光线的响应曲线不一致,这种不一致现象可以理解为多光谱图像传感器在空域上的非均匀性导致的。这种非均匀性可能会导致同一对象在不同的成像空间,表现的颜色或光谱曲线不一致。以活检为例,在中心位置的活检效果好,其他位置的活检效果稍差等。因此,需对多光谱图像传感器的非均匀性误差进行校正。Specifically, the
计算机程序14存储在存储器12内,计算机程序14包括多光谱图像的非均匀性误差校正程序及校正矩阵的计算程序等程序。非均匀性误差校正程序可被处理器11调用以执行对多光谱图像进行非均匀性误差校正指令,例如实现图3所示的多光谱图像的非均匀性误差校正方法。校正矩阵的计算程序可被处理器11调用以执行计算校正多光谱图像传感器的非均匀性误差的校正矩阵指令,例如实现图4所示的校正矩阵的计算方法。在一些实施例中,非均匀性误差校正程序及校正矩阵的计算程序也可分别位于两个存储器12内。The
请参见图3,图3是本申请第二实施例提供的一种多光谱图像的非均匀性误差校正方法的流程示意图。多光谱图像的非均匀性误差校正方法可以包括:Please refer to FIG. 3 . FIG. 3 is a schematic flowchart of a non-uniformity error correction method for a multispectral image provided in the second embodiment of the present application. Non-uniformity error correction methods for multispectral images can include:
S201:获取初始多光谱图像。S201: Acquire an initial multispectral image.
初始多光谱图像可以是多光谱相机实时拍摄的,也可以是拍摄后存储在存储器内的图像。其中,初始多光谱图像中可包括至少四个不同波段的数据,即,初始多光谱图像至少为四通道多光谱图像。The initial multispectral image may be captured by the multispectral camera in real time, or may be an image stored in the memory after being captured. Wherein, the initial multispectral image may include data of at least four different bands, that is, the initial multispectral image is at least a four-channel multispectral image.
S202:根据预设的校正矩阵对初始多光谱图像进行非均匀性校正,得到目标多光谱图像;其中,校正矩阵可通过如图4所示的校正矩阵的计算方法计算得到后存储在存储器内。S202: Perform non-uniformity correction on the initial multispectral image according to a preset correction matrix to obtain a target multispectral image; wherein, the correction matrix can be calculated by the calculation method of the correction matrix as shown in FIG. 4 and stored in a memory.
处理器可从存储器内调用预设的校正矩阵,校正矩阵包括每个通道对应的子校正矩阵,然后根据子校正矩阵对初始多光谱图像中每个像素点中每个通道的数据进行非均匀性校正,校正后生成的图像为目标多光谱图像。The processor can recall a preset correction matrix from the memory, and the correction matrix includes a sub-correction matrix corresponding to each channel, and then perform non-uniformity on the data of each channel in each pixel in the initial multispectral image according to the sub-correction matrix Correction, the image generated after correction is the target multispectral image.
以初始多光谱图像为9通道多光谱图像为例进行说明。整个初始多光谱图像的多光谱数据为MSI_target(m,n,9),其中,MSI_target(m,n,9)是三维矩阵,m为初始多光谱图像中像素点的行数,n为初始多光谱图像中的像素点的列数,9为每个像素点的9个通道的数据。校正矩阵为Correct(m,n,9),Correct(m,n,9)是三维矩阵,m是像素点的行数,n是像素点的列数,9是每个像素点的9个通道的校正参数。在一个实施例中,对初始多光谱图像进行非均匀性校正方法具体如下:Take the initial multispectral image as an example of a 9-channel multispectral image for illustration. The multispectral data of the entire initial multispectral image is MSI_target(m,n,9), where MSI_target(m,n,9) is a three-dimensional matrix, m is the number of rows of pixels in the initial multispectral image, and n is the initial multispectral image. The number of columns of pixels in the spectral image, 9 is the data of 9 channels for each pixel. The correction matrix is Correct(m,n,9), Correct(m,n,9) is a three-dimensional matrix, m is the number of rows of pixels, n is the number of columns of pixels, and 9 is 9 channels for each pixel correction parameters. In one embodiment, the method for performing non-uniformity correction on the initial multispectral image is as follows:
MSI_target_correct(m,n,9)=MSI_target(m,n,9)./Correct(m,n,9)MSI_target_correct(m,n,9)=MSI_target(m,n,9)./Correct(m,n,9)
其中,./代表两个矩阵中对应点的数据对应相除,MSI_target_correct(m,n,9)为目标多光谱图像的多光谱数据,也是以三维矩阵的形式表示。Among them, ./ represents the corresponding division of data at corresponding points in the two matrices, and MSI_target_correct(m,n,9) is the multispectral data of the target multispectral image, which is also expressed in the form of a three-dimensional matrix.
在一个实施例中,校正矩阵Correct(m,n,9)可分解成Correct1(m,n,1)、Correct2(m,n,2)、Correct3(m,n,3)、Correct4(m,n,4)、Correct5(m,n,5)、Correct6(m,n,6)、Correct7(m,n,7)、Correct8(m,n,8)、Correct9(m,n,9)这9个通道对应的子校正矩阵,均为二维矩阵,然后用9个通道子图像的数据分别点除9个子校正矩阵,得到9个子通道校正后的数据,进而得到目标多光谱图像。In one embodiment, the correction matrix Correct(m,n,9) can be decomposed into Correct1(m,n,1), Correct2(m,n,2), Correct3(m,n,3), Correct4(m, n,4), Correct5(m,n,5), Correct6(m,n,6), Correct7(m,n,7), Correct8(m,n,8), Correct9(m,n,9) The sub-correction matrices corresponding to the 9 channels are all two-dimensional matrices, and then divide the 9 sub-correction matrices by the data of the sub-images of the 9 channels to obtain the corrected data of the 9 sub-channels, and then obtain the target multispectral image.
本申请实施例中,通过调用校正矩阵对采集到的多光谱图像进行非均匀性校正,减小了非均匀性带来的误差,使得生成的目标多光谱图像更加准确。In the embodiment of the present application, non-uniformity correction is performed on the collected multi-spectral image by calling the correction matrix, which reduces the error caused by the non-uniformity and makes the generated target multi-spectral image more accurate.
在一些实施例中,上述校正矩阵可通过校正矩阵的计算方法计算得到。如图4所示,图4是本申请第三实施例提供的一种校正矩阵的计算方法的流程示意图,校正矩阵的计算方法可以包括以下步骤:In some embodiments, the above-mentioned correction matrix can be calculated by a calculation method of a correction matrix. As shown in FIG. 4, FIG. 4 is a schematic flowchart of a calculation method of a correction matrix provided in the third embodiment of the present application. The calculation method of the correction matrix may include the following steps:
S401:获取白板的标定多光谱图像,并获取标定多光谱图像中每个通道的第一数据。S401: Acquire a calibrated multispectral image of the whiteboard, and acquire first data of each channel in the calibrated multispectral image.
白板对于各个波段的光均具有较好的响应,获取白板的标定多光谱图像然后根据白板的多光谱数据计算校正矩阵,得到的校正矩阵更加准确。在需要计算校正矩阵时,处理器可控制多光谱相机采集白板的标定多光谱图像,采集标定多光谱图像时,需保证白板完全覆盖多光谱相机的视场角,如此,采集到的标定多光谱图像整个画面均是白板,避免了其它物品的干扰,有利于提高后续校正矩阵的准确性。在一个实施例中,白板为漫反射白板,漫反射白板对于紫外光、可见光及近红外光的反射率均能达到98%以上,采用漫反射白板更能体现出不同位置处的相同通道之间的差异,进而标定得到的校正矩阵将更加准确。The whiteboard has a good response to the light of each band. Obtaining the calibrated multispectral image of the whiteboard and then calculating the correction matrix based on the multispectral data of the whiteboard will result in a more accurate correction matrix. When the correction matrix needs to be calculated, the processor can control the multispectral camera to collect the calibrated multispectral image of the whiteboard. When collecting the calibrated multispectral image, it is necessary to ensure that the whiteboard completely covers the field of view of the multispectral camera. The entire picture of the image is a whiteboard, which avoids the interference of other items and is conducive to improving the accuracy of the subsequent correction matrix. In one embodiment, the whiteboard is a diffuse reflection whiteboard, and the reflectance of the diffuse reflection whiteboard for ultraviolet light, visible light and near-infrared light can reach more than 98%. The difference, and then the calibration matrix obtained by calibration will be more accurate.
在获取到标定多光谱图像后,进一步获取标定多光谱图像中每个通道的第一数据。具体可分别提取标定多光谱图像中每个通道对应的通道子图像,然后提取每张通道子图像中各个像素点的数据,则可以得到每个通道的第一数据,第一数据以矩阵形式表示。每个通道的第一数据包括标定多光谱图像中每个像素点在该通道的数据,以m行n列的矩阵的形式表示,其中,m为标定多光谱图像中像素点的行数,n为标定多光谱图像中像素点的列数。After the calibrated multispectral image is acquired, the first data of each channel in the calibrated multispectral image is further acquired. Specifically, the channel sub-image corresponding to each channel in the calibration multispectral image can be extracted separately, and then the data of each pixel point in each channel sub-image can be extracted, then the first data of each channel can be obtained, and the first data is expressed in matrix form . The first data of each channel includes the data of each pixel in the calibration multispectral image in the channel, expressed in the form of a matrix with m rows and n columns, where m is the number of rows of pixels in the calibration multispectral image, n is the column number of pixels in the calibration multispectral image.
继续以标定多光谱图像为9通道图像为例进行说明。提取得到的一通道至九通道分别对应的第一数据为:ch1(m,n)=MSI_1(m,n,1);ch2(m,n)=MSI_1(m,n,2);ch3(m,n)=MSI_1(m,n,3);ch4(m,n)=MSI_1(m,n,4);ch5(m,n)=MSI_1(m,n,5);ch6(m,n)=MSI_1(m,n,6);ch7(m,n)=MSI_1(m,n,7);ch8(m,n)=MSI_1(m,n,8);ch9(m,n)=MSI_1(m,n,9)。其中,MSI_1(m,n,1)为标定多光谱图像中一通道的第一数据。Continue to calibrate the multispectral image to a 9-channel image as an example for illustration. The extracted first data corresponding to the first channel to the ninth channel respectively are: ch 1 (m,n)=MSI_1(m,n,1); ch 2 (m,n)=MSI_1(m,n,2); ch 3 (m,n)=MSI_1(m,n,3); ch 4 (m,n)=MSI_1(m,n,4); ch 5 (m,n)=MSI_1(m,n,5) ;ch 6 (m,n)=MSI_1(m,n,6); ch 7 (m,n)=MSI_1(m,n,7); ch 8 (m,n)=MSI_1(m,n,8 ); ch 9 (m,n)=MSI_1(m,n,9). Wherein, MSI_1(m,n,1) is the first data of a channel in the calibration multispectral image.
S402:获取多光谱图像传感器中的参考位置;其中,多光谱图像传感器在参考位置处的实际多通道响应曲线与理想多通道响应曲线之间的重合度大于预设阈值。S402: Acquire a reference position in the multi-spectral image sensor; wherein, the coincidence degree between the actual multi-channel response curve and the ideal multi-channel response curve of the multi-spectral image sensor at the reference position is greater than a preset threshold.
参考位置即为多光谱图像传感器中的实际多通道响应曲线与理想多通道响应曲线之间的重合度大于预设阈值的位置,预设阈值可以为80%、90%、95%等,在此不一一列举。理想多通道响应曲线可以理解为无非均匀性误差时(例如,滤光片涂布均匀时)各个通道对一宽波段的光谱的响应曲线,实际多通道响应曲线为实际使用时各个通道对一宽波段的光谱的响应曲线。可以理解,参考位置对应的实际各个通道响应曲线与理想各个通道响应曲线之间的差异值在一个允许范围内,参考位置处获取到的数据较准确。具体来说,参考位置可预先存储在存储器内,不同多光谱图像传感器的参考位置可能相同,也可能不同。参考位置主要由多光谱图像传感器的制造工艺等决定,在多光谱图像传感器生产出来后即可确定参考位置,参考位置处的非均匀性误差是最小的,例如多光谱图像传感器的中心区域的滤光片涂覆比较均匀,参考位置可以是中心坐标点。The reference position is the position where the coincidence degree between the actual multi-channel response curve and the ideal multi-channel response curve in the multispectral image sensor is greater than a preset threshold, and the preset threshold can be 80%, 90%, 95%, etc., here Not to list them all. The ideal multi-channel response curve can be understood as the response curve of each channel to a wide-band spectrum when there is no non-uniformity error (for example, when the filter is uniformly coated), and the actual multi-channel response curve is each channel to a wide band in actual use Spectral response curves for the bands. It can be understood that the difference between the actual response curve of each channel corresponding to the reference position and the ideal response curve of each channel is within an allowable range, and the data obtained at the reference position is more accurate. Specifically, the reference position may be pre-stored in the memory, and the reference positions of different multispectral image sensors may be the same or different. The reference position is mainly determined by the manufacturing process of the multispectral image sensor. The reference position can be determined after the multispectral image sensor is produced. The non-uniformity error at the reference position is the smallest. For example, the filter in the central area of the multispectral image sensor The light sheet coating is relatively uniform, and the reference position can be the central coordinate point.
在一个实施例中,参考位置为坐标点,可通过标定得到参考位置。例如通过多光谱相机采集样本图像,通过获取到的样本图像上的每个像素点的通道响应曲线,然后寻找最理想的通道响应曲线的理想像素点,进而可确定多光谱图像传感器的参考位置。当理想像素点为多个时,可以比较该理想像素点的周围一定区域内的像素点的9通道响应曲线,然后找到最理想像素点作为参考位置;或者,也可以任意选择多个中的一个作为参考位置;或者也可以将多个理想像素点均作为参考位置。In one embodiment, the reference position is a coordinate point, which can be obtained through calibration. For example, a sample image is collected by a multi-spectral camera, and the channel response curve of each pixel on the sample image is obtained, and then the ideal pixel point of the most ideal channel response curve is found, and then the reference position of the multi-spectral image sensor can be determined. When there are multiple ideal pixel points, you can compare the 9-channel response curves of the pixels in a certain area around the ideal pixel point, and then find the most ideal pixel point as a reference position; or, you can also select one of the multiple points arbitrarily as a reference position; or a plurality of ideal pixel points can also be used as a reference position.
由于采用单一坐标点的方式可能会因为单一坐标点的数据存在噪点干扰而影响校正矩阵的准确性,在另一个实施例中,参考位置可以是一个或多个区域,多光谱图像传感器在该区域内的实际多通道响应曲线较接近于理想多通道响应曲线,具体也可以通过标定等方式确定区域的具体位置。Since the method of using a single coordinate point may affect the accuracy of the correction matrix due to noise interference in the data of a single coordinate point, in another embodiment, the reference position can be one or more areas, and the multispectral image sensor in this area The actual multi-channel response curve within is closer to the ideal multi-channel response curve, and the specific location of the area can also be determined by calibration and other methods.
S403:根据参考位置确定标定多光谱图像中的参考区域,并获取参考区域中每个通道的第二数据。S403: Determine a reference area in the calibration multispectral image according to the reference position, and acquire second data of each channel in the reference area.
由于标定多光谱图像是多光谱相机生成的,根据参考位置的信息可以确定出标定多光谱图像中的参考区域,可以理解,参考区域对应的图像数据是参考位置的像素生成的。当参考区域为一个像素点时,则可提取该像素点中各个通道的数据,作为参考区域各个通道的第二区域。当参考区域包括多个像素点时,则需要分别提取每个像素点中各个通道的数据,每个通道可得到多个数据,然后对每个通道的多个数据求平均值,得到参考区域各个通道的第二数据,可以理解,第二数据并不是一个矩阵而是一个数值。其中,获取第二数据的方式可参照步骤S401中获取第一数据的方式,在此不做赘述。Since the calibrated multispectral image is generated by the multispectral camera, the reference area in the calibrated multispectral image can be determined according to the information of the reference position. It can be understood that the image data corresponding to the reference area is generated by the pixels at the reference position. When the reference area is a pixel point, the data of each channel in the pixel point may be extracted as the second area of each channel in the reference area. When the reference area includes multiple pixels, it is necessary to extract the data of each channel in each pixel, and each channel can obtain multiple data, and then average the multiple data of each channel to obtain the data of each channel in the reference area. As for the second data of the channel, it can be understood that the second data is not a matrix but a value. Wherein, the manner of acquiring the second data may refer to the manner of acquiring the first data in step S401, which will not be repeated here.
S404:根据第一数据和第二数据,计算每个通道对应的校正矩阵。S404: Calculate a correction matrix corresponding to each channel according to the first data and the second data.
在一个实施例中,标定多光谱图像的数量为一张,为多光谱相机距离白板预设距离时,采集到的白板的多光谱图像,则将每个通道的第一数据和第二数据相除,得到每个通道对应的校正矩阵。例如,Correct(m,n,k)=chk(m,n)/chk(x,y),其中,Correct(m,n,k)为k通道的校正矩阵,chk(m,n)为k通道的第一数据,以矩阵形式表示,chk(x,y)为k通道的第二数据,以数值表示。其中,每个通道对应的校正矩阵即为上述非均匀性校正方法实施例中描述的每个通道的子校正矩阵。In one embodiment, the number of calibrated multispectral images is one. When the multispectral camera is at a preset distance from the whiteboard, the collected multispectral images of the whiteboard are compared with the first data and the second data of each channel. to get the correction matrix corresponding to each channel. For example, Correct(m,n,k)=ch k (m,n)/ch k (x,y), where Correct(m,n,k) is the correction matrix of channel k, and ch k (m,n ) is the first data of channel k, expressed in matrix form, and ch k (x, y) is the second data of channel k, expressed in numerical value. Wherein, the correction matrix corresponding to each channel is the sub-correction matrix of each channel described in the above embodiment of the non-uniformity correction method.
在另一个实施例中,为了更准确地计算校正矩阵,多光谱相机在距离白板多个距离时分别采集一张标定多光谱图像,可以得到多张标定多光谱图像,则需分别获取每张标定多光谱图像中的每个通道的第一数据、及每张标定多光谱图像的参考区域中各个通道的第二数据。可以理解,各个通道的第一数据的数量为多个,各个通道的第二数据的数量为多个,计算校正矩阵时,对多个第一数据进行求和或求均值,得到各个通道对应的第三数据;对多个第二数据进行求和或求均值,得到第四数据;然后将第三数据和第四数据相除,得到多光谱图像传感器中每个通道对应的校正矩阵。In another embodiment, in order to calculate the correction matrix more accurately, the multispectral camera collects a calibration multispectral image at multiple distances from the whiteboard, and multiple calibration multispectral images can be obtained. The first data of each channel in the multispectral image, and the second data of each channel in the reference area of each calibrated multispectral image. It can be understood that the number of first data of each channel is multiple, and the number of second data of each channel is multiple. When calculating the correction matrix, the multiple first data are summed or averaged to obtain the corresponding third data; summing or averaging a plurality of second data to obtain fourth data; and then dividing the third data and the fourth data to obtain a correction matrix corresponding to each channel in the multispectral image sensor.
继续以9通道的标定多光谱图像为例进行说明,共采集了p个距离下对应的白板的p个标定多光谱图像,每个通道均有p个第二数据,一通道至九通道对应的第三数据可以通过如下方式进行计算:Continue to take the 9-channel calibrated multispectral image as an example. A total of p calibrated multispectral images of whiteboards corresponding to p distances have been collected, and each channel has p second data. The third data can be calculated as follows:
ch1(m,n)=MSI_1(m,n,1)+MSI_2(m,n,1)+......+MSI_p(m,n,1);ch 1 (m,n)=MSI_1(m,n,1)+MSI_2(m,n,1)+...+MSI_p(m,n,1);
ch2(m,n)=MSI_1(m,n,2)+MSI_2(m,n,2)+......+MSI_p(m,n,2);ch 2 (m,n)=MSI_1(m,n,2)+MSI_2(m,n,2)+...+MSI_p(m,n,2);
ch3(m,n)=MSI_1(m,n,3)+MSI_2(m,n,3)+......+MSI_p(m,n,3);ch 3 (m,n)=MSI_1(m,n,3)+MSI_2(m,n,3)+...+MSI_p(m,n,3);
ch4(m,n)=MSI_1(m,n,4)+MSI_2(m,n,4)+......+MSI_p(m,n,4);ch 4 (m,n)=MSI_1(m,n,4)+MSI_2(m,n,4)+...+MSI_p(m,n,4);
ch5(m,n)=MSI_1(m,n,5)+MSI_2(m,n,5)+......+MSI_p(m,n,5);ch 5 (m,n)=MSI_1(m,n,5)+MSI_2(m,n,5)+...+MSI_p(m,n,5);
ch6(m,n)=MSI_1(m,n,6)+MSI_2(m,n,6)+......+MSI_p(m,n,6);ch 6 (m,n)=MSI_1(m,n,6)+MSI_2(m,n,6)+...+MSI_p(m,n,6);
ch7(m,n)=MSI_1(m,n,7)+MSI_2(m,n,7)+......+MSI_p(m,n,7);ch 7 (m,n)=MSI_1(m,n,7)+MSI_2(m,n,7)+...+MSI_p(m,n,7);
ch8(m,n)=MSI_1(m,n,8)+MSI_2(m,n,8)+......+MSI_p(m,n,8);ch 8 (m,n)=MSI_1(m,n,8)+MSI_2(m,n,8)+...+MSI_p(m,n,8);
ch9(m,n)=MSI_1(m,n,9)+MSI_2(m,n,9)+......+MSI_p(m,n,9)。ch 9 (m,n)=MSI_1(m,n,9)+MSI_2(m,n,9)+...+MSI_p(m,n,9).
参考区域中每个通道均对应有p个第二数据,一通道至九通道对应的第四数据可以通过如下方式进行计算:Each channel in the reference area corresponds to p second data, and the fourth data corresponding to channel 1 to channel 9 can be calculated as follows:
ch1(x,y)=MSI_1(x,y,1)+MSI_2(x,y,1)+......+MSI_p(x,y,1);ch 1 (x,y)=MSI_1(x,y,1)+MSI_2(x,y,1)+...+MSI_p(x,y,1);
ch2(x,y)=MSI_1(x,y,2)+MSI_2(x,y,2)+......+MSI_p(x,y,2);ch 2 (x,y)=MSI_1(x,y,2)+MSI_2(x,y,2)+...+MSI_p(x,y,2);
ch3(x,y)=MSI_1(x,y,3)+MSI_2(x,y,3)+......+MSI_p(x,y,3);ch 3 (x,y)=MSI_1(x,y,3)+MSI_2(x,y,3)+...+MSI_p(x,y,3);
ch4(x,y)=MSI_1(x,y,4)+MSI_2(x,y,4)+......+MSI_p(x,y,4);ch 4 (x,y)=MSI_1(x,y,4)+MSI_2(x,y,4)+...+MSI_p(x,y,4);
ch5(x,y)=MSI_1(x,y,5)+MSI_2(x,y,5)+......+MSI_p(x,y,5);ch 5 (x,y)=MSI_1(x,y,5)+MSI_2(x,y,5)+...+MSI_p(x,y,5);
ch6(x,y)=MSI_1(x,y,6)+MSI_2(x,y,6)+......+MSI_p(x,y,6);ch 6 (x,y)=MSI_1(x,y,6)+MSI_2(x,y,6)+...+MSI_p(x,y,6);
ch7(x,y)=MSI_1(x,y,7)+MSI_2(x,y,7)+......+MSI_p(x,y,7);ch 7 (x,y)=MSI_1(x,y,7)+MSI_2(x,y,7)+...+MSI_p(x,y,7);
ch8(x,y)=MSI_1(x,y,8)+MSI_2(x,y,8)+......+MSI_p(x,y,8);ch 8 (x,y)=MSI_1(x,y,8)+MSI_2(x,y,8)+...+MSI_p(x,y,8);
ch9(x,y)=MSI_1(x,y,9)+MSI_2(x,y,9)+......+MSI_p(x,y,9)。ch 9 (x, y)=MSI_1(x,y,9)+MSI_2(x,y,9)+...+MSI_p(x,y,9).
其中,x、y指的是参考区域为参考像素点时,参考像素点的位置坐标。Wherein, x and y refer to the position coordinates of the reference pixel when the reference area is the reference pixel.
将每个通道的第三数据和第四数据相除,每个通道的第三数据包括m*n个数据,第四数据只有一个数据,即将该m*n个数据均除以第四数据,进而得到每个通道对应的校正矩阵。例如,9个通道的校正矩阵具体计算如下:Dividing the third data and the fourth data of each channel, the third data of each channel includes m*n data, and the fourth data has only one data, that is, dividing the m*n data by the fourth data, Then the correction matrix corresponding to each channel is obtained. For example, the correction matrix of 9 channels is specifically calculated as follows:
Correct(m,n,1)=ch1(m,n)/ch1(x,y);Correct(m,n,1)=ch 1 (m,n)/ch 1 (x,y);
Correct(m,n,2)=ch2(m,n)/ch2(x,y);Correct(m,n,2)=ch 2 (m,n)/ch 2 (x,y);
Correct(m,n,3)=ch3(m,n)/ch3(x,y);Correct(m,n,3)=ch 3 (m,n)/ch 3 (x,y);
Correct(m,n,4)=ch4(m,n)/ch4(x,y);Correct(m,n,4)=ch 4 (m,n)/ch 4 (x,y);
Correct(m,n,5)=ch5(m,n)/ch5(x,y);Correct(m,n,5)=ch 5 (m,n)/ch 5 (x,y);
Correct(m,n,6)=ch6(m,n)/ch6(x,y);Correct(m,n,6)=ch 6 (m,n)/ch 6 (x,y);
Correct(m,n,7)=ch7(m,n)/ch7(x,y);Correct(m,n,7)=ch 7 (m,n)/ch 7 (x,y);
Correct(m,n,8)=ch8(m,n)/ch8(x,y);Correct(m,n,8)=ch 8 (m,n)/ch 8 (x,y);
Correct(m,n,9)=ch9(m,n)/ch9(x,y)。Correct(m,n,9)=ch 9 (m,n)/ch 9 (x,y).
此外,上述例子中采用求和的方式计算得到第三数据和第四数据只是一种实施方式,在其它实施方式中,还可以采用求平均值等方式计算得到第三数据和第四数据;上述例子中,计算校正矩阵时是第一数据除第二数据,在其他例子中,也可以是第二数据除第一数据,在此不做限制。In addition, in the above example, the calculation of the third data and the fourth data by means of summation is only one implementation mode, and in other implementation modes, the third data and the fourth data can also be calculated by means of averaging; the above In an example, when calculating the correction matrix, the first data is divided by the second data. In other examples, the second data may also be divided by the first data, which is not limited here.
其中,获取到的每个通道的校正矩阵可以存储在存储器中,以便于处理器执行上述的非均匀性误差校正方法时调用。在一个实施例中,得到每个通道的校正矩阵后,可以将多个通道的校正矩阵进行组合得到多通道校正矩阵,多通道校正矩阵则为三维矩阵,该三维矩阵可以理解为上述非均匀性校正方法实施例中描述的每个通道的子校正矩阵。此外,本实施例中获取到的每个通道的校正矩阵可以适用于对任何拍摄距离得到多光谱图像进行非均匀性校正。Wherein, the acquired correction matrix of each channel may be stored in a memory so as to be invoked by the processor when executing the above non-uniformity error correction method. In one embodiment, after obtaining the correction matrix of each channel, the correction matrices of multiple channels can be combined to obtain a multi-channel correction matrix. The multi-channel correction matrix is a three-dimensional matrix, which can be understood as the above-mentioned non-uniformity The sub-correction matrix for each channel described in the correction method example. In addition, the correction matrix of each channel obtained in this embodiment can be applied to perform non-uniformity correction on multispectral images obtained from any shooting distance.
本申请实施例中,通过获取白板的标定多光谱图像及提取标定多光谱图像中每个通道的数据以及参考区域中每个通道对应的数据,计算每个通道的目标校正矩阵,从而得到每个通道的校正矩阵,进而可根据校正矩阵采集到的多光谱图像进行非均匀性误差校正,减小了由于多光谱图像传感器的非均匀性带来的误差,得到的目标多光谱图像更加真实。In the embodiment of the present application, by obtaining the calibrated multispectral image of the whiteboard and extracting the data of each channel in the calibrated multispectral image and the data corresponding to each channel in the reference area, the target correction matrix for each channel is calculated, thereby obtaining each The correction matrix of the channel, and then the non-uniformity error correction can be performed according to the multi-spectral image collected by the correction matrix, which reduces the error caused by the non-uniformity of the multi-spectral image sensor, and the obtained target multi-spectral image is more real.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the sequence numbers of the steps in the above embodiments do not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiment of the present application.
请参见图5,图5是本申请第四实施例提供的多光谱图像的非均匀性误差校正装置的示意图。包括的各单元用于执行图3对应的实施例中的各步骤。具体请参阅图3对应的实施例中的相关描述。为了便于说明,仅示出了与本实施例相关的部分。参见图5,多光谱图像的非均匀性误差校正装置5包括获取单元510和非均匀性校正单元520。Please refer to FIG. 5 . FIG. 5 is a schematic diagram of a non-uniformity error correction device for a multispectral image provided by a fourth embodiment of the present application. Each included unit is used to execute each step in the embodiment corresponding to FIG. 3 . For details, refer to the relevant description in the embodiment corresponding to FIG. 3 . For ease of description, only the parts related to this embodiment are shown. Referring to FIG. 5 , the
具体地,获取单元510用于获取初始多光谱图像;非均匀性校正单元520用于根据预设的校正矩阵对初始多光谱图像进行非均匀性校正,得到目标多光谱图像;其中,校正矩阵可通过如图4所示的校正矩阵的计算方法计算得到。Specifically, the
请参见图6,图6是本申请第五实施例提供的校正矩阵的计算装置的示意图。包括的各单元用于执行图4对应的实施例中的各步骤。具体请参阅图4对应的实施例中的相关描述。为了便于说明,仅示出了与本实施例相关的部分。参见图6,校正矩阵的计算装置6包括第一获取单元610、第二获取单元620、处理单元630及计算单元640。Please refer to FIG. 6 . FIG. 6 is a schematic diagram of an apparatus for calculating a correction matrix provided by a fifth embodiment of the present application. Each included unit is used to execute each step in the embodiment corresponding to FIG. 4 . For details, refer to the relevant description in the embodiment corresponding to FIG. 4 . For ease of description, only the parts related to this embodiment are shown. Referring to FIG. 6 , the correction
第一获取单元610用于获取白板的标定多光谱图像,并获取标定多光谱图像中每个通道的第一数据,标定多光谱图像由多光谱图像传感器采集得到;第二获取单元620用于获取多光谱图像传感器中的参考位置;其中,多光谱图像传感器在参考位置处的实际多通道响应曲线与理想多通道响应曲线之间的重合度大于预设阈值;处理单元630用于根据参考位置确定标定多光谱图像中的参考区域,并获取参考区域中每个通道的第二数据;计算单元640用于根据第一数据和第二数据,计算每个通道对应的校正矩阵。The
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。It should be noted that the information interaction and execution process between the above-mentioned devices/units are based on the same concept as the method embodiment of the present application, and its specific functions and technical effects can be found in the method embodiment section. I won't repeat them here.
本申请实施例还提供了一种网络设备,该网络设备包括:至少一个处理器、存储器以及存储在存储器中并可在至少一个处理器上运行的计算机程序,处理器执行计算机程序时实现上述任意各个方法实施例中的步骤。The embodiment of the present application also provides a network device, which includes: at least one processor, a memory, and a computer program stored in the memory and operable on the at least one processor. When the processor executes the computer program, any of the above-mentioned Steps in various method embodiments.
本申请实施例还提供了一种计算机可读存储介质,计算机可读存储介质存储有计算机程序,计算机程序被处理器执行时实现可实现上述各个方法实施例中的步骤。The embodiment of the present application also provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps in the foregoing method embodiments can be realized.
本申请实施例提供了一种计算机程序产品,当计算机程序产品在移动终端上运行时,使得移动终端执行时实现可实现上述各个方法实施例中的步骤。An embodiment of the present application provides a computer program product. When the computer program product is run on a mobile terminal, the mobile terminal can implement the steps in the foregoing method embodiments when executed.
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,计算机程序包括计算机程序代码,计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置/终端的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments in the present application can be completed by instructing related hardware through computer programs, and the computer programs can be stored in a computer-readable storage medium. When executed by a processor, the steps in the foregoing method embodiments can be realized. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying computer program codes to a photographing device/terminal, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random-access memory (RAM, Random Access Memory), electrical carrier signals, telecommunication signals, and software distribution media. Such as U disk, mobile hard disk, magnetic disk or optical disk, etc. In some jurisdictions, computer readable media may not be electrical carrier signals and telecommunication signals under legislation and patent practice.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above-mentioned embodiments, the descriptions of each embodiment have their own emphases, and for parts that are not detailed or recorded in a certain embodiment, refer to the relevant descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
在本申请所提供的实施例中,应该理解到,所揭露的装置/网络设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/网络设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed device/network device and method may be implemented in other ways. For example, the device/network device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units Or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still implement the foregoing embodiments Modifications to the technical solutions described in the examples, or equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the application, and should be included in the Within the protection scope of this application.
Claims (11)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211078874.XA CN115511972A (en) | 2022-09-05 | 2022-09-05 | Calculation method of correction matrix, non-uniformity correction method and related device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211078874.XA CN115511972A (en) | 2022-09-05 | 2022-09-05 | Calculation method of correction matrix, non-uniformity correction method and related device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN115511972A true CN115511972A (en) | 2022-12-23 |
Family
ID=84502293
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211078874.XA Pending CN115511972A (en) | 2022-09-05 | 2022-09-05 | Calculation method of correction matrix, non-uniformity correction method and related device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115511972A (en) |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20140193050A1 (en) * | 2013-01-10 | 2014-07-10 | Caliper Life Sciences, Inc. | Multispectral Imaging Systems and Methods |
| CN112514359A (en) * | 2018-06-18 | 2021-03-16 | 杜比实验室特许公司 | Image capturing method and system |
| CN113297977A (en) * | 2021-05-26 | 2021-08-24 | 奥比中光科技集团股份有限公司 | Living body detection method and device and electronic equipment |
| CN113496518A (en) * | 2020-03-20 | 2021-10-12 | 华为技术有限公司 | Camera response curve calculation method and device |
| CN113676639A (en) * | 2021-08-17 | 2021-11-19 | Oppo广东移动通信有限公司 | Image processing method, processing device, electronic device and medium |
| CN114219724A (en) * | 2021-11-25 | 2022-03-22 | 中国科学院深圳先进技术研究院 | Multispectral image generation method, terminal device and computer-readable storage medium |
-
2022
- 2022-09-05 CN CN202211078874.XA patent/CN115511972A/en active Pending
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20140193050A1 (en) * | 2013-01-10 | 2014-07-10 | Caliper Life Sciences, Inc. | Multispectral Imaging Systems and Methods |
| CN112514359A (en) * | 2018-06-18 | 2021-03-16 | 杜比实验室特许公司 | Image capturing method and system |
| CN113496518A (en) * | 2020-03-20 | 2021-10-12 | 华为技术有限公司 | Camera response curve calculation method and device |
| CN113297977A (en) * | 2021-05-26 | 2021-08-24 | 奥比中光科技集团股份有限公司 | Living body detection method and device and electronic equipment |
| CN113676639A (en) * | 2021-08-17 | 2021-11-19 | Oppo广东移动通信有限公司 | Image processing method, processing device, electronic device and medium |
| CN114219724A (en) * | 2021-11-25 | 2022-03-22 | 中国科学院深圳先进技术研究院 | Multispectral image generation method, terminal device and computer-readable storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN113609907B (en) | Multispectral data acquisition method, device and equipment | |
| EP2529555B1 (en) | Denoising cfa images using weighted pixel differences | |
| EP2529554B1 (en) | Iteratively denoising color filter array images | |
| US20130272605A1 (en) | Image processing device, image processing method, and program | |
| WO2022110846A1 (en) | Living body detection method and device | |
| CN113533256B (en) | A method, device and equipment for determining spectral reflectance | |
| CN110691226B (en) | Image processing method, device, terminal and computer readable storage medium | |
| CN111510692B (en) | Image processing method, terminal and computer readable storage medium | |
| US9313467B2 (en) | Pixel value calibration device and method | |
| CN111161188B (en) | Method, computer device and readable storage medium for reducing image color noise | |
| CN114866754B (en) | Automatic white balance method and device, computer readable storage medium and electronic equipment | |
| CN111163301B (en) | Color adjustment method, device, and computer-readable storage medium | |
| CN115471571B (en) | Calibration method, image processing method, device, storage medium and electronic device | |
| CN113628228B (en) | Lens shading correction data detection method and device | |
| WO2023273412A1 (en) | Method, apparatus and device for determining spectral reflectance | |
| CN114217757B (en) | Color temperature adjustment method, terminal device and computer readable storage medium | |
| CN112200842B (en) | Image registration method, device, terminal equipment and storage medium | |
| CN114630108B (en) | Photosensitive data correction circuit, method, device, electronic equipment and medium | |
| CN115511729A (en) | Multispectral image correction method, device, equipment and storage medium | |
| KR20200106854A (en) | Pixel correction | |
| CN115511972A (en) | Calculation method of correction matrix, non-uniformity correction method and related device | |
| CN112601079B (en) | Camera module calibration method, device, equipment and medium | |
| CN115619640B (en) | Image processing method and device, terminal, chip, and chip module | |
| CN118660232A (en) | Image processing method, device, electronic device and computer readable storage medium | |
| CN115791099A (en) | Optical filter evaluation method, face recognition method, color temperature calculation method and color temperature calculation equipment |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |