CN108932707B - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN108932707B
CN108932707B CN201810942146.6A CN201810942146A CN108932707B CN 108932707 B CN108932707 B CN 108932707B CN 201810942146 A CN201810942146 A CN 201810942146A CN 108932707 B CN108932707 B CN 108932707B
Authority
CN
China
Prior art keywords
image
processed
pixel point
channel
target
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
CN201810942146.6A
Other languages
Chinese (zh)
Other versions
CN108932707A (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.)
Yiaipu Co ltd
Original Assignee
Yiaipu 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 Yiaipu Co ltd filed Critical Yiaipu Co ltd
Priority to CN201810942146.6A priority Critical patent/CN108932707B/en
Publication of CN108932707A publication Critical patent/CN108932707A/en
Application granted granted Critical
Publication of CN108932707B publication Critical patent/CN108932707B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • G06T5/94

Abstract

The embodiment of the application discloses an image processing method and device, firstly, an image to be processed is obtained, wherein the image to be processed comprises a plurality of groups of pixel points, each group of pixel points comprises a plurality of pixel points which are the same in number and are adjacent, each group of pixel points in the plurality of pixel points is respectively compressed and processed for one pixel point in a compressed image, and compression characteristic values of a plurality of channels corresponding to one pixel point in the compressed image are respectively the to-be-processed characteristic values of target channels of a group of pixel points corresponding to the image to be processed. And then, carrying out fuzzy processing on the compressed image to form a fuzzy image, and adjusting the image to be processed according to the fuzzy image to obtain the adjusted image to be processed. Because the number of the pixel points of the compressed image is less than that of the image to be processed, the number of the pixel points which need to be processed when the compressed image is subjected to the fuzzy processing is less, and therefore, less calculation amount is needed in the fuzzy processing process, and the algorithm of the image processing is simplified.

Description

