CN109829859B - Image processing method and terminal equipment - Google Patents

Image processing method and terminal equipment Download PDF

Info

Publication number
CN109829859B
CN109829859B CN201811477606.9A CN201811477606A CN109829859B CN 109829859 B CN109829859 B CN 109829859B CN 201811477606 A CN201811477606 A CN 201811477606A CN 109829859 B CN109829859 B CN 109829859B
Authority
CN
China
Prior art keywords
image
target image
matrix
equalization
ambiguity
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
CN201811477606.9A
Other languages
Chinese (zh)
Other versions
CN109829859A (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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201811477606.9A priority Critical patent/CN109829859B/en
Publication of CN109829859A publication Critical patent/CN109829859A/en
Application granted granted Critical
Publication of CN109829859B publication Critical patent/CN109829859B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Processing (AREA)

Abstract

The invention is applicable to the technical field of computer application, and provides an image processing method, terminal equipment and a computer readable storage medium, comprising the following steps: acquiring a target image to be processed; generating an image matrix of a target image, and carrying out equalization processing on the image matrix to obtain an equalization matrix; calculating the ambiguity of the target image according to the equalization matrix; and processing the target image according to the ambiguity and a preset processing mode. The image equalization is carried out on the target image according to the conditions of illumination intensity or light reflection and the like, the problem that the brightness values of the pixels of the image are not uniform due to illumination factors is solved, the ambiguity of the image is calculated according to the equalized image matrix, a fair and accurate evaluation method is provided for subsequent image processing or use, and the accuracy and the anti-interference performance of image quality evaluation are improved.

Description

Image processing method and terminal equipment
Technical Field
The present invention relates to the field of computer applications, and in particular, to an image processing method, a terminal device, and a computer readable storage medium.
Background
With the continued development of computer technology, digital image technology has been applied to almost all fields related to imaging. In the prior art, an image is acquired by a camera or a mobile terminal, and the image is stored as user information or otherwise used. The digital image undergoes a plurality of processes such as photoelectric conversion, analog-to-digital conversion, interpolation fitting and the like in the imaging process. During each process, imaging may be affected by external factors or camera configuration parameters, such that the quality of the image is degraded. Therefore, the image in many cases in the prior art is easily affected by the external environment, resulting in a problem of low image quality.
Disclosure of Invention
In view of the above, embodiments of the present invention provide an image processing method, a terminal device, and a computer readable storage medium, so as to solve the problem in the prior art that the image quality is easily affected by the external shooting environment, resulting in low image quality.
A first aspect of an embodiment of the present invention provides an image processing method, including:
Acquiring a target image to be processed; the target image is obtained through shooting by a shooting device;
Generating an image matrix of the target image, and carrying out equalization processing on the image matrix to obtain an equalization matrix;
calculating the ambiguity of the target image according to the equalization matrix;
And processing the target image according to the ambiguity and a preset processing mode.
A second aspect of an embodiment of the present invention provides a terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
Acquiring a target image to be processed; the target image is obtained through shooting by a shooting device;
Generating an image matrix of the target image, and carrying out equalization processing on the image matrix to obtain an equalization matrix;
calculating the ambiguity of the target image according to the equalization matrix;
And processing the target image according to the ambiguity and a preset processing mode.
A third aspect of an embodiment of the present invention provides a terminal device, including:
an acquisition unit configured to acquire a target image to be processed; the target image is obtained through shooting by a shooting device;
The equalization unit is used for generating an image matrix of the target image and performing equalization processing on the image matrix to obtain an equalization matrix;
A calculating unit, configured to calculate an ambiguity of the target image according to the equalization matrix;
and the processing unit is used for processing the target image according to the ambiguity and a preset processing mode.
A fourth aspect of an embodiment of the invention provides a computer readable storage medium storing a computer program comprising program instructions which, when executed by a processor, cause the processor to perform the method of the first aspect described above.
Compared with the prior art, the embodiment of the invention has the beneficial effects that:
according to the embodiment of the invention, the target image to be processed is obtained; the target image is obtained through shooting by a shooting device; generating an image matrix of the target image, and carrying out equalization processing on the image matrix to obtain an equalization matrix; calculating the ambiguity of the target image according to the equalization matrix; and processing the target image according to the ambiguity and a preset processing mode. The image equalization is carried out on the target image according to the conditions of illumination intensity or light reflection and the like, the problem that the brightness values of the pixels of the image are not uniform due to illumination factors is solved, the ambiguity of the image is calculated according to the equalized image matrix, a fair and accurate evaluation method is provided for subsequent image processing or use, and the accuracy and the anti-interference performance of image quality evaluation are improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of an image processing method according to a first embodiment of the present invention;
fig. 2 is a flowchart of an image processing method according to a second embodiment of the present invention;
Fig. 3 is a schematic diagram of a terminal device according to a third embodiment of the present invention;
Fig. 4 is a schematic diagram of a terminal device according to a fourth embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to illustrate the technical scheme of the invention, the following description is made by specific examples.
Referring to fig. 1, fig. 1 is a flowchart of an image processing method according to an embodiment of the present invention. The execution subject of the image processing method in this embodiment is a terminal. The terminal comprises, but is not limited to, a mobile terminal such as a smart phone, a tablet computer, a wearable device and the like, and can also be a desktop computer and the like. The image processing method as shown in the figure may include the steps of:
s101: acquiring a target image to be processed; the target image is obtained through shooting by a shooting device.
The image is one of the most important information acquisition, transmission and communication modes of human beings except characters, and more than 80% of the information acquired by the human beings comes from the image. Particularly, with the rapid development of ultra-large scale integrated circuits in recent years, digital cameras and video cameras are becoming popular, digital images are being acquired more conveniently and cheaper, and generated digital image information is also becoming larger; with the rapid development of broadband networks, particularly mobile broadband networks, the network scale and performance have been unprecedented; various multimedia processing chips and systems have been developed successfully, and multimedia systems requiring a large amount of computing resources can serve people almost in real time. It can be said that the real multimedia age has come, and multimedia technology has been applied to every corner of real life. However, the current multimedia system is not quite full, and the network capability cannot fully meet the requirement of multimedia transmission, so that distortion is inevitably introduced in the processes of acquisition, compression, transmission and storage of images and videos.
When images and videos are acquired, the images are blurred due to improper focusing and camera or camera shake, and the images are greatly affected by external illumination in the photographing process, so that the problems of reflection or unfocusing occur in the images. A common feature of images and video is the very large amount of information that is not acceptable for communication systems and storage media if transmitted and stored directly. Therefore, the image and the video can be compressed before transmission and storage, the compression is divided into lossless compression and lossy compression, the efficiency of the lossy compression is higher than that of the non-arithmetic compression, and certain distortion is caused after the compression. If the joint image expert group (Joint Photographic Experts Group, JPEG) is used for compression, different quantization parameters are selected, and the compressed image can present different degrees of blurring due to the loss of image details caused by the loss of high-frequency components insensitive to human eyes in the compression process. In addition, during the transmission of images and videos, the quality of the received images can be affected due to instability of a transmission network, and particularly in a wireless network or a packet switching network sensitive to noise, network blocking and jitter can greatly affect the quality of the images and the real-time performance of the videos. In addition, noise necessarily exists in every part of the entire system, which tends to introduce distortion in images and videos.
In industrial applications based on machine vision, such as product monitoring, car navigation control, object recognition and video monitoring, in order to achieve better effects in different environments, the quality of the acquired image must be determined, and only the image with good quality can be used as a subsequent processing step, and if the quality is poor, the image must be discarded without affecting the subsequent processing and determination. For example, in the application of computer auto-focusing of a microscope, after a computer acquires one image, the computer calculates the blur degree of the image, then moves the lens, acquires another image, calculates the blur degree of the image, and continues the above process until the image with the minimum blur degree is found, and focusing is completed.
Before the system processes the image, a target image to be subjected to image quality evaluation is acquired. The image acquisition mode can be to acquire the target image through the image file uploaded or sent by the receiving terminal. The application environment may be that when a user needs to apply for or authenticate a certain application or system, through adding subpoena images or self certificate images to a corresponding server system, after receiving the images, the server detects the image quality of the images, evaluates whether the information in the images is clear, whether the information in the images is possibly accurately detected, and evaluates the image quality, and then performs corresponding operations according to the image quality, for example, through image checking, image information extraction, or image checking failing, sending a notification of re-uploading the images, etc.
The application scenario in the scheme can be that in a website for acquiring and verifying the user certificate image, the user takes a photo, such as an identity card, a passport and the like, through own terminal equipment by sending an image acquisition instruction to the user, the shot image is sent to an execution subject through application software or a webpage in the mobile terminal, and the execution subject detects the acquired target image after the target image is acquired to determine whether the target image meets the regulations.
S102: generating an image matrix of the target image, and carrying out equalization processing on the image matrix to obtain an equalization matrix.
After the target image is acquired, an image matrix of the image is determined according to the pixel value of each pixel point in the target image. The digital image data may be represented by a matrix, and thus the digital image may be analyzed and processed using matrix theory and matrix algorithms. Since digital images can be represented in a matrix form, in a computer digital image processing program, image data is typically stored in a two-dimensional array.
The pixel data of the gray image is a matrix, the rows of the matrix correspond to the heights of the image, the columns of the matrix correspond to the widths of the image, the units of the heights and the widths are pixels, the elements of the matrix correspond to the pixels of the image, and the values of the matrix elements are gray values of the pixels. Because the digital image can be expressed in a matrix form, in the computer digital image processing program, the image data is usually stored by a two-dimensional array, the digital image is stored by the two-dimensional array, the line and line characteristics of the two-dimensional image are met, and the addressing operation of the program is convenient, so that the computer image programming is very convenient.
Specifically, in MATLAB, the imshow () function may be used to display an image, and the image matrix at this time may have undergone some operation. In MATLAB, in order to ensure accuracy, the data type of the image matrix subjected to the operation is changed from unit8 type to double type. If imshow (I) is run directly, a white image is displayed. This is because imshow () displays an image in which double type data is considered to be white in the range of 0 to 1, that is, more than 1, and imshow displays a uint8 in the range of 0 to 255, and double type data having been operated in the range of 0 to 255 is abnormally displayed as a white image. Therefore, in the present embodiment, the individual numerical value in the image matrix is in the range of 0 to 255, so as to represent the pixel value size of each pixel point in the image.
S103: and calculating the ambiguity of the target image according to the equalization matrix.
In the field of digital image processing, image quality assessment has important practical significance in the fields of image, video processing, compression, communication and the like, and is an important component of the systems. The image is likely to be degraded in the processes of acquisition, compression, processing, transmission and display, and a plurality of factors influencing the image degradation are generated, wherein the blurring is one of the degradation factors which are most easily perceived and perceived to be strongest by human eyes and is one of the most important factors influencing the image quality, so that the evaluation of the image blurring degree plays a very important role in the whole image quality evaluation.
Blur is an important image degradation factor, and many factors may cause image blur during image acquisition, transmission and processing, for example, incorrect focusing may generate defocus blur during image acquisition, relative motion between a scene and a camera may cause motion blur, and blur caused by high-frequency loss after image compression. Blurring reduces the sharpness of the image, seriously affects the image quality, causes difficulties or even fails in image analysis, processing and reception, and therefore an effective blurring evaluation method must be used to control the use of the blurred image, thereby improving the overall performance of the system. Blur and sharpness are two concepts that describe two opposite but interrelated image blur levels. The clearer the image, the higher the quality, the greater the definition and the smaller the blurring degree; the less sharp, blurred, of lower quality, less sharp, and more blurred the image. Thus, when describing the sharpness of an image, sharpness or blur may be used, but the two indices are inversely proportional in value.
Furthermore, in practical application, the obtained target image is likely to cause the situation of the reflector lamp of the image due to different illumination intensities or illumination angles of the ambient light, and in this case, after the edge filtering processing is performed on the image matrix, the integral variance of the marginalized image pixel data is calculated, and the variance is large, so that more marginalized places of the original image are indicated, namely, the outline is clearer. When the brightness of the environment is high during image shooting, the brightness of the whole color of the image is high, the matrix value is high, the calculated variance is also high when the obtained edge filtering matrix value is high through the algorithm. Therefore, the matrix value of the original image needs to be balanced, the darker image is lightened, and the ambiguity is calculated after the brighter image is darkened, so that the accuracy of the ambiguity calculation and the objectivity of image evaluation are ensured.
S104: and processing the target image according to the ambiguity and a preset processing mode.
After the ambiguity is calculated, the target image is subjected to data according to the magnitude of the ambiguity. In the scheme, an ambiguity threshold is preset and used for measuring the magnitude of the ambiguity. When the calculated ambiguity is greater than or equal to the ambiguity threshold, the ambiguity of the target image is higher, and the current image acquisition requirement is not met, so that the target image can be saved, and a message for re-uploading the image can be sent to the user using terminal. Conversely, when the ambiguity of the target image is smaller than the ambiguity threshold, it indicates that the target image is clearer, and the method can be adopted.
After the image to be processed is determined according to the image ambiguity, the image is processed in such a way that text information in the image is extracted, and the text information is compared with the information stored in the authorities to determine whether the image uploaded by the user is legal or not; the method can also extract the face image in the target image for feature extraction and quantization, and compare the quantized data with the face information data stored in the authorities to determine whether the image uploaded by the user is correct and clear and whether the information in the image is complete.
According to the scheme, the target image to be processed is obtained; the target image is obtained through shooting by a shooting device; generating an image matrix of the target image, and carrying out equalization processing on the image matrix to obtain an equalization matrix; calculating the ambiguity of the target image according to the equalization matrix; and processing the target image according to the ambiguity and a preset processing mode. The image equalization is carried out on the target image according to the conditions of illumination intensity or light reflection and the like, the problem that the brightness values of the pixels of the image are not uniform due to illumination factors is solved, the ambiguity of the image is calculated according to the equalized image matrix, a fair and accurate evaluation method is provided for subsequent image processing or use, and the accuracy and the anti-interference performance of image quality evaluation are improved.
Referring to fig. 2, fig. 2 is a flowchart of an image processing method according to a second embodiment of the present invention. The execution subject of the image processing method in this embodiment is a terminal. The terminal comprises, but is not limited to, a mobile terminal such as a smart phone, a tablet computer, a wearable device and the like, and can also be a desktop computer and the like. The image processing method as shown in the figure may include the steps of:
S201: acquiring a target image to be processed; the target image is obtained through shooting by a shooting device.
In this embodiment, the implementation manner of S201 is identical to that of S101 in the embodiment corresponding to fig. 1, and specific reference may be made to the description related to S101 in the embodiment corresponding to fig. 1, which is not repeated here.
S202: and generating an image matrix of the target image according to the pixel values of the target image.
And calling the picture binary data matrix read by the local system to serve as a gradient matrix. The gradient matrix is a stereoscopic histogram which can be abstracted into a picture pixel data lattice according to a pixel matrix sorting value list, can also be a picture formed by points with different pixel values, and can be embodied by modifying pixel numerical control pictures through blocks.
In this scheme, the reflection area data caused by the specular area reflection light source of the object surface at the time of photographing is regarded as non-standard pixels, and the chromaticity of the image in this area is high due to reflection. If the reflection area exists in the image and the direct extreme ambiguity exists, calculating the overall ambiguity of the image, wherein the reflection area will have positive deviation, and the image area of the part needs to be removed to calculate the ambiguity. After the gradient matrix of the target image is determined, the image matrix can be directly determined through the gradient matrix and is used for representing the continuous area with highest chromaticity in the current image, the reflective data is discharged outside to calculate the ambiguity, and the error is reduced.
For example, a Robert operator mode can be adopted to determine a gradient matrix of the target image, a local difference operator is utilized to find an operator of the edge, and the difference between two adjacent pixels of a diagonal line is adopted as a gradient amplitude value to detect the edge. The operator has better vertical edge detection effect than the inclined edge and high positioning accuracy.
S203: and calculating an equalization factor of the target image according to the image matrix.
Pixels with different brightness may exist in the target image, which may cause unclear display of pixel information in the image and may cause errors in the calculated equalization factor of the image, where the equalization factor of the target image is calculated according to the image matrix in this embodiment.
Specifically, a reflective region in a target image can be identified by setting a reflective chromaticity threshold, and if the chromaticity of a certain pixel point in the image is greater than or equal to the reflective chromaticity threshold, the numerical value of the pixel point is not counted in the calculation of the image ambiguity, so as to solve the problem that the calculation of the image ambiguity caused by the reflective region has deviation.
Besides the problem of light reflection, the situation that the image ambiguity calculation is biased due to dim or over-strong ambient light can also occur, and in this case, the image matrix in the target image is uniformly adjusted by calculating the mean value equalizing factor. The equalization factor is calculated as:
wherein, P (i, j) is used for representing the gradient matrix of the gray image, i, j are respectively used for representing the pixel point with the coordinates (i, j) in the current image, and mu is used for representing the calculated balance factor.
S204: and carrying out image equalization on the target image according to the equalization factors and the image matrix to obtain an equalization matrix.
After the balance factors are obtained through calculation, the brightness condition of each pixel point in the image matrix is measured according to the balance factors, and image balance is carried out according to the brightness value of each pixel point, so that the balance matrix is obtained.
Further, step S204 may specifically include steps S2041 to S2042:
S2041: and identifying a region with the pixel brightness value larger than or equal to a preset brightness value threshold value in the target image as a first region, and reducing the pixel brightness value of the first region according to the balance factor and the image matrix.
In this embodiment, a luminance threshold is preset for measuring whether the luminance in the target image is too high or too low. And quantifying the brightness value of the pixel in the target image, if the obtained brightness value of the pixel is greater than or equal to the brightness value threshold value, determining the area as a first area, namely, in the first area, the brightness of the image is greater than that of other areas, and the situation that reflection and the like possibly occur, so that the image display is unclear, and in the case, adjusting the pixel value in the target image according to the calculated balance factor.
Specifically, if the first region exists, it is explained that the pixel luminance value in the region is high, and the image information in the region cannot be clarified, and therefore, the pixel luminance value of the pixel in the first region needs to be adjusted, specifically, the pixel luminance value of the pixel in the first region is reduced according to the equalization factor and the image matrix. When the illumination is too strong, the brightness of the pixel points in the image is greater than or equal to the balance factor, the brightness values of the pixel points in the image are uniformly reduced, and the brightness values after the brightness is reduced are as follows:
f′(i,j)=f(i,j)+(1-μ)P(i,j);
wherein P (i, j) is used for representing a gradient matrix of the gray-scale image, f (i, j) is used for representing a pixel brightness value of a pixel point with coordinates (i, j) in the current image, f' (i, j) is used for representing a pixel brightness value of a pixel point with coordinates (i, j) in the image after the equalization processing, and mu is used for representing the calculated equalization factor.
S2042: and identifying an area, in the target image, of which the pixel brightness value is smaller than a preset brightness value threshold value as a second area, and increasing the pixel brightness value in the second area according to the equalization factor and the image matrix.
After the equalization factor is calculated, when the brightness of the pixel point in the image is smaller than the equalization factor under the condition of dim light, uniformly increasing the brightness value of the pixel point in the image, and specifically, the brightness value after the increase is:
f′(i,j)=f(i,j)+(1+μ)P(i,j);
S205: and calculating the ambiguity of the target image according to the equalization matrix.
And after the equalization factor of the image is obtained by calculation, carrying out image equalization on the target image according to the equalization factor, obtaining a new equalization matrix, and calculating the ambiguity of the target image according to the equalization matrix.
Further, step S205 may specifically include steps S2051 to S2052:
s2051: according to the equalization matrix and the formula Calculating the gray value average value of the target image; wherein x, y are used to represent pixel coordinates in the target image; f (x, y) is used to represent the gray value at coordinates (x, y) in the target image; n x、Ny is used to represent the pixel length and pixel width of the target image; /(I)For representing the gray value mean.
Specifically, in the present embodiment, f (x, y) is used to represent the gray value at the coordinate (x, y) in the target image, which is substantially the gray value of the target image after the equalization process. After the image equalization is carried out on the target image, an equalization matrix is obtained, gray value equalization is calculated according to the equalization matrix after the equalization processing, and the gray value equalization is used for measuring the reference condition of the image pixels in the target image.
S2052: according to the formulaCalculating the image ambiguity; wherein/>For representing the image blur degree.
After the gray value mean value of the target image is calculated, the image ambiguity is calculated according to the following formula:
It should be noted that, (x, y) is used to represent the pixel coordinates in the target image when calculating the image ambiguity, and the maximum values of x and y are N x、Ny respectively, and all integers are taken. For the image blur degree, in general, if the image blur degree is smaller, the image blur is described as more blurred; the higher the image blur, the clearer the image is explained. In this way, the blurring or sharpness of an image can be measured by the image blur.
S206: if the ambiguity of the target image is smaller than a preset ambiguity threshold, sending a notice of uploading the image again, or calculating the ambiguity of the rest images, and determining the image with the minimum ambiguity as a processing object.
And after the image ambiguity is calculated, evaluating the target image according to a preset ambiguity threshold. Specifically, if the ambiguity of the target image is smaller than the preset ambiguity threshold, it indicates that the image of the target image is less ambiguous, and the image is blurred, so that the required user information may not be extracted, or the authenticity of the target image may not be verified. In this case, a notification of re-uploading the image may be sent to the user terminal to acquire other target images; or if the number of the target images acquired simultaneously is at least two, calculating the ambiguity of the rest images except the target images, and determining the image with the minimum ambiguity as the processing object.
S207: and if the ambiguity of the target image is greater than or equal to a preset ambiguity threshold, determining that the target image is a processing object.
After the image ambiguity is calculated, if the ambiguity of the target image is greater than or equal to a preset ambiguity threshold, the method indicates that the required user information can be extracted from the target image or the authenticity of the target image can be verified. In this case, the target image is determined as the processing object.
S208: extracting image information in the processing object and detecting whether the image information is correct.
After the processing object is determined, feature information in the processing object may be extracted, and corresponding processing may be performed. The processing method in this embodiment may be to extract image information in a processing object and detect whether the image information is correct.
In industrial applications based on machine vision, such as product monitoring, car navigation control, object recognition and video monitoring, in order to achieve better effects in different environments, the quality of the acquired image must be determined, and only the image with good quality can be used as a subsequent processing step, and if the quality is poor, the image must be discarded without affecting the subsequent processing and determination. For example, in the application of computer auto-focusing of a microscope, after a computer acquires one image, the computer calculates the blur degree of the image, then moves the lens, acquires another image, calculates the blur degree of the image, and continues the above process until the image with the minimum blur degree is found, and focusing is completed.
Alternatively, the quality of the image processing system may also be measured by the degree of ambiguity. For example, various image compression algorithms can cause fuzzy distortion of images, so that under the condition of the same compression bit rate, the quality of the algorithm can be obtained through the fuzzy degree evaluation of the images, and the lower the fuzzy degree, the better the quality.
Optionally, the ambiguity is used as an auxiliary subsystem of the image processing system for optimizing and parameter setting the system. For example, for a video monitoring system, the quality and the ambiguity of an image can be monitored at a receiving end, and when the ambiguity increases, an alarm is given or an automatic adjustment process is started, so that the monitoring quality of the system is ensured. In short, the blurring distortion is one of the most main factors in image and video degradation, and the quality of the whole image processing system can be controlled by capturing and quantifying the blurring distortion, so that the robustness of the system is improved, and the system performance is improved.
According to the scheme, the target image to be processed is obtained; the target image is obtained through shooting by a shooting device; generating an image matrix of the target image according to the pixel values of the target image; calculating an equalization factor of the target image according to the image matrix; and carrying out image equalization on the target image according to the equalization factors and the image matrix to obtain an equalization matrix. Identifying a region with a pixel brightness value greater than or equal to a preset brightness value threshold value in the target image as a first region, and reducing the pixel brightness value of the first region according to the equalization factor and the image matrix; and identifying an area, in the target image, of which the pixel brightness value is smaller than a preset brightness value threshold value as a second area, and increasing the pixel brightness value in the second area according to the equalization factor and the image matrix. Calculating the ambiguity of the target image according to the equalization matrix; and processing the target image according to the ambiguity and a preset processing mode. And calculating the ambiguity of the image according to the image matrix obtained after the equalization processing, and carrying out corresponding processing according to the ambiguity, so that a fair and accurate evaluation method is provided for the subsequent image processing or use, and the accuracy and anti-interference performance of image quality evaluation are improved.
Referring to fig. 3, fig. 3 is a schematic diagram of a terminal device according to a third embodiment of the present invention. The terminal device includes units for executing the steps in the embodiments corresponding to fig. 1 to 2. Refer specifically to the related descriptions in the respective embodiments of fig. 1-2. For convenience of explanation, only the portions related to the present embodiment are shown. The terminal device 300 of the present embodiment includes:
an acquiring unit 301, configured to acquire a target image to be processed; the target image is obtained through shooting by a shooting device;
The equalization unit 302 is configured to generate an image matrix of the target image, and perform equalization processing on the image matrix to obtain an equalization matrix;
A calculating unit 303, configured to calculate an ambiguity of the target image according to the equalization matrix;
and the processing unit 304 is configured to process the target image according to the ambiguity and a preset processing manner.
Further, the equalizing unit 302 may include:
An image matrix unit for generating an image matrix of the target image according to the pixel values of the target image;
An equalization factor unit, configured to calculate an equalization factor of the target image according to the image matrix;
and the equalization processing unit is used for carrying out image equalization on the target image according to the equalization factors and the image matrix to obtain an equalization matrix.
Further, the equalizing unit 302 may include:
A first equalization unit, configured to identify a region in the target image, where a pixel luminance value is greater than or equal to a preset luminance value threshold, as a first region, and reduce the pixel luminance value of the first region according to the equalization factor and the image matrix;
And the second equalization unit is used for identifying an area, in which the brightness value of the pixel in the target image is smaller than a preset brightness value threshold, as a second area and increasing the brightness value of the pixel in the second area according to the equalization factor and the image matrix.
Further, the computing unit 303 may include:
a gray-scale average unit for generating a gray-scale average value according to the image matrix and the formula Calculating the gray value average value of the target image; wherein x, y are used to represent pixel coordinates in the target image; f (x, y) is used to represent the gray value at coordinates (x, y) in the target image; n x、Ny is used to represent the pixel length and pixel width of the target image; /(I)For representing the gray value mean;
an ambiguity calculating unit for calculating the ambiguity according to the formula Calculating the image ambiguity; wherein/>For representing the image blur degree.
Further, the processing unit 304 may include:
The first processing unit is used for sending a notification of re-uploading the image or calculating the ambiguity of the rest images if the ambiguity of the target image is smaller than a preset ambiguity threshold value, and determining the image with the minimum ambiguity as a processing object;
the second processing unit is used for determining the target image as a processing object if the ambiguity of the target image is greater than or equal to a preset ambiguity threshold;
and the feature detection unit is used for extracting the image information in the processing object and detecting whether the image information is correct or not.
According to the scheme, the target image to be processed is obtained; the target image is obtained through shooting by a shooting device; generating an image matrix of the target image, and carrying out equalization processing on the image matrix to obtain an equalization matrix; calculating the ambiguity of the target image according to the equalization matrix; and processing the target image according to the ambiguity and a preset processing mode. The image equalization is carried out on the target image according to the conditions of illumination intensity or light reflection and the like, the problem that the brightness values of the pixels of the image are not uniform due to illumination factors is solved, the ambiguity of the image is calculated according to the equalized image matrix, a fair and accurate evaluation method is provided for subsequent image processing or use, and the accuracy and the anti-interference performance of image quality evaluation are improved.
Fig. 4 is a schematic diagram of a terminal device according to a fourth embodiment of the present invention. As shown in fig. 4, the terminal device 4 of this embodiment includes: a processor 40, a memory 41 and a computer program 42 stored in the memory 41 and executable on the processor 40. The steps of the various image processing method embodiments described above, such as steps 101 through 104 shown in fig. 1, are implemented by the processor 40 when executing the computer program 42. Or the processor 40, when executing the computer program 42, performs the functions of the modules/units of the apparatus embodiments described above, e.g. the functions of the units 301 to 304 shown in fig. 3.
Illustratively, the computer program 42 may be partitioned into one or more modules/units that are stored in the memory 41 and executed by the processor 40 to complete the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions for describing the execution of the computer program 42 in the terminal device 4.
The terminal device 4 may be a computing device such as a desktop computer, a notebook computer, a palm computer, a cloud server, etc. The terminal device may include, but is not limited to, a processor 40, a memory 41. It will be appreciated by those skilled in the art that fig. 4 is merely an example of the terminal device 4 and does not constitute a limitation of the terminal device 4, and may include more or less components than illustrated, or may combine certain components, or different components, e.g., the terminal device may further include an input-output device, a network access device, a bus, etc.
The Processor 40 may be a central processing unit (Central Processing Unit, CPU), other general purpose Processor, digital signal Processor (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), off-the-shelf Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 41 may be an internal storage unit of the terminal device 4, such as a hard disk or a memory of the terminal device 4. The memory 41 may also be an external storage device of the terminal device 4, such as a plug-in hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD, FC) or the like, which are provided on the terminal device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the terminal device 4. The memory 41 is used for storing the computer program as well as other programs and data required by the terminal device. The memory 41 may also be used for temporarily storing data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units and modules are only for distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present invention may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention.

