Image color correction method and device and storage medium

文档序号:1146539 发布日期:2020-09-11 浏览:2次 中文

阅读说明:本技术 图像色彩校正方法及装置、存储介质 (Image color correction method and device and storage medium ) 是由 林威丞 于 2018-11-13 设计创作,主要内容包括:本申请公开了一种图像色彩校正方法及装置、存储介质,属于图像处理技术领域。该方法包括:确定待校正图像中的至少一个标准色,每个所述标准色为一个由标准色块定义的颜色,待校正图像是拍摄所得到的图像;基于该至少一个标准色的标准像素值和图像像素值,确定色彩校正信息,每个标准色的图像像素值为对标准色块进行拍摄所得到的像素值;基于所述色彩校正信息对该待校正图像进行图像色彩校正。本申请提高了图像色彩校正的准确性。(The application discloses an image color correction method and device and a storage medium, and belongs to the technical field of image processing. The method comprises the following steps: determining at least one standard color in an image to be corrected, wherein each standard color is a color defined by a standard color block, and the image to be corrected is an image obtained by shooting; determining color correction information based on the standard pixel value and the image pixel value of the at least one standard color, wherein the image pixel value of each standard color is a pixel value obtained by shooting a standard color block; and carrying out image color correction on the image to be corrected based on the color correction information. The method and the device improve the accuracy of image color correction.)

A method for color correction of an image, the method comprising:

determining at least one standard color in an image to be corrected, wherein each standard color is a color defined by a standard color block, and the image to be corrected is an image obtained by shooting;

determining color correction information based on the standard pixel value and the image pixel value of the at least one standard color, wherein the image pixel value of each standard color is a pixel value obtained by shooting the standard color block;

and carrying out image color correction on the image to be corrected based on the color correction information.

The method according to claim 1, wherein the color correction information comprises a color correction matrix, wherein the standard pixel values of the at least one standard color are used to form a standard pixel matrix, and the image pixel values of the at least one standard color are used to form an image pixel matrix, wherein each column of elements in the standard pixel matrix represents the standard pixel values of one standard color, each column of elements in the image pixel matrix represents the image pixel values of one standard color, and the elements in different rows in each column of elements respectively correspond to different color components.

The method of claim 2, wherein determining color correction information based on the standard pixel values and the image pixel values for the at least one standard color comprises:

determining a product of the standard pixel matrix, the transpose of the image pixel matrix, and a target inverse matrix as the color correction matrix, the target inverse matrix being an inverse of a product of the image pixel matrix and the transpose of the image pixel matrix.

A method according to any one of claims 1 to 3, wherein said determining at least one standard color carried by the image to be corrected comprises:

converting the image to be corrected into a first hue image comprising at least one first hue;

determining a standard color corresponding to each of the first colors to obtain the at least one standard color.

The method of claim 4, wherein said determining a standard color corresponding to each of said first colors comprises:

acquiring at least one second color phase corresponding to at least one preset standard color, wherein each second color phase is determined based on an image pixel value of the corresponding preset standard color of the second color;

and for each first color phase, when the first color phase is the same as a target second color phase in the at least one second color phase, determining a preset standard color corresponding to the target second color phase as the standard color corresponding to the first color phase.

The method according to claim 4 or 5, wherein, before said determining the standard color corresponding to each of the first colors, resulting in the at least one standard color, said determining at least one standard color carried by the image to be corrected further comprises:

counting the total number of image blocks carrying the same first hue in the first hue diagram, wherein each image block comprises at least one image pixel;

the determining a standard color corresponding to each of the first colors includes:

and when the total number of the image blocks carrying the same first hue is greater than a preset number threshold, determining a standard color corresponding to the first color.

The method according to any one of claims 4 to 6, wherein said converting the image to be corrected into a first color phase map comprising at least one first color phase comprises:

acquiring the pixel average value of each image block in the image to be corrected, wherein each image block comprises at least one image pixel;

and determining a first hue of each image block based on the pixel average value of each image block to obtain the first hue diagram.

The method according to any one of claims 2 to 7, wherein the image color correction of the image to be corrected based on the color correction information comprises:

multiplying the color correction matrix with an image matrix of the image to be corrected, the image matrix including image pixel values of pixels in the image to be corrected.

An image color correction apparatus, characterized in that the apparatus comprises:

the device comprises a first determining module, a second determining module and a correcting module, wherein the first determining module is used for determining at least one standard color in an image to be corrected, each standard color is a color defined by a standard color block, and the image to be corrected is an image obtained by shooting;

a second determining module, configured to determine color correction information based on a standard pixel value and an image pixel value of the at least one standard color, where an image pixel value of each standard color is a pixel value obtained by shooting the standard color block;

and the correction module is used for carrying out image color correction on the image to be corrected based on the color correction information.

The apparatus according to claim 9, wherein the color correction information comprises a color correction matrix, the standard pixel values of the at least one standard color are used to form a standard pixel matrix, the image pixel values of the at least one standard color are used to form an image pixel matrix, each column of elements in the standard pixel matrix represents the standard pixel value of one standard color, each column of elements in the image pixel matrix represents the image pixel value of one standard color, and the elements in different rows in each column of elements respectively correspond to different color components.

The apparatus of claim 10, wherein the second determining module is configured to:

determining a product of the standard pixel matrix, the transpose of the image pixel matrix, and a target inverse matrix as the color correction matrix, the target inverse matrix being an inverse of a product of the image pixel matrix and the transpose of the image pixel matrix.

The apparatus of any of claims 9 to 11, wherein the first determining module comprises:

the conversion sub-module is used for converting the image to be corrected into a first color phase diagram comprising at least one first color phase;

and the determining submodule is used for determining the standard color corresponding to each first color to obtain the at least one standard color.

The apparatus of claim 12, wherein the determination submodule is configured to:

acquiring at least one second hue corresponding to at least one preset standard color, wherein each second hue is determined based on an image pixel value of the corresponding preset standard color of the second hue, and each preset standard color is a color defined by one standard color block;

and for each first color phase, when the first color phase is the same as a target second color phase in the at least one second color phase, determining a preset standard color corresponding to the target second color phase as the standard color corresponding to the first color phase.

The apparatus of claim 12 or 13, wherein the first determining module further comprises:

the counting submodule is used for counting the total number of image blocks carrying the same first hue in the first hue diagram, and each image block comprises at least one image pixel;

the determination submodule is configured to:

and when the total number of the image blocks carrying the same first hue is greater than a preset number threshold, determining a standard color corresponding to the first color.

The apparatus of any one of claims 12 to 14, wherein the conversion submodule is configured to:

acquiring the pixel average value of each image block in the image to be corrected, wherein each image block comprises at least one image pixel;

and determining a first hue of each image block based on the pixel average value of each image block to obtain the first hue diagram.

The apparatus of any one of claims 10 to 15, wherein the correction module is configured to:

multiplying the color correction matrix with an image matrix of the image to be corrected, the image matrix including image pixel values of pixels in the image to be corrected.

An image color correction apparatus comprising a processor and a memory;

when the processor executes the computer program stored in the memory, the image color correction apparatus executes the image color correction method according to any one of claims 1 to 8.

A storage medium having stored therein a computer program for instructing an image color correction apparatus to execute an image color correction method according to any one of claims 1 to 8.

28页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:图像生成装置、图像生成方法、程序以及记录介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类