[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN112532957B - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN112532957B
CN112532957B CN202011339418.7A CN202011339418A CN112532957B CN 112532957 B CN112532957 B CN 112532957B CN 202011339418 A CN202011339418 A CN 202011339418A CN 112532957 B CN112532957 B CN 112532957B
Authority
CN
China
Prior art keywords
image
brightness
color space
luminance
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011339418.7A
Other languages
Chinese (zh)
Other versions
CN112532957A (en
Inventor
陈岩
李怀东
姬长胜
游瑞蓉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Spreadtrum Communications Shanghai Co Ltd
Original Assignee
Spreadtrum Communications Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Spreadtrum Communications Shanghai Co Ltd filed Critical Spreadtrum Communications Shanghai Co Ltd
Priority to CN202011339418.7A priority Critical patent/CN112532957B/en
Publication of CN112532957A publication Critical patent/CN112532957A/en
Application granted granted Critical
Publication of CN112532957B publication Critical patent/CN112532957B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the application provides an image processing method and device. According to the method, the terminal device carries out brightness matching processing on each original brightness value of a second image in a brightness color space by using the proportion of an original brightness mean value of a first image in the brightness color space to an original brightness mean value of the second image in the brightness color space to obtain a second image after the brightness matching processing, and then replaces each color value of the second image after the brightness matching processing in the brightness color space by using a color value of the first image in the brightness color space to obtain the second image after the color matching with the first image. The color matching degree between images with different characteristics can be improved, and meanwhile, the calculation complexity is reduced, so that high-quality images can be obtained through fusion.

Description

Image processing method and device
Technical Field
The present application relates to the field of electronic communications, and in particular, to an image processing method and apparatus.
Background
With the continuous development of hardware technology, the number of smart phone cameras is increasing, for example, from an initial single shot to a double shot, a triple shot or even more. The smart phone can obtain images with different characteristics by shooting through a plurality of cameras, and then the images with different characteristics are fused by adopting an image fusion technology, so that a high-quality image is obtained, and the image obtained by fusion has the advantages of the images obtained by different cameras. Taking the wide-angle camera and the telephoto camera of the smartphone as an example, the smartphone can obtain an image by using the double-shot and image fusion technology, and the image obtained by the smartphone has a wider field angle of the image obtained by the wide-angle camera and a definition of the image obtained by the telephoto camera.
Currently, for image fusion technology, many alignment processing algorithms have been proposed to align images with different characteristics obtained by shooting with multiple cameras, and a good alignment effect can be obtained. However, due to hardware reasons, the colors of the images with different characteristics obtained by shooting with multiple cameras are different, and if the degree of color matching between the images is not high, even if the images can be well aligned, the fused images have image quality problems. Therefore, how to improve the color matching degree between a plurality of images with different characteristics in order to obtain a high-quality image becomes an urgent problem to be solved.
Disclosure of Invention
The application provides a method which can effectively improve the image color matching degree and reduce the calculation complexity.
In a first aspect, an embodiment of the present application provides an image processing method, including:
and then replacing each color value of the second image after the brightness matching in the brightness color space by the color value of the first image in the brightness color space to obtain the second image after the color matching with the first image. And the first image is a reference image of the second image with the matched color.
In one implementation, the original luminance mean value of the first image in the luminance color space is obtained by averaging the luminance values of the first image in the luminance color space after inverse gamma conversion; the original brightness mean value of the second image in the brightness color space is obtained by averaging the brightness values of the second image in the brightness color space after inverse gamma conversion.
In one implementation, performing a luminance matching process on each original luminance value of the second image in a luminance color space to obtain a luminance-matched second image includes: obtaining a ratio between an original luminance mean value of the first image in a luminance color space and an original luminance mean value of the second image in the luminance color space; scaling each original brightness value of the second image in the brightness color space by using a proportion; carrying out gamma transformation on each original brightness value of the scaled second image in a brightness color space to obtain a second image subjected to brightness matching processing; the gamma transform transforms the original luminance values in the luminance color space into luminance values.
In one implementation, the luminance values, color values in the luminance color space are obtained from a numerical transformation of the image in the red R channel, blue B channel, green G channel in the RGB color space.
In one implementation, the luminance color space of the second image and the luminance color space of the first image after color matching of the first image are converted into RGB color spaces; and fusing the second image and the first image after color matching of the first image after conversion into the RGB color space.
In a second aspect, an embodiment of the present application further provides an image processing apparatus, including:
the processing unit is used for performing brightness matching processing on each original brightness value of the second image in the brightness color space by utilizing the proportion of the original brightness average value of the first image in the brightness color space to the original brightness average value of the second image in the brightness color space to obtain a second image subjected to brightness matching processing; the first image is a reference image of the second image needing color matching;
and the replacing unit is used for replacing each color value of the second image after the brightness matching processing in the brightness color space by using the color value of the first image in the brightness color space to obtain the second image after the color matching with the first image.
The original brightness mean value of the first image in the brightness color space is obtained by averaging the brightness values of the first image in the brightness color space after inverse gamma conversion; the original brightness mean value of the second image in the brightness color space is obtained by averaging the brightness values of the second image in the brightness color space after inverse gamma conversion.
In one implementation, the processing unit is configured to perform luminance matching processing on each original luminance value of the second image in the luminance color space by using a ratio between an original luminance average value of the first image in the luminance color space and an original luminance average value of the second image in the luminance color space, and includes: obtaining the proportion between the original brightness mean value of the first image in the brightness color space and the original brightness mean value of the second image in the brightness color space, then scaling each original brightness value of the second image in the brightness color space by using the proportion, and carrying out gamma conversion on each original brightness value of the scaled second image in the brightness color space to obtain a second image after brightness matching processing; where gamma transforms transform the original luminance values in the luminance color space into luminance values.
Wherein, the brightness value and the color value in the brightness color space are obtained by the value transformation of the red R channel, the blue B channel and the green G channel of the image in the RGB color space.
In one embodiment, the image device further comprises:
the conversion unit is used for converting the brightness color space of the second image and the brightness color space of the first image after the color matching of the first image into RGB color space;
and the fusion unit is used for fusing the second image and the first image which are subjected to color matching of the first image after being converted into the RGB color space.
In a third aspect, an embodiment of the present application further provides a terminal device, including: a processor and a memory; the memory for storing program code; the processor is configured to execute the codes in the memory, so that the access network device performs the method in the first aspect or any implementation manner of the first aspect.
In a fourth aspect, the present invention also provides a computer-readable storage medium, which includes a program and instructions, and when the program and instructions are run on a computer, the method according to the first aspect is performed.
In the embodiment of the application, the terminal device performs brightness matching processing on each original brightness value of the second image in the brightness color space by using the ratio between the original brightness average value of the first image in the brightness color space and the original brightness average value of the second image in the brightness color space to obtain the second image after the brightness matching processing, and then replaces each color value of the second image after the brightness matching processing in the brightness color space by using the color value of the first image in the brightness color space to obtain the second image after the color matching with the first image. Therefore, the embodiment of the application performs brightness matching processing on the original brightness values of the second image by using the proportion between the original brightness values of the images, namely, the characteristic that the original brightness average values obtained by using different hardware imaging principles have linear proportion is used for processing, so that the color matching degree between the images with different characteristics can be improved, and meanwhile, the calculation complexity is reduced, thereby being beneficial to obtaining high-quality images by fusion.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
Fig. 1 is a schematic structural diagram of a smart phone provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of an image processing method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of an image preprocessing method provided in an embodiment of the present application;
fig. 4 is a schematic flowchart of a smart phone according to an embodiment of the present application when performing image processing by using an image processing method;
fig. 5 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
With the continuous development of hardware technology, the number of smart phone cameras is increasing, and the initial single shooting is gradually changed into double shooting, triple shooting or even more. In the multi-camera module of the smart phone, images shot by different cameras have different characteristics. In order to shoot high-quality images, the smart phone can adopt an image fusion technology to fuse the shot images with different characteristics, and the fused images have the advantages of the images obtained by different cameras. Taking a dual-camera module of a wide-angle camera and a telephoto camera of a smart phone as an example, a fused image obtained by using an image fusion technology should have the characteristics of a wide field angle of an image obtained by the wide-angle lens and a clear content of the image obtained by the telephoto lens.
For the image fusion technology, besides image alignment, the image color matching degree also affects the image fusion quality. If the degree of color matching between images is not high, the fused images may have image quality problems even if the images are well aligned. Therefore, how to perform color matching on images with different characteristics becomes an urgent problem to be solved.
In view of the above problem, an embodiment of the present application provides an image processing method, in which a terminal device performs luminance matching processing on each original luminance value of a second image in a luminance color space by using a ratio between an original luminance average value of a first image in the luminance color space and an original luminance average value of the second image in the luminance color space to obtain an image after the luminance matching processing, and then replaces each color value of the second image after the luminance matching processing in the luminance color space by using a color value of the first image in the luminance color space to obtain a second image after color matching with the first image. Therefore, the embodiment of the application performs brightness matching processing on the original brightness values of the second image by using the proportion between the original brightness values of the images, namely, the characteristic that the original brightness mean values obtained by using different hardware imaging principles have linear proportion is used for processing, so that the color matching degree between the images with different characteristics can be improved, and the calculation complexity is reduced. The following description is made with reference to the accompanying drawings.
In the embodiment of the present application, the terminal device may include, but is not limited to, a smartphone, a tablet computer, and the like having a multi-camera module. Referring to fig. 1, fig. 1 is a schematic structural diagram of a smart phone according to an embodiment of the present disclosure. The smart phone shown in fig. 1 includes a dual-camera module including a wide-angle camera and a telephoto camera, and some examples of the present application are explained by taking the wide-angle camera and the telephoto camera in the smart phone shown in fig. 1 as examples.
Referring to fig. 2, fig. 2 is a schematic flowchart of an image processing method according to an embodiment of the present disclosure, where the method may include the following steps 201 to 202.
Step 201: and the terminal equipment performs brightness matching processing on each original brightness value of the second image in the brightness color space by using the ratio of the original brightness mean value of the first image in the brightness color space to the original brightness mean value of the second image in the brightness color space.
The first image and the second image are respectively images which are shot by cameras with different characteristics aiming at the same scene and have different characteristics, and the images are obtained after preprocessing. And the first image is a reference image of the second image with the matched color. For example, a smart phone includes a dual-camera module including a wide-angle camera and a telephoto camera, where an image captured by the wide-angle camera is a first image after being preprocessed, and an image captured by the telephoto camera is a second image after being preprocessed. And when color matching is carried out, the color of the image which is obtained by preprocessing the image shot by the wide-angle camera is taken as a reference. Referring to fig. 3, fig. 3 is a schematic flowchart of an image preprocessing method provided in an embodiment of the present application, and taking a wide-angle camera and a telephoto camera as examples, the image preprocessing method may include the following steps:
s301: the terminal equipment acquires an image shot by a wide-angle camera and an image shot by a long-focus camera aiming at the same scene, and the images are respectively recorded as an image W and an image T; wherein the optical power of the image W is K1, the optical power of the image T is K2, and the resolutions of the image W and the image T are both a x b; the angle of view of image T is included in the angle of view of image W;
s302: the terminal equipment zooms the image T, the magnification of the zoomed image T is K1, the zoomed image T is recorded as an image T _ temp, and the resolution of the image T _ temp is (K1/K2) x (a x b);
s303: the terminal device cuts the image W to be (K1/K2) x (a x b), and the cut image W is recorded as an image W _ temp; the resolution of the image T _ temp and the image W _ temp is the same as the magnification of the contained scene;
s304: the terminal equipment selects an image alignment processing algorithm to make the image T _ temp aligned with the image W _ temp, and records the aligned image T _ temp as an image T _ tmp _ alignment;
s305: the terminal device takes out the maximally overlapping rectangular areas of the image W _ tmp and the image T _ tmp _ alignment, i.e. the first image and the second image, respectively.
The image preprocessing process in other cases, such as the preprocessing process between the images obtained by the super wide-angle camera and the wide-angle camera, and the preprocessing process between the images obtained by the tele-camera and the super tele-camera, are similar to the preprocessing process between the images obtained by the super wide-angle camera and the tele-camera.
In one implementation manner, in S201, the original luminance average value of the first image in the luminance color space is obtained by performing inverse γ transform on the luminance value of the first image in the luminance color space and then performing averaging; the original brightness mean value of the second image in the brightness color space is obtained by averaging the brightness values of the second image in the brightness color space after inverse gamma conversion. The luminance values in the luminance color space are obtained by performing numerical conversion on the image in the R, G, and B channels in the RGB color space. In the actual imaging process, the brightness value of the image obtained by the camera is not the original brightness value, but the original brightness value is obtained after gamma conversion, so that the brightness value in the brightness color space can be converted into the original brightness value through inverse gamma conversion.
In one implementation manner, in S201, a terminal device performs brightness matching processing on each original brightness value of a second image in a brightness color space by using a ratio between an original brightness mean value of the first image in the brightness color space and an original brightness mean value of the second image in the brightness color space, to obtain a second image after the brightness matching processing, including: obtaining a ratio between an original luminance mean value of the first image in a luminance color space and an original luminance mean value of the second image in the luminance color space; scaling each original brightness value of the second image in the brightness color space by using a proportion; carrying out gamma transformation on each original brightness value of the scaled second image in a brightness color space to obtain a second image subjected to brightness matching processing; the gamma transform transforms the original luminance values in the luminance color space into luminance values.
Step 202: and the terminal equipment replaces each color numerical value of the second image in the brightness color space after the brightness matching processing by using the color numerical value of the first image in the brightness color space.
The color values in the luminance color space are obtained by numerical conversion of R, G, and B channels of the image in the RGB color space.
Optionally, after the terminal device performs step 202, the following steps may also be performed:
converting the brightness color space of the second image and the brightness color space of the first image after the color matching of the first image into RGB color space; and fusing the second image and the first image after color matching of the first image after conversion into the RGB color space. The obtained fused image has the characteristics of wide field angle of wide-angle images and clear content of telephoto lens images.
Referring to fig. 4, fig. 4 is a schematic flowchart of a flow when an image processing method is used for image processing by a smart phone according to an embodiment of the present application, and specifically includes the following steps:
s401: the smart phone acquires the wide-angle image W and the tele image T, and preprocesses the wide-angle image W and the tele image T, wherein the preprocessing method can be seen in the steps S301-S305, so that a first image and a second image are obtained;
s402: the smart phone performs color space conversion on the first image and the second image, and converts the RGB color space into YUV color space;
s403: the smart phone respectively carries out inverse gamma conversion on Y channel numerical values in the YUV color spaces of the first image and the second image to obtain original brightness numerical values corresponding to the first image and the second image;
s404: calculating the mean values of the original brightness values corresponding to the first image and the second image obtained in the step S403 to be "avgW" and "avgT" respectively by the smart phone, and calculating the ratio "avgW/avgT" between the two mean values;
s405: the smart phone scales each original brightness value of the second image in the YUV color space by using the proportion obtained in the step S404;
s406: the smart phone performs gamma conversion on each original brightness data zoomed in S405 to obtain a second image subjected to brightness matching processing;
s407: the smart phone replaces the U channel numerical value and the V channel numerical value of the second image after the brightness matching processing in the S406 with the U channel numerical value and the V channel numerical value in the YUV color space of the first image to complete the color matching of the second image;
s408: and the smart phone converts the second image subjected to color matching in the step S407 from a YUV color space to an RGB color space, and finally obtains a tele image subjected to color matching with the wide-angle image.
In S402, the smartphone may further convert the color spaces of the first and second images from the RGB color space to the HSV color space and the HSL color space, and the subsequent processing is similar to converting the color spaces of the first and second images from the RGB color space to the YUV color space.
In an image processing method provided by the embodiment of the present application, a terminal device performs luminance matching processing on each original luminance value of a second image in a luminance color space by using a ratio between an original luminance average value of a first image in the luminance color space and an original luminance average value of the second image in the luminance color space to obtain a second image subjected to luminance matching processing, and then replaces each color value of the second image subjected to luminance matching processing in the luminance color space with a color value of the first image in the luminance color space to obtain a second image subjected to color matching with the first image. The classical histogram matching method matches the histogram of the color channel data of the reference image by transforming the histogram of the color channel data of the image to be matched. In the digital image processing, the reference image and the image to be matched cannot be represented as continuous random variables, only a plurality of discrete gray values can be taken, and the cumulative probability density functions of the discrete gray values can only be used for approximating integrals by summation, so that when the histogram of the color channel data of the image to be matched is used for matching the histogram of the color channel data of the reference image, the histogram of the color channel data of the reference image is only approximated, the histogram of the color channel data of the reference image cannot be perfectly matched, a certain degree of error is formed, and the color matching degree between the obtained images is not high.
When the image processing method provided by the embodiment of the application performs color matching processing on the first image and the second image, the original brightness values of the second image are subjected to brightness matching processing by using the proportion between the original brightness values of the images, namely, the characteristic that the original brightness mean values obtained by using different hardware imaging principles have linear proportion is used for processing. The method and the device solve the problem of low color matching degree caused by errors formed in the approximation process of the histogram matching method, so that the color matching degree between images with different characteristics can be improved, and the calculation complexity is reduced, thereby being beneficial to obtaining high-quality images through fusion.
Based on the description of the embodiment of the image processing method, the embodiment of the application also provides an image processing apparatus, which can be run in a terminal device to execute the relevant operations in the embodiment of the image processing method. Referring to fig. 5, the image processing apparatus includes, but is not limited to, a processing unit 501, a replacing unit 502, a converting unit 503, and a fusing unit 504. Wherein:
a processing unit 501, configured to perform brightness matching processing on each original brightness value of the second image in the brightness color space by using a ratio between an original brightness average value of the first image in the brightness color space and an original brightness average value of the second image in the brightness color space, so as to obtain a second image after the brightness matching processing; the first image is a reference image of the second image needing color matching.
A replacing unit 502, configured to replace each color value of the second image after the brightness matching processing in the brightness color space with a color value of the first image in the brightness color space, to obtain a second image after color matching with the first image.
The original brightness mean value of the first image in the brightness color space is obtained by averaging the brightness values of the first image in the brightness color space after inverse gamma conversion; and the original brightness mean value of the second image in the brightness color space is obtained by averaging the brightness numerical value of the second image in the brightness color space after inverse gamma conversion.
In one embodiment, the processing unit 501 is configured to obtain a ratio between an original luminance mean value of the first image in the luminance color space and an original luminance mean value of the second image in the luminance color space; and then scaling each original luminance value of the second image in the luminance color space by using a scale. Carrying out gamma transformation on each original brightness value of the scaled second image in the brightness color space to obtain a second image subjected to brightness matching processing; wherein γ transform transforms an original luminance value in the luminance color space to a luminance value.
Wherein, the brightness value and the color value in the brightness color space are obtained by the value transformation of the red R channel, the blue B channel and the green G channel of the image in the RGB color space.
A converting unit 503, configured to convert the color-matched luminance color space of the first image and the luminance color space of the second image into an RGB color space.
A fusing unit 504, configured to fuse the color-matched second image and the first image of the first image after being converted into the RGB color space.
Based on the description of the above embodiment of the image processing method, an embodiment of the present application further provides a schematic structural diagram of a terminal device, please refer to fig. 6, where the terminal device may include a processor 601 and a memory 602. The processor 601 and the memory 602 are connected by a bus. The memory 602 is used to store computer programs comprising program instructions, and the processor 601 is used to execute the program instructions stored by the memory 602.
In the embodiment of the present application, the processor 601 executes the executable program code in the memory 602 to perform the following operations:
performing brightness matching processing on each original brightness value of the second image in the brightness color space by using the proportion of the original brightness mean value of the first image in the brightness color space to the original brightness mean value of the second image in the brightness color space to obtain a second image subjected to brightness matching processing; wherein the first image is a reference image of the second image required matching color;
and replacing each color numerical value of the second image after the brightness matching processing in the brightness color space by the color numerical value of the first image in the brightness color space to obtain the second image after the color matching with the first image.
The original brightness mean value of the first image in the brightness color space is obtained by averaging the brightness values of the first image in the brightness color space after inverse gamma conversion;
and the original brightness mean value of the second image in the brightness color space is obtained by averaging the brightness numerical value of the second image in the brightness color space after inverse gamma conversion.
In one embodiment, a ratio between an original luminance mean value of the first image in the luminance color space and an original luminance mean value of the second image in the luminance color space is obtained;
scaling each original brightness value of the second image in the brightness color space by using a proportion;
carrying out gamma transformation on each original brightness value of the scaled second image in a brightness color space to obtain a second image subjected to brightness matching processing; wherein γ transform transforms an original luminance value in the luminance color space to a luminance value.
The luminance value and the color value in the luminance color space are obtained by the value conversion of the red R channel, the blue B channel and the green G channel of the image in the RGB color space.
In one embodiment, the luminance color space of the second image and the luminance color space of the first image after color matching of the first image are converted into RGB color spaces;
and fusing the second image and the first image after color matching of the first image after conversion into the RGB color space.
It should be understood that, in the embodiment of the present application, the processor 601 is a computing core and a control core of the terminal device, and is adapted to implement one or more instructions, and specifically, adapted to load and execute one or more instructions so as to implement a corresponding method flow or a corresponding function. The Processor 601 may be a Central Processing Unit (CPU), and the Processor 601 may also be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 602 is a memory device in the communication device for storing programs and data. It is understood that the memory 602 herein may include both the built-in storage medium of the terminal device and, of course, the extended storage medium supported by the terminal device. The memory 602 may include both read-only memory and random access memory and provides instructions and data to the processor 601. A portion of the memory 602 may also include a non-volatile random access memory that may store the first image, the second image, and so on.
In a specific implementation, the processor 601 and the memory 602 described in this embodiment of the present application may execute the implementation described in the flow of the image processing method provided in fig. 2 in this embodiment of the present application, and may also execute the implementation described in the image processing apparatus shown in fig. 5 in this embodiment of the present application, which is not described herein again.
The embodiment of the application also provides a computer readable storage medium. The computer readable storage medium stores a computer program comprising program instructions, which when executed by a processor, can perform the image processing method shown in fig. 2 and the steps performed by the related embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
While the foregoing is directed to embodiments of the present invention, other and further embodiments of the invention may be devised without departing from the basic scope thereof, and the scope thereof is determined by the claims that follow.

Claims (10)

1. An image processing method, comprising:
performing brightness matching processing on each original brightness value of the second image in the brightness color space by using the ratio of the original brightness mean value of the first image in the brightness color space to the original brightness mean value of the second image in the brightness color space to obtain a second image after the brightness matching processing; the first image is a reference image of the second image required matching colors; the first image and the second image are respectively images which are shot by cameras with different characteristics aiming at the same scene and have different characteristics, and the images are obtained after preprocessing;
replacing each color numerical value of the second image subjected to the brightness matching processing in the brightness color space with the color numerical value of the first image in the brightness color space to obtain a second image subjected to color matching with the first image;
replacing each color value of the second image after the brightness matching processing in the brightness color space with the color value of the first image in the brightness color space comprises:
and replacing the U channel numerical value and the V channel numerical value of the second image in the YUV color space after the brightness matching processing by using the U channel numerical value and the V channel numerical value of the first image in the YUV color space.
2. The method of claim 1, wherein the original luminance mean value of the first image in the luminance color space is inverse to the luminance value of the first image in the luminance color spaceγObtaining an average value after transformation;
the original brightness mean value of the second image in the brightness color space is the brightness value of the second image in the brightness color space after being invertedγAnd obtaining the average value after transformation.
3. The method according to claim 1, wherein performing a luminance matching process on each original luminance value of the second image in the luminance color space to obtain a luminance-matched second image comprises:
obtaining a ratio between an original luminance mean value of the first image in a luminance color space and an original luminance mean value of the second image in the luminance color space;
scaling each original brightness value of the second image in the brightness color space by using the proportion;
carrying out gamma transformation on each original brightness value of the scaled second image in the brightness color space to obtain a second image subjected to brightness matching processing; the gamma transform transforms an original luminance value in the luminance color space into a luminance value.
4. The method according to any one of claims 1 to 3, wherein the luminance values and the color values in the luminance color space are obtained by performing numerical conversion on an image in a red R channel, a blue B channel and a green G channel in an RGB color space.
5. The method of claim 1, further comprising:
converting the brightness color space of the second image and the brightness color space of the first image after the color matching of the first image into RGB color space;
and fusing the second image after color matching of the first image after the conversion into the RGB color space and the first image.
6. An image processing apparatus characterized by comprising:
the processing unit is used for performing brightness matching processing on each original brightness value of the second image in the brightness color space by utilizing the proportion of the original brightness average value of the first image in the brightness color space to the original brightness average value of the second image in the brightness color space to obtain a second image subjected to brightness matching processing; the first image is a reference image of the second image required matching colors; the first image and the second image are respectively images which are shot by cameras with different characteristics aiming at the same scene and have different characteristics, and the images are obtained after preprocessing;
a replacing unit, configured to replace each color value of the second image subjected to the luminance matching processing in the luminance color space with a color value of the first image in the luminance color space, to obtain a second image subjected to color matching with the first image;
wherein the replacement unit is specifically configured to: and replacing the U-channel numerical value and the V-channel numerical value of the second image in the YUV color space after the brightness matching processing by using the U-channel numerical value and the V-channel numerical value of the first image in the YUV color space.
7. The apparatus of claim 6,
the original brightness mean value of the first image in the brightness color space is obtained by averaging the brightness numerical value of the first image in the brightness color space after inverse gamma conversion;
and the original brightness mean value of the second image in the brightness color space is obtained by averaging the brightness numerical value of the second image in the brightness color space after inverse gamma conversion.
8. The apparatus according to claim 6, wherein said performing a luminance matching process on each original luminance value of the second image in the luminance color space to obtain a luminance-matched second image comprises:
obtaining a ratio between an original luminance mean value of the first image in a luminance color space and an original luminance mean value of the second image in the luminance color space;
scaling each original brightness value of the second image in the brightness color space by using the proportion;
carrying out gamma transformation on each original brightness value of the scaled second image in the brightness color space to obtain a second image subjected to brightness matching processing; the gamma transform transforms an original luminance value in the luminance color space into a luminance value.
9. The apparatus according to any one of claims 6-8, wherein the luminance values and the color values in the luminance color space are obtained by performing a numerical conversion on the image in a red R channel, a blue B channel, and a green G channel in an RGB color space.
10. The apparatus of claim 6, further comprising:
a conversion unit, configured to convert a luminance color space of the second image and a luminance color space of the first image into RGB color spaces after color matching of the first image;
and the fusion unit is used for fusing the second image after color matching of the first image after the conversion into the RGB color space and the first image.
CN202011339418.7A 2020-11-25 2020-11-25 Image processing method and device Active CN112532957B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011339418.7A CN112532957B (en) 2020-11-25 2020-11-25 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011339418.7A CN112532957B (en) 2020-11-25 2020-11-25 Image processing method and device

Publications (2)

Publication Number Publication Date
CN112532957A CN112532957A (en) 2021-03-19
CN112532957B true CN112532957B (en) 2022-08-26

Family

ID=74993660

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011339418.7A Active CN112532957B (en) 2020-11-25 2020-11-25 Image processing method and device

Country Status (1)

Country Link
CN (1) CN112532957B (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3699873B2 (en) * 1999-10-27 2005-09-28 オリンパス株式会社 Image processing device
KR100793289B1 (en) * 2006-06-05 2008-01-10 주식회사 코아로직 Lens shading correction device and method of image sensor
CN103155567B (en) * 2010-10-20 2015-08-12 松下电器产业株式会社 Image processing apparatus and image processing method
CN105009168B (en) * 2013-03-04 2017-12-15 富士胶片株式会社 Restore wave filter generating means and method, image processing apparatus and method, camera device
JP5924370B2 (en) * 2014-05-23 2016-05-25 トヨタ自動車株式会社 Video display device, video switching device, and video display method
JP2018109971A (en) * 2016-12-28 2018-07-12 株式会社リコー Image processing device, image processing system, photographing system, image processing method, and program

Also Published As

Publication number Publication date
CN112532957A (en) 2021-03-19

Similar Documents

Publication Publication Date Title
CN111353948B (en) Image noise reduction method, device and equipment
US8571308B2 (en) Image processing for aberration correction
JP7508135B2 (en) IMAGE PROCESSING METHOD, IMAGE PROCESSING APPARATUS, ELECTRONIC DEVICE, AND COMPUTER PROGRAM
CN111311482B (en) Background blurring method and device, terminal equipment and storage medium
US10291844B2 (en) Image processing apparatus, image processing method, recording medium, program and imaging-capturing apparatus
CN112261387B (en) Image fusion method and device for multi-camera module, storage medium and mobile terminal
CN113168669B (en) Image processing method, device, electronic equipment and readable storage medium
US20130147910A1 (en) Mobile device and image capturing method
CN110855958B (en) Image adjusting method and device, electronic equipment and storage medium
CN108600783B (en) Frame rate adjusting method and device and terminal equipment
CN115496668A (en) Image processing method, image processing device, electronic equipment and storage medium
CN113395440A (en) Image processing method and electronic equipment
CN111724448A (en) Image super-resolution reconstruction method and device and terminal equipment
CN109934783B (en) Image processing method, image processing device, computer equipment and storage medium
CN110717864A (en) Image enhancement method and device, terminal equipment and computer readable medium
CN112532957B (en) Image processing method and device
CN114998122A (en) Low-illumination image enhancement method
CN114467298B (en) Image signal conversion processing method and device and terminal equipment
CN113824894A (en) Exposure control method, device, equipment and storage medium
CN111970501A (en) Pure color scene AE color processing method and device, electronic equipment and storage medium
CN110519486B (en) Distortion compensation method and device based on wide-angle lens and related equipment
CN116506742A (en) Camera switching method, device, electronic equipment and computer readable storage medium
KR102138331B1 (en) Image processing apparatus, image processing method, and photographing apparatus
CN113256501B (en) Image processing method, storage medium and terminal equipment
CN115908210A (en) Image processing method, electronic device, computer-readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant