Image processing method and device, electronic equipment, storage medium and chip

By performing mapping and dictionary learning on the target image to be processed, high-precision reconstruction of spectral images is achieved, which solves the problems of high spectral image acquisition cost and low accuracy in the existing technology, and is suitable for multi-spectral image scenarios.

CN118608641APending Publication Date: 2024-09-06BEIJING X RING TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410658461.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-24
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

The cost of obtaining spectral images in the existing technology is high, and the accuracy of the reconstructed spectral images is low.

Method used

By obtaining the target image to be processed, performing mapping processing to obtain the target mapping image, obtaining a dictionary based on the sample mapping image and the spectral image, and using these dictionaries to perform dimensionality processing on the target mapping image to obtain the target spectral image, thereby realizing the reconstruction of the spectral image. structure.

Benefits of technology

It improves the reconstruction accuracy of spectral images, is suitable for reconstruction scenarios of multi-spectral images, does not require the use of spectral sensors, and is low cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118608641A
    Figure CN118608641A
Patent Text Reader

Abstract

The invention relates to an image processing method and device, electronic equipment, a storage medium and a chip, and belongs to the technical field of image processing. The method comprises the following steps: acquiring a target to-be-processed image; performing mapping processing on the target to-be-processed image to obtain a target mapping image; obtaining a first dictionary and a second dictionary, the first dictionary being obtained based on data of a plurality of pixel points of the sample mapping image, the second dictionary being obtained based on data of a plurality of pixel points of the sample spectral image, and the sample mapping image being obtained by performing dimension reduction processing on the sample spectral image; and performing dimension raising processing on the target mapping image based on the first dictionary and the second dictionary to obtain a target spectral image. Therefore, the image to be processed can be mapped to obtain the mapped image, the first dictionary and the second dictionary are utilized to perform dimension raising processing on the mapped image to obtain the spectral image, reconstruction of the spectral image can be realized based on dictionary learning, the precision of the reconstructed spectral image is improved, and the cost is relatively low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technology, and in particular to an image processing method, device, electronic device, storage medium and chip. Background Art

[0002] At present, spectral images have the advantages of multiple data dimensions and high spectral resolution, and have been widely used in remote sensing, agriculture, environmental science and other fields. However, in the related technologies, most of them need to use image acquisition equipment such as spectral sensors to collect spectral images, which is costly, or reconstruct spectral images based on the collected images, but there is a problem of low accuracy of the reconstructed spectral images. Summary of the invention

[0003] The present disclosure provides an image processing method, device, electronic device, computer-readable storage medium and chip to at least solve the problem of high cost of acquiring spectral images and low accuracy of reconstructed spectral images in the related art. The technical solution of the present disclosure is as follows:

[0004] According to a first aspect of an embodiment of the present disclosure, there is provided an image processing method, comprising: acquiring a target image to be processed; performing mapping processing on the target image to be processed to obtain a target mapping image, wherein the dimension of data of each pixel point of the target mapping image is a first dimension; acquiring a first dictionary and a second dictionary, wherein the first dictionary is obtained based on data of multiple pixel points of a sample mapping image, and the second dictionary is obtained based on data of multiple pixel points of a sample spectral image, the dimension of data of each pixel point of the sample spectral image is a second dimension, the first dimension is smaller than the second dimension, and the sample mapping image is obtained by performing dimensionality reduction processing on the sample spectral image; based on the first dictionary and the second dictionary, performing dimensionality increase processing on the target mapping image to obtain a target spectral image, wherein the dimension of data of each pixel point of the target spectral image is the second dimension.

[0005] According to a second aspect of an embodiment of the present disclosure, there is provided an image processing apparatus, comprising: a first acquisition module, configured to execute acquisition of a target image to be processed; a mapping module, configured to execute mapping processing on the target image to be processed to obtain a target mapping image, wherein the dimension of data of each pixel point of the target mapping image is a first dimension; a second acquisition module, configured to execute acquisition of a first dictionary and a second dictionary, wherein the first dictionary is obtained based on data of multiple pixels of a sample mapping image, the second dictionary is obtained based on data of multiple pixels of a sample spectral image, the dimension of data of each pixel point of the sample spectral image is a second dimension, the first dimension is smaller than the second dimension, and the sample mapping image is obtained by performing dimensionality reduction processing on the sample spectral image; a dimension increasing module, configured to execute dimensionality increasing processing on the target mapping image based on the first dictionary and the second dictionary to obtain a target spectral image, wherein the dimension of data of each pixel point of the target spectral image is the second dimension.

[0006] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, comprising a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to implement the steps of the method described in the first aspect of the embodiment of the present disclosure.

[0007] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the method described in the first aspect of the embodiment of the present disclosure are implemented.

[0008] According to the fifth aspect of the embodiments of the present disclosure, a chip is provided, comprising one or more interface circuits and one or more processors; the interface circuit is used to receive a signal and send the signal to the processor, the signal comprising a computer instruction stored in a memory, and when the processor executes the computer instruction, the chip executes the steps of the method described in the first aspect of the embodiments of the present disclosure.

[0009] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects: obtaining a target image to be processed, performing mapping processing on the target image to be processed to obtain a target mapping image, obtaining a first dictionary and a second dictionary, and performing dimension-upgrading processing on the target mapping image based on the first dictionary and the second dictionary to obtain a target spectral image. Thus, the image to be processed can be mapped to obtain a mapping image, and the mapping image can be dimensionally upgraded using the first dictionary and the second dictionary to obtain a spectral image, and the spectral image can be reconstructed based on dictionary learning, thereby improving the accuracy of the reconstructed spectral image, being suitable for the reconstruction scenario of multi-spectral images, and not requiring the use of image acquisition equipment such as spectral sensors to acquire spectral images, and having low cost.

[0010] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0012] Figure 1 The figure is a flowchart of an image processing method according to an exemplary embodiment.

[0013] Figure 2 is a flowchart of an image processing method according to another exemplary embodiment.

[0014] Figure 3 is a flowchart of an image processing method according to another exemplary embodiment.

[0015] Figure 4 is a flowchart of an image processing method according to another exemplary embodiment.

[0016] Figure 5 is a schematic diagram of an image processing method according to an exemplary embodiment.

[0017] Figure 6 is a block diagram of an image processing apparatus according to an exemplary embodiment.

[0018] Figure 7 It is a block diagram of an electronic device according to an exemplary embodiment.

[0019] Figure 8 is a block diagram of a chip according to an exemplary embodiment. DETAILED DESCRIPTION

[0020] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0021] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0022] The acquisition, storage, use, and processing of data in the technical solution disclosed in this disclosure are in compliance with the relevant laws and regulations.