Claims (5)

1. An image processing method, comprising:
Acquiring a target image to be processed; the target image is obtained through shooting by a shooting device;
Generating an image matrix of the target image, and carrying out equalization processing on the image matrix to obtain an equalization matrix;
calculating the ambiguity of the target image according to the equalization matrix;
processing the target image according to the ambiguity and a preset processing mode;
The processing mode comprises the steps of extracting text information in an image, comparing the text information with stored information, and determining whether the image is legal or not;
the calculating the ambiguity of the target image according to the equalization matrix comprises the following steps:
According to the image matrix and the formula Calculating the gray value average value of the target image; wherein/>For representing pixel coordinates in the target image; /(I)For representing coordinates in the target imageGray values at; /(I)The pixel length and the pixel width are used for representing the target image and are all integers; /(I)For representing the gray value mean;
According to the formula Calculating the ambiguity; wherein/>For representing the ambiguity;
The generating the image matrix of the target image and performing equalization processing on the image matrix to obtain an equalization matrix comprises the following steps:
generating an image matrix of the target image according to the pixel values of the target image;
Calculating an equalization factor of the target image according to the image matrix;
performing image equalization on the target image according to the equalization factors and the image matrix to obtain an equalization matrix;
performing image equalization on the target image according to the equalization factor and the image matrix to obtain an equalization matrix, including:
Identifying a region with a pixel brightness value greater than or equal to a preset brightness value threshold value in the target image as a first region, and reducing the pixel brightness value of the first region according to the equalization factor and the image matrix;
And identifying an area, in the target image, of which the pixel brightness value is smaller than a preset brightness value threshold value as a second area, and increasing the pixel brightness value in the second area according to the equalization factor and the image matrix.
2. The image processing method according to claim 1, wherein the processing the target image according to the degree of blur and a preset processing manner includes:
If the ambiguity of the target image is smaller than a preset ambiguity threshold, sending a notice of uploading the image again, or calculating the ambiguity of the rest images, and determining the image with the minimum ambiguity as a processing object;
if the ambiguity of the target image is greater than or equal to a preset ambiguity threshold, determining that the target image is a processing object;
Extracting image information in the processing object and detecting whether the image information is correct.
3. A terminal device comprising a memory and a processor, said memory storing a computer program executable on said processor, characterized in that said processor, when executing said computer program, performs the steps of:
Acquiring a target image to be processed; the target image is obtained through shooting by a shooting device;
Generating an image matrix of the target image, and carrying out equalization processing on the image matrix to obtain an equalization matrix;
calculating the ambiguity of the target image according to the equalization matrix;
processing the target image according to the ambiguity and a preset processing mode;
the calculating the ambiguity of the target image according to the equalization matrix comprises the following steps:
According to the image matrix and the formula Calculating the gray value average value of the target image; wherein/>For representing pixel coordinates in the target image; /(I)For representing coordinates in the target imageGray values at; /(I)The pixel length and the pixel width are used for representing the target image and are all integers; /(I)For representing the gray value mean;
According to the formula Calculating the ambiguity; wherein/>For representing the ambiguity;
The generating the image matrix of the target image and performing equalization processing on the image matrix to obtain an equalization matrix comprises the following steps:
generating an image matrix of the target image according to the pixel values of the target image;
Calculating an equalization factor of the target image according to the image matrix;
performing image equalization on the target image according to the equalization factors and the image matrix to obtain an equalization matrix;
performing image equalization on the target image according to the equalization factor and the image matrix to obtain an equalization matrix, including:
Identifying a region with a pixel brightness value greater than or equal to a preset brightness value threshold value in the target image as a first region, and reducing the pixel brightness value of the first region according to the equalization factor and the image matrix;
And identifying an area, in the target image, of which the pixel brightness value is smaller than a preset brightness value threshold value as a second area, and increasing the pixel brightness value in the second area according to the equalization factor and the image matrix.
4. A terminal device, comprising:
an acquisition unit configured to acquire a target image to be processed; the target image is obtained through shooting by a shooting device;
The equalization unit is used for generating an image matrix of the target image and performing equalization processing on the image matrix to obtain an equalization matrix;
A calculating unit, configured to calculate an ambiguity of the target image according to the equalization matrix;
The processing unit is used for processing the target image according to the ambiguity and a preset processing mode;
The calculation unit includes:
a gray-scale average unit for generating a gray-scale average value according to the image matrix and the formula Calculating the gray value average value of the target image; wherein/>For representing pixel coordinates in the target image; /(I)For representing coordinates/>, in the target imageGray values at; /(I)The pixel length and the pixel width are used for representing the target image and are all integers; /(I)For representing the gray value mean;
ambiguity calculating unit for calculating ambiguity according to the formula Calculating the ambiguity; wherein/>For representing the ambiguity;
The equalization unit includes:
An image matrix unit for generating an image matrix of the target image according to the pixel values of the target image;
An equalization factor unit, configured to calculate an equalization factor of the target image according to the image matrix;
The equalization processing unit is used for carrying out image equalization on the target image according to the equalization factors and the image matrix to obtain an equalization matrix;
A first equalization unit, configured to identify a region in the target image, where a pixel luminance value is greater than or equal to a preset luminance value threshold, as a first region, and reduce the pixel luminance value of the first region according to the equalization factor and the image matrix;
And the second equalization unit is used for identifying an area, in which the brightness value of the pixel in the target image is smaller than a preset brightness value threshold, as a second area and increasing the brightness value of the pixel in the second area according to the equalization factor and the image matrix.
5. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor realizes the steps of the method according to claim 1 or 2.
CN201811477606.9A 2018-12-05 2018-12-05 Image processing method and terminal equipment Active CN109829859B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811477606.9A CN109829859B (en) 2018-12-05 2018-12-05 Image processing method and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811477606.9A CN109829859B (en) 2018-12-05 2018-12-05 Image processing method and terminal equipment

