CN107025633B - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN107025633B
CN107025633B CN201610067209.9A CN201610067209A CN107025633B CN 107025633 B CN107025633 B CN 107025633B CN 201610067209 A CN201610067209 A CN 201610067209A CN 107025633 B CN107025633 B CN 107025633B
Authority
CN
China
Prior art keywords
image
brightness
processed
area
contour
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
CN201610067209.9A
Other languages
Chinese (zh)
Other versions
CN107025633A (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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201610067209.9A priority Critical patent/CN107025633B/en
Priority to PCT/CN2016/090460 priority patent/WO2017128646A1/en
Publication of CN107025633A publication Critical patent/CN107025633A/en
Application granted granted Critical
Publication of CN107025633B publication Critical patent/CN107025633B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • G06T5/70
    • G06T5/92
    • G06T5/90
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20172Image enhancement details
    • G06T2207/20192Edge enhancement; Edge preservation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20172Image enhancement details
    • G06T2207/20208High dynamic range [HDR] image processing

Abstract

The invention provides an image processing method and device, wherein the method comprises the following steps: acquiring an image to be processed, and determining a first area in the image to be processed, wherein the first area is an area containing a preset object or a preset area; performing brightness fuzzy processing on an image to be processed to obtain a first image; extracting the contour of a first area in the first image, calculating a brightness discrimination threshold of a contour boundary according to the contour of the first area, and determining contour boundary information of all contours in the first image according to the brightness discrimination threshold; carrying out coarse quantization processing on brightness information of an image to be processed to obtain a second image; and performing enhancement processing on the contour boundary in the second image by using contour boundary information of all contours in the first image to obtain a processed image. The embodiment of the invention improves the filter shooting effect of the image by adopting a contour extraction mechanism and a brightness quantization grade increasing mechanism, and effectively solves the problem of excessive pockmarks in the filter shooting effect of the conventional image.

Description

Image processing method and device
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to an image processing method and apparatus.
Background
The smart terminal camera application is a very widely used function. In order to improve the practicability of camera application, a plurality of image processing functions, namely a filter, are implanted in the application. However, the prior art filter is limited by the simplicity of the design device, and the treatment effect is not satisfactory.
Disclosure of Invention
The embodiment of the invention aims to provide an image processing method and device, and aims to solve the problem that an obtained effect image is not clear due to simple filter design when an intelligent terminal camera is applied in the prior art.
The embodiment of the invention provides an image processing method, which comprises the following steps:
acquiring an image to be processed, and determining a first area in the image to be processed, wherein the first area is an area containing a preset object or a preset area;
performing brightness fuzzy processing on the image to be processed to obtain a first image;
extracting the contour of the first area in the first image, calculating a brightness discrimination threshold of a contour boundary according to the contour of the first area, and determining contour boundary information of all contours in the first image according to the brightness discrimination threshold;
carrying out coarse quantization processing on the brightness information of the image to be processed to obtain a second image;
and performing enhancement processing on the contour boundary in the second image by using the contour boundary information of all contours in the first image to obtain a processed image.
Wherein the determining the first region in the image to be processed comprises:
judging whether a preset object exists in the image to be processed or not;
when a preset object exists in the image to be processed, determining an area occupied by the preset object as the first area;
and when no preset object exists in the image to be processed, determining a preset area as the first area.
Wherein, when there is a preset object in the image to be processed, determining the area occupied by the preset object as the first area includes:
when a plurality of preset objects exist in the image to be processed, selecting the preset object with the largest area, and determining the area occupied by the preset object with the largest area as the first area;
when two preset objects with the same area size exist in the image to be processed, selecting the preset object close to the central coordinate, and determining the area occupied by the preset object close to the central coordinate as the first area.
The extracting the contour of the first region in the first image, and calculating the brightness discrimination threshold of the contour boundary according to the contour of the first region includes:
extracting contour pixel points of the first region, and counting the maximum brightness value, the minimum brightness value or the average brightness value of the contour pixel points of the first region;
and determining a brightness discrimination threshold of the contour boundary according to a product of the brightness maximum value and a first proportional coefficient, a product of the brightness minimum value and a second proportional coefficient or a brightness average value, wherein the first proportional coefficient is a positive number smaller than 1, and the second proportional coefficient is a positive number larger than 1.
Wherein, the performing the coarse quantization processing of the brightness information on the image to be processed to obtain a second image includes:
extracting pixel points of the image to be processed, and performing brightness increasing quantization grade processing on the pixel points of the image to be processed according to the following formula to obtain the second image:
Y1=[y/Q]*Q
wherein: y1 represents the brightness of the pixel point after the quantization grade is increased, Y represents the brightness of the original pixel point, Q represents the numerical value of the quantization grade, the value of Q is any integer of 1-255, and [ Y/Q ] represents the operation of rounding the quotient of Y and Q.
The obtaining a processed image after performing enhancement processing on the contour boundary in the second image by using the contour boundary information of all the contours in the first image includes:
extracting pixel points of the contour boundary of the second image according to the contour boundary information of all contours in the first image, and calculating the pixel points of the contour boundary of the second image according to the following formula to obtain the brightness of the corresponding pixel points:
Y2=K*Y1+b
wherein: y2 represents the brightness of the corresponding pixel point, Y1 represents the brightness of the pixel point after the quantization level is increased, K represents any number between 0 and 1, and b is any value between 0 and 255;
performing brightness quantization level increasing processing on corresponding pixel points by adopting the following formula to finish the enhancement processing on the contour boundary brightness in the second image and ensure the consistency of the brightness quantization levels of the pixel points of the second image:
Y3=[Y2/Q]*Q
wherein: y2 represents the brightness of the corresponding pixel point, Y3 represents the brightness of the pixel point processed by Y2 of the corresponding pixel point, Q represents the numerical value of the quantization grade, the value of Q is any integer of 1-255, and [ Y2/Q ] represents the operation of rounding the quotient of Y2 and Q.
An embodiment of the present invention further provides an image processing apparatus, including:
the device comprises an acquisition determining module, a processing module and a processing module, wherein the acquisition determining module is used for acquiring an image to be processed and determining a first area in the image to be processed, and the first area is an area containing a preset object or a preset area;
the first processing module is used for carrying out brightness fuzzy processing on the image to be processed to obtain a first image;
the calculation processing module is used for extracting the contour of the first area in the first image, calculating a brightness discrimination threshold of a contour boundary according to the contour of the first area, and determining contour boundary information of all contours in the first image according to the brightness discrimination threshold;
the second processing module is used for carrying out coarse quantization processing on the brightness information of the image to be processed to obtain a second image;
and the processing and obtaining module is used for performing strengthening processing on the contour boundary in the second image by using the contour boundary information of all the contours in the first image to obtain a processed image.
Wherein the acquisition determining module comprises:
the judgment submodule is used for judging whether a preset object exists in the image to be processed or not;
the first determining submodule is used for determining the area occupied by the preset object as the first area when the preset object exists in the image to be processed;
and the second determining submodule is used for determining a preset area as the first area when no preset object exists in the image to be processed.
Wherein the first determination submodule includes:
the first unit is used for selecting the preset object with the largest area when a plurality of preset objects exist in the image to be processed, and determining the area occupied by the preset object with the largest area as the first area;
and the second unit is used for selecting the preset object which is close to the central coordinate when two preset objects with the same area size exist in the image to be processed, and determining the area occupied by the preset object which is close to the central coordinate as the first area.
Wherein the calculation processing module comprises:
the extraction and statistics submodule is used for extracting the contour pixel points of the first area and counting the maximum brightness value, the minimum brightness value or the average brightness value of the contour pixel points of the first area;
and the third determining sub-module is used for determining the brightness discrimination threshold of the contour boundary according to the product of the brightness maximum value and the first scale coefficient, the product of the brightness minimum value and the second scale coefficient or the brightness average value, wherein the first scale coefficient is a positive number smaller than 1, and the second scale coefficient is a positive number larger than 1.
Wherein the second processing module is further configured to:
extracting pixel points of the image to be processed, and performing brightness increasing quantization grade processing on the pixel points of the image to be processed according to the following formula to obtain the second image:
Y1=[y/Q]*Q
wherein: y1 represents the brightness of the pixel point after the quantization grade is increased, Y represents the brightness of the original pixel point, Q represents the numerical value of the quantization grade, the value of Q is any integer of 1-255, and [ Y/Q ] represents the operation of rounding the quotient of Y and Q.
Wherein, the processing and acquiring module comprises:
the extraction processing submodule is used for extracting pixel points of the contour boundary of the second image according to the contour boundary information of all contours in the first image, and calculating the pixel points of the contour boundary of the second image according to the following formula to obtain the brightness of corresponding pixel points:
Y2=K*Y1+b
wherein: y2 represents the brightness of the corresponding pixel point, Y1 represents the brightness of the pixel point after the quantization level is increased, K represents any number between 0 and 1, and b is any value between 0 and 255;
the processing submodule is used for performing brightness increasing quantization level processing on corresponding pixel points by adopting the following formula, completing the enhancement processing on the outline boundary brightness in the second image and ensuring the consistency of the brightness quantization levels of the pixel points of the second image:
Y3=[Y2/Q]*Q
wherein: y2 represents the brightness of the corresponding pixel point, Y3 represents the brightness of the pixel point processed by Y2 of the corresponding pixel point, Q represents the numerical value of the quantization grade, the value of Q is any integer of 1-255, and [ Y2/Q ] represents the operation of rounding the quotient of Y2 and Q.
The technical scheme of the embodiment of the invention at least comprises the following beneficial effects:
according to the embodiment of the invention, the contour pixel point information of the first region of the first image subjected to brightness blurring processing is obtained, the brightness discrimination threshold of the contour boundary is obtained through calculation according to the contour pixel point information of the first region of the first image, the contour boundary information of all contours in the first image is determined according to the brightness discrimination threshold, and then the contour boundary of the second image subjected to the coarse quantization processing of the brightness information is subjected to strengthening processing according to the contour boundary information of all contours in the first image, so that the filter shooting effect of the image can be improved, and the problem that the filter shooting effect of the existing image is too many points is effectively solved.
Drawings
FIG. 1 is a first schematic diagram illustrating an image processing method according to an embodiment of the present invention;
FIG. 2 is a second schematic diagram of an image processing method according to an embodiment of the present invention;
FIG. 3a is a diagram of a prewitt operator;
FIG. 3b is a diagram of the prewitt operator;
FIG. 4 is a third schematic view of an image processing method according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating a fourth exemplary image processing method according to the present invention;
FIG. 6 is a schematic overall flowchart of an image processing method according to an embodiment of the present invention;
FIG. 7 is a diagram of an image processing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the technical problems, technical solutions and advantages of the present invention more apparent, the following detailed description is given with reference to the accompanying drawings and specific embodiments.
As shown in fig. 1, an embodiment of the present invention provides an image processing method, including:
s101, acquiring an image to be processed, and determining a first area in the image to be processed, wherein the first area is an area containing a preset object or a preset area;
s102, performing brightness fuzzy processing on an image to be processed to obtain a first image;
s103, extracting the contour of a first area in the first image, calculating a brightness discrimination threshold of a contour boundary according to the contour of the first area, and determining contour boundary information of all contours in the first image according to the brightness discrimination threshold;
s104, performing coarse quantization processing on brightness information of the image to be processed to obtain a second image;
and S105, carrying out enhancement processing on the contour boundary in the second image by using the contour boundary information of all contours in the first image to obtain a processed image.
According to the steps of the embodiment of the invention, the filter shooting effect of the image is improved by adopting a contour extraction mechanism and a brightness quantization level increasing mechanism, so that the problem of excessive filter shooting effect of the conventional image is effectively solved.
Specifically, the image to be processed is acquired first, and for convenience of calculation, the acquired image to be processed may be stored in a yuv format. Then, a first region in the image to be processed is determined, where the first region may be a region including a preset object or a preset region. The preset object of the invention takes a face image as an example, and a person skilled in the art can also determine other preset objects according to requirements.
It should be noted that, when the image to be processed is located in a coordinate system, and the first region is a preset region, in general, as shown in fig. 2, the preset region is a region centered on an origin of coordinates, and the size of the preset region is preset, h represents a longitudinal distance of the preset region, and w represents a lateral distance of the preset region.
After the first area in the image to be processed is determined, brightness blurring processing needs to be performed on the image to be processed, and the first image is obtained, wherein when the brightness blurring processing is performed on the image to be processed, a gaussian filtering mode can be adopted for processing. However, the blurring processing method is not limited to gaussian filtering, and those skilled in the art may adopt other blurring processing methods according to the requirement.
After the first image is obtained, the contour of the first region in the first image needs to be extracted, the boundary information of the first region is calculated by adopting a corresponding edge extraction operator, such as a sobel operator or a prewitt operator, according to the extracted contour of the first region, and the brightness discrimination threshold of the contour boundary is calculated according to the boundary information of the first region. Wherein a schematic diagram of the prewitt operator is shown in fig. 3a and 3 b.
And determining the contour boundary information of all contours in the first image according to the obtained brightness discrimination threshold. And then, carrying out coarse quantization processing on the brightness information of the image to be processed to obtain a second image. And performing enhancement processing on the contour boundary in the second image according to the contour boundary information of all contours in the first image to obtain a processed effect image. The purpose of performing the luminance enhancement processing on the boundary is to: the outline of the image can be clearly distinguished, so that the image effect after processing is better.
According to the embodiment of the invention, the contour pixel point information of the first region of the first image subjected to brightness blurring processing is obtained, the brightness discrimination threshold of the contour boundary is obtained through calculation according to the contour pixel point information of the first region of the first image, the contour boundary information of all contours in the first image is determined according to the brightness discrimination threshold, and then the contour boundary of the second image subjected to the coarse quantization processing of the brightness information is subjected to strengthening processing according to the contour boundary information of all contours in the first image, so that the filter shooting effect of the image can be improved, and the problem that the filter shooting effect of the existing image is too many points is effectively solved.
In the above embodiment of the present invention, the determining the first region in the image to be processed in step S101, as shown in fig. 4, includes:
s1011, judging whether a preset object exists in the image to be processed;
s1012, when a preset object exists in the image to be processed, determining an area occupied by the preset object as a first area;
and S1013, when the preset object does not exist in the image to be processed, determining the preset area as a first area.
Specifically, when determining the first region in the image to be processed, it is necessary to determine whether a preset object exists in the image to be processed. In this embodiment, the preset object is a face image. When a face image exists in the image to be processed, namely a preset object exists in the image to be processed, determining the area occupied by the face image as a first area. When the face image does not exist in the image to be processed, a preset area needs to be determined as a first area. It should be noted that, the position of the preset region and the area size of the preset region are both preset, and those skilled in the art can adjust the preset region in the presetting process according to actual requirements.
When a preset object exists in the image to be processed, the preset object is a face image as an example, and the following situations are required to determine the first area:
when only one face image exists in the image to be processed, determining the area occupied by the face image as a first area;
when the image to be processed only has a plurality of face images, the area sizes of the plurality of face images can be compared, and a face image with the largest area is determined, so that the area occupied by the face image with the largest area is the first area;
when two face images with the same area exist in the image to be processed, the distance between the center point of the area occupied by the face images and the coordinate origin of the coordinate system where the image to be processed is located needs to be checked. When the distance between the center point of the area occupied by the first face image and the coordinate origin is smaller than the distance between the center point of the area occupied by the second face image and the coordinate origin, the area occupied by the first face image can be determined to be the first area.
In the above embodiment of the present invention, the step S103 extracts the contour of the first region in the first image, and calculates the brightness decision threshold of the contour boundary according to the contour of the first region, as shown in fig. 5, includes:
s1031, extracting contour pixel points of the first region, and counting the maximum brightness value, the minimum brightness value or the average brightness value of the contour pixel points of the first region;
s1032, determining a brightness discrimination threshold of the contour boundary according to the product of the brightness maximum value and a first proportional coefficient, the product of the brightness minimum value and a second proportional coefficient or the brightness average value, wherein the first proportional coefficient is a positive number smaller than 1, and the second proportional coefficient is a positive number larger than 1.
Specifically, when the brightness discrimination threshold of the contour boundary is calculated according to the contour of the first region, firstly, contour pixel points of the first region need to be obtained, the brightness values of the pixel points are counted for the obtained contour pixel points of the first region, and the brightness discrimination threshold of the contour boundary is determined according to the brightness values of the pixel points.
The method for determining the brightness discrimination threshold of the contour boundary according to the brightness value of each pixel point includes, but is not limited to, the following methods:
counting the brightness value of each pixel point, selecting the maximum brightness value, multiplying the obtained maximum brightness value by a first proportional coefficient to obtain a brightness discrimination threshold of the contour boundary, wherein the first proportional coefficient is any value between 0 and 1.
And counting the brightness value of each pixel point, selecting a minimum brightness value, and multiplying the obtained minimum brightness value by a second proportional coefficient to obtain a brightness discrimination threshold of the contour boundary, wherein the second proportional coefficient is a number greater than 1.
And counting the brightness value of each pixel point, calculating the average value of the brightness value of each pixel point, and taking the calculated average value as the brightness discrimination threshold of the contour boundary.
And counting the brightness value of each pixel point, and selecting the maximum brightness value. And then calculating the average value of the brightness values of all the pixel points, and taking the median of the maximum brightness value and the average brightness value to obtain the brightness discrimination threshold of the contour boundary.
After the brightness discrimination threshold of the contour boundary is obtained, contour boundary information of all contours in the first image can be determined by adopting a contour boundary extraction algorithm according to the brightness discrimination threshold. It should be noted that the operator used in the contour boundary extraction algorithm is the same as the operator used in the calculation of the boundary information of the first region. And the brightness discrimination threshold is used as a limiting condition, so that the brightness of pixel points of all the contour boundaries in the first image is smaller than the brightness discrimination threshold.
In the above embodiment of the present invention, step S104 is further configured to:
extracting pixel points of the image to be processed, and performing brightness increasing quantization grade processing on the pixel points of the image to be processed according to the following formula to obtain a second image:
Y1=[y/Q]*Q
wherein: y1 represents the brightness of the pixel point after the quantization grade is increased, Y represents the brightness of the original pixel point, Q represents the numerical value of the quantization grade, the value of Q is any integer of 1-255, and [ Y/Q ] represents the operation of rounding the quotient of Y and Q.
Specifically, in the process of obtaining the second image, each pixel point of the image to be processed needs to be obtained first, and the processing of increasing the brightness quantization level is performed according to the brightness of each pixel point of the image to be processed. The specific process is as follows:
and aiming at each pixel point of the image to be processed, the processing of increasing the brightness quantization level is carried out by adopting the following formula I.
Y1 [ [ Y/Q ] ] Q formula one
Wherein, Y1 represents the pixel brightness after the quantization grade is increased, Y represents the original pixel brightness, Q represents the value of the quantization grade, the value of Q is any integer of 1-255, and [ Y/Q ] represents the operation of rounding the quotient of Y and Q.
When the original pixel brightness Y is operated, a quantization level needs to be determined, Q is a numerical value of the quantization level, the value range of the original pixel brightness Y is 0-255, assuming that the value of Y is 25 and the value of Q is 4, a value of Y1 is obtained after calculation by adopting a formula one, and the value of Y1 is 24. The specific calculation process is as follows: and rounding the quotient of 25 divided by 4 to obtain 6, and multiplying 6 by 4 to obtain a numerical value 24, namely the pixel point brightness Y1 after the quantization grade is increased.
Or assuming that the value of Y is 23 and the value of Q is 4, the value of Y1 is 20 after calculation by the formula one. The specific calculation process is as follows: and rounding the quotient of 23 divided by 4 to obtain 5, and multiplying 5 by 4 to obtain a value 20, namely the pixel point brightness Y1 after the quantization level is increased.
And after the brightness Y1 of the pixel point after the quantization grade is increased is obtained, obtaining a second image according to each updated pixel point.
In the above embodiment of the present invention, in step S105, the step of obtaining a processed image after performing enhancement processing on the contour boundary in the second image by using the contour boundary information of all the contours in the first image includes:
extracting pixel points of the contour boundary of the second image according to contour boundary information of all contours in the first image, and calculating the pixel points of the contour boundary of the second image according to the following formula to obtain the brightness of the corresponding pixel points:
Y2=K*Y1+b
wherein: y2 represents the brightness of the corresponding pixel point, Y1 represents the brightness of the pixel point after the quantization level is increased, K represents any number between 0 and 1, and b is any value between 0 and 255;
and (3) performing brightness quantization grade increasing processing on the corresponding pixel points by adopting the following formula to finish the enhancement processing on the contour boundary brightness in the second image and ensure the consistency of the brightness quantization grades of the pixel points of the second image:
Y3=[Y2/Q]*Q
wherein: y2 represents the brightness of the corresponding pixel point, Y3 represents the brightness of the pixel point processed by Y2 of the corresponding pixel point, Q represents the numerical value of the quantization grade, the value of Q is any integer of 1-255, and [ Y2/Q ] represents the operation of rounding the quotient of Y2 and Q.
Specifically, firstly, according to contour boundary information of all contours in the first image, pixel points of a contour boundary of the second image are extracted, and luminance processing is performed on the pixel points of the contour boundary of the second image by using a formula.
Y2 ═ K × Y1+ b formula two
It should be noted that, when the pixel points of the contour boundary of the second image are processed by using the formula again, since the value range of Y2 is 0-255, it is necessary to ensure that the obtained Y2 value does not exceed 255 in the value process of K or b.
Assuming that Y1 has a value of 20, K is 0.1, and b can have any value from 0 to 253, the K and b values are determined for the same image in the actual calculation process. For example: k is 0.1, b is 4, Y1 is 20, and the value of Y2 is 6 when calculated according to equation two. And aiming at different pixel points of the same image, the value of Y1 is 30, and the value of Y2 is 7 by calculation according to a formula II. It should be noted that, for an image, the values of K and b are preset and determined, and according to the determined values of K and b, the calculation is performed by using the formula two, and the obtained Y2 may be larger than Y1, or smaller than Y1, where the size relationship between Y2 and Y1 depends on the values of K and b. When K is 0.5 and b is 25, Y1 has a value of 30, and calculation according to equation two yields a value of Y2 of 40, where Y2 is greater than Y1.
And then, after the pixel points of the contour boundary of the second image are processed by using a formula two, the brightness quantization grade is increased by using a formula three to Y2.
Y3 ═ Y2/Q ═ Q formula three
It should be noted that the quantization level used here is the same as the quantization level used when processing the image to be processed, so as to ensure consistency of the luminance quantization levels of the pixels of the second image. For example: assuming that the value of Y2 is 23 and the value of Q is 4, the value of Y3 is 20 after calculation by formula three.
As shown in fig. 6, it is a schematic overall flow chart of the embodiment of the present invention:
s201, acquiring an image to be processed;
s202, determining a first area;
s203, carrying out brightness fuzzy processing on the image to be processed to obtain a first image;
s204, extracting the contour of the first area in the first image, and calculating a brightness discrimination threshold of the contour boundary according to the contour of the first area;
s205, determining contour boundary information of all contours in the first image according to the brightness discrimination threshold;
s206, carrying out coarse quantization processing on the brightness information of the image to be processed to obtain a second image;
s207, carrying out strengthening treatment on the contour boundary in the second image by using contour boundary information of all contours in the first image;
and S208, outputting an effect image.
An embodiment of the present invention further provides an image processing apparatus, as shown in fig. 7, including:
the acquisition determining module 10 is configured to acquire an image to be processed, and determine a first region in the image to be processed, where the first region is a region including a preset object or a preset region;
the first processing module 20 is configured to perform brightness blurring processing on an image to be processed to obtain a first image;
the calculation processing module 30 is configured to extract an outline of a first region in the first image, calculate a brightness discrimination threshold of an outline boundary according to the outline of the first region, and determine outline boundary information of all outlines in the first image according to the brightness discrimination threshold;
the second processing module 40 is configured to perform coarse quantization processing on the luminance information of the image to be processed to obtain a second image;
and the processing and acquiring module 50 is configured to perform enhancement processing on the contour boundary in the second image by using the contour boundary information of all contours in the first image, so as to obtain a processed image.
Wherein, the obtaining and determining module 10 includes:
the judgment submodule 11 is configured to judge whether a preset object exists in the image to be processed;
the first determining submodule 12 is configured to determine, when a preset object exists in the image to be processed, an area occupied by the preset object as a first area;
the second determining submodule 13 is configured to determine the preset area as the first area when the preset object does not exist in the image to be processed.
Wherein the first determination submodule 12 includes:
a first unit 121, configured to select a preset object with a largest area when multiple preset objects exist in an image to be processed, and determine an area occupied by the preset object with the largest area as a first area;
the second unit 122 is configured to, when two preset objects having the same area size exist in the image to be processed, select a preset object close to the center coordinate, and determine an area occupied by the preset object close to the center coordinate as the first area.
Among them, the calculation processing module 30 includes:
the extraction statistics submodule 31 is configured to extract contour pixel points of the first region, and count a maximum brightness value, a minimum brightness value, or an average brightness value of the contour pixel points of the first region;
the third determining sub-module 32 is configured to determine a brightness discrimination threshold of the contour boundary according to a product of the brightness maximum value and a first scaling factor, a product of the brightness minimum value and a second scaling factor, or a brightness average value, where the first scaling factor is a positive number smaller than 1, and the second scaling factor is a positive number greater than 1.
Wherein the second processing module 40 is further configured to:
extracting pixel points of the image to be processed, and performing brightness increasing quantization grade processing on the pixel points of the image to be processed according to the following formula to obtain a second image:
Y1=[y/Q]*Q
wherein: y1 represents the brightness of the pixel point after the quantization grade is increased, Y represents the brightness of the original pixel point, Q represents the numerical value of the quantization grade, the value of Q is any integer of 1-255, and [ Y/Q ] represents the operation of rounding the quotient of Y and Q.
Wherein, the processing and acquiring module 50 includes:
the extraction processing submodule 51 is configured to extract pixel points of the contour boundary of the second image according to the contour boundary information of all contours in the first image, and calculate the pixel points of the contour boundary of the second image according to the following formula to obtain the brightness of corresponding pixel points:
Y2=K*Y1+b
wherein: y2 represents the brightness of the corresponding pixel point, Y1 represents the brightness of the pixel point after the quantization level is increased, K represents any number between 0 and 1, and b is any value between 0 and 255;
the processing submodule 52 is configured to perform brightness quantization level increasing processing on the corresponding pixel point by using the following formula, complete enhancement processing on the contour boundary brightness in the second image, and ensure consistency of the brightness quantization levels of the pixel points of the second image:
Y3=[Y2/Q]*Q
wherein: y2 represents the brightness of the corresponding pixel point, Y3 represents the brightness of the pixel point processed by Y2 of the corresponding pixel point, Q represents the numerical value of the quantization grade, the value of Q is any integer of 1-255, and [ Y2/Q ] represents the operation of rounding the quotient of Y2 and Q.
According to the image processing method provided by the embodiment of the invention, the contour pixel point information of the first region of the first image subjected to brightness blurring processing is obtained, the brightness discrimination threshold of the contour boundary is calculated according to the contour pixel point information of the first region of the first image, the contour boundary information of all contours in the first image is determined according to the brightness discrimination threshold, and then the contour boundary of the second image subjected to the coarse quantization processing of the brightness information is subjected to strengthening processing according to the contour boundary information of all contours in the first image, so that the filter shooting effect of the image can be improved, and the problem that the filter shooting effect of the existing image is too many points is effectively solved.
It should be noted that, the image processing apparatus provided by the embodiment of the present invention is an apparatus applying the method described above, and all embodiments of the method described above are applicable to the apparatus and can achieve the same or similar beneficial effects.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (10)

1. An image processing method, comprising:
acquiring an image to be processed, and determining a first area in the image to be processed, wherein the first area is an area containing a preset object or a preset area;
performing brightness fuzzy processing on the image to be processed to obtain a first image;
extracting the contour of the first area in the first image, calculating a brightness discrimination threshold of a contour boundary according to the contour of the first area, and determining contour boundary information of all contours in the first image according to the brightness discrimination threshold;
carrying out coarse quantization processing on the brightness information of the image to be processed to obtain a second image;
carrying out strengthening processing on the contour boundary in the second image by using the contour boundary information of all contours in the first image to obtain a processed image,
the extracting the contour of the first region in the first image and calculating the brightness discrimination threshold of the contour boundary according to the contour of the first region includes:
extracting contour pixel points of the first region, and counting the maximum brightness value, the minimum brightness value or the average brightness value of the contour pixel points of the first region;
and determining a brightness discrimination threshold of the contour boundary according to a product of the brightness maximum value and a first scale coefficient, a product of the brightness minimum value and a second scale coefficient, and a brightness average value or a median of the brightness maximum value and the brightness average value, wherein the first scale coefficient is a positive number smaller than 1, and the second scale coefficient is a positive number larger than 1.
2. The method of claim 1, wherein the determining the first region in the image to be processed comprises:
judging whether a preset object exists in the image to be processed or not;
when a preset object exists in the image to be processed, determining an area occupied by the preset object as the first area;
and when no preset object exists in the image to be processed, determining a preset area as the first area.
3. The method of claim 2, wherein when a preset object exists in the image to be processed, determining an area occupied by the preset object as the first area comprises:
when a plurality of preset objects exist in the image to be processed, selecting the preset object with the largest area, and determining the area occupied by the preset object with the largest area as the first area;
when two preset objects with the same area size exist in the image to be processed, selecting the preset object close to the central coordinate, and determining the area occupied by the preset object close to the central coordinate as the first area.
4. The method of claim 1, wherein the performing the coarse quantization of the luminance information on the image to be processed to obtain a second image comprises:
extracting pixel points of the image to be processed, and performing brightness increasing quantization grade processing on the pixel points of the image to be processed according to the following formula to obtain the second image:
Y1=[y/Q]*Q
wherein: y1 represents the brightness of the pixel point after the quantization grade is increased, Y represents the brightness of the original pixel point, Q represents the numerical value of the quantization grade, the value of Q is any integer of 1-255, and [ Y/Q ] represents the operation of rounding the quotient of Y and Q.
5. The method as claimed in claim 4, wherein the obtaining of the processed image after performing the enhancement processing on the contour boundary in the second image by using the contour boundary information of all the contours in the first image comprises:
extracting pixel points of the contour boundary of the second image according to the contour boundary information of all contours in the first image, and calculating the pixel points of the contour boundary of the second image according to the following formula to obtain the brightness of the corresponding pixel points:
Y2=K*Y1+b
wherein: y2 represents the brightness of the corresponding pixel point, Y1 represents the brightness of the pixel point after the quantization level is increased, K represents any number between 0 and 1, and b is any value between 0 and 255;
performing brightness quantization level increasing processing on corresponding pixel points by adopting the following formula to finish the enhancement processing on the contour boundary brightness in the second image and ensure the consistency of the brightness quantization levels of the pixel points of the second image:
Y3=[Y2/Q]*Q
wherein: y2 represents the brightness of the corresponding pixel point, Y3 represents the brightness of the pixel point processed by Y2 of the corresponding pixel point, Q represents the numerical value of the quantization grade, the value of Q is any integer of 1-255, and [ Y2/Q ] represents the operation of rounding the quotient of Y2 and Q.
6. An image processing apparatus characterized by comprising:
the device comprises an acquisition determining module, a processing module and a processing module, wherein the acquisition determining module is used for acquiring an image to be processed and determining a first area in the image to be processed, and the first area is an area containing a preset object or a preset area;
the first processing module is used for carrying out brightness fuzzy processing on the image to be processed to obtain a first image;
the calculation processing module is used for extracting the contour of the first area in the first image, calculating a brightness discrimination threshold of a contour boundary according to the contour of the first area, and determining contour boundary information of all contours in the first image according to the brightness discrimination threshold;
the second processing module is used for carrying out coarse quantization processing on the brightness information of the image to be processed to obtain a second image;
a processing and obtaining module, configured to perform enhancement processing on the contour boundary in the second image by using the contour boundary information of all contours in the first image to obtain a processed image,
the calculation processing module comprises:
the extraction and statistics submodule is used for extracting the contour pixel points of the first area and counting the maximum brightness value, the minimum brightness value or the average brightness value of the contour pixel points of the first area;
and the third determining submodule is used for determining the brightness discrimination threshold of the contour boundary according to the product of the brightness maximum value and the first scale coefficient, the product of the brightness minimum value and the second scale coefficient, the brightness average value or the median of the brightness maximum value and the brightness average value, wherein the first scale coefficient is a positive number smaller than 1, and the second scale coefficient is a positive number larger than 1.
7. The apparatus of claim 6, wherein the acquisition determination module comprises:
the judgment submodule is used for judging whether a preset object exists in the image to be processed or not;
the first determining submodule is used for determining the area occupied by the preset object as the first area when the preset object exists in the image to be processed;
and the second determining submodule is used for determining a preset area as the first area when no preset object exists in the image to be processed.
8. The apparatus of claim 7, wherein the first determination submodule comprises:
the first unit is used for selecting the preset object with the largest area when a plurality of preset objects exist in the image to be processed, and determining the area occupied by the preset object with the largest area as the first area;
and the second unit is used for selecting the preset object which is close to the central coordinate when two preset objects with the same area size exist in the image to be processed, and determining the area occupied by the preset object which is close to the central coordinate as the first area.
9. The apparatus of claim 6, wherein the second processing module is further to:
extracting pixel points of the image to be processed, and performing brightness increasing quantization grade processing on the pixel points of the image to be processed according to the following formula to obtain the second image:
Y1=[y/Q]*Q
wherein: y1 represents the brightness of the pixel point after the quantization grade is increased, Y represents the brightness of the original pixel point, Q represents the numerical value of the quantization grade, the value of Q is any integer of 1-255, and [ Y/Q ] represents the operation of rounding the quotient of Y and Q.
10. The apparatus of claim 9, wherein the processing acquisition module comprises:
the extraction processing submodule is used for extracting pixel points of the contour boundary of the second image according to the contour boundary information of all contours in the first image, and calculating the pixel points of the contour boundary of the second image according to the following formula to obtain the brightness of corresponding pixel points:
Y2=K*Y1+b
wherein: y2 represents the brightness of the corresponding pixel point, Y1 represents the brightness of the pixel point after the quantization level is increased, K represents any number between 0 and 1, and b is any value between 0 and 255;
the processing submodule is used for performing brightness increasing quantization level processing on corresponding pixel points by adopting the following formula, completing the enhancement processing on the outline boundary brightness in the second image and ensuring the consistency of the brightness quantization levels of the pixel points of the second image:
Y3=[Y2/Q]*Q
wherein: y2 represents the brightness of the corresponding pixel point, Y3 represents the brightness of the pixel point processed by Y2 of the corresponding pixel point, Q represents the numerical value of the quantization grade, the value of Q is any integer of 1-255, and [ Y2/Q ] represents the operation of rounding the quotient of Y2 and Q.
CN201610067209.9A 2016-01-29 2016-01-29 Image processing method and device Active CN107025633B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201610067209.9A CN107025633B (en) 2016-01-29 2016-01-29 Image processing method and device
PCT/CN2016/090460 WO2017128646A1 (en) 2016-01-29 2016-07-19 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610067209.9A CN107025633B (en) 2016-01-29 2016-01-29 Image processing method and device

Publications (2)

Publication Number Publication Date
CN107025633A CN107025633A (en) 2017-08-08
CN107025633B true CN107025633B (en) 2020-11-27

Family

ID=59397386

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610067209.9A Active CN107025633B (en) 2016-01-29 2016-01-29 Image processing method and device

Country Status (2)

Country Link
CN (1) CN107025633B (en)
WO (1) WO2017128646A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109145768A (en) * 2018-07-31 2019-01-04 北京旷视科技有限公司 Obtain the method and device of the human face data with face character
CN113129218A (en) * 2019-12-30 2021-07-16 Tcl集团股份有限公司 Method and terminal for processing image
CN111483803B (en) * 2020-04-17 2022-03-04 湖南视比特机器人有限公司 Control method, capture system and storage medium
CN114387500A (en) * 2020-10-16 2022-04-22 苏州科瓴精密机械科技有限公司 Image recognition method and system applied to self-walking device, self-walking device and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101321289A (en) * 2008-06-13 2008-12-10 北京大学 Method, system and device for processing video image in mobile phone television
CN101727658A (en) * 2008-10-14 2010-06-09 深圳迈瑞生物医疗电子股份有限公司 Image processing method and device
CN102612697A (en) * 2009-07-21 2012-07-25 高通股份有限公司 A method and system for detection and enhancement of video images
CN104915934A (en) * 2015-06-15 2015-09-16 电子科技大学 Grayscale image enhancement method based on retina mechanism

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002247611A (en) * 2001-02-16 2002-08-30 Matsushita Electric Ind Co Ltd Image discriminating circuit, image quality correcting device, image discrimination method, image quality correction method and program
CN101241526A (en) * 2007-02-08 2008-08-13 佛山市顺德区顺达电脑厂有限公司 Palm moving electronic device image identification authentication method
CN100512374C (en) * 2007-12-05 2009-07-08 北京航空航天大学 A method for image edge detection based on threshold sectioning
JP5227639B2 (en) * 2008-04-04 2013-07-03 富士フイルム株式会社 Object detection method, object detection apparatus, and object detection program
JP5779089B2 (en) * 2011-12-28 2015-09-16 株式会社ドワンゴ Edge detection apparatus, edge detection program, and edge detection method
CN102920477B (en) * 2012-03-05 2015-05-20 杭州弘恩医疗科技有限公司 Device and method for determining target region boundary of medical image
US8805114B2 (en) * 2012-11-27 2014-08-12 Texas Instruments Incorporated Content adaptive edge and detail enhancement for image and video processing
CN103996212B (en) * 2013-02-18 2017-11-14 威达电股份有限公司 The method of automatic rendered object edge trend
CN103514588B (en) * 2013-10-10 2016-05-18 广东威创视讯科技股份有限公司 Image enchancing method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101321289A (en) * 2008-06-13 2008-12-10 北京大学 Method, system and device for processing video image in mobile phone television
CN101727658A (en) * 2008-10-14 2010-06-09 深圳迈瑞生物医疗电子股份有限公司 Image processing method and device
CN102612697A (en) * 2009-07-21 2012-07-25 高通股份有限公司 A method and system for detection and enhancement of video images
CN104915934A (en) * 2015-06-15 2015-09-16 电子科技大学 Grayscale image enhancement method based on retina mechanism

Also Published As

Publication number Publication date
WO2017128646A1 (en) 2017-08-03
CN107025633A (en) 2017-08-08

Similar Documents

Publication Publication Date Title
CN107025633B (en) Image processing method and device
CN109003249B (en) Method, device and terminal for enhancing image details
AU2016101504A4 (en) Method for edge detection
WO2016206087A1 (en) Low-illumination image processing method and device
CN106683100B (en) Image segmentation defogging method and terminal
CN109146826A (en) A kind of image enchancing method and device
US11156564B2 (en) Dirt detection on screen
CN108280386B (en) Monitoring scene detection method and device
CN104574285A (en) Method for automatically removing image black eyes
CN109190617B (en) Image rectangle detection method and device and storage medium
CN109584185A (en) Image processing method
CN109214996B (en) Image processing method and device
CN109255792B (en) Video image segmentation method and device, terminal equipment and storage medium
CN114127784A (en) Method, computer program product and computer readable medium for generating a mask for a camera stream
CN112991374A (en) Canny algorithm-based edge enhancement method, device, equipment and storage medium
JP6432296B2 (en) Device and method for detecting zebra crossings in images
Fuh et al. Mcpa: A fast single image haze removal method based on the minimum channel and patchless approach
CN105447827A (en) Image noise reduction method and system thereof
CN110298796B (en) Low-illumination image enhancement method based on improved Retinex and logarithmic image processing
Jeong et al. Fast fog detection for de-fogging of road driving images
CN110633705A (en) Low-illumination imaging license plate recognition method and device
JP2021051382A (en) Attached matter detection device and attached matter detection method
CN115471413A (en) Image processing method and device, computer readable storage medium and electronic device
CN108230328B (en) Method and device for acquiring target object and robot
CN107437255B (en) Image processing apparatus and method

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