[0023] Figure 1 is a flowchart of an image processing method according to an exemplary embodiment. Figure 1 As shown, the image processing method of the embodiment of the present disclosure includes the following steps.

[0024] S101, obtaining a target image to be processed.

[0025] It should be noted that the image processing method of the embodiment of the present disclosure is executed by an electronic device, such as a mobile phone, a notebook, a desktop computer, a vehicle-mounted terminal, a smart home appliance, a wearable device, etc. Among them, the wearable device may include a wrist-worn device (such as a smart watch, a smart bracelet), a head-worn device, a foot-worn device, etc. The image processing method of the embodiment of the present disclosure can be executed by the image processing device of the embodiment of the present disclosure, and the image processing device of the embodiment of the present disclosure can be configured in any electronic device to execute the image processing method of the embodiment of the present disclosure.

[0026] It should be noted that the target image to be processed may be any image in the relevant technology, and no excessive restrictions are made here. For example, the target image to be processed may include RGB, HSV, HSL, YCbCr, Lab, YUV images, etc.

[0027] The data of the pixel points of the RGB image include the pixel value of the pixel point under the red channel, the pixel value of the pixel point under the green channel, and the pixel value of the pixel point under the blue channel.

[0028] The pixel data of the HSV image includes the hue, saturation and value of the pixel.

[0029] The pixel data of the HSL image includes the hue, saturation and brightness of the pixel.

[0030] The pixel data of the YCbCr image includes a brightness component (Luma), a blue chrominance component (Chrominance blue, Cb), and a red chrominance component (Chrominance red, Cr) of the pixel.

[0031] The pixel data of the Lab image includes the brightness of the pixel, the pixel value of the pixel under color channel a, and the pixel value of the pixel under color channel b. Color channel a is a color range from green to red, and color channel b is a color range from blue to yellow.

[0032] The pixel data of the YUV image includes a brightness component (Luma) and two chrominance components (Chrominance) of the pixel.

[0033] In one implementation, the dimension of the data of each pixel point of the sample image to be processed and the target image to be processed may be three-dimensional.

[0034] In one embodiment, obtaining the target image to be processed includes obtaining the original image to be processed acquired by an image acquisition device as the target image to be processed. It should be noted that the image acquisition device is used to acquire the original image to be processed, and there is no excessive limitation on the image acquisition device, for example, it may include a camera (such as an RGB camera, an RGB sensor, a depth camera), a scanner, etc.

[0035] In one embodiment, obtaining the target image to be processed includes obtaining the original image to be processed acquired by the image acquisition device, and performing white balance correction on the original image to be processed to obtain the target image to be processed. Thus, the white balance correction can be performed on the acquired original image to be processed to obtain the target image to be processed, so that the color of the target image to be processed is close to the real color of the photographed object, that is, the color accuracy of the target image to be processed is improved.

[0036] S102, mapping processing is performed on the target image to be processed to obtain a target mapping image, wherein the dimension of data of each pixel point of the target mapping image is a first dimension.

[0037] It should be noted that the dimension of the data of each pixel point of the sample mapping image and the target mapping image is the first dimension, and the dimension of the data of each pixel point of the sample spectrum image and the target spectrum image is the second dimension, and the first dimension is smaller than the second dimension. There are no excessive restrictions on the first dimension and the second dimension. For example, the first dimension can be 3 dimensions and the second dimension can be 5 dimensions, or the first dimension can be 5 dimensions and the second dimension can be 10 dimensions.

[0038] For example, taking the target mapping image as an example, the data of the pixel points of the target mapping image include the data of the pixel points of the target mapping image in the i-th dimension, wherein i is a positive integer not greater than the first dimension.

[0039] For example, taking the target spectrum image as an example, the data of the pixel points of the target spectrum image include the spectral emissivity of the pixel points of the target spectrum image in the jth band, where j is a positive integer not greater than the second dimension.

[0040] It should be noted that the mapping process is performed on the target image to be processed to obtain the target mapped image, which can be achieved by using any image mapping method in the related art, and no further limitation is made here.

[0041] In one embodiment, mapping processing is performed on the target image to be processed to obtain the target mapped image, including mapping processing on the pixel data of the target image to be processed to obtain data of the first dimension as the pixel data of the target mapped image.

[0042] In some examples, mapping the data of the pixel points of the target image to be processed to obtain the data of the first dimension may include mapping the data of the pixel points of the target image to be processed based on a set mapping function to obtain the data of the first dimension. It should be noted that there is no excessive limitation on the set mapping function, for example, it may include a linear mapping function, a nonlinear mapping function, such as RBF (Radial Basis Function).

[0043] S103, obtaining a first dictionary and a second dictionary, wherein the first dictionary is obtained based on data of multiple pixel points of the sample mapping image, and the second dictionary is obtained based on data of multiple pixel points of the sample spectral image, the dimension of the data of each pixel point of the sample spectral image is the second dimension, the first dimension is smaller than the second dimension, and the sample mapping image is obtained by performing dimensionality reduction processing on the sample spectral image.

[0044] It should be noted that the dimension of each atom in the first dictionary is the first dimension, and the dimension of each atom in the second dictionary is the second dimension. The data of each pixel point of the sample mapping image can be sparsely represented by a linear combination of at least one atom in the first dictionary, and the data of each pixel point of the sample spectral image can be sparsely represented by a linear combination of at least one atom in the second dictionary.

[0045] It should be noted that the first dictionary and the second dictionary can be obtained by using any dictionary learning method in the related art, and no further limitation is made here. For example, the dictionary learning method may include K-SVD (K-Sparse Singular Value Decomposition), ODL (Online Dictionary Learning), MOD (Method of Optimal Directions), etc.

[0046] It should be noted that the sample spectral image is subjected to dimensionality reduction processing to obtain the sample mapping image, which can be achieved by using any image dimensionality reduction method in the relevant technology, and no excessive limitation is made here. For example, the image dimensionality reduction method may include a linear dimensionality reduction method, a nonlinear dimensionality reduction method, such as manifold learning (Manifold Learning), PCA (Principal Component Analysis), ICA (Independent Component Analysis), etc.

[0047] In one embodiment, the sample spectral image is subjected to dimensionality reduction processing to obtain the sample mapping image, including performing dimensionality reduction processing on the pixel data of the sample spectral image to obtain data of the first dimension as the pixel data of the sample mapping image.

