Image processing method, device, electronic device and storage medium
By performing singular value decomposition and compensation processing on the images obtained by the passive infrared night vision system, the problems of low image quality and high detection difficulty are solved, and image quality improvement and detection efficiency are improved.
Patent Information
- Application Number
- CN202210155162.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-21
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2042-02-21
AI Technical Summary
The boundaries between grayscale images obtained by the passive infrared night vision system are blurred, the thermal information noise distribution is random, and the image quality is poor, which increases the difficulty of image processing during object detection.
By performing singular value decomposition on the original image, a non-zero singular value matrix is extracted, a singular value compensation matrix is constructed based on the matrix, and a target image is constructed using the matrix, the left singular vector and the right singular vector to improve image quality.
Through the application of the singular value compensation matrix, the quality of the original image is improved, the difficulty of image detection is reduced, and the image detection efficiency is improved, especially in environments with poor light.
Smart Images

Figure CN114549352B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of image processing technology, and in particular to an image processing method, device, electronic device and storage medium. Background Art
[0002] With the application of intelligent technologies such as artificial intelligence, big data, and cloud computing, passive infrared night vision systems have gradually been applied to active safety systems to improve the safety and comfort of the second-stage autonomous driving technology at night.
[0003] Because traditional cameras rely heavily on external light source conditions in target perception in night scenes, when the external light source environment is poor, due to the lack of natural light conditions, the effective obstacle detection distance becomes closer, the detection time becomes later, and obstacles on the road ahead cannot be detected in time, resulting in collision accidents. The passive infrared night vision system uses thermal imaging technology to obtain the thermal signal of the object to form a grayscale image. By processing the grayscale image of the passive night vision thermal information, it can realize night target detection, and then realize vehicle alarm or other control to reduce the occurrence of vehicle accidents in poor light environments.
[0004] However, the grayscale images obtained by the passive infrared night vision system have blurred boundaries between targets, random distribution of thermal information noise, and poor image quality, which increases the difficulty of image processing during target detection. Summary of the invention
[0005] The embodiments of the present invention provide an image processing method, an apparatus, an electronic device and a storage medium, which can improve image quality and reduce the difficulty of image detection.
[0006] In a first aspect, an embodiment of the present invention provides an image processing method, comprising:
[0007] Perform singular value decomposition on the original image to obtain left singular vectors, right singular vectors and original singular value matrix;
[0008] Extracting non-zero eigenvalues in the original singular value matrix to construct a matrix and obtain a non-zero singular value matrix;
[0009] Extracting a singular value matrix compensation amount from the original singular value matrix based on the non-zero singular value matrix;
[0010] Constructing a singular value compensation matrix based on the non-zero singular value matrix and the singular value matrix compensation amount;
[0011] A target image corresponding to the original image is constructed based on the singular value compensation matrix, the left singular vector and the right singular vector.
[0012] In a second aspect, an embodiment of the present invention provides an image processing device, the device comprising:
[0013] An image decomposition module is used to perform singular value decomposition on the original image to obtain left singular vectors, right singular vectors and an original singular value matrix;
[0014] A feature extraction module is used to extract non-zero eigenvalues in the original singular value matrix to construct a matrix and obtain a non-zero singular value matrix;
[0015] A compensation extraction module, used for extracting a singular value matrix compensation amount from the original singular value matrix based on the non-zero singular value matrix;
[0016] A matrix construction module, used for constructing a singular value compensation matrix based on the non-zero singular value matrix and the singular value matrix compensation amount;
[0017] An image construction module is used to construct a target image corresponding to the original image based on the singular value compensation matrix, the left singular vector and the right singular vector.
[0018] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, an image processing method as described in any one of the embodiments of the present invention is implemented.
[0019] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the image processing method as described in any one of the embodiments of the present invention.
[0020] The image processing scheme provided by the embodiment of the present invention first performs singular value decomposition on the original image to obtain left singular vectors, right singular vectors and original singular value matrix; then extracts non-zero eigenvalues in the original singular value matrix to construct a matrix to obtain a non-zero singular value matrix; and extracts singular value matrix compensation from the original singular value matrix based on the non-zero singular value matrix; then constructs a singular value compensation matrix based on the non-zero singular value matrix and the singular value matrix compensation; finally, constructs a target image corresponding to the original image based on the singular value compensation matrix, left singular vectors and right singular vectors. Through the above scheme, the generated singular value compensation matrix performs singular value compensation on the original image, and the target image obtained by the reverse compensation method of singular value decomposition can improve the quality of the original image, thereby facilitating image processing based on a passive infrared night vision system, reducing the difficulty of image detection, and improving image detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 is a flowchart of an image processing method provided by an embodiment of the present invention;
[0023] Figure 2 is another flowchart of the image processing method provided by an embodiment of the present invention;
[0024] Figure 3 is a structural schematic diagram of an image processing device provided by an embodiment of the present invention;
[0025] Figure 4 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0026] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0027] Figure 1 The present invention provides a flowchart of an image processing method according to an embodiment of the present invention. The method can be performed by an image processing device according to an embodiment of the present invention. The device can be implemented in software and / or hardware. In a specific embodiment, the device can be integrated into an electronic device, such as a computer or a server. The following embodiments will be described by taking the device integrated into an electronic device as an example. Figure 1 , the method may specifically include the following steps:
[0028] S110, performing singular value decomposition on the original image to obtain left singular vectors, right singular vectors and an original singular value matrix.
[0029] The passive infrared night vision system uses the infrared radiation of an object to obtain the image of the target object, and then uses radiation temperature measurement technology to measure the radiation intensity of the target point by point based on the difference in temperature and radiation emissivity between the target object and the background, thereby forming a thermal image of the visible target. The passive infrared night vision system can improve the detection efficiency of pedestrians and objects in the dark. However, since the boundaries between targets in the grayscale image obtained by the passive infrared night vision system are blurred, the thermal information noise is randomly distributed, and the image quality is poor, the difficulty of image processing during target detection is increased. Therefore, the image processing solution provided in the embodiment of the present invention solves the problem of low image quality and poor recognition effect obtained by the passive infrared night vision system in the existing solution, thereby improving the accuracy of target object recognition when the vehicle is driving at night and avoiding the occurrence of traffic accidents.
[0030] The above original image is an original grayscale image obtained based on the passive infrared night vision thermal system. It should be noted that the image processing and analysis processes in the following embodiments are all performed on the basis of the grayscale image obtained based on the passive infrared night vision thermal information, which will not be repeated in the subsequent description.
[0031] Singularity Value Decompose (SVD) is a common matrix calculation process in mathematics, which can be used to accelerate the calculation of matrix inversion, etc. Therefore, before performing singular value decomposition on the original image, the original image needs to be converted into a matrix form.
[0032] The original image can be converted into a matrix by extracting rows and columns of the original image pixels using MATLAB, so that the size of the matrix corresponds to the size of the obtained pixels. Optionally, the original image can also be normalized based on the original image pixels obtained based on MATLAB, so as to avoid interference in subsequent processing due to different image contrasts.
[0033] The original singular value matrix represents the matrix composed of singular values obtained after performing singular value decomposition on the matrix corresponding to the original image. Assuming that the original singular value matrix is Σ, and the original singular value matrix is of m×n order, it can be expressed as Σ m×n .
[0034] When performing singular value decomposition on the matrix corresponding to the original image, assume that the matrix corresponding to the original image is A, U is the left singular vector of A, and the columns of V are the right singular vectors of A. T The columns of V are composed of the normalized eigenvectors of A TThe normalized eigenvector of A is composed. Then the original image is subjected to singular value decomposition to obtain the left singular vector and the right singular vector, which can be used to solve AA T The eigenvalues and eigenvectors of , use the normalized eigenvectors to form the left singular vector U; solve A T The eigenvalues and eigenvectors of A are used to form the right singular vector V using the normalized eigenvectors.
[0035] S120, extracting non-zero eigenvalues in the original singular value matrix to construct a matrix, and obtaining a non-zero singular value matrix.
[0036] The non-zero eigenvalues are eigenvalues that are not zero in the original singular value matrix, that is, the non-zero eigenvalues in the original singular value matrix are extracted to form a non-zero singular value matrix.
[0037] Optionally, the zero eigenvalues in the original singular value matrix may be extracted, and the matrix composed of the remaining eigenvalues after the zero eigenvalues are extracted is the non-zero singular value matrix to be obtained.
[0038] The specific method of extracting the non-zero singular value matrix is not limited here, and is based on the number of non-zero or zero in the original singular value matrix. If the number of zero in the original singular value matrix is large, non-zero eigenvalues can be extracted to construct a non-zero singular value matrix; otherwise, eigenvalues of zero are extracted to speed up the acquisition of the non-zero singular value matrix.
[0039] For example, the original singular value matrix is ∑ m×n For example, the original singular value matrix can be expressed as follows:
[0040]
[0041] Among them, the above Σ p×q represents a non-zero singular value matrix composed of non-zero singular values, p, q represent the order of the non-zero singular value matrix, and satisfy p<m, q<n.
[0042] S130. Extracting a singular value matrix compensation amount from an original singular value matrix based on a non-zero singular value matrix.
[0043] The purpose of determining the singular value matrix compensation amount is to facilitate the subsequent steps to construct a singular value compensation matrix, so as to realize compensation for the original image through the singular value compensation matrix, thereby improving the quality of the original image, facilitating image processing based on the passive infrared night vision system, reducing the difficulty of image detection, and improving image detection efficiency.
[0044] The current singular value matrix compensation amount can be determined based on the order of the original singular value matrix and the order of the non-zero singular value matrix. m×n and the non-zero singular value matrix Σp×q , then the singular value matrix compensation can be Σ (m-p)×(n-q) , where mp)×(nq) is the extraction order corresponding to the compensation amount of the singular value matrix.
[0045] S140: construct a singular value compensation matrix based on the non-zero singular value matrix and the singular value matrix compensation amount.
[0046] Further, based on the non-zero singular value matrix Σ obtained in step S120 p×q and the singular value matrix compensation Σ selected in step S130 (m-p)×(n-q) When constructing a singular value compensation matrix, the singular values are arranged in order from large to small to generate a singular value compensation matrix Σ, wherein the singular value compensation matrix Σ is an m×n-order matrix, that is, the final singular value compensation matrix is consistent with the order of the original singular value matrix.
[0047] S150, constructing a target image corresponding to the original image based on the singular value compensation matrix, the left singular vectors and the right singular vectors.
[0048] When constructing the target matrix corresponding to the original image, the compensated grayscale matrix can be obtained by multiplying the left singular vector, the singular value compensation matrix, and the transpose of the right singular vector. The current compensated grayscale matrix is a matrix after the quality is improved based on the original image. The passive night vision system detects and identifies the former compensated grayscale matrix based on the target thermal information to obtain the target image corresponding to the original image.
[0049] The current target image can improve its quality after being compensated by the singular value compensation matrix, thereby improving the recognition efficiency of the passive night vision system for the target image.
[0050] The image processing method provided by the embodiment of the present invention first performs singular value decomposition on the original image to obtain left singular vectors, right singular vectors and original singular value matrix; then extracts non-zero eigenvalues in the original singular value matrix to construct a matrix to obtain a non-zero singular value matrix; and extracts singular value matrix compensation from the original singular value matrix based on the non-zero singular value matrix; then constructs a singular value compensation matrix based on the non-zero singular value matrix and the singular value matrix compensation; finally, constructs a target image corresponding to the original image based on the singular value compensation matrix, left singular vectors and right singular vectors. Through the above scheme, the generated singular value compensation matrix performs singular value compensation on the original image, and the target image obtained by the reverse compensation method of singular value decomposition can improve the quality of the original image, thereby facilitating image processing based on a passive infrared night vision system, reducing the difficulty of image detection, and improving image detection efficiency.
[0051] Figure 2 FIG. 1 is another flow chart of the image processing method provided by an embodiment of the present invention. The relationship between this embodiment and the above-mentioned embodiment is a refinement of the features of the corresponding steps. Figure 2 As shown, the method includes:
[0052] S210: Convert the original image into an original grayscale image.
[0053] The original image obtained directly by the camera is usually a red, green, and blue (RGB) image. Since color itself is easily affected by light in nature, RGB varies greatly under the influence of light. Converting the three-channel RGB image into a one-channel grayscale image can greatly reduce the amount of calculation.
[0054] Grayscale image is also called grayscale image, which divides white and black into several levels according to the logarithmic relationship, called grayscale. Grayscale is divided into 256 levels (0-255), 255 represents full white, 0 represents full black, and the image converted to grayscale is called original grayscale image.
[0055] When converting the original image into the original grayscale image, a component method, a maximum value method or a weighted average method may be used, and the specific conversion method of the original grayscale image is not limited here.
[0056] S211, normalizing the grayscale values of the original grayscale image to obtain an original grayscale matrix.
[0057] Since singular value decomposition is required in the subsequent steps, and the singular value decomposition is calculated based on the matrix, the original grayscale image needs to be processed to obtain the original grayscale matrix.
[0058] First, a matrix consistent with the pixel points can be obtained based on the pixel points of the original gray image. Since the grayscale value of the current pixel point is between 0-255, the span between pixel values is large and there is a large interference noise. Therefore, the current pixel point matrix needs to be normalized to obtain the original grayscale matrix.
[0059] When obtaining a matrix consistent with the pixel points based on the pixel points of the original grayscale image, the method of obtaining is that for an image with M×N pixels, M represents the length of the image, and N represents the width of the image; then the matrix corresponding to the image has M rows and N columns, and a total of M×N pixel units, and (M, N) represents the position of the pixel in the image, which is equivalent to putting the image in a coordinate system, M represents the horizontal coordinate, N represents the vertical coordinate, and (M, N) determines the position of a pixel. The original grayscale matrix obtained is a matrix of M×N order.
[0060] S212, performing singular value decomposition on the original grayscale matrix to obtain left singular vectors, right singular vectors and an original singular value matrix.
[0061] When performing singular value decomposition on the original grayscale matrix, for any singular value decomposition, the elements on the diagonal of the matrix Σ are equal to the singular values of M. The columns of U and V are the left singular vectors and right singular vectors in the singular values, respectively. For any matrix, the following theorem applies: an M×N matrix has at most p=min(M, N) different singular values; an orthogonal basis U can always be found in Km to form the left singular vectors of M; an orthogonal basis V can always be found with Kn to form the right singular vectors of M.
[0062] Optionally, the relationship between the original grayscale matrix, the left singular vectors, the right singular vectors and the original singular value matrix can be expressed by the following expression:
[0063]
[0064] Among them, M×N Represents the original grayscale matrix, U M×M represents the left singular vector, represents the right singular vector, Σ M×N Represents the original singular value matrix. M and N represent the order of the current matrix.
[0065] S220, extracting non-zero eigenvalues in the original singular value matrix to construct a matrix, and obtaining a non-zero singular value matrix.
[0066] Based on step S210, assuming that the non-zero matrix is Σ p×q , p, q represent the order of the non-zero matrix, then the non-zero singular matrix constructed by extracting non-zero eigenvalues from the original singular value matrix can be expressed as follows:
[0067]
[0068] S230. Determine a matrix extraction order based on the order of the non-zero singular value matrix.
[0069] Non-zero matrix Σ p×q The rows and columns are of order p and q respectively, and the order of the matrix extraction is from the original singular value matrix Ι M×N If the extraction is performed in , the order of the original singular value matrix and the order of the non-zero singular value matrix have the following relationship: <M,q<N。
[0070] Based on the non-zero singular value matrix Σ p×q The order of the original singular value matrix Ι M×N The matrix extraction order determined in is (Mp)×(Nq).
[0071] S231. Extracting a singular value matrix compensation amount from the original singular value matrix based on the matrix extraction order.
[0072] The extraction of singular value matrix compensation from the original singular value matrix based on the matrix extraction order can be achieved in the following way: extract (Mp)×(Nq) order data from the specified position in the original singular value matrix to obtain the singular value matrix compensation. The singular value matrix compensation is Σ (M-p)×(N-q) .
[0073] When extracting (Mp)×(Nq) order data from the original singular value matrix, you can select the initial part of the original singular value matrix for extraction, or you can extract from the middle position of the original singular value matrix, or you can extract from the end of the original singular value matrix. The specific extraction method is based on actual needs and is not limited here.
[0074] The extracted (Mp)×(Nq) order data constitutes a singular value matrix with a compensation value of Σ (M-p)×(N-q) .
[0075] S240: construct a singular value compensation matrix based on the non-zero singular value matrix and the singular value matrix compensation amount.
[0076] Let Σ represent the singular value compensation matrix, then based on the non-zero singular value matrix Σ p×q and singular value matrix compensation Σ (M-p)×(N-q) The singular value compensation matrix Σ can be expressed as follows:
[0077]
[0078] S250, constructing a target grayscale matrix based on the singular value compensation matrix, the left singular vectors and the right singular vectors.
[0079] Let I represent the target grayscale matrix, then based on the singular value compensation matrix Σ, the left singular vector U M×M and the right singular vectors The target grayscale matrix can be constructed by the following expression:
[0080]
[0081] It should be noted that the order of the target grayscale matrix obtained after compensation by the singular value compensation matrix is also M×N.
[0082] S251. Determine a target image based on a target grayscale matrix.
[0083] The target grayscale matrix obtained is obtained after the quality of the original grayscale matrix is improved. The target image determined based on the target grayscale matrix can improve the detection rate of the passive infrared night vision system for the corresponding image of the target object, so as to identify the target object in a dimly lit environment as soon as possible, so that the vehicle has enough time to take corresponding measures, avoid the occurrence of vehicle collision accidents, and improve the safety and comfort of the vehicle's automatic driving technology when applied at night.
[0084] The image processing method provided by the embodiment of the present invention first performs singular value decomposition on the original image to obtain left singular vectors, right singular vectors and original singular value matrix; then extracts non-zero eigenvalues in the original singular value matrix to construct a matrix to obtain a non-zero singular value matrix; and extracts singular value matrix compensation from the original singular value matrix based on the non-zero singular value matrix; then constructs a singular value compensation matrix based on the non-zero singular value matrix and the singular value matrix compensation; finally, constructs a target image corresponding to the original image based on the singular value compensation matrix, left singular vectors and right singular vectors. Through the above scheme, the generated singular value compensation matrix performs singular value compensation on the original image, and the target image obtained by the reverse compensation method of singular value decomposition can improve the quality of the original image, thereby facilitating image processing based on a passive infrared night vision system, reducing the difficulty of image detection, and improving image detection efficiency.
[0085] Figure 3 is a structural diagram of an image processing device provided by an embodiment of the present invention, and the device is suitable for executing the image processing method provided by an embodiment of the present invention. Figure 3 As shown, the device may specifically include:
[0086] An image decomposition module 31 is used to perform singular value decomposition on the original image to obtain left singular vectors, right singular vectors and an original singular value matrix;
[0087] A feature extraction module 32 is used to extract non-zero eigenvalues in the original singular value matrix to construct a matrix and obtain a non-zero singular value matrix;
[0088] A compensation extraction module 33, configured to extract a singular value matrix compensation amount from the original singular value matrix based on the non-zero singular value matrix;
[0089] A matrix construction module 34, configured to construct a singular value compensation matrix based on the non-zero singular value matrix and the singular value matrix compensation amount;
[0090] The image construction module 35 is used to construct a target image corresponding to the original image based on the singular value compensation matrix, the left singular vector and the right singular vector.
[0091] Optionally, the image decomposition module 31 includes: a conversion unit, a processing unit and a decomposition unit, wherein:
[0092] A conversion unit for converting the original image into an original grayscale image;
[0093] A processing unit for normalizing the grayscale values of the original grayscale image to obtain an original grayscale matrix;
[0094] A decomposition unit for performing singular value decomposition on the original grayscale matrix to obtain the left singular vector, the right singular vector, and the original singular value matrix.
[0095] Optionally, the performing singular value decomposition on the original grayscale matrix to obtain the left singular vector, the right singular vector, and the original singular value matrix includes:
[0096]
[0097] where Ι M×N represents the original grayscale matrix, U M×M represents the left singular vector, represents the right singular vector, Σ M×N represents the original singular value matrix, and M and N represent the order of the current matrix.
[0098] Optionally, the compensation extraction module 33 includes: a first determination unit and an extraction unit, where:
[0099] The first determination unit is configured to determine the matrix extraction order based on the order of the non-zero singular value matrix;
[0100] The extraction unit is configured to extract the singular value matrix compensation amount from the original singular value matrix based on the matrix extraction order.
[0101] Optionally, the non-zero singular value matrix is Σ p×q , where p < M, q < N, and the matrix extraction order is (M - p) × (N - q).
[0102] The compensation extraction module 33 is specifically configured to extract (M - p) × (N - q)-order data from a specified position in the original singular value matrix to obtain the singular value matrix compensation amount, and the singular value matrix compensation amount is Σ (M-p)×(N-q) .
[0103] Optionally, the constructing the singular value compensation matrix based on the non-zero singular value matrix and the singular value matrix compensation amount includes:
[0104]
[0105] where Σ represents the singular value compensation matrix.
[0106] Optionally, the image construction module 35 includes: a construction unit and a second determination unit, wherein:
[0107] A construction unit, configured to construct a target grayscale matrix based on the singular value compensation matrix, the left singular vectors and the right singular vectors;
[0108] The second determining unit is used to determine the target image based on the target grayscale matrix.
[0109] Optionally, constructing a target grayscale matrix based on the singular value compensation matrix, the left singular vector and the right singular vector comprises:
[0110]
[0111] Wherein, Ι represents the target grayscale matrix.
[0112] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the functional modules described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0113] The image processing device provided by the embodiment of the present invention first performs singular value decomposition on the original image to obtain left singular vectors, right singular vectors and original singular value matrix; then extracts non-zero eigenvalues in the original singular value matrix to construct a matrix to obtain a non-zero singular value matrix; and extracts singular value matrix compensation from the original singular value matrix based on the non-zero singular value matrix; then constructs a singular value compensation matrix based on the non-zero singular value matrix and the singular value matrix compensation; finally, constructs a target image corresponding to the original image based on the singular value compensation matrix, left singular vectors and right singular vectors. Through the above scheme, the generated singular value compensation matrix performs singular value compensation on the original image, and the target image obtained by the reverse compensation method of singular value decomposition can improve the quality of the original image, thereby facilitating image processing based on a passive infrared night vision system, reducing the difficulty of image detection, and improving image detection efficiency.
[0114] An embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the image processing method provided in any of the above embodiments when executing the program.
[0115] An embodiment of the present invention further provides a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the image processing method provided by any of the above embodiments is implemented.
[0116] Reference below Figure 4 , which shows a schematic diagram of the structure of a computer system 500 of an electronic device suitable for implementing an embodiment of the present invention. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0117] like Figure 4 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0118] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.
[0119] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.
[0120] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0121] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0122] The modules and / or units involved in the embodiments of the present invention may be implemented in software or hardware. The modules and / or units described may also be arranged in a processor, for example, it may be described as follows: a processor includes an acquisition module, a determination module, and a creation module. The names of these modules do not, in some cases, constitute limitations on the modules themselves.
[0123] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: performing singular value decomposition on the original image to obtain left singular vectors, right singular vectors and original singular value matrix; extracting non-zero eigenvalues in the original singular value matrix to construct a matrix to obtain a non-zero singular value matrix; extracting singular value matrix compensation from the original singular value matrix based on the non-zero singular value matrix; constructing a singular value compensation matrix based on the non-zero singular value matrix and the singular value matrix compensation; constructing a target image corresponding to the original image based on the singular value compensation matrix, the left singular vector and the right singular vector.
[0124] According to the technical solution of the embodiment of the present invention, firstly, singular value decomposition is performed on the original image to obtain left singular vectors, right singular vectors and original singular value matrix; then, non-zero eigenvalues in the original singular value matrix are extracted to construct a matrix to obtain a non-zero singular value matrix; and singular value matrix compensation is extracted from the original singular value matrix based on the non-zero singular value matrix; then a singular value compensation matrix is constructed based on the non-zero singular value matrix and the singular value matrix compensation; finally, a target image corresponding to the original image is constructed based on the singular value compensation matrix, left singular vectors and right singular vectors. Through the above scheme, the generated singular value compensation matrix performs singular value compensation on the original image, and the target image obtained by the reverse compensation method of singular value decomposition can improve the quality of the original image, thereby facilitating image processing based on a passive infrared night vision system, reducing the difficulty of image detection, and improving image detection efficiency.
[0125] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An image processing method, characterized in that: include: Perform singular value decomposition on the original image to obtain left singular vectors, right singular vectors and original singular value matrix; Extracting non-zero eigenvalues in the original singular value matrix to construct a matrix and obtain a non-zero singular value matrix; Extracting a singular value matrix compensation amount from the original singular value matrix based on the non-zero singular value matrix; Constructing a singular value compensation matrix based on the non-zero singular value matrix and the singular value matrix compensation amount; Constructing a target image corresponding to the original image based on the singular value compensation matrix, the left singular vector and the right singular vector; The step of extracting a singular value matrix compensation amount from the original singular value matrix based on the non-zero singular value matrix includes: Determining a matrix extraction order based on the order of the non-zero singular value matrix; The singular value matrix compensation amount is extracted from the original singular value matrix based on the matrix extraction order.
2. The image processing method according to claim 1, characterized in that: The process of performing singular value decomposition on the original image to obtain left singular vectors, right singular vectors and an original singular value matrix includes: Converting the original image into an original grayscale image; Normalizing the grayscale values of the original grayscale image to obtain an original grayscale matrix; Performing singular value decomposition on the original grayscale matrix to obtain the left singular vector, the right singular vector and the original singular value matrix.
3. The image processing method according to claim 2, characterized in that: The step of performing singular value decomposition on the original grayscale matrix to obtain the left singular vector, the right singular vector and the original singular value matrix comprises: Among them, M×N Represents the original grayscale matrix, U M×M represents the left singular vector, represents the right singular vector, Σ M×N represents the original singular value matrix, and M and N represent the order of the current matrix.
4. The image processing method according to claim 1, characterized in that: The non-zero singular value matrix is Σ p×q , where p < M, q < N, the matrix extraction order is (M - p) × (N - q), and extracting the singular value matrix compensation amount from the original singular value matrix based on the matrix extraction order includes: Extract (Mp)×(Nq) order data from the specified position in the original singular value matrix to obtain the singular value matrix compensation amount, and the singular value matrix compensation amount is Σ (M-p)×(N-q) .
5. The image processing method according to claim 4, characterized in that: The constructing a singular value compensation matrix based on the non-zero singular value matrix and the singular value matrix compensation amount comprises: Wherein, Σ represents the singular value compensation matrix.
6. The image processing method according to claim 5, characterized in that: The step of constructing a target image corresponding to the original image based on the singular value compensation matrix, the left singular vector and the right singular vector comprises: Constructing a target grayscale matrix based on the singular value compensation matrix, the left singular vectors and the right singular vectors; The target image is determined based on the target grayscale matrix.
7. The image processing method according to claim 6, characterized in that: The constructing a target grayscale matrix based on the singular value compensation matrix, the left singular vector and the right singular vector comprises: Wherein, 1 represents the target grayscale matrix.
8. An image processing device, characterized in that: include: An image decomposition module is used to perform singular value decomposition on the original image to obtain left singular vectors, right singular vectors and an original singular value matrix; A feature extraction module is used to extract non-zero eigenvalues in the original singular value matrix to construct a matrix and obtain a non-zero singular value matrix; A compensation extraction module, used for extracting a singular value matrix compensation amount from the original singular value matrix based on the non-zero singular value matrix; A matrix construction module, used for constructing a singular value compensation matrix based on the non-zero singular value matrix and the singular value matrix compensation amount; An image construction module, used for constructing a target image corresponding to the original image based on the singular value compensation matrix, the left singular vector and the right singular vector; Wherein, the compensation extraction module includes a first determination unit and an extraction unit; A first determining unit, configured to determine a matrix extraction order based on the order of the non-zero singular value matrix; An extraction unit is used to extract the singular value matrix compensation amount from the original singular value matrix based on the matrix extraction order.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the image processing method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the image processing method according to any one of claims 1 to 7 is implemented.