Image processing method and device
Technical Field
The present application relates to the field of image processing, and in particular, to an image processing method and apparatus.
Background
With the development of the artificial intelligence AI technical field, the intelligent terminal equipment has also been deeply developed. The camera through the intelligent terminal device is used for photographing to become an important link in daily life of people, wherein the photographed image is processed in a common scene, for example, a beauty camera can enable the image to meet the requirements of users.
In the existing image processing process, an image processor in the intelligent terminal equipment can calculate the image output by the camera in real time, so that a user can obtain a better processing effect, for example, the face beautifying calculation is carried out in real time, and a better face beautifying effect is obtained. However, the existing image processing algorithm is complex, the requirement on an image processor is high, and how to simplify the image processing algorithm and enable a user to obtain smoother shooting experience is an important problem in the development of the existing intelligent terminal equipment.
Disclosure of Invention
In order to solve the problem of complex image processing algorithm in the prior art, the embodiment of the application provides an image processing method and device.
The embodiment of the application provides an image processing method, which comprises the following steps:
acquiring an image to be processed, wherein the image to be processed comprises a plurality of groups of pixel points, and each group of pixel points in the plurality of groups of pixel points comprises a plurality of pixel points which are the same in number and are adjacent;
compressing each group of pixel points in the multiple groups of pixel points into one pixel point in a compressed image respectively, wherein the compression characteristic values of multiple channels corresponding to one pixel point in the compressed image are respectively the to-be-processed characteristic values of the target channels of the corresponding group of pixel points in the to-be-processed image;
blurring the compressed image to form a blurred image;
and adjusting the image to be processed according to the blurred image.
Optionally, if the group of pixels corresponds to three channels, the target channel is one of the three channels;
or, the group of pixel points corresponds to four channels, and the target channel is one or two of the channels.
Optionally, the blurring the compressed image to form a blurred image includes:
respectively carrying out weighted average on the compression characteristic values of the target pixel points and the same channel of the surrounding pixel points of the target pixel points aiming at each channel corresponding to the target pixel points in the compressed image to obtain the fuzzy characteristic values of the target pixel points in the fuzzy image;
and forming a blurred image according to the blurred feature value of each channel of each target pixel point in the blurred image.
Optionally, the performing, for each channel corresponding to a target pixel point in the compressed image, weighted average on the compressed feature values of the target pixel point and the same channel of surrounding pixels of the target pixel point, respectively, to obtain a fuzzy feature value of each channel of the target pixel point in the fuzzy image includes:
respectively carrying out weighted average on the compressed characteristic values of the target pixel point and the pixel point, the distance of which from the target pixel point in the first direction is less than or equal to a first preset distance, of the same channel of each channel corresponding to the target pixel point in the compressed image to obtain the weighted characteristic value of the target pixel point in each channel in the compressed image;
and respectively carrying out weighted average on the weighted characteristic values of the target pixel point and the same channel of the pixel point, the distance of which from the target pixel point in the second direction is less than or equal to a second preset distance, aiming at each channel corresponding to the target pixel point in the compressed image, so as to obtain the fuzzy characteristic value of the target pixel point in each channel in the fuzzy image.
Optionally, the first direction includes a horizontal direction, and the second direction includes a vertical direction;
or, the first direction comprises a vertical direction and the second direction comprises a horizontal direction.
Optionally, the adjusting the image to be processed according to the blurred image includes:
adjusting the characteristic value to be processed of the target channel of the pixel point in the image to be processed according to the characteristic difference value corresponding to the target channel of the pixel point in the image to be processed; the characteristic difference value is a difference value between a characteristic value to be processed of a target channel of a pixel point in the image to be processed and a characteristic value of a channel of a corresponding pixel point in the blurred image of the target channel of the pixel point.
Optionally, the adjusting, according to the feature difference corresponding to the target channel of the pixel point in the image to be processed, the feature value to be processed of the target channel of the pixel point in the image to be processed includes:
pre-establishing a to-be-processed characteristic value of a target channel of a pixel point in the to-be-processed image, a fuzzy characteristic value of a channel of the pixel point in the fuzzy image and a corresponding relation between the to-be-processed characteristic value of the target channel and a characteristic difference value of the fuzzy characteristic value;
searching the corresponding relation according to the characteristic value to be processed of the target channel of the pixel point in the image to be processed and the characteristic value of the channel of the pixel point corresponding to the target channel of the pixel point in the blurred image to obtain a characteristic difference value corresponding to the target channel of the pixel point in the image to be processed;
and adjusting the characteristic value to be processed of the target channel of the pixel point in the image to be processed according to the characteristic difference value corresponding to the target channel of the pixel point in the image to be processed.
Optionally, the adjusting, according to the feature difference corresponding to the target channel of the pixel point in the image to be processed, the feature value to be processed of the target channel of the pixel point in the image to be processed includes:
calculating to obtain a characteristic difference value corresponding to a target channel of a pixel point in the image to be processed;
adjusting the range of the characteristic difference value to enable the characteristic difference value to be within a preset range, wherein the preset range comprises a first range and a second range;
if the characteristic difference value is within a first range, reducing the characteristic difference value;
if the characteristic difference value is in a second range, increasing the characteristic difference value;
and adjusting the characteristic value to be processed of the target channel of the pixel point in the image to be processed according to the processed characteristic difference value.
An embodiment of the present application further provides an image processing apparatus, where the apparatus includes:
the image processing device comprises a to-be-processed image acquisition unit, a processing unit and a processing unit, wherein the to-be-processed image acquisition unit is used for acquiring a to-be-processed image which comprises a plurality of groups of pixel points, and each group of pixel points in the plurality of groups of pixel points comprises a plurality of pixel points which are the same in number and are adjacent;
the pixel point compression unit is used for respectively compressing each group of pixel points in the multiple groups of pixel points into one pixel point in a compressed image, wherein the compression characteristic values of multiple channels corresponding to one pixel point in the compressed image are respectively the characteristic values to be processed of a target channel of a group of corresponding pixel points in the image to be processed;
the fuzzy processing unit is used for carrying out fuzzy processing on the compressed image to form a fuzzy image;
and the image adjusting unit is used for adjusting the image to be processed according to the blurred image.
Optionally, if the group of pixels corresponds to three channels, the target channel is one of the three channels;
or, the group of pixel points corresponds to four channels, and the target channel is one or two of the channels.
Optionally, the blur processing unit includes:
the fuzzy characteristic value calculating unit is used for respectively carrying out weighted average on the compressed characteristic values of the target pixel points and the same channel of the surrounding pixel points of the target pixel points aiming at each channel corresponding to the target pixel points in the compressed image to obtain the fuzzy characteristic value of each channel of the target pixel points in the fuzzy image;
and the blurred image forming unit is used for forming a blurred image according to the blurred feature value of each channel of each target pixel point in the blurred image.
Optionally, the fuzzy feature value calculating unit includes:
the first weighting unit is used for respectively carrying out weighted averaging on the compressed characteristic values of the target pixel point and the pixel point, the distance between the target pixel point and the pixel point in the first direction is smaller than or equal to a first preset distance, of the same channel of the pixel point, and the weighted characteristic values of the target pixel point in the compressed image in each channel are obtained;
and the second weighting unit is used for respectively carrying out weighted average on the weighted characteristic values of the target pixel point and the same channel of the pixel point, the distance of which from the target pixel point in the second direction is less than or equal to a second preset distance, of the pixel point, aiming at each channel corresponding to the target pixel point in the compressed image, so as to obtain the fuzzy characteristic value of the target pixel point in each channel in the fuzzy image.
Optionally, the first direction includes a horizontal direction, and the second direction includes a vertical direction;
or, the first direction comprises a vertical direction and the second direction comprises a horizontal direction.
Optionally, the image adjusting unit includes:
the image adjusting subunit is used for adjusting the characteristic value to be processed of the target channel of the pixel point in the image to be processed according to the characteristic difference value corresponding to the target channel of the pixel point in the image to be processed; the characteristic difference value is a difference value between a characteristic value to be processed of a target channel of a pixel point in the image to be processed and a characteristic value of a channel of a corresponding pixel point in the blurred image of the target channel of the pixel point.
Optionally, the image adjusting subunit includes:
a corresponding relation establishing unit, configured to establish in advance a to-be-processed feature value of a target channel of a pixel point in the to-be-processed image, a blur feature value of a channel of a pixel point in the blur image, and a corresponding relation between the to-be-processed feature value of the target channel and a feature difference value of the blur feature value;
the searching unit is used for searching the corresponding relation according to the characteristic value to be processed of the target channel of the pixel point in the image to be processed and the characteristic value of the channel of the pixel point corresponding to the target channel of the pixel point in the blurred image to obtain the characteristic difference value corresponding to the target channel of the pixel point in the image to be processed;
and the characteristic value adjusting unit is used for adjusting the characteristic value to be processed of the target channel of the pixel point in the image to be processed according to the characteristic difference value corresponding to the target channel of the pixel point in the image to be processed.
Optionally, the image adjusting subunit includes:
the difference value calculating unit is used for calculating and obtaining a characteristic difference value corresponding to a target channel of a pixel point in the image to be processed;
the range adjusting unit is used for adjusting the range of the characteristic difference value to enable the characteristic difference value to be within a preset range, and the preset range comprises a first range and a second range;
if the characteristic difference value is within a first range, reducing the characteristic difference value;
if the characteristic difference value is in a second range, increasing the characteristic difference value;
and the characteristic value adjusting unit is used for adjusting the characteristic value to be processed of the target channel of the pixel point in the image to be processed according to the processed characteristic difference value.
In the image processing method and apparatus provided in the embodiment of the present application, an image to be processed is first obtained, where the image to be processed includes multiple groups of pixel points, where each group of pixel points includes multiple pixel points that are the same in number and are adjacent to each other, for example, two, three, or four adjacent pixel points, and each group of pixel points among the multiple pixel points is respectively compressed to process one pixel point in a compressed image thereof, where compression characteristic values of multiple channels corresponding to one pixel point in the compressed image are respectively to-be-processed characteristic values of target channels of a group of pixel points corresponding to the to-be-processed image. That is to say, the feature values to be processed of the target channels in each group of pixel points can be extracted, the extracted feature values to be processed of a plurality of target channels are given to a plurality of channels corresponding to one pixel point in the compressed image and used as the compressed feature values in the compressed image, and thus, the number of the pixel points in the formed compressed image is less than that of the images to be processed. And then, carrying out fuzzy processing on the compressed image to form a fuzzy image, and adjusting the image to be processed according to the fuzzy image to obtain the adjusted image to be processed. Because the number of the pixel points of the compressed image is less than that of the image to be processed, compared with the blurring processing of the image to be processed, the number of the pixel points which need to be processed when the blurring processing is carried out on the compressed image is less, and therefore, less calculation amount is needed in the blurring processing process, and the algorithm of the image processing is simplified.
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 description below are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of an image processing method according to an embodiment of the present application;
fig. 2 is a schematic distribution diagram of a group of pixel points according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of a compressed pixel provided in an embodiment of the present application;
fig. 4 is a schematic distribution diagram of a target pixel point and surrounding pixel points thereof according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram of a corresponding relationship between pixel points according to an embodiment of the present application;
FIG. 6 is a pixel diagram according to an embodiment of the present disclosure;
fig. 7 is a block diagram of an image processing apparatus according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, 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, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the prior art, an image processor in the intelligent terminal device can calculate images output by a camera in real time, so that a user can obtain a better processing effect, for example, the user can calculate the beauty in real time, and a better beauty effect can be obtained. Specifically, the image to be processed is subjected to the beautifying processing, the image to be processed can be subjected to the blurring processing firstly, the color difference between adjacent pixel points in the image to be processed is reduced, then the image to be processed is adjusted according to the image after the blurring processing, the color difference of each pixel point in the image to be processed is reduced, the skin color looks more uniform, and the skin is smoother.
The image to be processed is subjected to fuzzy processing, and usually, the feature value of each pixel point of the image to be processed and the feature values of surrounding pixel points are subjected to weighted average to obtain the feature value of the fuzzy image. For example, for a 1920 × 1080 pixel to-be-processed image, to perform a blurring operation on the to-be-processed image, 24 surrounding pixels may be selected for each pixel, and the feature values of the 24 pixels and the feature value of the pixel are weighted and averaged to obtain a blurred image of the to-be-processed image, that is, to perform blurring processing on one pixel, 25 times of sampling is required, that is, to obtain the feature values of 25 pixels. If the entire image to be processed is blurred, about 1920 × 1080 × 25 samples (when blurring is performed on the edge pixel, the number of samples is less than 25), and calculation of 1920 × 1080 × 25 weighted averages is performed.
Therefore, the calculation amount of the fuzzy processing algorithm is too large, the requirement on the image processor for calculation is high, and if the performance of the image processor is poor, calculation delay may occur, which directly causes the phenomena of jamming and the like in the photographing process of the user, and affects the user experience. Therefore, how to simplify the image processing algorithm and enable the user to obtain smoother shooting experience is an important problem in the development of the current intelligent terminal equipment.
In order to solve the above technical problem, in an image processing method and an image processing apparatus provided in an embodiment of the present application, an image to be processed is first obtained, where the image to be processed includes multiple groups of pixels, where each group of pixels includes multiple pixels that are the same in number and are adjacent to each other, for example, two, three, or four adjacent pixels, and each group of pixels in the multiple pixels is respectively compressed to process one pixel in a compressed image thereof, where compression feature values of multiple channels corresponding to one pixel in the compressed image are respectively to-be-processed feature values of a target channel of a group of pixels corresponding to the image to be processed. That is to say, the feature values to be processed of the target channels in each group of pixel points can be extracted, the extracted feature values to be processed of a plurality of target channels are given to a plurality of channels corresponding to one pixel point in the compressed image and used as the compressed feature values in the compressed image, and thus, the number of the pixel points in the formed compressed image is less than that of the images to be processed. And then, carrying out fuzzy processing on the compressed image to form a fuzzy image, and adjusting the image to be processed according to the fuzzy image to obtain the adjusted image to be processed. Because the number of the pixel points of the compressed image is less than that of the image to be processed, compared with the blurring processing of the image to be processed, the number of the pixel points which need to be processed when the blurring processing is carried out on the compressed image is less, and therefore, less calculation amount is needed in the blurring processing process, and the algorithm of the image processing is simplified.
Referring to fig. 1, the figure is a flowchart of an image processing method provided in an embodiment of the present application, and includes the following steps.
And S101, acquiring an image to be processed.
In this embodiment of the application, the image to be processed includes a plurality of groups of pixel points, where each group of pixel points in the plurality of groups of pixel points includes a plurality of pixel points that are the same in number and are adjacent, for example, two adjacent pixel points, three pixel points, or four pixel points.
The number of the pixel points in each group of pixel points can be determined according to the color characteristics of the pixel points in the image to be processed. Specifically, the color features in the image to be processed can be represented by a plurality of channels.
As a possible implementation manner, the color features in the image to be processed may be represented by red (rad, R), green (green, G), and blue (blue, B), and respectively correspond to R, G and B channels, at this time, the number of the pixel points in each group of pixel points may be 3, that is, each group of pixel points may include 3 adjacent pixel points.
As another possible implementation, the color feature in the image to be processed may be represented by red, green, blue and transparency, which respectively correspond to R, G, B and four channels of alpha (alpha, a), at this time, the number of the pixel points in each group of the pixel points may be 2 or 4, that is, each group of the pixel points may include 2 or 4 adjacent pixel points.
The relative position between each pixel point in each group of pixel points can be determined according to actual conditions. Taking an example that each group of pixel points includes 4 adjacent pixel points, the four pixel points are Q1、Q2、Q3And Q4, as shown in fig. 2, the 4 pixels may be 4 continuous pixels in the horizontal direction, 4 continuous pixels in the vertical direction, or 4 pixels forming a rectangle.
After the number of the pixel points included in each group of pixel points and the relative position of each pixel point are determined, the image to be processed can be split, and a plurality of groups of pixel points are formed.
S102, each group of pixel points in the multiple groups of pixel points are respectively compressed into one pixel point in the compressed image.
Each group of the plurality of pixel points is compressed into one pixel point in the compressed image, and actually, the plurality of pixel points in each group of the pixel points are compressed into one pixel point.
Specifically, the feature value to be processed of the target channel in a plurality of pixel points in each group of pixel points may be determined first. The number of the target channels may be determined according to the total number of the channels corresponding to the pixel points, for example, when the pixel points correspond to three channels, the target channel may be one of the channels, and when the pixel points correspond to four channels, the target channel may be one of the channels or two of the channels.
In general, in the image to be processed, the characteristic value of the a channel is usually 1, which indicates opacity. And when the image to be processed is human skin, the whole color and luster will be reddish, and the red channel will be brighter at this time, which means that the red channel has less details, compared with the green channel and the blue channel, the details are more, so that the G channel in the image to be processed can be used as the target channel, the B channel in the image to be processed can be used as the target channel, and the G channel and the B channel in the image to be processed can be used as the target channels.
Therefore, when the pixel points in the image to be processed correspond to three channels, the number of the pixel points in each group of the pixel points in the image to be processed is 3, and the target channel corresponding to each pixel point is a channel, such as a B channel or a G channel. When the pixel points in the image to be processed correspond to four channels, the number of the pixel points in each group of the pixel points in the image to be processed is 2 or 4, correspondingly, if the number of the pixel points in each group of the pixel points is 2, the target channel corresponding to each pixel point is 2 channels, such as a B channel and a G channel, and if the number of the pixel points in each group of the pixel points is 4, the target channel corresponding to each pixel point is 1 channel, such as a B channel or a G channel.
After the feature values to be processed of the target channels of the multiple pixel points in each group of pixel points are determined, the feature values to be processed of the target channels of the multiple pixel points in the group of pixel points can be combined to form the compressed feature values of the multiple channels corresponding to one pixel point in the compressed image. For example, referring to fig. 3, a group of pixels may include 4 pixels Q1, Q2, Q3, and Q4Each pixel point corresponds to four channels, and then the pixel point Q1Is characterized by R00G00B00A00Pixel point Q2Is characterized by R01G01B01A01, Pixel Q3Is characterized by R10G10B10A10Pixel point Q4Is characterized by R11G11B11A11. If the G channel is taken as a target channel, the characteristic values to be processed of the G channels of the 4 pixel points can be combined to form a pixel point P in the compressed image1Compression characteristic G of00G01G10G11
Similarly, a certain group of pixels can include 2 pixels Q1And Q2Each pixel point pairIn response to four channels, pixel point Q1Is characterized by R00G00B00A00Pixel point Q2Is characterized by R01G01B01A01If the G channel and the B channel are taken as target channels, the characteristics to be processed of the G channel and the B channel of 2 pixel points can be combined to form a pixel point P in a compressed image2Compression characteristic G of00B00G01B01
When four channels corresponding to color features of pixel points in an image are compressed, the four channels do not correspond to the four RBGA channels, but are endowed with feature values of a target channel, so that the four channels can be named as a first channel, a second channel, a third channel and a fourth channel.
Because the characteristic values of the channels corresponding to each pixel point in the compressed image are formed by combining the characteristic values of the target channels of a group of pixel points, the number of the pixel points in the compressed image is less than that of the pixel points in the image to be processed. Specifically, when each group of pixels in the image to be processed includes 2 pixels, the number of pixels in the compressed image is half of the number of pixels in the image to be processed, that is, when each group of pixels in the image to be processed includes 4 pixels, the number of pixels in the compressed image is one fourth of the number of pixels in the image to be processed, and the number of pixels in the compressed image is 1920 × 1080, or 1920 × 540.
S103, blurring the compressed image to form a blurred image.
Because the number of the pixel points in the compressed image is less than that of the pixel points in the image to be processed, the calculation amount required for blurring the compressed image is less than that for blurring the image to be processed, and the algorithm is simplified.
Specifically, the compressed image is subjected to fuzzy processing, and the compression characteristic values of the target pixel point and the surrounding pixel points of the target pixel point can be weighted and averaged to obtain the fuzzy characteristic value of the target pixel point in the fuzzy image, wherein the difference between the fuzzy characteristic values of the adjacent pixel points is smaller than the difference between the compression characteristic values of the adjacent pixel points.
For example, referring to FIG. 4, the target pixel P00Has a compression characteristic value of P (0,0), and in the horizontal direction, the target pixel point P00The left pixels are pixels P0-2And P0-1The compression characteristic values are P (0, -2) and P (0, -1), and the pixel points on the right side of the target pixel point are pixel points P01And P02The compression eigenvalues are P (0,1) and P (0,2), respectively.
In the vertical direction, pixel point P0-2The upper pixel point of (1) is P-2-2And P-1-2The compression characteristic values are P (-2, -2) and P (-1, -2), respectively, and the pixel point P0-2The lower pixel point of (B) is P1-2And P2-2The compression characteristic values are P (1, -2) and P (2, -2); pixel point P0-1The upper pixel point of (1) is P-2-1And P-1-1The compression characteristic values are respectively P (-2, -1) and P (-1, -1), and the pixel point P0-1The lower pixel point of (B) is P1-1And P2-1The compression characteristic values are P (1, -1) and P (2, -1) respectively; pixel point P00The upper pixel point of (1) is P-20And P-10The compression characteristic values are respectively P (-2,0) and P (-1,0), and the pixel point P00The lower pixel point of (B) is P10And P20The compression characteristic values are P (1,0) and P (2,0) respectively; pixel point P01The upper pixel point of (1) is P-21And P-11The compression characteristic values are P (-2,1) and P (-1,1), respectively, and the pixel point P01The lower pixel point of (B) is P11And P21The compression characteristic values are P (1,1) and P (2,1) respectively; pixel point P02The upper pixel point of (A) is P-22And P-12The compression characteristic values are P (-2,2) and P (-1,2), respectively, and the pixel point P02The lower pixel point of (B) is P12And P22The compression characteristic values are P (1,2) and P (2,2) respectively.
As a possible implementation manner of weighted average, the compression characteristic value of the target pixel point in the compressed image and the compression characteristic values of the surrounding pixel points of the target pixel point may be obtained first, and then the compression characteristic value of the target pixel point and the compression characteristic values of the surrounding pixel points of the target pixel point are weighted average to obtain the fuzzy characteristic value of the target pixel point in the fuzzy image. That is to say, in the blurring processing of the compressed image, 25 times of sampling may be performed on one target pixel, and certainly, since the number of pixels in the compressed image is less than the number of pixels in the image to be processed, the amount of calculation required for the blurring processing of the compressed image is less, and for the pixel of the image to be processed, 1920 × 1080, the pixel of the compressed image may be 960 × 540, and compared with 1920 × 1080 times of sampling required for the blurring processing of the image to be processed, 960 × 540 × 25 times of sampling is only required for the blurring processing of the compressed image, and the amount of calculation may be reduced by four times.
For example, the compression feature value of each pixel point shown in fig. 4 is weighted, so that the target pixel point P in the blurred image can be obtained00The fuzzy eigenvalues of (a) are: p "(0, 0) × 0.16 × P (0,0) +0.08 × P (-1,0) +0.08 × P (1,0) +0.04 × P (-2,0) +0.04 × P (2,0) +0.08 × P (0, -1) +0.04 × P (-1, -1) +0.04 × P (1, -1) +0.02 × P (-2, -1) +0.02 × P (2, -1) +0.08 × P (0,1) +0.04 × P (-1,1) +0.04 × P (1,1) +0.02 × P (-2,1) + 0.02) + P (2,1) +0.02 × P (2,1) + 0.02) + P (2,1 × P (0.04 × P (-0.02) + P (-2, 0.02) + P (-0.02) +0.04 × P (-0, 0) +0.04 × P (0,0) + 0.02) + P (2) + 0.02) + 2, 0.02) + P (0,0, 2) +0.02 × P (1,2) +0.01 × P (-2,2) +0.01 × P (2, 2).
As another possible implementation manner of weighted average, the compressed characteristic value of the target pixel point and the compressed characteristic value of the pixel point, whose distance from the target pixel point in the first direction is less than or equal to a first preset distance, may be weighted average to obtain a weighted characteristic value of the target pixel point in the blurred image; and then carrying out weighted average on the weighted characteristic value of the target pixel point and the weighted characteristic value of the pixel point of which the distance from the target pixel point in the second direction is less than or equal to a second preset distance to obtain the fuzzy characteristic value of the target pixel point in the fuzzy image.
Specifically, the first direction may be a horizontal direction, and the second direction may be a vertical direction, of course, the first direction may also be a vertical direction, and the corresponding second direction may also be a horizontal direction, which does not affect the implementation of the embodiment of the present application.
For example, referring to the target pixel point and the 24 pixels around the target pixel point shown in fig. 4, in the vertical direction, the target pixel point P may be set to be the target pixel point P00And a pixel point P having a distance in the vertical direction from the target pixel of 2 or less-20、P-10、P10And P20The compressed feature values P (-1,0), P (-2,0), and P (2,0) are weighted and averaged to obtain a weighted feature value P '(0, 0) of the target pixel in the compressed image, specifically, P' (0,0) ═ 0.4 × P (0,0) +0.2 × P (-1,0) +0.2 × P (1,0) +0.1 × P (-2,0) +0.1 × P (2, 0).
On the basis, the target pixel point P is processed00And a pixel point P' in the compressed image whose distance from the target pixel in the horizontal direction is less than or equal to 20-2、P0-1、P01And P02The weighted feature values P '(0, -1), P' (0, -2) and P '(0, 2) are weighted and averaged to obtain a fuzzy feature value P' (0,0) of the target pixel point in the fuzzy image. Wherein, the pixel point P-20、P-10、P10And P20The weighted feature values P ' (0, -1), P ' (0, -2) and P ' (0,2) can be obtained by referring to the target pixel point P in the compressed image00Wherein, as an example, P ' (0, -1) ═ 0.4 × P (0, -1) +0.2 × P (-1, -1) +0.2 × P (1, -1) +0.1 × P (-2, -1) +0.1 × P (2, -1), P ' (0,1) ═ 0.4 × P (0,1) +0.2 × P (-1,1) +0.2 × P (1,1) +0.1 × P (-2,1) +0.1 × P (2,1), P ' (0, -2) ═ 0.4 × P (0, -2) +0.2 × P (-1, -2) +0.2 × P (1, -2) +0.1 × P (-2), P (-2) +0.2 + (0.2) + P (1), 2) +0.2 × P (1,2) +0.1 × P (-2,2) +0.1 × P (2, 2).
Then P "(0, 0) × 0.4 × P ' (0,0) +0.2 × P ' (0, -1) +0.2 × P ' (0,1) +0.1 × P ' (0, -2) +0.1 × P ' (0,2) × 0.16 × P (0,0) +0.08 × P (-1,0) +0.08 × P (1,0) +0.04 × P (-2,0) +0.04 × P (2,0) +0.02 × P (2,0) +0.08 × P (0, -1) +0.04 × P (-1, -1) +0.04 × P (1, -1) +0.02 × P (-2, -1) + 0.02) + P (2, -1) +0.02 × P (0,0) +0.04 × P (1,0) + 0.02) + P (0,0) + 1,0) + P (0,0) + 0.02) + P (0,0) +0, 2) + P (0,0, -2) + 0.01P (-2, -2) + 0.01P (2, -2) + 0.04P (0,2) + 0.02P (-1,2) + 0.02P (1,2) + 0.01P (-2,2) + 0.01P (2,2), that is to say, in the process of blurring the compressed image, for a target pixel point, 10 times of sampling can be performed, the result of weighted averaging of the surrounding 25 points is obtained, thus allowing a further reduction in the number of calculations with respect to 25 samples, for 1920 × 1080 pixels of the image to be processed, the pixels of the compressed image may be 960 × 540, compared to 1920 × 1080 × 25 samples required for blurring the image to be processed, the blurring process for the compressed image only needs to perform 960 × 540 × 10 sampling, and the calculation amount can be reduced to 10 times of the original calculation amount.
The target pixel and the surrounding pixels thereof all have a plurality of channels, such as a first channel, a second channel, a third channel and a fourth channel, and the weighted average is performed on the compression characteristic values of the target pixel and the surrounding pixels thereof, which may specifically be performed on the weighted average of the compression characteristic values of the corresponding channels of the target pixel and the surrounding pixels. For example, the compression characteristic value of the first channel is weighted and averaged to obtain the fuzzy characteristic value of the first channel, and the compression characteristic value of the second channel is weighted and averaged to obtain the fuzzy characteristic value of the second channel, so that the fuzzy characteristic value of each channel of the target pixel point in the fuzzy image is obtained.
Therefore, the compressed image is blurred to form a blurred image, and the compressed characteristic values of the target pixel points and the compressed characteristic values of the same channels of the surrounding pixel points of the target pixel points in the blurred image can be weighted and averaged respectively for each channel corresponding to the target pixel point in the compressed image to obtain the blurred characteristic value of each channel of the target pixel point in the blurred image. Specifically, for each channel corresponding to a target pixel point in a compressed image, weighted averaging may be performed on compressed feature values of the target pixel point and a same channel of a pixel point whose distance from the target pixel point in the first direction is less than or equal to a first preset distance, so as to obtain weighted feature values of the target pixel point in each channel in the blurred image; and respectively carrying out weighted average on the weighted characteristic values of the target pixel point and the same channel of the pixel point, the distance of which from the target pixel point in the second direction is less than or equal to a second preset distance, aiming at each channel corresponding to the target pixel point in the compressed image, so as to obtain the fuzzy characteristic value of the target pixel point in each channel in the fuzzy image. Wherein, the first direction may be a horizontal direction, and the corresponding second direction may be a vertical direction; or the first direction may be a vertical direction and the second direction may be a horizontal direction.
And S104, adjusting the image to be processed according to the blurred image.
In the embodiment of the application, the image to be processed can be directly adjusted according to the blurred image, specifically, the feature value to be processed of the pixel point in the image to be processed can be adjusted according to the blurred feature value of the pixel point in the blurred image, so as to change the color feature of the pixel point in the image to be processed, and achieve the purpose of beautifying the image to be processed. Specifically, the channels of the pixels in the blurred image corresponding to the target channels of the pixels in the image to be processed may be determined, so that the to-be-processed characteristic values of the target channels of the pixels in the image to be processed are adjusted according to the blurred characteristic values of the channels of the pixels in the blurred image corresponding to the target channels of the pixels in the image to be processed.
The channels of the pixel points in the blurred image corresponding to the target channels of the pixel points in the image to be processed can be determined according to the corresponding relationship between the compression characteristic values of the multiple channels of the pixel points in the blurred image and the characteristic values to be processed of the target channels in the image to be processed.
For example, referring to fig. 5, the to-be-processed image includes 16 pixels, and is divided into 4 groups of pixels, where one group of pixels includes 4 pixels, and a target channel of each pixel is a green channel, and then the compression feature values of the 4 channels of the pixels in the blurred image respectively correspond to the to-be-processed feature values of the green channels of the four pixels in the to-be-processed image. At this time, the coordinates Q (x, y) of each pixel point in the image to be processed may be obtained by using the upper left corner of the image to be processed and the blurred image as the origin of coordinates, the horizontal rightward direction as the positive x-axis direction, and the horizontal downward direction as the positive y-axis direction.
Referring to fig. 5, it may be determined that coordinates of a pixel point in the blurred image corresponding to the point Q in the image to be processed are P (x/2, y/2), where x/2 and y/2 are rounding functions for removing decimal places, taking Q (3,3) as an example, a corresponding pixel point in the blurred image is P (1,1), and feature values of four channels corresponding to P1 are G22G23G32G33(ii) a The channel in the compressed image corresponding to the target channel of the Q point in the image to be processed may be determined according to (x% 2, y% 2), where x% 2 and y% 2 are the remainder operation, and with (x% 2, y% 2) as coordinates, the channel position may be determined, for example, (0,0) represents the first channel, (0,1) represents the second channel, (1,0) represents the third channel, and (1,1) represents the fourth channel, for example, the green channel of Q (3,3) corresponds to the (1,1) channel in the P (1,1) point, i.e., the fourth channel in P (1,1) in the compressed image. In this embodiment of the present application, a difference between the to-be-processed feature value of the target channel of the pixel point in the to-be-processed image and the compressed feature value of the target channel of the pixel point in the blurred image may also be used as a feature difference value corresponding to the target channel of the pixel point in the to-be-processed image, and the to-be-processed image may be adjusted according to the feature difference value.
As a possible feature difference value obtaining mode, the to-be-processed feature value O of the target channel of the pixel point in the to-be-processed image can be calculated in real time1The fuzzy characteristic value B of the target channel corresponding to the pixel point in the channel of the pixel point in the fuzzy image1The difference H between the characteristics may be, specifically, H ═ O1-B1
After the feature difference is obtained through calculation, the feature difference may be further adjusted to further improve the processing effect of the image.
Specifically, the range of the characteristic difference value may be adjusted first, so that the characteristic difference value is within a preset range, where the preset range may be 0 to 1. The range of the characteristic difference value is adjusted, and the characteristic value O to be processed of the target channel of the pixel point in the image to be processed can be firstly processed1Normalizing to obtainTo normalized feature to be processed O2=O1/256 fuzzy eigenvalues B of the channels of the pixel points in the blurred image1Normalization is carried out to obtain normalized fuzzy characteristics B2=B1256, thereby normalizing the feature difference to O1/256-B1And/256, the normalized feature difference value ranges from-1 to 1. Adding 0.5 on the basis of the normalized feature difference to obtain an adjusted feature difference, wherein the range of the adjusted feature difference is-0.5 to 1.5; setting the part of the adjusted characteristic difference value smaller than 0 as 0 and the part of the adjusted characteristic difference value larger than 1 as 1 to obtain the readjusted characteristic difference value H1And ranges from 0 to 1.
After the range of the feature difference value is adjusted, the feature difference value is adjusted according to the specific range of the feature difference value, specifically, the preset range may include a first range and a second range, where the first range and the second range do not have an intersection, and a union of the first range and the second range may be the preset range or may be smaller than the preset range.
If the feature difference value H after readjustment1Within the first range, the feature difference value may be subjected to a reduction process. Specifically, the first range may be greater than or equal to 0 and less than or equal to 0.5, so that the characteristic difference value H after the reduction processing is made2=2H1 2Therefore, the difference between the characteristic value to be processed of the target channel of the pixel point in the image to be processed and the fuzzy characteristic value of the target channel corresponding to the pixel point in the channel of the pixel point in the fuzzy image is reduced.
If the first difference value H after readjustment1Within the second range, the feature difference value may be subjected to the increase processing. Specifically, the second range may be greater than 0.5 and less than or equal to 1, and the feature difference H after the increase processing may be made3=1-(1-H1)2Therefore, the difference between the characteristic value to be processed of the target channel of the pixel point in the image to be processed and the fuzzy characteristic value of the target channel corresponding to the pixel point in the channel of the pixel point in the fuzzy image is increased.
It will be appreciated that the processed feature difference value may be taken as the first differenceValue H1The above process of adjusting the feature difference value according to the specific range of the feature difference value is executed for a plurality of times, and the feature difference value is adjusted for a plurality of times, for example, it may be 5 times, so as to further improve the processing effect of the image.
As another possible acquisition mode of the difference features, a to-be-processed feature value of a target channel of a pixel point in the to-be-processed image, a fuzzy feature value of a channel of a pixel point in the fuzzy image, and a corresponding relationship between the to-be-processed feature value of the target channel and the difference features of the fuzzy feature values can be pre-established; and searching a pre-established corresponding relation according to the characteristic value to be processed of the target channel of the pixel point in the image to be processed and the characteristic value of the channel of the pixel point corresponding to the target channel of the pixel point in the blurred image, so as to obtain a characteristic difference value corresponding to the target channel of the pixel point in the image to be processed.
Optionally, the to-be-processed feature value of the target channel of the pixel in the to-be-processed image, the blur feature value of the channel of the pixel in the blur image, and the correspondence between the to-be-processed feature value of the target channel of the pixel in the to-be-processed image and the difference feature of the blur feature value may be represented by a function, that is, the difference feature H ═ f (O) (where O is an integer of one or more of m, m1,B1)。
Optionally, the to-be-processed feature value of the target channel of the pixel in the to-be-processed image, the blur feature value of the channel of the pixel in the blur image, and the corresponding relationship between the to-be-processed feature value of the target channel of the pixel in the to-be-processed image and the difference feature of the blur feature value may also be represented by a pixel map as shown in fig. 6, where an abscissa may be the to-be-processed feature value of the target channel of the pixel in the to-be-processed image, an ordinate may be the blur feature value of the channel of the pixel in the blur image, and a color value of the pixel in the pixel map represents the to-be-processed feature value of the target channel of the pixel in the to-be-processed image and the difference feature of the blur feature value. Of course, the abscissa in the pixel map may also be a blur characteristic value of a channel of a pixel point in the blur image, and the ordinate is a to-be-processed characteristic value of a target channel of a pixel point in the to-be-processed image. Corresponding to the value range of the color channel, the abscissa can have 256 values, and the ordinate can also have 256 values, so that 256 combinations of 256 × 256 values in the pixel map can be searched.
After the feature difference is obtained, the feature value to be processed of the target channel of the pixel point in the image to be processed can be adjusted according to the feature difference. Specifically, the target feature value of the target channel of the pixel point in the image to be processed may be obtained according to the feature value to be processed and the feature difference value of the target channel of the pixel point in the image to be processed, where the target feature value R ═ O2+(0.5-|O2-0.5 |). 2 [ (. 0.5-H), wherein H may be the feature difference itself or an adjusted feature difference. And the target characteristic value is the characteristic value of the target channel of the pixel point in the adjusted image to be processed.
And adjusting the characteristic value to be processed of the target channel of the pixel point in the image to be processed to further beautify the image to be processed. If the image to be processed is human skin, the uneven area of the skin or the spot of pox becomes closer to the surrounding skin, so that the skin looks smoother.
In an image processing method provided by an embodiment of the present application, an image to be processed is first obtained, where the image to be processed includes multiple groups of pixel points, where each group of pixel points includes multiple pixel points that are the same in number and are adjacent, for example, two, three, or four adjacent pixel points, and each group of pixel points in the multiple pixel points is respectively compressed to process one pixel point in a compressed image thereof, where compression characteristic values of multiple channels corresponding to one pixel point in the compressed image are respectively to-be-processed characteristic values of target channels of a group of pixel points corresponding to the image to be processed. That is to say, the feature values to be processed of the target channels in each group of pixel points can be extracted, the extracted feature values to be processed of a plurality of target channels are given to a plurality of channels corresponding to one pixel point in the compressed image and used as the compressed feature values in the compressed image, and thus, the number of the pixel points in the formed compressed image is less than that of the images to be processed. And then, carrying out fuzzy processing on the compressed image to form a fuzzy image, and adjusting the image to be processed according to the fuzzy image to obtain the adjusted image to be processed. Because the number of the pixel points of the compressed image is less than that of the image to be processed, compared with the blurring processing of the image to be processed, the number of the pixel points which need to be processed when the blurring processing is carried out on the compressed image is less, and therefore, less calculation amount is needed in the blurring processing process, and the algorithm of the image processing is simplified.
Based on the method provided by the above embodiment, the embodiment of the present application further provides an image processing apparatus, and the working principle of the image processing apparatus is described in detail below with reference to the accompanying drawings.
Referring to fig. 7, this figure is a block diagram of an image processing apparatus according to an embodiment of the present application, where the apparatus includes:
the image processing apparatus includes a to-be-processed image obtaining unit 110, configured to obtain an image to be processed, where the image to be processed includes multiple groups of pixel points, and each group of pixel points in the multiple groups of pixel points includes multiple pixel points that are the same in number and are adjacent to each other;
a pixel point compressing unit 120, configured to compress each group of pixel points in the multiple groups of pixel points into one pixel point in a compressed image, where compression characteristic values of multiple channels corresponding to one pixel point in the compressed image are to-be-processed characteristic values of a target channel of a group of pixel points corresponding to the to-be-processed image;
a blurring processing unit 130, configured to perform blurring processing on the compressed image to form a blurred image;
an image adjusting unit 140, configured to adjust the image to be processed according to the blurred image.
Optionally, if the group of pixels corresponds to three channels, the target channel is one of the three channels;
or, the group of pixel points corresponds to four channels, and the target channel is one or two of the channels.
Optionally, the blur processing unit includes:
the fuzzy characteristic value calculating unit is used for respectively carrying out weighted average on the compressed characteristic values of the target pixel points and the same channel of the surrounding pixel points of the target pixel points aiming at each channel corresponding to the target pixel points in the compressed image to obtain the fuzzy characteristic value of each channel of the target pixel points in the fuzzy image;
and the blurred image forming unit is used for forming a blurred image according to the blurred characteristic values of the channels of the target pixel points in the blurred image.
Optionally, the fuzzy feature value calculating unit includes:
the first weighting unit is used for respectively carrying out weighted averaging on the compressed characteristic values of the target pixel point and the pixel point, the distance between the target pixel point and the pixel point in the first direction is smaller than or equal to a first preset distance, of the same channel of the pixel point, and the weighted characteristic values of the target pixel point in the compressed image in each channel are obtained;
and the second weighting unit is used for respectively carrying out weighted average on the weighted characteristic values of the target pixel point and the same channel of the pixel point, the distance of which from the target pixel point in the second direction is less than or equal to a second preset distance, of the pixel point, aiming at each channel corresponding to the target pixel point in the compressed image, so as to obtain the fuzzy characteristic value of the target pixel point in each channel in the fuzzy image.
Optionally, the first direction includes a horizontal direction, and the second direction includes a vertical direction;
or, the first direction comprises a vertical direction and the second direction comprises a horizontal direction.
Optionally, the image adjusting unit includes:
the image adjusting subunit is used for adjusting the characteristic value to be processed of the target channel of the pixel point in the image to be processed according to the characteristic difference value corresponding to the target channel of the pixel point in the image to be processed; the characteristic difference value is a difference value between the characteristic value to be processed of the target channel of the pixel point in the image to be processed and the characteristic value of the channel of the corresponding pixel point of the target channel of the pixel point in the blurred image.
Optionally, the image adjusting subunit includes:
a corresponding relation establishing unit, configured to establish in advance a to-be-processed feature value of a target channel of a pixel point in the to-be-processed image, a blur feature value of a channel of a pixel point in the blur image, and a corresponding relation between the to-be-processed feature value of the target channel and a feature difference value of the blur feature value;
the searching unit is used for searching the corresponding relation according to the characteristic value to be processed of the target channel of the pixel point in the image to be processed and the characteristic value of the channel of the pixel point corresponding to the target channel of the pixel point in the blurred image to obtain the characteristic difference value corresponding to the target channel of the pixel point in the image to be processed;
and the characteristic value adjusting unit is used for adjusting the characteristic value to be processed of the target channel of the pixel point in the image to be processed according to the characteristic difference value corresponding to the target channel of the pixel point in the image to be processed.
Optionally, the image adjusting subunit includes:
the difference value calculating unit is used for calculating and obtaining a characteristic difference value corresponding to a target channel of a pixel point in the image to be processed;
a range adjusting unit, configured to adjust a range of the feature difference value so that the feature difference value is within a preset range, where the preset range includes a first range and a second range;
if the characteristic difference value is in a first range, reducing the characteristic difference value;
if the characteristic difference value is in a second range, increasing the characteristic difference value;
and the characteristic value adjusting unit is used for adjusting the characteristic value to be processed of the target channel of the pixel point in the image to be processed according to the processed characteristic difference value.
In an image processing apparatus provided in an embodiment of the present application, an image to be processed is first obtained, where the image to be processed includes multiple groups of pixel points, where each group of pixel points includes multiple pixel points that are the same in number and are adjacent, for example, two, three, or four adjacent pixel points, and each group of pixel points among the multiple pixel points is equally divided into one pixel point in a compressed image of the group of pixel points, where compression characteristic values of multiple channels corresponding to one pixel point in the compressed image are respectively to-be-processed characteristic values of a target channel of a corresponding group of pixel points in the image to be processed. That is to say, the feature values to be processed of the target channels in each group of pixel points can be extracted, the extracted feature values to be processed of a plurality of target channels are given to a plurality of channels corresponding to one pixel point in the compressed image and used as the compressed feature values in the compressed image, and therefore the number of the pixel points in the formed compressed image is less than that of the images to be processed. And then, carrying out fuzzy processing on the compressed image to form a fuzzy image, and adjusting the image to be processed according to the fuzzy image to obtain the adjusted image to be processed. Because the number of the pixel points of the compressed image is less than that of the image to be processed, compared with the blurring processing of the image to be processed, the number of the pixel points which need to be processed when the blurring processing is carried out on the compressed image is less, and therefore, less calculation amount is needed in the blurring processing process, and the algorithm of the image processing is simplified.
When introducing elements of various embodiments of the present application, the articles "a," "an," "the," and "said" are intended to mean that there are one or more of the elements. The terms "comprising," "including," and "having" are intended to be inclusive and mean that there may be additional elements other than the listed elements.
It should be noted that, as one of ordinary skill in the art would understand, all or part of the processes of the above method embodiments may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when executed, the computer program may include the processes of the above method embodiments. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the apparatus embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the description of the method embodiments for relevant points. The above-described apparatus embodiments are merely illustrative, and the units and modules described as separate components may or may not be physically separate. In addition, some or all of the units and modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The foregoing is directed to embodiments of the present application and it is noted that numerous modifications and adaptations may be made by those skilled in the art without departing from the principles of the present application and are intended to be within the scope of the present application.

Claims (12)

1. A method of image processing, the method comprising:
acquiring an image to be processed, wherein the image to be processed comprises a plurality of groups of pixel points, and each group of pixel points in the plurality of groups of pixel points comprises a plurality of pixel points which are the same in number and are adjacent;
compressing each group of pixel points in the multiple groups of pixel points into one pixel point in a compressed image respectively, wherein the compression characteristic values of multiple channels corresponding to one pixel point in the compressed image are respectively the to-be-processed characteristic values of the target channels of the corresponding group of pixel points in the to-be-processed image;
blurring the compressed image to form a blurred image;
adjusting the image to be processed according to the blurred image;
the group of pixel points corresponds to three channels, and the target channel is one of the three channels;
or, the group of pixel points corresponds to four channels, and the target channel is one or two of the channels;
the blurring process is performed on the compressed image to form a blurred image, and the blurring process includes:
respectively carrying out weighted average on the compression characteristic values of the target pixel points and the same channel of the surrounding pixel points of the target pixel points aiming at each channel corresponding to the target pixel points in the compressed image to obtain the fuzzy characteristic values of the target pixel points in the fuzzy image;
and forming a blurred image according to the blurred characteristic value of each channel of each target pixel point in the blurred image.
2. The method according to claim 1, wherein the obtaining the blur characteristic value of each channel of the target pixel point in the blur image by performing weighted average on the compressed characteristic values of the target pixel point and the same channel of the surrounding pixels of the target pixel point for each channel corresponding to the target pixel point in the compressed image comprises:
respectively carrying out weighted average on the compressed characteristic values of the target pixel point and the pixel point, the distance of which from the target pixel point in the first direction is less than or equal to a first preset distance, of the same channel of each channel corresponding to the target pixel point in the compressed image to obtain the weighted characteristic value of the target pixel point in each channel in the compressed image;
and respectively carrying out weighted average on the weighted characteristic values of the target pixel point and the same channel of the pixel point, the distance of which from the target pixel point in the second direction is less than or equal to a second preset distance, aiming at each channel corresponding to the target pixel point in the compressed image, so as to obtain the fuzzy characteristic value of the target pixel point in each channel in the fuzzy image.
3. The method of claim 2, wherein the first direction comprises a horizontal direction and the second direction comprises a vertical direction;
or, the first direction comprises a vertical direction and the second direction comprises a horizontal direction.
4. The method of claim 1, wherein the adjusting the image to be processed according to the blurred image comprises:
adjusting the characteristic value to be processed of the target channel of the pixel point in the image to be processed according to the characteristic difference value corresponding to the target channel of the pixel point in the image to be processed; the characteristic difference value is a difference value between a characteristic value to be processed of a target channel of a pixel point in the image to be processed and a characteristic value of a channel of a corresponding pixel point in the blurred image of the target channel of the pixel point.
5. The method according to claim 4, wherein the adjusting the feature value to be processed of the target channel of the pixel point in the image to be processed according to the feature difference value corresponding to the target channel of the pixel point in the image to be processed includes:
pre-establishing a to-be-processed characteristic value of a target channel of a pixel point in the to-be-processed image, a fuzzy characteristic value of a channel of the pixel point in the fuzzy image and a corresponding relation between the to-be-processed characteristic value of the target channel and a characteristic difference value of the fuzzy characteristic value;
searching the corresponding relation according to the characteristic value to be processed of the target channel of the pixel point in the image to be processed and the characteristic value of the channel of the pixel point corresponding to the target channel of the pixel point in the blurred image to obtain a characteristic difference value corresponding to the target channel of the pixel point in the image to be processed;
and adjusting the characteristic value to be processed of the target channel of the pixel point in the image to be processed according to the characteristic difference value corresponding to the target channel of the pixel point in the image to be processed.
6. The method according to claim 4, wherein the adjusting the feature value to be processed of the target channel of the pixel point in the image to be processed according to the feature difference value corresponding to the target channel of the pixel point in the image to be processed includes:
calculating to obtain a characteristic difference value corresponding to a target channel of a pixel point in the image to be processed;
adjusting the range of the characteristic difference value to enable the characteristic difference value to be within a preset range, wherein the preset range comprises a first range and a second range;
if the characteristic difference value is within a first range, reducing the characteristic difference value;
if the characteristic difference value is in a second range, increasing the characteristic difference value;
and adjusting the characteristic value to be processed of the target channel of the pixel point in the image to be processed according to the processed characteristic difference value.
7. An apparatus for image processing, the apparatus comprising:
the image processing device comprises a to-be-processed image acquisition unit, a processing unit and a processing unit, wherein the to-be-processed image acquisition unit is used for acquiring a to-be-processed image which comprises a plurality of groups of pixel points, and each group of pixel points in the plurality of groups of pixel points comprises a plurality of pixel points which are the same in number and are adjacent;
the pixel point compression unit is used for respectively compressing each group of pixel points in the multiple groups of pixel points into one pixel point in a compressed image, wherein the compression characteristic values of multiple channels corresponding to one pixel point in the compressed image are respectively the characteristic values to be processed of a target channel of a group of corresponding pixel points in the image to be processed;
the fuzzy processing unit is used for carrying out fuzzy processing on the compressed image to form a fuzzy image;
the image adjusting unit is used for adjusting the image to be processed according to the blurred image;
the group of pixel points corresponds to three channels, and the target channel is one of the three channels;
or, the group of pixel points corresponds to four channels, and the target channel is one or two of the channels;
the blur processing unit includes:
the fuzzy characteristic value calculating unit is used for respectively carrying out weighted average on the compressed characteristic values of the target pixel points and the same channel of the surrounding pixel points of the target pixel points aiming at each channel corresponding to the target pixel points in the compressed image to obtain the fuzzy characteristic value of each channel of the target pixel points in the fuzzy image;
and the blurred image forming unit is used for forming a blurred image according to the blurred feature value of each channel of each target pixel point in the blurred image.
8. The apparatus according to claim 7, wherein the blur feature value calculation unit includes:
the first weighting unit is used for respectively carrying out weighted averaging on the compressed characteristic values of the target pixel point and the pixel point, the distance between the target pixel point and the pixel point in the first direction is smaller than or equal to a first preset distance, of the same channel of the pixel point, and the weighted characteristic values of the target pixel point in the compressed image in each channel are obtained;
and the second weighting unit is used for respectively carrying out weighted average on the weighted characteristic values of the target pixel point and the same channel of the pixel point, the distance of which from the target pixel point in the second direction is less than or equal to a second preset distance, of the pixel point, aiming at each channel corresponding to the target pixel point in the compressed image, so as to obtain the fuzzy characteristic value of the target pixel point in each channel in the fuzzy image.
9. The apparatus of claim 8, wherein the first direction comprises a horizontal direction and the second direction comprises a vertical direction;
or, the first direction comprises a vertical direction and the second direction comprises a horizontal direction.
10. The apparatus of claim 7, wherein the image adjusting unit comprises:
the image adjusting subunit is used for adjusting the characteristic value to be processed of the target channel of the pixel point in the image to be processed according to the characteristic difference value corresponding to the target channel of the pixel point in the image to be processed; the characteristic difference value is a difference value between a characteristic value to be processed of a target channel of a pixel point in the image to be processed and a characteristic value of a channel of a corresponding pixel point in the blurred image of the target channel of the pixel point.
11. The apparatus of claim 10, wherein the image adjustment subunit comprises:
a corresponding relation establishing unit, configured to establish in advance a to-be-processed feature value of a target channel of a pixel point in the to-be-processed image, a blur feature value of a channel of a pixel point in the blur image, and a corresponding relation between the to-be-processed feature value of the target channel and a feature difference value of the blur feature value;
the searching unit is used for searching the corresponding relation according to the characteristic value to be processed of the target channel of the pixel point in the image to be processed and the characteristic value of the channel of the pixel point corresponding to the target channel of the pixel point in the blurred image to obtain the characteristic difference value corresponding to the target channel of the pixel point in the image to be processed;
and the characteristic value adjusting unit is used for adjusting the characteristic values to be processed of the target channels of the pixel points in the image to be processed according to the characteristic difference values corresponding to the target channels of the pixel points in the image to be processed.
12. The apparatus of claim 10, wherein the image adjustment subunit comprises:
the difference value calculating unit is used for calculating and obtaining a characteristic difference value corresponding to a target channel of a pixel point in the image to be processed;
the range adjusting unit is used for adjusting the range of the characteristic difference value to enable the characteristic difference value to be within a preset range, and the preset range comprises a first range and a second range;
if the characteristic difference value is within a first range, reducing the characteristic difference value;
if the characteristic difference value is in a second range, increasing the characteristic difference value;
and the characteristic value adjusting unit is used for adjusting the characteristic value to be processed of the target channel of the pixel point in the image to be processed according to the processed characteristic difference value.
CN201810942146.6A 2018-08-17 2018-08-17 Image processing method and device Active CN108932707B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810942146.6A CN108932707B (en) 2018-08-17 2018-08-17 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810942146.6A CN108932707B (en) 2018-08-17 2018-08-17 Image processing method and device

Publications (2)

Publication Number Publication Date
CN108932707A CN108932707A (en) 2018-12-04
CN108932707B true CN108932707B (en) 2022-06-07

Family

ID=64445922

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810942146.6A Active CN108932707B (en) 2018-08-17 2018-08-17 Image processing method and device

Country Status (1)

Country Link
CN (1) CN108932707B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101500066A (en) * 2008-02-03 2009-08-05 深圳艾科创新微电子有限公司 Method and system for image sampling format conversion
CN102907103A (en) * 2010-06-02 2013-01-30 索尼公司 Image processing device, image processing method and program
CN102932654A (en) * 2011-08-09 2013-02-13 鸿富锦精密工业(深圳)有限公司 Color processing device and method
CN103945208A (en) * 2014-04-24 2014-07-23 西安交通大学 Parallel synchronous scaling engine and method for multi-view naked eye 3D display
CN104301621A (en) * 2014-09-28 2015-01-21 北京凌云光技术有限责任公司 Image processing method, device and terminal
CN106530252A (en) * 2016-11-08 2017-03-22 北京小米移动软件有限公司 Image processing method and device
CN107211128A (en) * 2015-03-10 2017-09-26 苹果公司 Adaptive chroma down-sampling and color space switch technology
CN108171657A (en) * 2018-01-26 2018-06-15 上海富瀚微电子股份有限公司 Image interpolation method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8749635B2 (en) * 2009-06-03 2014-06-10 Flir Systems, Inc. Infrared camera systems and methods for dual sensor applications
KR101073939B1 (en) * 2009-12-31 2011-10-17 전자부품연구원 Method for encoding image using estimation of color space
IN2013MN02138A (en) * 2012-08-07 2015-06-12 Spreadtrum Comm Shanghai Co
US9661328B2 (en) * 2013-03-15 2017-05-23 Arris Enterprises, Inc. Method of bit allocation for image and video compression using perceptual guidance

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101500066A (en) * 2008-02-03 2009-08-05 深圳艾科创新微电子有限公司 Method and system for image sampling format conversion
CN102907103A (en) * 2010-06-02 2013-01-30 索尼公司 Image processing device, image processing method and program
CN102932654A (en) * 2011-08-09 2013-02-13 鸿富锦精密工业(深圳)有限公司 Color processing device and method
CN103945208A (en) * 2014-04-24 2014-07-23 西安交通大学 Parallel synchronous scaling engine and method for multi-view naked eye 3D display
CN104301621A (en) * 2014-09-28 2015-01-21 北京凌云光技术有限责任公司 Image processing method, device and terminal
CN107211128A (en) * 2015-03-10 2017-09-26 苹果公司 Adaptive chroma down-sampling and color space switch technology
CN106530252A (en) * 2016-11-08 2017-03-22 北京小米移动软件有限公司 Image processing method and device
CN108171657A (en) * 2018-01-26 2018-06-15 上海富瀚微电子股份有限公司 Image interpolation method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Single image super-resolution using Gaussian process regression;He He 等;《CVPR 2011》;20110822;449-456 *
有雾图像传输系统中的去雾和去块方法研究;王丽萍;《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》;20170915(第09期);I138-322 *

Also Published As

Publication number Publication date
CN108932707A (en) 2018-12-04

Similar Documents

Publication Publication Date Title
US10565742B1 (en) Image processing method and apparatus
US10003765B2 (en) System and method for brightening video image regions to compensate for backlighting
CN106570838B (en) A kind of brightness of image optimization method and device
CN108805839A (en) Combined estimator image defogging method based on convolutional neural networks
CN111445564A (en) Face texture image generation method and device, computer equipment and storage medium
CN111918095B (en) Dim light enhancement method and device, mobile terminal and storage medium
Hanumantharaju et al. Color image enhancement using multiscale retinex with modified color restoration technique
CN108062755A (en) A kind of picture intelligence method of cutting out and device
CN111899197A (en) Image brightening and denoising method and device, mobile terminal and storage medium
CN113039576A (en) Image enhancement system and method
CN110570384A (en) method and device for carrying out illumination equalization processing on scene image, computer equipment and computer storage medium
CN106803920B (en) Image processing method and device and intelligent conference terminal
CN110175967B (en) Image defogging processing method, system, computer device and storage medium
JP4635975B2 (en) Image processing apparatus and image processing method
CN108377372B (en) A kind of white balancing treatment method, device, terminal device and storage medium
CN108932707B (en) Image processing method and device
WO2023103813A1 (en) Image processing method and apparatus, device, storage medium, and program product
CN112435173A (en) Image processing and live broadcasting method, device, equipment and storage medium
Tao et al. An illuminance-reflectance nonlinear video enhancement model for homeland security applications
CN108171671B (en) Beautifying method and device for enlarging eye
CN108965685A (en) A kind of image processing method and device
CN113055659A (en) Color compensation parameter generation method and device, computer equipment and storage medium
KR102111317B1 (en) System and method of transmission rate calculation for suppression of degradation of image quality
JP2003331275A (en) Color conversion device
CN113099206A (en) Image processing method, device, equipment and 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