[0048] In one embodiment, a sample spectral image is subjected to dimensionality reduction processing to obtain a sample mapping image, including generating a second data set based on data of multiple pixel points of the sample spectral image, constructing a KD tree (K-Dimensional Tree) based on the second data set, searching for K neighbors of the data of the pixel points of the sample spectral image based on the KD tree, and constructing a neighborhood graph, wherein nodes in the neighborhood graph are used to represent the data of the pixel points of the sample spectral image, adding a connecting edge between a first node and a second node in the neighborhood graph, wherein the data of the pixel point of the sample spectral image corresponding to the first node is a neighbor of the data of the pixel point of the sample spectral image corresponding to the second node, generating a geodesic distance matrix based on the shortest distance between any two nodes in the neighborhood graph, and performing dimensionality reduction processing on the geodesic distance matrix to obtain data of multiple pixel points of the sample mapping image.

[0049] It should be noted that obtaining the shortest distance between any two nodes in the neighborhood graph can be achieved by using any shortest distance obtaining method in the relevant technology, and no further limitation is made here. For example, the shortest distance obtaining method may include Dijkstra algorithm, Floyd-Warshall algorithm, etc.

[0050] It should be noted that the dimension reduction processing of the geodesic distance matrix can be implemented by using any data dimension reduction method in the relevant technology, and no excessive limitation is made here. For example, the data dimension reduction method may include MDS (Multidimensional Scaling), Sammon Mapping, ISOMAP (Isometric Mapping), etc.

[0051] S104, performing dimension-upgrading processing on the target mapping image based on the first dictionary and the second dictionary to obtain a target spectrum image, wherein the dimension of data of each pixel point of the target spectrum image is the second dimension.

[0052] In the embodiment of the present disclosure, based on the first dictionary and the second dictionary, the target mapping image is subjected to dimensionality increase processing to obtain the target spectral image, including the following possible implementations:

[0053] Method 1: Based on the first dictionary and the second dictionary, a dimension-raising matrix is ​​determined, and based on the dimension-raising matrix, the pixel data of the target mapping image is dimension-raised to obtain the pixel data of the target spectral image.

[0054] In some examples, determining a dimension-raised matrix based on the first dictionary and the second dictionary includes obtaining a product of the second dictionary and a pseudo-inverse matrix of the first dictionary as the dimension-raised matrix.

[0055] In some examples, based on the dimension-raising matrix, the data of the pixel points of the target mapping image are dimensionally raised to obtain the data of the pixel points of the target spectral image, including generating a column vector of the first dimension based on the pixel point data of the target mapping image, obtaining the product of the dimension-raising matrix and the column vector of the first dimension as the column vector of the second dimension, and using the data of the column vector of the second dimension as the pixel point data of the target spectral image.

[0056] Method 2: based on the first dictionary and the pixel data of the target mapping image, determine the sparse coding of the pixel data of the target mapping image, and based on the second dictionary and the sparse coding of the pixel data of the target mapping image, obtain the pixel data of the target spectral image.

[0057] It should be noted that the dimension of the sparse coding of the pixel data of the target mapping image is the third dimension, wherein the third dimension is the number of atoms in the first dictionary and the number of atoms in the second dictionary.

[0058] In some examples, the data of the pixel points of the target spectral image are obtained based on the sparse coding of the second dictionary and the pixel points of the target mapping image, including determining the weight corresponding to each atom of the second dictionary based on the sparse coding of the pixel points of the target mapping image, and performing weighted summation on each atom of the second dictionary based on the weight corresponding to each atom of the second dictionary to obtain the data of the pixel points of the target spectral image.

[0059] For example, the process of obtaining the pixel data of the target spectral image is as follows:

[0060] y i =D L c i

[0061]

[0062] x i =D H c i

[0063] Among them, y i is the data of the i-th pixel of the target mapping image, y i is the column vector of d rows, c i is the sparse coding of the data of the i-th pixel of the target mapping image, c i is the column vector of K rows, x i is the data of the i-th pixel of the target spectral image, x i is the column vector of D rows, D L is the first dictionary, D L is a matrix with d rows and K columns, D H is the second dictionary, D H It is a matrix with D rows and K columns, where d is the first dimension, D is the second dimension, K is the third dimension, and i is a positive integer.

[0064] The image processing method provided by the embodiment of the present disclosure obtains a target image to be processed, performs mapping processing on the target image to be processed to obtain a target mapping image, obtains a first dictionary and a second dictionary, and performs dimension-upgrading processing on the target mapping image based on the first dictionary and the second dictionary to obtain a target spectral image. Thus, the image to be processed can be mapped to obtain a mapping image, and the mapping image can be dimensionally upgraded using the first dictionary and the second dictionary to obtain a spectral image. The spectral image can be reconstructed based on dictionary learning, thereby improving the accuracy of the reconstructed spectral image. The method is suitable for the reconstruction scenario of multi-spectral images, and does not require the use of image acquisition equipment such as spectral sensors to acquire spectral images, and has low cost.

[0065] Figure 2 is a flowchart of an image processing method according to another exemplary embodiment. Figure 2 As shown, the image processing method of the embodiment of the present disclosure includes the following steps.

[0066] S201, obtaining a target image to be processed.

[0067] S202, mapping processing is performed on the target image to be processed to obtain a target mapping image, wherein the dimension of data of each pixel point of the target mapping image is a first dimension.

[0068] S203, obtaining a first dictionary and a second dictionary, wherein the first dictionary is obtained based on data of multiple pixel points of the sample mapping image, and the second dictionary is obtained based on data of multiple pixel points of the sample spectral image, the dimension of the data of each pixel point of the sample spectral image is the second dimension, the first dimension is smaller than the second dimension, and the sample mapping image is obtained by performing dimensionality reduction processing on the sample spectral image.

[0069] S204 , based on the first dictionary and the second dictionary, perform dimensionality up-scaling processing on the target mapping image to obtain a target spectrum image, wherein the dimension of data of each pixel point of the target spectrum image is the second dimension.

[0070] For the relevant contents of steps S201 - S204 , please refer to the above embodiment and will not be described again here.

[0071] S205 , estimating the light source of the target image to be processed based on the target spectrum image, to obtain an estimated light source of the target image to be processed.

[0072] In the embodiments of the present disclosure, based on the target spectral image, the light source of the target image to be processed is estimated to obtain the estimated light source of the target image to be processed, including the following possible implementations:

[0073] Method 1: extract a first image feature from a target spectral image, estimate the light source of the target image to be processed based on the first image feature, and obtain an estimated light source of the target image to be processed.

[0074] It should be noted that there are no excessive restrictions on the first image features. For example, the first image features may include spectral image features that are highly correlated with the light source, such as spectral reflectance, emissivity, and the like.

[0075] In one embodiment, estimating the light source of the target image to be processed based on the first image feature to obtain the estimated light source of the target image to be processed includes obtaining a mapping relationship between the candidate image feature and the candidate light source, and obtaining a candidate light source having a mapping relationship with the first image feature as the estimated light source of the target image to be processed. It is understandable that different candidate image feature mappings may result in different candidate light sources.

