CN110009563A - Image processing method and device, electronic equipment and storage medium - Google Patents

Image processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110009563A
CN110009563A CN201910239102.1A CN201910239102A CN110009563A CN 110009563 A CN110009563 A CN 110009563A CN 201910239102 A CN201910239102 A CN 201910239102A CN 110009563 A CN110009563 A CN 110009563A
Authority
CN
China
Prior art keywords
image
enhancing
weight matrix
matrix
original
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.)
Granted
Application number
CN201910239102.1A
Other languages
Chinese (zh)
Other versions
CN110009563B (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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201910239102.1A priority Critical patent/CN110009563B/en
Publication of CN110009563A publication Critical patent/CN110009563A/en
Application granted granted Critical
Publication of CN110009563B publication Critical patent/CN110009563B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4046Scaling of whole images or parts thereof, e.g. expanding or contracting using neural networks
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the present invention provides a kind of image processing method and device, electronic equipment and storage medium, wherein the described method includes: obtaining the first image to original image processing, the data volume of the first image is less than the original image;Enhancing processing is carried out to the first image, obtains the first enhancing image;The first weight matrix is obtained based on the first image and the first enhancing image;By the size adjusting of first weight matrix at the size same or similar in size with the original image, the second weight matrix is obtained;Target image is generated based on the original image and second weight matrix, to realize the enhancing to the original image.When handling image by using method provided by the invention, it can maximumlly retain the detailed information of original image, to improve the reinforcing effect of image while guaranteeing processing speed.

Description

Image processing method and device, electronic equipment and storage medium
Technical field
This application involves field of image processing, in particular to a kind of image processing method and device, electronic equipment and storage Medium.
Background technique
In recent years, image enhancement on the mobile terminals such as mobile phone using more and more extensive, especially for photo Beautification.With the development of neural network, the effect of image enhancement has leaping for matter, but the place of the chip due to mobile terminal Reason ability is limited, and the operand of neural network is very big, causes the efficiency of image enhancement not high.
In the prior art, in order to guarantee processing real-time, original image is usually subjected to a certain proportion of scaling, then The enhancing that directly thumbnail of generation is calculated by neural network, and is exported neural network by the methods of linear interpolation Thumbnail readjust be original image size.However, the thumbnail of enhancing to be adjusted to the size of original image A large amount of detailed information can be lost in the process, and therefore, this method causes image enhancement effects poor, and further results in user's body Test difference.
Summary of the invention
The embodiment of the present invention is designed to provide a kind of image processing method and device, electronic equipment and storage medium, The detailed information of original image can maximumlly be retained while guaranteeing processing speed, to improve the enhancing effect of image Fruit, and further promote user experience.
In order to solve the above-mentioned technical problem, the embodiment of the present invention adopts the technical scheme that
First aspect present invention provides a kind of image processing method, comprising:
To original image processing, the first image is obtained, the data volume of the first image is less than the original image;
Enhancing processing is carried out to the first image, obtains the first enhancing image;
The first weight matrix is obtained based on the first image and the first enhancing image;
By the size adjusting of first weight matrix at the size same or similar in size with the original image, obtain To the second weight matrix;
Target image is generated based on the original image and second weight matrix, to realize to the original image Enhancing.
Preferably, carrying out enhancing processing to the first image using neural network, the first enhancing image is obtained.
Preferably, it is described based on the first image and it is described first enhancing image obtain the first weight matrix, comprising:
The image array of the first image and the image array of the first enhancing image are obtained respectively;
The image array of image array and the first enhancing image to the first image a little obtain except operation First weight matrix.
Preferably, before generating the target image, the method also includes:
Second weight matrix is filtered, so that the weight distribution of second weight matrix is more flat It is sliding.
Second aspect of the present invention provides a kind of image processing apparatus, comprising:
Scaling processing module is configured to obtain the first image, the data volume of the first image is small to original image processing In the original image;
Image enhancement module is configured to carry out enhancing processing to the first image, obtains the first enhancing image;
Weight matrix obtains module, is configured to the first image and the first enhancing image obtains the first weight Matrix;
By the size adjusting of first weight matrix at the size same or similar in size with the original image, obtain To the second weight matrix;
Target image generation module, is configured to the original image and second weight matrix generates target figure Picture, to realize the enhancing to the original image.
Preferably, described image enhancing module is further configured to, the first image is carried out using neural network Enhancing processing, obtains the first enhancing image.
It is further configured to preferably, the weight matrix obtains module, obtains the image of the first image respectively The image array of matrix and the first enhancing image;
The image array of image array and the first enhancing image to the first image a little obtain except operation First weight matrix.
Preferably, described device further includes filter module, it is configured to, before generating the target image, to institute It states the second weight matrix to be filtered, so that the weight distribution of second weight matrix is more smooth.
Third aspect present invention provides a kind of electronic equipment, including memory, processor, is stored with meter on the memory Calculation machine program, the processor realize above-mentioned method when executing the computer program on the memory.
Fourth aspect present invention provides a kind of storage medium, is stored with computer program, and the computer program is processed Device realizes above-mentioned method when executing.
The beneficial effect of the embodiment of the present invention is:
Image processing method provided by the invention can maximumlly retain original graph while guaranteeing processing speed The detailed information of picture to improve the reinforcing effect of image, and further promotes user experience.
Detailed description of the invention
Fig. 1 is the flow chart of the image processing method of the embodiment of the present invention;
Fig. 2 is the logic diagram of the image processing apparatus of the embodiment of the present invention.
Specific embodiment
Various schemes and feature of the invention are described herein with reference to attached drawing.
It should be understood that various modifications can be made to the embodiment invented herein.Therefore, description above should not regard To limit, and only as the example of embodiment.Those skilled in the art will expect within the scope and spirit of this invention Other modifications.
The attached drawing being included in the description and forms part of the description shows the embodiment of the present invention, and with it is upper What face provided is used to explain the present invention substantially description and the detailed description given below to embodiment of the invention together Principle.
It is of the invention by the description of the preferred form with reference to the accompanying drawings to the embodiment for being given as non-limiting example These and other characteristic will become apparent.
Although being also understood that invention has been described referring to some specific examples, those skilled in the art Member realizes many other equivalents of the invention in which can determine, they have feature as claimed in claim and therefore all In the protection scope defined by whereby.
When read in conjunction with the accompanying drawings, in view of following detailed description, above and other aspect of the invention, feature and advantage will become It is more readily apparent.
Specific embodiments of the present invention are described hereinafter with reference to attached drawing;It will be appreciated, however, that the embodiment invented is only Various ways implementation can be used in example of the invention.Known and/or duplicate function and structure and be not described in detail to avoid Unnecessary or extra details makes the present invention smudgy.Therefore, the specific structural and functionality invented herein is thin Section is not intended to restrictions, but as just the basis of claim and representative basis be used to instructing those skilled in the art with Substantially any appropriate detailed construction diversely uses the present invention.
This specification can be used phrase " in one embodiment ", " in another embodiment ", " in another embodiment In " or " in other embodiments ", it can be referred to one or more of identical or different embodiment according to the present invention.
As shown in Figure 1, first embodiment of the invention provides a kind of image processing method, comprising:
To original image processing, the first image is obtained, the data volume of the first image is less than the original image;
Enhancing processing is carried out to the first image, obtains the first enhancing image;
The first weight matrix is obtained based on the first image and the first enhancing image;
By the size adjusting of first weight matrix at the size same or similar in size with the original image, obtain To the second weight matrix;
Target image is generated based on the original image and second weight matrix, to realize to the original image Enhancing.
In the above-described embodiments, by being handled original image to obtain the first image, thus by data volume it is small Object of one image as image enhancement processing, the speed that enhancing can be made to handle in this way become faster, and obtain after being then based on enhancing To the first enhancing image and the first image obtain the first weight matrix, then by the size of the first weight matrix be tuned into it is original Image is same or similar, obtains the second weight matrix, finally generates target figure based on original image and second weight matrix Picture.The method applied in the present invention, there is no the methods of linear interpolation used in background technique thus directly to enhanced The size that image is readjusted as original image;But by first obtaining the first weight matrix, then pass through the first weight matrix The second weight matrix is obtained, generates target image finally by original image and second weight matrix, through the invention This method target image generated will not lose a large amount of detailed information, can maximumlly retain the thin of original image Information is saved, to improve the reinforcing effect of image, and further promotes user experience.
In the present invention, the image that can be absorbed to any electronic equipment is handled, and is not appointed to the electronic equipment What is limited, and is only illustratively to be illustrated so that electronic equipment is mobile phone as an example below.
It the use of mobile phone shooting photo has been public demand since present mobile phone is more more and more universal.But since mobile phone is set Standby is limited, ability of taking pictures much deficiency slr cameras, so in order to shoot good-looking photo with mobile phone, it is usually used Algorithm carries out post-processing to the photo that mobile phone is shot, and such treatment process is called image enhancement.Institute in above-described embodiment The original image of the original image stated here refers to the digital picture directly shot by mobile phone.Digital picture is by a series of The matrix of number composition, the color of each value representative image respective pixel position in this matrix.We are to original original image It is actually some operations carried out to this matrix that image, which carries out enhancing operation, and the result after operation is exactly certain in matrix Value is changed.So the form of expression of a width digital picture in a computer should be the form as shown in formula (I).
Wherein Ii,jRefer to the color of the i-th row jth column respective pixel position in image (if it is black white image, here It can be understood as the degree of black and white, if we describe the degree of black and white with 255 grades, then I=255 just represents the position Setting is white, and it is black that I=0, which just represents this position, and color image is similar), the value range of i and j are exactly picture size, such as As soon as fruit is the image that resolution ratio is 640*480, then what this matrix should be made of the number that 640 rows 480 arrange.
In one embodiment of the invention, to original image processing, the first image, the data of the first image are obtained Amount is less than the original image;It specifically refers to, by the matrixing of the original image matrix smaller than the matrix at a size. Enhancing processing is carried out to it to facilitate, by handling relatively small first image of data volume, can be made compared to directly right The speed that original image carries out enhancing processing becomes faster, and has saved the time.
Wherein, the first image is construed as the original image thumbnail of original image, and the data volume of the first image is either The data volume of original image is construed as the resolution ratio of image;Original image is handled to obtain the mistake of the first image Miscellaneous picture, is actually uniformly scaled to the process of the picture of a fixed size by journey, such as mobile phone Various photos can be stored in photograph album, their resolution ratio is all different, some photos are 640*480, some photos It is 800*600, some photos are 1280*800, then need these photos being uniformly scaled to 500*500.Here 500* 500 photo is exactly above-mentioned the first image obtained by original image.Then enhancing processing is carried out to the first image again, obtained Enhanced processing result.Enhancing treated output result be also a character matrix.
Image enhancement is actually the content passed through in the character matrix for changing image, to change respective pixel in image The color of position, to achieve the effect that enhancing.For example, the result of an image enhancement operation may be it is following in this way: where I indicates that the matrix of original image, I ' indicate the matrix obtained after original image enhancing;
It can be seen that some numerical value in the matrix of enhanced image are changed, and these variations are set by electronics It is exactly that the colors of certain positions in image is changed that the display of standby display device, which is embodied on image,.Currently a popular is each The U.S. face method of kind is exactly one kind of image enhancement, and the color of application on human skin position is exactly become brighter.Our applied field Scape is focused primarily on mobile phone terminal, so U.S. face algorithm just simply can also be understood as algorithm for image enhancement.It continues the above Example, image enchancing method are exactly that some values in the matrix original image are changed, and this variation has foundation, root According to the regular also difference of its transformation of different image enchancing methods.Comparing traditional certain methods is exactly simply to increase whole figure The color saturation (color saturation can be calculated by image digitization matrix) of picture, or do histogram equalization, Image gamma transformation etc..Currently, carrying out image enhancement using neural network is also popular method, but no matter what uses Kind method carries out enhancing processing to image, and common practice is directly to export final enhancing figure, then this is increased in the prior art Strong figure reverts to original size and has just obtained final result.But this mode is thin due to that can bring during reduction Section loss, although the reinforcing effect that neural network obtains is fine, enhanced image has lost after re-scaling Part details causes final result undesirable.
For example the enhanced matrix of a 2*2 (matrix I) is reduced directly the square to original 4*4 (matrix I ') Battle array, it would be possible that form be following such:
Be scaled to one big figure if it is by small figure, then the value for certainly existing some pixels be it is unknown, this is just needed What very important person was supplements these values, and rule used in its supplementary unknown of different image-scaling methods is different.It is most simple Single method is a kind of method for being called neighbor interpolation, and this method is simply one of the value adjacent position of unknown position Value substitutes, such as above example, if with neighbor interpolation method, obtained result will be it is following in this way:
As soon as thereby realizing a matrix being exaggerated by 2*2 to 4*4, it is so-called original in conventional method also to have obtained The enhanced image of image.There are also bilinear interpolations, cubic etc. for other some Zoom methods.But whether which Kind interpolation method cannot all reflect image due detailed information originally completely, can only allow these as far as possible The information artificially filled up more meets really, so from image, amplified image it is possible that mosaic or Situations such as person deforms.This phenomenon is just called bring loss of detail during scaling.Therefore, used straight in the prior art The final enhancing figure of output is connect, then this enhancing figure is reverted into original size to obtain the method for final result and can exist seriously Loss of detail.
The method applied in the present invention, which has been evaded, directly zooms in and out enhancing figure, but the first weight is obtained by calculation Then first weight matrix is zoomed in and out the method for obtaining the second weight matrix by matrix.Although obtained after scaling the Two weight matrix also bring along certain loss, but by by after the information of the second weight matrix combination original image, it can To allow the loss of detail of result to be reduced to minimum.
In another embodiment of the present invention, enhancing processing is carried out to the first image using neural network, obtained First enhancing image.
First image is sent into neural network, the character matrix of the first image is grasped by a series of operations of neural network Make, obtains the output of neural network as a result, obtaining the first enhancing image.
The method of neural network is exactly currently a popular deep learning method, that is, the common method of artificial intelligence it One.It simply can be understood as this and set formed operated by a series of addition subtraction multiplication and division, when a matrix is sent into neural network Later, neural network will carry out a series of addition subtraction multiplication and division operation to each value in matrix, and some of them operation may also can Change the size of matrix.In order to allow neural network that can handle miscellaneous data, need to guarantee to be sent into neural network every time The size of matrix be it is unified, in this way could the value to corresponding position in matrix carry out corresponding operation.So in simple terms, it is defeated The size for entering the matrix of neural network is preferably maintained in unified, and the present invention does not have any limit to the size of matrix of input neural network System, as long as it is smaller than the data volume of original image, meet the standard that neural network is able to carry out processing, for example all can only be The matrix of 640*480 size, that is to say, that the matrix size of the first image is 640*480.Same reason, neural network are passed through It is a series of be uniformly processed after, the content of output is also unified, for example neural network may be a series of 640*480 Matrix disposal after all become the matrixes of 1080*720.So the size of in general neural network output and input is all It is unified.
In other embodiments of the invention, it is described based on the first image and it is described first enhancing image obtain first Weight matrix, comprising:
The image array of the first image and the image array of the first enhancing image are obtained respectively;
The image array of image array and the first enhancing image to the first image a little obtain except operation First weight matrix.
In the above-described embodiments, the calculation of the first weight matrix M can there are many kinds of, the present invention does not make this specifically It limits, is exemplarily only calculated in such a way that matrix dot removes, to obtain the first weight matrix.
Wherein i, j respectively indicate the value of the i-th row jth column corresponding position of corresponding matrix.O indicates the first enhancing figure Picture, I indicate the first image.Citing:
Then
Here the first weight matrix indicates a difference degree of the first image and the first image after enhancing, intuitively comes See to be exactly a matrix, in this matrix each value correspond to original image to enhancing figure corresponding position mapping relations.
In another embodiment of the present invention, before generating the target image, the method also includes:
Second weight matrix is filtered, so that the weight distribution of second weight matrix is more flat It is sliding.
In the present invention, for by the size adjusting of first weight matrix at identical as the size of the original image or Method used in similar size does not have any restrictions, as long as can by the size adjusting of the first weight matrix at the original The size of beginning image is same or similar, such as can be linear interpolation method or neighbor interpolation method etc..But It can carry out Gaussian smoothing again after carrying out interpolation in embodiments of the present invention, to make up interpolation method bring loss of detail, Even mosaic effect brought by interpolation method, (as blocking artifact, all pixels point is all same face in certain fritter Color, so seeming is exactly that a fritter is the same), the more smooth of value transition between block and block is allowed, to allow the second weight square The weight distribution of battle array is more smooth, and the image seemed in this way is more smooth.
In one embodiment of the invention, by the size adjusting of first weight matrix at the original image Size same or similar in size obtains the second weight matrix, comprising:
Obtain the image array of the original image;
The size of first weight matrix is enlarged into or phase identical as the size of the image array of the original image Closely, to obtain second weight matrix.
In embodiment provided by the present invention, since the size of the image exported by Processing with Neural Network may be One fixed dimension, i.e., the first enhancing image may be a fixed dimension, but the fixed dimension may not be with the image of original image Size is identical, so needing for the size of first weight matrix to be enlarged into the size with the image array of the original image It is same or similar, to obtain second weight matrix.Then again based on the original image and second weight matrix into The dot product of row corresponding position is operated to generate target image, to realize the enhancing to the original image.
It is described raw based on the original image and second weight matrix in other embodiments provided by the present invention At target image, to realize the enhancing to the original image, comprising:
Image array and second weight matrix to the original image carry out dot product operation, obtain the target figure The image array of picture;
Image array based on the target image generates the target image, to realize the increasing to the original image By force.
Based on the same inventive concept, as shown in Fig. 2, second embodiment of the invention provides a kind of image processing apparatus, packet It includes:
Scaling processing module is configured to obtain the first image, the data volume of the first image is small to original image processing In the original image;
Image enhancement module is coupled with the scaling processing module, is configured to carry out at enhancing the first image Reason, obtains the first enhancing image;
Weight matrix obtains module, couples, configures with the scaling processing module and described image enhancing module respectively To obtain the first weight matrix based on the first image and the first enhancing image;
By the size adjusting of first weight matrix at the size same or similar in size with the original image, obtain To the second weight matrix;
Target image generation module obtains module with the weight matrix and couples, is configured to the original image Target image is generated with second weight matrix, to realize the enhancing to the original image.
In the above-described embodiments, by being handled original image to obtain the first image, thus by data volume it is small Object of one image as image enhancement processing, the speed that enhancing can be made to handle in this way become faster, and obtain after being then based on enhancing To the first enhancing image and the first image obtain the first weight matrix, then by the size of the first weight matrix be tuned into it is original Image is same or similar, obtains the second weight matrix, finally generates target figure based on original image and second weight matrix Picture.Device of the present invention, there is no the sizes directly readjusted to enhanced image as original image;But it is logical After first obtaining the first weight matrix, the second weight matrix is then obtained by the first weight matrix, finally by original image and Second weight matrix generates target image, and this device target image generated through the invention will not lose largely Detailed information, can maximumlly retain the detailed information of original image, to improve the reinforcing effect of image, go forward side by side one Step promotes user experience.
In the present invention, the image that can be absorbed to any electronic equipment is handled, and is not appointed to the electronic equipment What is limited, and is only illustratively to be illustrated so that electronic equipment is mobile phone as an example below.
It the use of mobile phone shooting photo has been public demand since present mobile phone is more more and more universal.But since mobile phone is set Standby is limited, ability of taking pictures much deficiency slr cameras, so in order to shoot good-looking photo with mobile phone, it is usually used Algorithm carries out post-processing to the photo that mobile phone is shot, and such treatment process is called image enhancement.Institute in above-described embodiment The original image of the original image stated here refers to the digital picture directly shot by mobile phone.Digital picture is by a series of The matrix of number composition, the color of each value representative image respective pixel position in this matrix.We are to original original image It is actually some operations carried out to this matrix that image, which carries out enhancing operation, and the result after operation is exactly certain in matrix Value is changed.So the form of expression of a width digital picture in a computer should be the form as shown in formula (I).
Wherein Ii,jRefer to the color of the i-th row jth column respective pixel position in image (if it is black white image, here It can be understood as the degree of black and white, if we describe the degree of black and white with 255 grades, then I=255 just represents the position Setting is white, and it is black that I=0, which just represents this position, and color image is similar), the value range of i and j are exactly picture size, such as As soon as fruit is the image that resolution ratio is 640*480, then what this matrix should be made of the number that 640 rows 480 arrange.
In one embodiment of the invention, to original image processing, the first image, the data of the first image are obtained Amount is less than the original image;It specifically refers to, by the matrixing of the original image matrix smaller than the matrix at a size. Enhancing processing is carried out to it to facilitate, by handling relatively small first image of data volume, can be made compared to directly right The speed that original image carries out enhancing processing becomes faster, and has saved the time.
Wherein, the first image is construed as the original image thumbnail of original image, and the data volume of the first image is either The data volume of original image is construed as the resolution ratio of image;Original image is handled to obtain the mistake of the first image Miscellaneous picture, is actually uniformly scaled to the process of the picture of a fixed size by journey, such as mobile phone Various photos can be stored in photograph album, their resolution ratio is all different, some photos are 640*480, some photos It is 800*600, some photos are 1280*800, then need these photos being uniformly scaled to 500*500.Here 500* 500 photo is exactly above-mentioned the first image obtained by original image.Then enhancing processing is carried out to the first image again, obtained Enhanced processing result.Enhancing treated output result be also a character matrix.
Image enhancement is actually the content passed through in the character matrix for changing image, to change respective pixel in image The color of position, to achieve the effect that enhancing.For example, the result of an image enhancement operation may be it is following in this way: where I indicates that the matrix of original image, I ' indicate the matrix obtained after original image enhancing;
It can be seen that some numerical value in the matrix of enhanced image are changed, and these variations are set by electronics It is exactly that the colors of certain positions in image is changed that the display of standby display device, which is embodied on image,.Currently a popular is each The U.S. face method of kind is exactly one kind of image enhancement, and the color of application on human skin position is exactly become brighter.Our applied field Scape is focused primarily on mobile phone terminal, so U.S. face algorithm just simply can also be understood as algorithm for image enhancement.It continues the above Example, image enchancing method are exactly that some values in the matrix original image are changed, and this variation has foundation, root According to the regular also difference of its transformation of different image enchancing methods.Comparing traditional certain methods is exactly simply to increase whole figure The color saturation (color saturation can be calculated by image digitization matrix) of picture, or do histogram equalization, Image gamma transformation etc..Currently, carrying out image enhancement using neural network is also popular method, but no matter what uses Kind method carries out enhancing processing to image, and common practice is directly to export final enhancing figure, then this is increased in the prior art Strong figure reverts to original size and has just obtained final result.But this mode is thin due to that can bring during reduction Section loss, although the reinforcing effect that neural network obtains is fine, enhanced image has lost after re-scaling Part details causes final result undesirable.
For example the enhanced matrix of a 2*2 (matrix I) is reduced directly the square to original 4*4 (matrix I ') Battle array, it would be possible that form be following such:
Be scaled to one big figure if it is by small figure, then the value for certainly existing some pixels be it is unknown, this is just needed What very important person was supplements these values, and rule used in its supplementary unknown of different image-scaling methods is different.It is most simple Single method is a kind of method for being called neighbor interpolation, and this method is simply one of the value adjacent position of unknown position Value substitutes, such as above example, if with neighbor interpolation method, obtained result will be it is following in this way:
As soon as thereby realizing a matrix being exaggerated by 2*2 to 4*4, it is so-called original in conventional method also to have obtained The enhanced image of image.There are also bilinear interpolations, cubic etc. for other some Zoom methods.But whether which Kind interpolation method cannot all reflect image due detailed information originally completely, can only allow these as far as possible The information artificially filled up more meets really, so from image, amplified image it is possible that mosaic or Situations such as person deforms.This phenomenon is just called bring loss of detail during scaling.Therefore, used straight in the prior art The final enhancing figure of output is connect, then this enhancing figure is reverted into original size to obtain the method for final result and can exist seriously Loss of detail.
Device of the present invention, which has been evaded, directly zooms in and out enhancing figure, but the first weight is obtained by calculation Then first weight matrix is zoomed in and out the method for obtaining the second weight matrix by matrix.Although obtained after scaling the Two weight matrix also bring along certain loss, but by by after the information of the second weight matrix combination original image, it can To allow the loss of detail of result to be reduced to minimum.
In another embodiment provided by the invention, described image enhancing module is further configured to, using nerve net Network carries out enhancing processing to the first image, obtains the first enhancing image.
First image is sent into neural network, the character matrix of the first image is grasped by a series of operations of neural network Make, obtains the output of neural network as a result, obtaining the first enhancing image.
The method of neural network is exactly currently a popular deep learning method, that is, the common method of artificial intelligence it One.It simply can be understood as this and set formed operated by a series of addition subtraction multiplication and division, when a matrix is sent into neural network Later, neural network will carry out a series of addition subtraction multiplication and division operation to each value in matrix, and some of them operation may also can Change the size of matrix.In order to allow neural network that can handle miscellaneous data, need to guarantee to be sent into neural network every time The size of matrix be it is unified, in this way could the value to corresponding position in matrix carry out corresponding operation.So in simple terms, it is defeated The size for entering the matrix of neural network is preferably maintained in unified, and the present invention does not have any limit to the size of matrix of input neural network System, as long as it is smaller than the data volume of original image, meet the standard that neural network is able to carry out processing, for example all can only be The matrix of 640*480 size, that is to say, that the matrix size of the first image is 640*480.Same reason, neural network are passed through It is a series of be uniformly processed after, the content of output is also unified, for example neural network may be a series of 640*480 Matrix disposal after all become the matrixes of 1080*720.So the size of in general neural network output and input is all It is unified.
In other embodiments of the invention, the weight matrix obtains module and is further configured to, respectively described in acquisition The image array of the image array of first image and the first enhancing image;
The image array of image array and the first enhancing image to the first image a little obtain except operation First weight matrix.
In the above-described embodiments, the calculation of the first weight matrix M can there are many kinds of, the present invention does not make this specifically It limits, is exemplarily only calculated in such a way that matrix dot removes, to obtain the first weight matrix.
Wherein i, j respectively indicate the value of the i-th row jth column corresponding position of corresponding matrix.O indicates the first enhancing figure Picture, I indicate the first image.Citing:
Then
Here the first weight matrix indicates a difference degree of the first image and the first image after enhancing, intuitively comes See to be exactly a matrix, in this matrix each value correspond to original image to enhancing figure corresponding position mapping relations.
In another embodiment of the present invention, described device further includes filter module, is configured to, and the mesh is being generated Before logo image, second weight matrix is filtered, so that the weight distribution of second weight matrix is more Smoothly.
In the present invention, for by the size adjusting of first weight matrix at identical as the size of the original image or Method used in similar size does not have any restrictions, as long as can by the size adjusting of the first weight matrix at the original The size of beginning image is same or similar, such as can be linear interpolation method or neighbor interpolation method etc..But It can carry out Gaussian smoothing again after carrying out interpolation in embodiments of the present invention, to make up interpolation method bring loss of detail, Even mosaic effect brought by interpolation method, (as blocking artifact, all pixels point is all same face in certain fritter Color, so seeming is exactly that a fritter is the same), the more smooth of value transition between block and block is allowed, to allow the second weight square The weight distribution of battle array is more smooth, and the image seemed in this way is more smooth.
In one embodiment of the invention, the weight matrix obtains module and is additionally configured to:
Obtain the image array of the original image;
The size of first weight matrix is enlarged into or phase identical as the size of the image array of the original image Closely, to obtain second weight matrix.
In embodiment provided by the present invention, since the size of the image exported by Processing with Neural Network may be One fixed dimension, i.e., the first enhancing image may be a fixed dimension, but the fixed dimension may not be with the image of original image Size is identical, so needing for the size of first weight matrix to be enlarged into the size with the image array of the original image It is same or similar, to obtain second weight matrix.Then again based on the original image and second weight matrix into The dot product of row corresponding position is operated to generate target image, to realize the enhancing to the original image.
In other embodiments provided by the present invention, the target image generation module is additionally configured to:
Image array and second weight matrix to the original image carry out dot product operation, obtain the target figure The image array of picture;
Image array based on the target image generates the target image, to realize the increasing to the original image By force.
Based on inventive concept identical with above-mentioned image processing method, third embodiment of the invention provides a kind of electronics and sets It is standby, including memory, processor, computer program is stored on the memory, the processor is executing the memory On computer program when realize above-mentioned method.
Based on inventive concept identical with above-mentioned image processing method, four embodiment of the invention provides a kind of storage Jie Matter, is stored with computer program, and the computer program realizes above-mentioned method when being executed by processor.
Above embodiments are only exemplary embodiment of the present invention, are not used in the limitation present invention, protection scope of the present invention It is defined by the claims.Those skilled in the art can within the spirit and scope of the present invention make respectively the present invention Kind modification or equivalent replacement, this modification or equivalent replacement also should be regarded as being within the scope of the present invention.

Claims (10)

1. a kind of image processing method, comprising:
To original image processing, the first image is obtained, the data volume of the first image is less than the original image;
Enhancing processing is carried out to the first image, obtains the first enhancing image;
The first weight matrix is obtained based on the first image and the first enhancing image;
By the size adjusting of first weight matrix at the size same or similar in size with the original image, is obtained Two weight matrix;
Target image is generated based on the original image and second weight matrix, to realize the increasing to the original image By force.
2. the method according to claim 1, wherein being carried out at enhancing using neural network to the first image Reason, obtains the first enhancing image.
3. the method according to claim 1, wherein described schemed based on the first image with first enhancing As obtaining the first weight matrix, comprising:
The image array of the first image and the image array of the first enhancing image are obtained respectively;
The image array of image array and the first enhancing image to the first image a little obtain described except operation First weight matrix.
4. the method according to claim 1, wherein the method is also wrapped before generating the target image It includes:
Second weight matrix is filtered, so that the weight distribution of second weight matrix is more smooth.
5. a kind of image processing apparatus, comprising:
Scaling processing module is configured to obtain the first image to original image processing, and the data volume of the first image is less than institute State original image;
Image enhancement module is configured to carry out enhancing processing to the first image, obtains the first enhancing image;
Weight matrix obtains module, is configured to the first image and the first enhancing image obtains the first weight square Battle array;
By the size adjusting of first weight matrix at the size same or similar in size with the original image, is obtained Two weight matrix;
Target image generation module, is configured to the original image and second weight matrix generates target image, with Realize the enhancing to the original image.
6. image processing apparatus according to claim 5, described image enhancing module is further configured to, using nerve net Network carries out enhancing processing to the first image, obtains the first enhancing image.
7. image processing apparatus according to claim 5, the weight matrix obtains module and is further configured to, and obtains respectively Take the image array of the first image and the image array of the first enhancing image;
The image array of image array and the first enhancing image to the first image a little obtain described except operation First weight matrix.
8. image processing apparatus according to claim 5, described device further includes filter module, is configured to, and is being generated Before the target image, second weight matrix is filtered, so that the weight of second weight matrix point Cloth is more smooth.
9. a kind of electronic equipment, including memory, processor, computer program is stored on the memory, which is characterized in that The processor is realized according to any one of claims 1 to 4 when executing the computer program on the memory Method.
10. a kind of storage medium, is stored with computer program, which is characterized in that when the computer program is executed by processor Realize method according to any one of claims 1 to 4.
CN201910239102.1A 2019-03-27 2019-03-27 Image processing method and device, electronic device and storage medium Active CN110009563B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910239102.1A CN110009563B (en) 2019-03-27 2019-03-27 Image processing method and device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910239102.1A CN110009563B (en) 2019-03-27 2019-03-27 Image processing method and device, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN110009563A true CN110009563A (en) 2019-07-12
CN110009563B CN110009563B (en) 2021-02-19

Family

ID=67168517

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910239102.1A Active CN110009563B (en) 2019-03-27 2019-03-27 Image processing method and device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN110009563B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022027197A1 (en) * 2020-08-03 2022-02-10 SZ DJI Technology Co., Ltd. Systems and methods for processing image

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060232823A1 (en) * 2005-04-13 2006-10-19 Hooper David S Image contrast enhancement
CN102622732A (en) * 2012-03-14 2012-08-01 上海大学 Front-scan sonar image splicing method
CN103345732A (en) * 2013-07-26 2013-10-09 电子科技大学 Pulse coupled neural network (PCNN) image enhancement algorithm and device based on Contourlet transformation

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060232823A1 (en) * 2005-04-13 2006-10-19 Hooper David S Image contrast enhancement
CN102622732A (en) * 2012-03-14 2012-08-01 上海大学 Front-scan sonar image splicing method
CN103345732A (en) * 2013-07-26 2013-10-09 电子科技大学 Pulse coupled neural network (PCNN) image enhancement algorithm and device based on Contourlet transformation

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022027197A1 (en) * 2020-08-03 2022-02-10 SZ DJI Technology Co., Ltd. Systems and methods for processing image

Also Published As

Publication number Publication date
CN110009563B (en) 2021-02-19

Similar Documents

Publication Publication Date Title
Klatzer et al. Learning joint demosaicing and denoising based on sequential energy minimization
Delbracio et al. Mobile computational photography: A tour
CN108604369B (en) Method, device and equipment for removing image noise and convolutional neural network
CN104376542B (en) A kind of image enchancing method
Ren et al. Single image super-resolution via adaptive high-dimensional non-local total variation and adaptive geometric feature
CN109255769A (en) The training method and training pattern and image enchancing method of image enhancement network
US7983511B1 (en) Methods and apparatus for noise reduction in digital images
CN108765343A (en) Method, apparatus, terminal and the computer readable storage medium of image procossing
CN109544482A (en) A kind of convolutional neural networks model generating method and image enchancing method
CN110059815B (en) Artificial intelligence reasoning computing equipment
KR102606824B1 (en) Apparatus comprising multi-camera and image processing method thereof
KR102095443B1 (en) Method and Apparatus for Enhancing Image using Structural Tensor Based on Deep Learning
RU2697928C1 (en) Superresolution of an image imitating high detail based on an optical system, performed on a mobile device having limited resources, and a mobile device which implements
CN105389776B (en) Image scaling techniques
CN113822830A (en) Multi-exposure image fusion method based on depth perception enhancement
Nam et al. Modelling the scene dependent imaging in cameras with a deep neural network
CN106162131B (en) A kind of real time image processing
CN113781318A (en) Image color mapping method and device, terminal equipment and storage medium
CN109118436A (en) Picture tone adaptation method and corresponding electronic equipment and storage medium
Hsieh et al. Variational contrast-saturation enhancement model for effective single image dehazing
CN110009563A (en) Image processing method and device, electronic equipment and storage medium
CN111951171A (en) HDR image generation method and device, readable storage medium and terminal equipment
CN105590294B (en) A kind of image processing method and electronic equipment
Du et al. Low-light image enhancement and denoising via dual-constrained Retinex model
US9619864B2 (en) Image processing apparatus and method for increasing sharpness of images

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