Image resolution ratio method of adjustment and device
Technical field
The invention belongs to technical field of image processing more particularly to a kind of image resolution ratio method of adjustment and devices.
Background technology
In the prior art, the resolution ratio of the camera on intelligent terminal is preset point of captured photo out
Resolution is also fixed.In practical application, user would generally select maximum resolution ratio to take pictures, to obtain clarity maximum
Photo.
However, in the case of insufficient light, camera shoots the photo come there are larger noise, causes its resolving power
Deficiency, resolving power refer to the ability for differentiating the original details that is taken.If the resolution ratio of the photo is very big, the correspondingly photo
The memory space needed is also big, if resolving power is insufficient, image quality fails to reach the due readability of the resolution ratio, causes instead
The waste of memory space.Further, image is during network sharing, and the prior art is mainly by compressing the resolution ratio of image
Reduce the size of image, however existing resolution compression technology is mainly to be realized by way of sampling, resolution ratio
The clarity and resolving power of compressed image are substantially reduced.
The content of the invention
In consideration of it, the embodiment of the present invention provides a kind of image resolution ratio method of adjustment and device, to keep photo solution picture
The resolution ratio of photo is compressed in the case that power is constant, reduces the memory space of photo, and promotes the quality of photo.
In a first aspect, a kind of image resolution ratio method of adjustment is provided, the described method includes:
Obtain the ISO photosensitive values of pending image;
The resolving power of the pending image is obtained according to the ISO photosensitive values;
The resolution ratio of the pending image is compressed according to the resolving power.
Further, the resolution ratio that the pending image is compressed according to the resolving power includes:
Resolution ratio corresponding with the resolving power is obtained according to the resolving power;
It is resolution ratio corresponding with the resolving power by the current resolution compression of the pending image.
Further, the resolution compression that the pending image is current is resolution corresponding with the resolving power
Rate is specially:
It is a pixel by every n potting gum in pending image;
Wherein, the n is odd number, and the color value of the pixel after merging is the average value of the color value of the n pixel.
Further, the n pixel is the pixel in n pixel of continuous adjacent or k × k fields, wherein n=k
×k。
Further, before resolution ratio corresponding with the resolving power is obtained according to the resolving power, the method is also
Including:
The correspondence between resolving power and resolution ratio is established, and stores the correspondence.
Second aspect, provides a kind of image resolution ratio adjusting apparatus, and described device includes:
First acquisition module, for obtaining the corresponding ISO photosensitive values of pending image;
Second acquisition module, for obtaining the resolving power of the pending image according to the ISO photosensitive values;
Compression module, for compressing the resolution ratio of the pending image according to the resolving power.
Further, the compression module includes:
Acquiring unit, for obtaining resolution ratio corresponding with the resolving power according to the resolving power;
Compression unit, for being resolution corresponding with the resolving power by the current resolution compression of the pending image
Rate.
Further, the compression unit is specifically used for:
It is a pixel by every n potting gum in pending image;
Wherein, the n is odd number, and the color value of the pixel after merging is the average value of the color value of the n pixel.
Further, the n pixel is the pixel in n pixel of continuous adjacent or k × k fields, wherein n=k
×k。
Further, described device further includes:
Memory module for establishing the correspondence between resolving power and resolution ratio, and stores the correspondence.
Compared with prior art, the embodiment of the present invention is by obtaining the ISO photosensitive values of pending image;According to the ISO
Photosensitive value obtains the resolving power of the pending image;Then the resolution of the pending image is compressed according to the resolving power
Rate;It is achieved thereby that dynamic adjusts the resolution ratio of photo, photograph is efficiently reduced in the case where keeping the original resolving power of photo
The memory space of piece, and improve the quality of photo.
Description of the drawings
It in order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention, for those of ordinary skill in the art, without having to pay creative labor, may be used also
To obtain other attached drawings according to these attached drawings.
Fig. 1 is the first realization flow chart of the image resolution ratio method of adjustment that the embodiment of the present invention one provides;
Fig. 2 is the specific implementation flow of step S103 in image resolution ratio method of adjustment provided by Embodiment 2 of the present invention
Figure;
Fig. 3 is the composition structure chart for the image resolution ratio adjusting apparatus that the embodiment of the present invention three provides.
Specific embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, with reference to the accompanying drawings and embodiments, it is right
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.
The embodiment of the present invention is by obtaining the ISO photosensitive values of pending image;It is treated according to obtaining the ISO photosensitive values
Handle the resolving power of image;Then the resolution ratio of the pending image is compressed according to the resolving power;It is achieved thereby that dynamic
The resolution ratio of photo is adjusted, the memory space of photo is efficiently reduced in the case where keeping the original resolving power of photo, and carries
The quality of photo is risen.The embodiment of the present invention additionally provides corresponding device, is described in detail individually below.
Embodiment one
Fig. 1 shows that the first of the image resolution ratio method of adjustment that the embodiment of the present invention one provides realizes flow, in order to just
In explanation, illustrate only and the relevant part of the embodiment of the present invention.
In embodiments of the present invention, the method is applied to smart machine.The smart machine includes but not limited to move
Phone, pocket computer (Pocket personal Computer, PPC), palm PC, personal digital assistant (Personal
Digital Assistant, PDA), smart camera, intelligent camera etc., be preferably smart mobile phone, tablet computer.The intelligence
Camera is provided in equipment, possesses the function of taking pictures.
As shown in Figure 1, the described method includes:
In step S101, the ISO photosensitive values of pending image are obtained.
Illustratively, after smart machine is shot by camera, the photo conduct captured by camera is obtained
Pending image;Certainly, the pending image or any one photo being stored in the photograph album of smart machine.It obtains
Take the ISO photosensitive values of the pending image.Wherein, the ISO photosensitive values refer to the sensitive journey that camera negative reacts light
Spend measured value.In general, photosensitive value is higher, the particle of egative film is thicker, and amplified effect is poor, and digital camera generally also covers
Used light exposure is indicated with ISO photosensitive values.Therefore, the ISO photosensitive values are reflected when shooting the pending image
Ambient light illumination.
In step s 102, the resolving power of the pending image is obtained according to the ISO photosensitive values.
In embodiments of the present invention, the resolving power refers to the ability for differentiating the original details that is taken, i.e., each on image
The sharp-edged degree of thin portion.When being taken pictures, ISO photosensitive values are smaller, and the noise for the photo taken is relatively smaller;And
ISO photosensitive values are bigger, and the noise for the photo taken is relatively bigger.Noise is bigger, and image detail is largely submerged in noise,
The details that image can be shown is less and image is fuzzyyer.As it can be seen that the ISO photosensitive values of image are bigger, the resolving power of described image
It is poorer;Correspondingly, the ISO photosensitive values of image are smaller, and the resolving power of described image is better.Therefore, root of the embodiment of the present invention
The factors such as size, ambient light illumination according to different camera apertures, pre-established the ISO photosensitive values of the camera and resolving power it
Between correspondence, and store the correspondence.After the ISO photosensitive values of pending image are got, wait to locate by analyzing
The ISO photosensitive values of image and the correspondence are managed, obtains the resolving power of the pending image.
In step s 103, the resolution ratio of the pending image is compressed according to the resolving power.
The resolution ratio of image has reacted the clarity of image, if resolving power deficiency resolution ratio is high again, image is also or mould
Paste.The embodiment of the present invention pre-establishes understanding according to the resolution ratio of different camera lenses, the factors such as total quality of different cameras
Correspondence between image force and resolution ratio.It is default according to this after the resolving power of present image is got by step S102
Correspondence, search corresponding with resolving power resolution ratio, and be by the current resolution compression of the pending image
Resolution ratio corresponding with the resolving power.Wherein, the compression refers to image size conversion (i.e. Resize), by multiple pixels
Merge a pixel, so as in the case where ensureing that pending image resolving power is constant, effectively reduce pending image
Resolution ratio, reduce the memory space of pending image.
The embodiment of the present invention is by obtaining the ISO photosensitive values of pending image;It is treated according to obtaining the ISO photosensitive values
Handle the resolving power of image;Then the resolution ratio of the pending image is compressed according to the resolving power;It is achieved thereby that dynamic
The resolution ratio of photo is adjusted, the memory space of photo is efficiently reduced in the case where keeping the original resolving power of photo, and carries
The quality of photo has been risen, has been conducive to save the memory space of equipment.
Embodiment two
Fig. 2 shows the specific implementation stream of step S103 in image quality adjustment method provided by Embodiment 2 of the present invention
Journey for convenience of description, illustrates only and the relevant part of the embodiment of the present invention.
As shown in Fig. 2, step S103 includes:
In step s 201, resolution ratio corresponding with the resolving power is obtained according to the resolving power.
It is resolution corresponding with the resolving power by the current resolution compression of the pending image in step S202
Rate.
In embodiments of the present invention, since mainly random noise, random noise to scheme present in pending image
The illumination of picture and the intensity of color fluctuate above and below actual image intensity.The embodiment of the present invention is being compressed the same of resolution ratio
When remove the random noise.Therefore, the step S202 is specially:It is one by every n potting gum in pending image
A pixel;Wherein, the n is odd number, and the color value of the pixel after merging is the average value of the color value of the n pixel.It is excellent
Selection of land, the n pixel are the pixel in n pixel of continuous adjacent or k × k fields, wherein n=k × k.
In embodiments of the present invention, noise is bigger, and the value of the n is relatively bigger, with specific reference to the solution picture of present image
Power (or noise size) determines.But the too conference of n values causes the image after resolution adjustment to obscure, therefore, the value of n is not yet
It can be too big.
The embodiment of the present invention pre-establishes understanding according to the quality of different camera lenses, the factors such as total quality of different cameral
Correspondence between image force and resolution ratio.After the resolving power of present image is got, according to the default correspondence,
Resolution ratio corresponding with the resolving power is searched, then according to the resolution ratio, will be closed in the pending image per n pixel
And for a pixel, using by the resolution compression of pending image as resolution ratio corresponding with the resolving power;And after compressing
Image in each pixel color value for the color value of n pixel described in pending image average value;Ensureing to treat
(the details readability of the image i.e. after resolution compression and former pending image phase in the case that processing image resolving power is constant
Together), reduce the resolution ratio of pending image, delete redundant sub-pixels present in pending image, effectively reduce and treat
Handle the memory space of image;And the noise in image has been filtered out, improve the quality of the image after resolution adjustment so that
The size and noise situations that the photo come is shot under any scene are all well controlled.
Embodiment three
Fig. 3 is the composition structure for the image resolution ratio adjusting apparatus that the embodiment of the present invention three provides, for convenience of description, only
Show part related to the present invention.
In embodiments of the present invention, described device is used to implement the image resolution ratio adjustment side described in Fig. 1 or Fig. 2 embodiments
Method can be the unit for being built in the software unit of smart machine, hardware cell or software and hardware combining.The smart machine bag
It includes but is not limited to mobile phone, pocket computer (Pocket personal Computer, PPC), palm PC, individual digital
Assistant (Personal Digital Assistant, PDA), smart camera, intelligent camera etc. are preferably smart mobile phone, flat
Plate computer.The smart machine is provided with camera.
As shown in figure 3, described device includes:
First acquisition module 31, for obtaining the ISO photosensitive values of pending image.
Second acquisition module 32, for obtaining the resolving power of the pending image according to the ISO photosensitive values.
Compression module 33, for compressing the resolution ratio of the pending image according to the resolving power.
Further, the embodiment of the present invention is according to the quality of different camera lenses, the factors such as total quality of different cameral, in advance
Establish the correspondence between resolving power and resolution ratio.Described device further includes:
Memory module 34 for establishing the correspondence between resolving power and resolution ratio, and stores the correspondence.
Further, the compression module 33 includes:
Acquiring unit 331, for obtaining resolution ratio corresponding with the resolving power according to the resolving power;
Compression unit 332, for being corresponding with the resolving power by the current resolution compression of the pending image
Resolution ratio.
Wherein, the compression unit 332 is specifically used for:
It is a pixel by every n potting gum in pending image;
Wherein, the n is odd number, and the color value of the pixel after merging is the average value of the color value of the n pixel.It is excellent
Selection of land, the n pixel are the pixel in n pixel of continuous adjacent or k × k fields, wherein n=k × k.
The embodiment of the present invention by one pixel of multiple potting gums in pending image by compressing pending image
Resolution ratio, and in compressed image each pixel color value for multiple pixels described in pending image color value
Average value;(the clear journey of details of the image i.e. after resolution adjustment in the case where ensureing that pending image resolving power is constant
Degree is identical with former pending image), reduce the resolution ratio of pending image, delete redundancy present in former pending image
Pixel effectively reduces the memory space of pending image;And the noise in image has been filtered out, after improving resolution compression
Image quality.
Further, the memory module 34 is additionally operable to:
The correspondence between ISO photosensitive values and resolving power is established, and stores the correspondence.
It should be noted that the device in the embodiment of the present invention can be used to implement whole skills in above method embodiment
Art scheme, the function of each function module can be implemented according to the method in above method embodiment, specific implementation
Process can refer to the associated description in above-described embodiment, and details are not described herein again.
The embodiment of the present invention is by obtaining the ISO photosensitive values of pending image;It is treated according to ISO photosensitive values analysis
Handle the resolving power of image;Then the resolution ratio to the pending image is compressed according to the resolving power;It is it is achieved thereby that dynamic
State adjusts the resolution ratio of photo, and the memory space of photo is efficiently reduced in the case where keeping the original resolving power of photo, and
The quality of photo is improved, is conducive to save the memory space of equipment.
Those of ordinary skill in the art may realize that each exemplary lists described with reference to the embodiments described herein
Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually
It is performed with hardware or software mode, specific application and design constraint depending on technical solution.Professional technician
Described function can be realized using distinct methods to each specific application, but this realization is it is not considered that exceed
The scope of the present invention.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description,
The specific work process of device and unit may be referred to the corresponding process in preceding method embodiment, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed apparatus and method can pass through it
Its mode is realized.For example, the apparatus embodiments described above are merely exemplary, for example, the division of the unit, only
Only a kind of division of logic function can have other dividing mode in actual implementation, such as multiple units or component can be tied
It closes or is desirably integrated into another system or some features can be ignored or does not perform.It is another, it is shown or discussed
Mutual coupling, direct-coupling or communication connection can be the INDIRECT COUPLING or logical by some interfaces, device or unit
Letter connection can be electrical, machinery or other forms.
The unit illustrated as separating component may or may not be physically separate, be shown as unit
The component shown may or may not be physical location, you can be located at a place or can also be distributed to multiple
In network element.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs
's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also
That unit is individually physically present, can also two or more units integrate in a unit.
If the function is realized in the form of SFU software functional unit and is independent production marketing or in use, can be with
It is stored in a computer read/write memory medium.Based on such understanding, technical scheme is substantially in other words
The part contribute to the prior art or the part of the technical solution can be embodied in the form of software product, the meter
Calculation machine software product is stored in a storage medium, is used including some instructions so that a computer equipment (can be
People's computer, server or network equipment etc.) perform all or part of the steps of the method according to each embodiment of the present invention.
And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited
The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic disc or CD.
The above description is merely a specific embodiment, but protection scope of the present invention is not limited thereto, any
Those familiar with the art in the technical scope disclosed by the present invention, can readily occur in change or replacement, should all contain
Lid is within protection scope of the present invention.Therefore, protection scope of the present invention described should be subject to the protection scope in claims.