[0076] Method 2: Input the target spectral image into the target model, and the target model outputs the estimated light source of the target image to be processed.

[0077] It should be noted that there are not too many restrictions on the target model. For example, it can include RF (Random Forest) model, logistic regression model, deep learning model, Xgboost (eXtreme gradient boosting) model, etc.

[0078] In one embodiment, the method also includes acquiring a sample spectral image and a sample light source of a sample image to be processed, inputting the sample spectral image into an initial model, outputting an estimated light source of the sample image to be processed by the initial model, and training the initial model based on the estimated light source of the sample image to be processed and the sample light source of the sample image to be processed to obtain a target model.

[0079] It should be noted that the initial model is trained based on the estimated light source of the sample image to be processed and the sample light source of the sample image to be processed, and any model training method in the relevant technology can be used to achieve it, which will not be repeated here. For example, the model training method may include LoRA (Low-Rank Adaptation) and instruction fine-tuning (Instruction Fine-Tuning) methods. It should be noted that LoRA is a method for efficient fine-tuning of model parameters (Parameter-Efficient Fine-Tuning).

[0080] In one embodiment, the initial model is trained based on the estimated light source of the sample image to be processed and the sample light source of the sample image to be processed, including obtaining a loss function of the initial model based on the estimated light source of the sample image to be processed and the sample light source of the sample image to be processed, and training the initial model based on the loss function. It should be noted that there are no excessive restrictions on the loss function, for example, it can include CE (Cross Entropy), MSE (Mean-Square Error), KL (Kullback-Leibler) divergence, contrast loss function, etc.

[0081] Method 3: Based on the target spectral image and the target image to be processed, the light source of the target image to be processed is estimated to obtain the estimated light source of the target image to be processed.

[0082] In one embodiment, based on the target spectral image and the target image to be processed, the light source of the target image to be processed is estimated to obtain the estimated light source of the target image to be processed, including extracting a first image feature from the target spectral image, extracting a second image feature from the target image to be processed, and estimating the light source of the target image to be processed based on the first image feature and the second image feature to obtain the estimated light source of the target image to be processed.

[0083] It should be noted that there are not too many restrictions on the second image features. For example, it may include image features to be processed that are highly correlated with the light source, such as image brightness distribution, image color distribution, image shadow parameters (such as shadow size and shape), etc.

[0084] In some examples, the light source of the target image to be processed is estimated based on the first image feature and the second image feature to obtain the estimated light source of the target image to be processed, including fusing the first image feature and the second image feature to obtain a fused feature, and estimating the light source of the target image to be processed based on the fused feature to obtain the estimated light source of the target image to be processed.

[0085] It should be noted that, for the relevant content of estimating the light source of the target image to be processed based on the fusion features, reference may be made to the relevant content of estimating the light source of the target image to be processed based on the first image features in the above embodiment, which will not be repeated here.

[0086] In one embodiment, based on the target spectral image and the target image to be processed, the light source of the target image to be processed is estimated to obtain the estimated light source of the target image to be processed, including inputting the target spectral image and the target image to be processed into a target model, and the target model outputs the estimated light source of the target image to be processed.

[0087] Method 4: perform dimensionality reduction processing on the target spectral image to obtain multiple candidate images to be processed, wherein the light source of the candidate images to be processed is the set light source, and the candidate images to be processed correspond to the set light source one by one. Based on the multiple candidate images to be processed and the target image to be processed, the light source of the target image to be processed is estimated to obtain the estimated light source of the target image to be processed.

[0088] It should be noted that the set light source can adopt any light source in the relevant technology, for example, it can include natural light sources (such as the sun, the moon), lighting fixtures (such as incandescent lamps, fluorescent lamps), optoelectronic devices (such as photodiodes, optical fibers), etc., without too many restrictions here.

[0089] In one embodiment, based on multiple candidate images to be processed and a target image to be processed, the light source of the target image to be processed is estimated to obtain the estimated light source of the target image to be processed, including obtaining the similarity between the candidate image to be processed and the target image to be processed, and based on the similarity, determining the estimated light source of the target image to be processed from multiple set light sources.

[0090] It should be noted that obtaining the similarity between the candidate image to be processed and the target image to be processed may be achieved by using any method for obtaining the similarity between two images in the related art, and no further limitation is made here.

[0091] In some examples, based on the similarity, determining the estimated light source of the target image to be processed from multiple set light sources includes sorting the multiple candidate images to be processed from small to large according to the similarity, obtaining the set light sources corresponding to the top L candidate images to be processed as the estimated light source of the target image to be processed, where L is a positive integer. It should be noted that L is not too limited, for example, L is 1, 3, etc.

[0092] In one embodiment, based on multiple candidate images to be processed and a target image to be processed, the light source of the target image to be processed is estimated to obtain the estimated light source of the target image to be processed, including obtaining the color difference between the candidate image to be processed and the target image to be processed, and based on the color difference, determining the estimated light source of the target image to be processed from multiple set light sources.

[0093] It should be noted that the color difference between the candidate image to be processed and the target image to be processed can be obtained by using any method of obtaining the color difference between two images in the related art, and no further limitation is made here. For example, the sub-color difference between the pixel point of the candidate image to be processed and the pixel point of the target image to be processed can be obtained, and the average value of multiple sub-color differences can be obtained as the color difference between the candidate image to be processed and the target image to be processed.

[0094] In some examples, based on the color difference, determining the estimated light source of the target image to be processed from multiple set light sources includes taking the set light source corresponding to the candidate image to be processed with the smallest color difference as the estimated light source of the target image to be processed,

[0095] In some examples, based on color difference, an estimated light source of a target image to be processed is determined from multiple set light sources, including sorting multiple candidate images to be processed from small to large according to color difference, and obtaining the set light sources corresponding to the first L candidate images to be processed as the estimated light source of the target image to be processed, where L is a positive integer.

[0096] In some examples, based on the color difference, determining the estimated illuminant of the target image to be processed from multiple set illuminants includes obtaining a score of the candidate image to be processed based on the color difference and the similarity, and determining the estimated illuminant of the target image to be processed from the multiple set illuminants based on the score. For example, the score of the candidate image to be processed is negatively correlated with the color difference, and the score of the candidate image to be processed is positively correlated with the similarity.

[0097] It should be noted that, for the content related to determining the estimated light source of the target image to be processed from multiple set light sources based on the score, reference may be made to the content related to determining the estimated light source of the target image to be processed from multiple set light sources based on the color difference in the above embodiment, which will not be repeated here.