Publications (2)

Publication Number Publication Date
CN109829859A CN109829859A (en) 2019-05-31
CN109829859B true CN109829859B (en) 2024-05-24

Family

ID=66859861

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811477606.9A Active CN109829859B (en) 2018-12-05 2018-12-05 Image processing method and terminal equipment

Country Status (1)

Country Link
CN (1) CN109829859B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111082517A (en) * 2019-10-14 2020-04-28 上海大学 Intelligent electrical equipment management device based on cloud computing
CN110910491A (en) * 2019-11-27 2020-03-24 广西科技大学 Three-dimensional human body modeling optimization method and system
CN111327831B (en) * 2020-03-30 2021-09-10 北京智美智学科技有限公司 Image acquisition method and device for UGC, electronic equipment and system
CN111462005B (en) * 2020-03-30 2023-01-06 腾讯医疗健康(深圳)有限公司 Method, apparatus, computer device and storage medium for processing microscopic image
CN112529845B (en) * 2020-11-24 2024-09-17 浙江大华技术股份有限公司 Image quality value determining method and device, storage medium and electronic device
CN112819714A (en) * 2021-01-29 2021-05-18 深圳市商汤科技有限公司 Target object exposure method, device, storage medium and equipment
CN113160357A (en) * 2021-04-07 2021-07-23 浙江工商大学 Information auditing method, system and computer readable storage medium
CN114489608B (en) * 2022-01-17 2022-08-16 星河智联汽车科技有限公司 Display screen icon control method and device, terminal equipment and storage medium
CN115100053A (en) * 2022-06-16 2022-09-23 南京航空航天大学 Background wave noise reduction method for schlieren picture

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104156921A (en) * 2014-08-08 2014-11-19 大连理工大学 Self-adaptive low-illuminance or non-uniform-brightness image enhancement method
CN104517268A (en) * 2014-12-24 2015-04-15 小米科技有限责任公司 Method and device for adjusting image brightness
CN105069783A (en) * 2015-07-23 2015-11-18 北京金山安全软件有限公司 Fuzzy picture identification method and device
CN107871303A (en) * 2016-09-26 2018-04-03 北京金山云网络技术有限公司 A kind of image processing method and device
CN108830197A (en) * 2018-05-31 2018-11-16 平安医疗科技有限公司 Image processing method, device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104156921A (en) * 2014-08-08 2014-11-19 大连理工大学 Self-adaptive low-illuminance or non-uniform-brightness image enhancement method
CN104517268A (en) * 2014-12-24 2015-04-15 小米科技有限责任公司 Method and device for adjusting image brightness
CN105069783A (en) * 2015-07-23 2015-11-18 北京金山安全软件有限公司 Fuzzy picture identification method and device
CN107871303A (en) * 2016-09-26 2018-04-03 北京金山云网络技术有限公司 A kind of image processing method and device
CN108830197A (en) * 2018-05-31 2018-11-16 平安医疗科技有限公司 Image processing method, device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Image processing and matrices;Omkar Prabhune等;《2017 International Conference on Data Management, Analytics and Innovation (ICDMAI)》;20171019;第166-171页 *
基于光照不均文本图像的分割方法;张剑等;《第三十二届中国控制会议论文集》;20130731;第C卷;第1251-1254页 *