[0098] In one embodiment, after obtaining the estimated light source of the target image to be processed, the method further includes performing color restoration on the target image to be processed based on the estimated light source of the target image to be processed to obtain a restored image to be processed. Thus, the estimated light source of the target image to be processed can be taken into consideration to perform color restoration on the target image to be processed, so that the color of the restored image to be processed is close to the real color of the photographed object, that is, the color accuracy of the restored image to be processed is improved.

[0099] It should be noted that color restoration of the target image to be processed based on the estimated light source of the target image to be processed can be achieved by using any color restoration method in the relevant technology, and no further limitation is made here.

[0100] It should be noted that the target spectral image is subjected to dimensionality reduction processing to obtain a plurality of candidate images to be processed, which can be achieved by using any image dimensionality reduction method in the relevant technology, and no excessive limitation is made here.

[0101] For example, taking the candidate image to be processed as a candidate RGB image, the process of performing dimensionality reduction processing on the target spectral image to obtain the candidate RGB image is as follows:

[0102]

[0103]

[0104]

[0105] Among them, p r (m) is the pixel value of the mth pixel of the candidate RGB image in the red channel, p g (m) is the pixel value of the mth pixel of the candidate RGB image in the green channel, p b (m) is the pixel value of the mth pixel of the candidate RGB image in the blue channel, E(λ n ) is the spectral power of the set light source corresponding to the candidate RGB image in the nth band, S r(λ n ) is the spectral response rate of the RGB sensor in the red channel and the nth band, S g (λ n ) is the spectral response rate of the RGB sensor in the green channel and the nth band, S b (λ n ) is the spectral response rate of the RGB sensor in the blue channel and the nth band, r(λ n ,m) is the spectral reflectance of the mth pixel of the target spectral image in the nth band, λ n is the wavelength of the nth band, and N is the number of bands of spectral reflectance in the visible light spectrum.

[0106] The image processing method provided by the embodiment of the present disclosure estimates the light source of the target image to be processed based on the target spectral image, and obtains the estimated light source of the target image to be processed. Therefore, the light source estimation of the image to be processed can be performed by taking into account the spectral image, which improves the accuracy of the light source estimation of the image to be processed. Moreover, the spectral image is obtained by reconstruction, and there is no need to use image acquisition devices such as spectral sensors to collect spectral images. It is suitable for image processing scenarios of devices with limited hardware capacity (such as terminal devices such as mobile phones).

[0107] Figure 3 is a flowchart of an image processing method according to another exemplary embodiment. Figure 3 As shown, the image processing method of the embodiment of the present disclosure includes the following steps.

[0108] S301, obtaining a target image to be processed.

[0109] S302 , mapping the target image to be processed to obtain a target mapping image, wherein the dimension of data of each pixel point of the target mapping image is a first dimension.

[0110] For the relevant contents of steps S301 - S302 , please refer to the above embodiments and will not be described again here.

[0111] S303: Generate a first data set based on data of a plurality of pixel points of the sample mapping image.

[0112] For example, the first data set Y′ can be expressed as:

[0113] Y'=[y′1,y′2…y′ N ]∈R d*N ,y′ i ∈R d*1

[0114] Among them, y′ i is the data of the i-th pixel of the sample mapping image, y′ iis a column vector with d rows, N is the number of pixels of the sample mapping image, d is the first dimension, and i is a positive integer.

[0115] S304: Generate a second data set based on data of a plurality of pixel points of the sample spectral image.

[0116] For example, the second data set X′ can be expressed as:

[0117] X'=[x′1,x'2…x' N ]∈R D*N ,x′ i ∈R D*1

[0118] Among them, x′ i is the data of the i-th pixel of the sample spectral image, x′ i is a column vector of D rows, N is the number of pixels of the sample spectral image, D is the second dimension, and i is a positive integer.

[0119] S305: Perform dictionary learning on the first data set to obtain a first dictionary.

[0120] S306: Perform dictionary learning on the second data set to obtain a second dictionary.

[0121] It should be noted that dictionary learning on the first data set to obtain relevant content of the first dictionary and dictionary learning on the second data set to obtain relevant content of the second dictionary can be achieved by using any dictionary learning method in the relevant technology, and no excessive restrictions are made here.

[0122] In one implementation, the optimization goal of dictionary learning for the second data set is as follows:

[0123]

[0124] C'=[c′1,c'2…c' N ]∈R K*N ,c′ i ∈R K*1

[0125] D H =[d1,d2…d K ]∈R D*K ,d j ∈R D*1

[0126] y′ i =g(x′ i )

[0127] Among them, C' is the sparse coding matrix corresponding to the second data set X', c' iis the sparse code of the i-th pixel of the sample spectral image, c′ i is the column vector of K rows, c' ji c′ i The j-th row element of D H is the second dictionary, d j is the jth atom in the second dictionary, d j is the column vector of D rows, N is the number of pixels of the sample spectral image, D is the second dimension, K is the third dimension, i and j are positive integers, λ is the setting coefficient, and g(·) is x′ i Dimensionality reduction to y′ i The dimensionality reduction function can be obtained based on manifold learning.

[0128] In one embodiment, the constraints for dictionary learning on the second data set include c′ i The sum of each row element of is 1, and / or, if d j Not in x′ i The nearest neighbor, c' ji =0.

[0129] In one implementation, the optimization goal of dictionary learning for the first data set is as follows:

[0130]

[0131] Among them, D L The first dictionary.

[0132] For example, the process of obtaining the first dictionary is as follows:

[0133] D L =Y'C' T (C'C' T ) -1

[0134] Among them, C' T is the transposed matrix of C'.

[0135] S307 , performing dimension-upgrading processing on the target mapping image based on the first dictionary and the second dictionary to obtain a target spectrum image, wherein the dimension of data of each pixel point of the target spectrum image is the second dimension.

[0136] For the relevant contents of step S307, please refer to the above embodiment, which will not be repeated here.

[0137] The image processing method provided by the embodiments of the present disclosure generates a first data set based on data of multiple pixel points of a sample mapping image, generates a second data set based on data of multiple pixel points of a sample spectral image, performs dictionary learning on the first data set to obtain a first dictionary, and performs dictionary learning on the second data set to obtain a second dictionary, so as to achieve the acquisition of the first dictionary and the second dictionary.

[0138] Figure 4 is a flowchart of an image processing method according to another exemplary embodiment. Figure 4 As shown, the image processing method of the embodiment of the present disclosure includes the following steps.

[0139] S401, obtaining a target image to be processed.

[0140] For the relevant contents of step S401, please refer to the above embodiment, which will not be repeated here.

[0141] S402, performing dimension reduction processing on the sample spectral image to obtain a sample image to be processed.

[0142] It should be noted that the dimensionality reduction processing of the sample spectral image to obtain the relevant content of the sample image to be processed can refer to the dimensionality reduction processing of the target spectral image to obtain the relevant content of the candidate image to be processed in the above embodiment, which will not be repeated here.

[0143] S403: Determine a first mapping manner of mapping a target image to be processed to a target mapping image based on the sample image to be processed and the sample mapping image.

[0144] In one embodiment, based on the sample image to be processed and the sample mapping image, a first mapping method of mapping the target image to be processed to the target mapping image is determined, including a third mapping method of mapping the sample image to be processed to the sample mapping image based on the sample image to be processed and the sample mapping image, as the first mapping method.

[0145] In some examples, based on the sample image to be processed and the sample mapping image, a third mapping method of mapping the sample image to be processed to the sample mapping image is determined, including inputting the sample image to be processed and the sample mapping image into a mapping model, and the mapping model outputs the third mapping method.

[0146] In one embodiment, based on a sample image to be processed and a sample mapping image, a first mapping method for mapping a target image to be processed to a target mapping image is determined, including generating a third data set based on data of multiple pixels of the sample image to be processed, generating a first data set based on data of multiple pixels of the sample mapping image, and obtaining a second mapping method for mapping data of a first pixel of the sample image to be processed to data of a second pixel of the sample mapping image based on the first data set and the third data set, as the first mapping method, wherein the data of the first pixel and the data of the second pixel are obtained by performing dimensionality reduction processing on the data of the same pixel of the sample spectral image.

[0147] For example, taking the data dimension of each pixel point of the sample to be processed image as 3-dimensional, the third data set P′ can be expressed as:

[0148] P'=[p'1,p'2…p' N ]∈R 3*N ,p′ i ∈R 3*1

[0149] Among them, p′ i is the data of the i-th pixel of the sample image to be processed, p′ i is a column vector with 3 rows, N is the number of pixels of the sample image to be processed, and i is a positive integer.

[0150] For example, taking the second mapping method as a mapping function, the optimization goal of the mapping function is as follows:

[0151]

[0152] Where f(·) is p′ i Mapping to y′ i The mapping function, p′ i , y′ i is for the same x′ i After dimensionality reduction, β is the function parameter of f(·), is the estimated function parameter of f(·), N is the number of pixels of the sample image to be processed, and i is a positive integer.

[0153] S404: Mapping the target image to be processed according to a first mapping method to obtain a target mapped image.

[0154] S405, obtaining a first dictionary and a second dictionary, wherein the first dictionary is obtained based on data of multiple pixel points of the sample mapping image, and the second dictionary is obtained based on data of multiple pixel points of the sample spectral image, the dimension of the data of each pixel point of the sample spectral image is the second dimension, the first dimension is smaller than the second dimension, and the sample mapping image is obtained by performing dimensionality reduction processing on the sample spectral image.

[0155] S406 , based on the first dictionary and the second dictionary, perform dimension-upgrading processing on the target mapping image to obtain a target spectrum image, wherein the dimension of data of each pixel point of the target spectrum image is the second dimension.

[0156] For the relevant contents of steps S404-S406, please refer to the above embodiment and will not be repeated here.

[0157] The image processing method provided by the embodiments of the present disclosure can perform dimensionality reduction processing on the sample spectral image to obtain the sample image to be processed, comprehensively consider the sample image to be processed and the sample mapping image, determine the first mapping method for mapping the target image to be processed to the target mapping image, and perform mapping processing on the target image to be processed according to the first mapping method to obtain the target mapping image, so as to achieve the mapping of the target image to be processed to the target mapping image.

[0158] Based on any of the above embodiments, Figure 5 As shown, the sample spectral image is subjected to dimensionality reduction processing to obtain a sample image to be processed and a sample mapping image, a first data set is generated based on data of multiple pixel points of the sample mapping image, a second data set is generated based on data of multiple pixel points of the sample spectral image, and a third data set is generated based on data of multiple pixel points of the sample image to be processed.

[0159] Dictionary learning is performed on the first data set to obtain a first dictionary, dictionary learning is performed on the second data set to obtain a second dictionary, and based on the first data set and the third data set, a first mapping method of mapping a target image to be processed to a target mapping image is determined.

[0160] An original image to be processed acquired by a camera is obtained, white balance correction is performed on the original image to be processed to obtain a target image to be processed, mapping processing is performed on the target image to be processed according to a first mapping method to obtain a target mapping image, and based on a first dictionary and a second dictionary, dimension-upgrading processing is performed on the target mapping image to obtain a target spectral image.

[0161] The target spectral image is subjected to dimensionality reduction processing to obtain multiple candidate images to be processed. Based on the multiple candidate images to be processed and the original image to be processed, the light source of the original image to be processed is estimated to obtain the estimated light source of the original image to be processed. Based on the estimated light source of the original image to be processed, the target image to be processed is color restored to obtain the restored image to be processed.

[0162] Figure 6 is a block diagram of an image processing device according to an exemplary embodiment. Figure 6 The image processing device 100 of the embodiment of the present disclosure includes: a first acquisition module 110, a mapping module 120, a second acquisition module 130 and a dimension upgrading module 140.

[0163] A first acquisition module 110 is configured to acquire a target image to be processed;

[0164] The mapping module 120 is configured to perform mapping processing on the target image to be processed to obtain a target mapping image, wherein the dimension of data of each pixel point of the target mapping image is a first dimension;

[0165] The second acquisition module 130 is configured to execute acquisition of a first dictionary and a second dictionary, wherein the first dictionary is obtained based on data of a plurality of pixels of a sample mapping image, the second dictionary is obtained based on data of a plurality of pixels of a sample spectrum image, the dimension of the data of each pixel of the sample spectrum image is a second dimension, the first dimension is smaller than the second dimension, and the sample mapping image is obtained by performing dimensionality reduction processing on the sample spectrum image;

[0166] The dimension increasing module 140 is configured to perform dimension increasing processing on the target mapping image based on the first dictionary and the second dictionary to obtain a target spectrum image, wherein the dimension of data of each pixel point of the target spectrum image is the second dimension.

[0167] In one embodiment of the present disclosure, the apparatus 100 further includes: an estimation module, wherein the estimation module is configured to perform: estimating the light source of the target image to be processed based on the target spectral image, to obtain an estimated light source of the target image to be processed.

[0168] In one embodiment of the present disclosure, the estimation module is further configured to execute: performing dimensionality reduction processing on the target spectral image to obtain a plurality of candidate images to be processed, wherein the light source of the candidate images to be processed is a set light source, and the candidate images to be processed correspond one-to-one to the set light source; estimating the light source of the target image to be processed based on the plurality of candidate images to be processed and the target image to be processed to obtain an estimated light source of the target image to be processed.