Also Published As

Publication number Publication date
CN109829859A (en) 2019-05-31

Similar Documents

Publication Publication Date Title
CN109829859B (en) Image processing method and terminal equipment
CN111028189B (en) Image processing method, device, storage medium and electronic equipment
CN107481186B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
US20130278788A1 (en) Method for determining the extent of a foreground object in an image
WO2018228310A1 (en) Image processing method and apparatus, and terminal
CN107395991B (en) Image synthesis method, image synthesis device, computer-readable storage medium and computer equipment
CN107563979B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
TWI721786B (en) Face verification method, device, server and readable storage medium
WO2017047494A1 (en) Image-processing device
CN110443766B (en) Image processing method and device, electronic equipment and readable storage medium
CN111368587B (en) Scene detection method, device, terminal equipment and computer readable storage medium
CN107908998B (en) Two-dimensional code decoding method and device, terminal equipment and computer readable storage medium
US10972676B2 (en) Image processing method and electronic device capable of optimizing hdr image by using depth information
CN115278103B (en) Security monitoring image compensation processing method and system based on environment perception
CN109068060B (en) Image processing method and device, terminal device and computer readable storage medium
CN110740266A (en) Image frame selection method and device, storage medium and electronic equipment
CN110175967B (en) Image defogging processing method, system, computer device and storage medium
CN107424134B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
CN111669572A (en) Camera module detection method and device, medium and electronic equipment
CN111161211B (en) Image detection method and device
CN111885371A (en) Image occlusion detection method and device, electronic equipment and computer readable medium
CN111062272A (en) Image processing and pedestrian identification method and device based on color recovery and readable storage medium
CN107481199B (en) Image defogging method and device, storage medium and mobile terminal
CN113422893B (en) Image acquisition method and device, storage medium and mobile terminal
KR20190072643A (en) A face detecting apparatus, a control method therefor, and a program

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