[0169] In one embodiment of the present disclosure, the estimation module is further configured to execute: obtaining the color difference between the candidate image to be processed and the target image to be processed; and determining the estimated light source of the target image to be processed from the plurality of set light sources based on the color difference.

[0170] In one embodiment of the present disclosure, the estimation module is further configured to execute: sorting the multiple candidate images to be processed from small to large according to the color difference; obtaining the set light sources corresponding to the first L candidate images to be processed as the estimated light source of the target image to be processed, where L is a positive integer.

[0171] In one embodiment of the present disclosure, after obtaining the estimated light source of the target image to be processed, the estimation module is further configured to execute: based on the estimated light source of the target image to be processed, color restoration of the target image to be processed is performed to obtain a restored image to be processed.

[0172] In one embodiment of the present disclosure, the dimension increasing module 140 is further configured to perform: determining the sparse coding of the pixel data of the target mapping image based on the first dictionary and the pixel data of the target mapping image; and obtaining the pixel data of the target spectral image based on the sparse coding of the pixel data of the target mapping image based on the second dictionary and the pixel data of the target mapping image.

[0173] In one embodiment of the present disclosure, the second acquisition module 130 is further configured to execute: generating a first data set based on data of multiple pixel points of the sample mapping image; generating a second data set based on data of multiple pixel points of the sample spectral image; performing dictionary learning on the first data set to obtain the first dictionary; performing dictionary learning on the second data set to obtain the second dictionary.

[0174] In one embodiment of the present disclosure, the mapping module 120 is further configured to execute: performing dimensionality reduction processing on the sample spectral image to obtain a sample image to be processed; determining a first mapping method for mapping the target image to be processed to the target mapping image based on the sample image to be processed and the sample mapping image; and performing mapping processing on the target image to be processed according to the first mapping method to obtain the target mapping image.

[0175] In one embodiment of the present disclosure, the mapping module 120 is further configured to execute: generating a third data set based on data of multiple pixel points of the sample image to be processed; generating a first data set based on data of multiple pixel points of the sample mapping image; and obtaining a second mapping method of mapping the data of the first pixel point of the sample image to be processed to the data of the second pixel point of the sample mapping image based on the first data set and the third data set, as the first mapping method, wherein the data of the first pixel point and the data of the second pixel point are obtained by performing dimensionality reduction processing on the data of the same pixel point of the sample spectral image.

[0176] In one embodiment of the present disclosure, the first acquisition module 110 is further configured to execute: acquiring an original image to be processed acquired by an image acquisition device; performing white balance correction on the original image to be processed to obtain the target image to be processed.

[0177] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0178] The image processing device provided by the embodiment of the present disclosure obtains a target image to be processed, performs mapping processing on the target image to be processed to obtain a target mapping image, obtains a first dictionary and a second dictionary, and performs dimension-upgrading processing on the target mapping image based on the first dictionary and the second dictionary to obtain a target spectral image. Thus, the image to be processed can be mapped to obtain a mapping image, and the mapping image can be dimensionally upgraded using the first dictionary and the second dictionary to obtain a spectral image. The spectral image can be reconstructed based on dictionary learning, thereby improving the accuracy of the reconstructed spectral image. The device is suitable for the reconstruction scene of multi-spectral images, and does not require the use of image acquisition equipment such as spectral sensors to acquire spectral images, and has low cost.

[0179] Figure 7 It is a block diagram of an electronic device according to an exemplary embodiment.

[0180] like Figure 7 As shown, the electronic device 200 includes:

[0181] The memory 210 and the processor 220, a bus 230 connecting different components (including the memory 210 and the processor 220), the memory 210 stores a computer program, and when the processor 220 executes the program, the image processing method described in the embodiment of the present disclosure is implemented.

[0182] Bus 230 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.

[0183] The electronic device 200 typically includes a variety of electronic device readable media. These media can be any available media that can be accessed by the electronic device 200, including volatile and non-volatile media, removable and non-removable media.

[0184] The memory 210 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 240 and / or cache memory 250. The electronic device 200 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 260 may be used to read and write non-removable, non-volatile magnetic media ( Figure 7 not shown, usually called a "hard drive"). Although Figure 7 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 230 via one or more data medium interfaces. The memory 210 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present disclosure.

[0185] A program / utility 280 having a set (at least one) of program modules 270 may be stored, for example, in the memory 210, such program modules 270 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 270 generally perform the functions and / or methods of the embodiments described in the present disclosure.

[0186] The electronic device 200 may also communicate with one or more external devices 290 (e.g., keyboards, pointing devices, displays 291, etc.), one or more devices that enable a user to interact with the electronic device 200, and / or any device that enables the electronic device 200 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed through an input / output (I / O) interface 292. Furthermore, the electronic device 200 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter 293. Figure 7 As shown, the network adapter 293 communicates with other modules of the electronic device 200 via the bus 230. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0187] The processor 220 executes various functional applications and data processing by running the programs stored in the memory 210 .

[0188] It should be noted that the implementation process and technical principles of the electronic device of this embodiment refer to the aforementioned explanation of the image processing method of the embodiment of the present disclosure, and will not be repeated here.

[0189] The electronic device provided by the embodiment of the present disclosure can execute the image processing method as described above, obtain the target image to be processed, perform mapping processing on the target image to be processed to obtain the target mapping image, obtain the first dictionary and the second dictionary, and perform dimension-upgrading processing on the target mapping image based on the first dictionary and the second dictionary to obtain the target spectral image. Thus, the image to be processed can be mapped to obtain the mapping image, and the mapping image can be dimensionally upgraded using the first dictionary and the second dictionary to obtain the spectral image, and the spectral image can be reconstructed based on dictionary learning, thereby improving the accuracy of the reconstructed spectral image, and is suitable for the reconstruction scene of multi-spectral images, and does not need to use image acquisition equipment such as spectral sensors to acquire spectral images, and the cost is low.

[0190] In order to implement the above embodiments, the present disclosure further proposes a computer-readable storage medium on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the image processing method provided by the present disclosure are implemented.

[0191] Alternatively, the computer readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, or the like.

[0192] Figure 8 is a block diagram of a chip according to an exemplary embodiment.

[0193] like Figure 8 As shown, the above-mentioned chip 300 includes one or more interface circuits 320 and one or more processors 310; the interface circuit 320 is used to receive signals and send signals to the processor 310, and the signals include computer instructions stored in the memory. When the processor 310 executes the computer instructions, the chip 300 executes the steps of the image processing method provided by the present disclosure.

[0194] The processor 310 and the interface circuit 320 may be interconnected via lines.

[0195] Chip 300 further includes a memory 330 , all or part of which may be located outside chip 300 .

[0196] The interface circuit 320 is connected to the memory 330. The interface circuit 320 can be used to receive signals from the memory 330 or other devices, and the interface circuit 320 can be used to send signals to the processor 310 or other devices. For example, the interface circuit 320 can read the instructions stored in the memory 330 and send the instructions to the processor 310.

[0197] The interface circuit 320 can obtain data, program instructions and / or information from the internal storage area of ​​the chip 300 ; it can also obtain data, program instructions and / or information from the outside of the chip 300 .

[0198] It should be noted that terms such as interface circuit, interface, transceiver pin, and transceiver are interchangeable.

[0199] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0200] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. An image processing method, characterized in that: include: Obtain the target image to be processed; Performing mapping processing on the target image to be processed to obtain a target mapping image, wherein the dimension of data of each pixel point of the target mapping image is a first dimension; Obtaining a first dictionary and a second dictionary, wherein the first dictionary is obtained based on data of a plurality of pixel points of a sample mapping image, and the second dictionary is obtained based on data of a plurality of pixel points of a sample spectral image, the dimension of the data of each pixel point of the sample spectral image is a second dimension, the first dimension is smaller than the second dimension, and the sample mapping image is obtained by performing dimensionality reduction processing on the sample spectral image; Based on the first dictionary and the second dictionary, the target mapping image is subjected to dimensionality increase processing to obtain a target spectrum image, wherein the dimension of data of each pixel point of the target spectrum image is the second dimension.

2. The method according to claim 1, characterized in that: After obtaining the target spectral image, the method further includes: Based on the target spectral image, the light source of the target image to be processed is estimated to obtain the estimated light source of the target image to be processed.

3. The method according to claim 2, characterized in that The step of estimating the light source of the target image to be processed based on the target spectrum image to obtain the estimated light source of the target image to be processed includes: Performing dimensionality reduction processing on the target spectral image to obtain a plurality of candidate images to be processed, wherein the light source of the candidate images to be processed is a set light source, and the candidate images to be processed correspond to the set light source one by one; Based on the plurality of candidate images to be processed and the target image to be processed, the light source of the target image to be processed is estimated to obtain the estimated light source of the target image to be processed.

4. The method according to claim 3, characterized in that The step of estimating the light source of the target image to be processed based on the plurality of candidate images to be processed and the target image to be processed to obtain the estimated light source of the target image to be processed includes: Acquire the color difference between the candidate image to be processed and the target image to be processed; Based on the color difference, an estimated light source of the target image to be processed is determined from the plurality of set light sources.

5. The method according to claim 4, characterized in that The step of determining the estimated light source of the target image to be processed from the plurality of set light sources based on the color difference comprises: sorting the plurality of candidate images to be processed from small to large according to the color difference; The set light sources corresponding to the top L candidate images to be processed are obtained as the estimated light sources of the target image to be processed, where L is a positive integer.

6. The method according to claim 2, characterized in that After obtaining the estimated light source of the target image to be processed, the method further includes: Based on the estimated light source of the target image to be processed, the target image to be processed is subjected to color restoration to obtain a restored image to be processed.

7. The method according to claim 1, characterized in that The step of performing dimension-upgrading processing on the target mapping image based on the first dictionary and the second dictionary to obtain a target spectral image includes: Determine sparse coding of the pixel data of the target mapping image based on the first dictionary and the pixel data of the target mapping image; Based on the second dictionary and the sparse coding of the pixel data of the target mapping image, the pixel data of the target spectral image is obtained.

8. The method according to claim 1, characterized in that The obtaining of the first dictionary and the second dictionary comprises: Generate a first data set based on data of a plurality of pixel points of the sample mapping image; Generate a second data set based on data of a plurality of pixel points of the sample spectral image; Performing dictionary learning on the first data set to obtain the first dictionary; Dictionary learning is performed on the second data set to obtain the second dictionary.

9. The method according to claim 1, characterized in that: The step of mapping the target image to be processed to obtain a target mapped image includes: Performing dimensionality reduction processing on the sample spectral image to obtain a sample image to be processed; Based on the sample to-be-processed image and the sample mapping image, determining a first mapping manner in which the target to-be-processed image is mapped to the target mapping image; According to the first mapping manner, mapping processing is performed on the target image to be processed to obtain the target mapped image.

10. The method according to claim 9, characterized in that The determining, based on the sample to-be-processed image and the sample mapping image, a first mapping manner in which the target to-be-processed image is mapped to the target mapping image comprises: Generate a third data set based on data of a plurality of pixel points of the sample image to be processed; Generate a first data set based on data of a plurality of pixel points of the sample mapping image; Based on the first data set and the third data set, a second mapping method of mapping the data of the first pixel point of the sample image to be processed to the data of the second pixel point of the sample mapping image is obtained as the first mapping method, wherein the data of the first pixel point and the data of the second pixel point are obtained by performing dimensionality reduction processing on the data of the same pixel point of the sample spectral image.

11. The method according to any one of claims 1 to 10, characterized in that The step of obtaining a target image to be processed includes: Acquire the original image to be processed acquired by the image acquisition device; White balance correction is performed on the original image to be processed to obtain the target image to be processed.

12. An image processing device, characterized in that: include: A first acquisition module is configured to acquire a target image to be processed; A mapping module is configured to perform mapping processing on the target image to be processed to obtain a target mapping image, wherein the dimension of data of each pixel point of the target mapping image is a first dimension; A second acquisition module is configured to execute acquisition of a first dictionary and a second dictionary, wherein the first dictionary is obtained based on data of a plurality of pixels of a sample mapping image, the second dictionary is obtained based on data of a plurality of pixels of a sample spectral image, the dimension of the data of each pixel of the sample spectral image is a second dimension, the first dimension is smaller than the second dimension, and the sample mapping image is obtained by performing dimensionality reduction processing on the sample spectral image; The dimension increasing module is configured to perform dimension increasing processing on the target mapping image based on the first dictionary and the second dictionary to obtain a target spectrum image, wherein the dimension of data of each pixel point of the target spectrum image is the second dimension.

13. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to: Implement the steps of the method according to any one of claims 1 to 11.

14. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the steps of the method described in any one of claims 1 to 11 are implemented.

15. A chip, characterized in that: It includes one or more interface circuits and one or more processors; the interface circuit is used to receive a signal and send the signal to the processor, the signal includes a computer instruction stored in a memory, and when the processor executes the computer instruction, the chip executes the steps of the method described in any one of claims 1 to 11.