The content of the invention
In view of above-mentioned the deficiencies in the prior art, it is an object of the invention to provide a kind of image based on small image memory to put
Big processing method and system, it is intended to solve high as number camera is carrying out image enhanced processing when institute in mobile phone in the prior art
Need the problem of internal memory is big, cost of manufacture is high.
Technical scheme is as follows:
A kind of image enlargement processing method based on small image memory, wherein, methods described includes:
A, the resolution ratio W0*H0 of the image amplified needed for mobile terminal is obtained, and obtains image memory in mobile terminal
Size R0*G0;
B, compare W0*H0 and R0*G0 size, as W0≤R0 and H0≤G0, perform step C;As W0≤R0 and H0 >
During G0, step D is performed;As W0 > R0 and H0≤G0, step E is performed;As W0 > R0 and H0 > G0, step F is performed;
C, the view data of described image is put into image memory and is amplified processing, perform step P;
D, described image is divided into the subgraph that several resolution ratio are W0*H1, and successively by the picture number of subgraph
Processing is amplified according to being put into image memory, the image being then spliced into after amplification simultaneously performs step P;The number of its neutron image
Amount is determined by H0 and G0;
E, described image is divided into the subgraph that several resolution ratio are W1*H0, and successively by the picture number of subgraph
Processing is amplified according to being put into image memory, the image being then spliced into after amplification simultaneously performs step P;The number of its neutron image
Amount is determined by W0 and R0;
F, described image is divided into the subgraph that several resolution ratio are W1*H1, and successively by the picture number of subgraph
Processing is amplified according to being put into image memory, the image being then spliced into after amplification simultaneously performs step P;Wherein sub-image data
Quantity determined by H0, G0, W0 and R0;
P, the image of amplification is shown.
The described image enlargement processing method based on small image memory, wherein, in the step D, when H0/G0 is integer
When, described image is divided into the equal subgraph of H0/G0 block sizes;When H0/G0 is not integer, described image is divided into
The equal subgraph of 1+ [H0/G0] block size, wherein [] represents rounding operation.
The described image enlargement processing method based on small image memory, wherein, in the step E, when W0/R0 is integer
When, described image is divided into the equal subgraph of W0/R0 block sizes;When W0/R0 is not integer, described image is divided into
The equal subgraph of 1+ [W0/R0] block size, wherein [] represents rounding operation.
The described image enlargement processing method based on small image memory, wherein, in the step F, as H0/G0 and W0/
When R0 is integer, described image is divided into(H0/G0)*(W0/R0)The equal subgraph of block size;As H0/G0 and W0/R0
When not being integer, described image is divided into(1+[H0/G0])*(1+[W0/R0])The equal subgraph of block size;Work as H0/
When G0 is integer and W0/R0 is not integer, image is divided into(H0/G0)*(1+[W0/R0])The equal subgraph of block size;When
H0/G0 is not integer and when W0/R0 is integer, and image is divided into(1+[H0/G0])*(W0/R0)The equal subgraph of block size,
Wherein [] represents rounding operation.
A kind of image enhanced processing system based on small image memory, wherein, the system includes:
Data obtaining module, for obtaining the resolution ratio W0*H0 of the image amplified needed for mobile terminal, and obtain movement
The size R0*G0 of image memory in terminal;
Comparison module, for comparing W0*H0 and R0*G0 size, as W0≤R0 and H0≤G0, perform the first amplification mould
Block;As W0≤R0 and H0 > G0, the second amplification module is performed;As W0 > R0 and H0≤G0, the 3rd amplification module is performed;When
W0 > R0 and during H0 > G0, perform the 4th amplification module;
First amplification module, processing is amplified for the view data of described image to be put into image memory;
Second amplification module, for described image to be divided into the subgraph that several resolution ratio are W0*H1, and successively will
The view data of subgraph, which is put into image memory, is amplified processing, the image being then spliced into after amplification;Its neutron image
Quantity determined by H0 and G0;
3rd amplification module, for described image to be divided into the subgraph that several resolution ratio are W1*H0, and successively will
The view data of subgraph, which is put into image memory, is amplified processing, the image being then spliced into after amplification;Its neutron image
Quantity determined by W0 and R0;
4th amplification module, for described image to be divided into the subgraph that several resolution ratio are W1*H1, and successively will
The view data of subgraph, which is put into image memory, is amplified processing, the image being then spliced into after amplification;Its neutron image
The quantity of data is determined by H0, G0, W0 and R0;
Display module, for being shown to the image of amplification.
The described image enhanced processing system based on small image memory, wherein, in second amplification module, work as H0/
When G0 is integer, described image is divided into the equal subgraph of H0/G0 block sizes;When H0/G0 is not integer, by the figure
As being divided into the equal subgraph of 1+ [H0/G0] block size, wherein [] represents rounding operation.
The described image enhanced processing system based on small image memory, wherein, in the 3rd amplification module, work as W0/
When R0 is integer, described image is divided into the equal subgraph of W0/R0 block sizes;When W0/R0 is not integer, by the figure
As being divided into the equal subgraph of 1+ [W0/R0] block size, wherein [] represents rounding operation
The described image enhanced processing system based on small image memory, wherein, in the 4th amplification module, work as H0/
When G0 and W0/R0 is integer, described image is divided into(H0/G0)*(W0/R0)The equal subgraph of block size;Work as H0/G0
When not being integer with W0/R0, described image is divided into(1+[H0/G0])*(1+[W0/R0])The equal subgraph of block size
Picture;When H0/G0 is integer and W0/R0 is not integer, image is divided into(H0/G0)*(1+[W0/R0])The equal son of block size
Image;When H0/G0 is not integer and W0/R0 is integer, image is divided into(1+[H0/G0])*(W0/R0)Block size is equal
Subgraph, wherein [] represents rounding operation.
Beneficial effect:By a kind of image enlargement processing method and system based on small image memory of the present invention,
The higher image of resolution ratio can be caused to remain to effectively amplify in smaller space internal memory, reduce pixel to image memory size
It is required that internal memory required when effective height solved in mobile phone in the prior art is as number camera enlarged drawing is big, cost of manufacture is high
The problem of.
Embodiment
The present invention provides a kind of image enlargement processing method and system based on small image memory, to make the mesh of the present invention
, technical scheme and effect it is clearer, clear and definite, the present invention is described in more detail below.It is it should be appreciated that described herein
Specific embodiment only to explain the present invention, be not intended to limit the present invention.
Fig. 1 is referred to, Fig. 1 is the image enlargement processing method flow based on small image memory in present pre-ferred embodiments
Figure, as shown in figure 1, its step includes:
S100, the resolution ratio W0*H0 for obtaining the image amplified needed for mobile terminal, and obtain in mobile terminal in image
The size R0*G0 deposited;
S200, the size for comparing W0*H0 and R0*G0, as W0≤R0 and H0≤G0, perform step S300;As W0≤R0
And during H0 > G0, perform step S400;As W0 > R0 and H0≤G0, step S500 is performed;As W0 > R0 and H0 > G0, hold
Row step S600;
S300, the view data of described image is put into image memory to be amplified handles and show;
S400, described image is divided into the subgraph that several resolution ratio are W0*H1, and successively by the image of subgraph
Data, which are put into image memory, is amplified processing, the image being then spliced into after amplification and display;The quantity of its neutron image
Determined by H0 and G0;
S500, described image is divided into the subgraph that several resolution ratio are W1*H0, and successively by the image of subgraph
Data, which are put into image memory, is amplified processing, the image being then spliced into after amplification and display;The quantity of its neutron image
Determined by W0 and R0;
S600, described image is divided into the subgraph that several resolution ratio are W1*H1, and successively by the image of subgraph
Data, which are put into image memory, is amplified processing, the image being then spliced into after amplification and display;Wherein sub-image data
Quantity is determined by H0, G0, W0 and R0.
Specifically, by the resolution ratio W0*H0 of the image amplified needed for mobile terminal and the size R0*G0 of image memory
It is compared, i.e., can be directly by image when the image resolution ratio of required amplification is less than image memory as W0≤R0 and H0≤G0
View data be put into image memory be amplified handle and directly display, its is same as the prior art, therefore repeats no more.
And as W0≤R0 and H0 > G0, then perform step S400;Described image is divided into several resolution ratio is
W0*H1 subgraph, and the view data of subgraph is put into image memory is amplified processing successively, then it is spliced into and puts
Image and display after big;The quantity of its neutron image is determined by H0 and G0.Specifically, as W0≤R0 and H0 > G0, then
H0 is divided into several equal-sized H1, and W0≤R0 need not be split because can directly put in image memory to W0,
And by the resolution ratio being divided into be W0*H1 subgraph view data be sequentially placed into image memory be amplified processing and by
Sequential concatenation is shown.
As W0 > R0 and H0≤G0, then step S500 is performed;It is W1* that described image is divided into several resolution ratio
H0 subgraph, and the view data of subgraph is put into image memory is amplified processing successively, then it is spliced into amplification
Image afterwards and display;The quantity of its neutron image is determined by W0 and R0.Specifically, as W0 > R0 and H0≤G0, then will
W0 is divided into several equal-sized W1, and H0≤G0 need not be split because can directly put in image memory to H0, and
The view data for the subgraph that the resolution ratio being divided into is W1*H0 is sequentially placed into image memory and is amplified processing and by suitable
Sequence splicing is shown.
As W0 > R0 and H0 > G0, then step S600 is performed;It is W1* that described image is divided into several resolution ratio
H1 subgraph, and the view data of subgraph is put into image memory is amplified processing successively, then it is spliced into amplification
Image afterwards and display;The quantity of wherein sub-image data is determined by H0, G0, W0 and R0.Specifically, as W0 > R0 and H0 >
During G0, then it is divided into several equal-sized H1, W0 to be divided into several equal-sized W1, and point that will be divided into H0
Resolution is that the view data of W1*H1 subgraph is sequentially placed into image memory, is amplified and handles and splice in order progress
Display.
A kind of image enlargement processing method based on small image memory described in the embodiment of the present invention, it is that use will be schemed
As being split, it is divided into equal-sized some pieces of subgraphs, is amplified processing successively respectively, then by the subgraph after amplification
Splice in order and shown.By segmentation figure of the present invention as and amplify splice method shown in carrying out again respectively, can
Image resolution ratio should be not less than effectively to solve image memory needed for prior art, so as to cause the enlarged drawing in mobile terminal
The problem of required image memory is big during piece, cost of manufacture is high.
Preferably, refer to Fig. 2, in the step S400, when H0/G0 is integer, described image is divided into H0/G0
The equal subgraph of block size, now, H1=G0;When H0/G0 is not integer, described image is divided into 1+ [H0/G0] block
Equal-sized subgraph, now, H1=H0/ (1+ [H0/G0]), wherein [] represents rounding operation.For example, when required amplification
The resolution ratio W0*H0 of image is 300*900, and when the size R0*G0 of image memory is 300*300 in mobile terminal, now H0/
G0 is integer 3, i.e., by image be divided into 3 pieces of pixels be 300*300 subgraph, as shown in Fig. 2 and be denoted as A, B, C, first
Subgraph A is put into the image being amplified in image memory after being amplified, then subgraph B is put into image memory and carried out
Amplify the image after being amplified, subgraph C is finally put into the image being amplified in image memory after being amplified, then
Image after 3 pieces of amplifications is spliced successively, obtains the image of required amplification.And for example, when required amplification image resolution ratio W0*
H0 is 300*900, and when the size R0*G0 of image memory is 300*200 in mobile terminal, now H0/G0 is not integer:4.5
The block number finally split is:1+ [H0/G0]=5 piece, so dividing the image into as the equal subgraph of 5 block sizes, now split
Subgraph its pixel be:W0*H1, wherein, H1=H0/ (1+ [H0/G0])=180.
Similarly, refer to Fig. 3, in the step S500, when W0/R0 is integer, described image is divided into W0/R0
The equal subgraph of block size, now, W1=R0;When W0/R0 is not integer, described image is divided into 1+ [W0/R0] block
Equal-sized subgraph, now W1=W0/ (1+ [W0/R0]), wherein [] represents rounding operation.For example, when required amplification
The resolution ratio W0*H0 of image is 900*300, and when the size R0*G0 of image memory is 300*300 in mobile terminal, now W0/
R0 is integer 3, i.e., image is divided into the subgraph that 3 pieces of pixels are 300*300, as shown in figure 3, and by being denoted as A, B, C,
Subgraph A is first put into the image being amplified in image memory after being amplified, then subgraph B is put into image memory
Row amplifies the image after being amplified, and subgraph C is finally put into the image being amplified in image memory after being amplified, so
The image after 3 pieces of amplifications is spliced successively afterwards, obtains the image of required amplification.And for example, when required amplification image resolution ratio
W0*H0 is 900*300, and when the size R0*G0 of image memory is 200*300 in mobile terminal, now W0/R0 is not integer:
4.5, the block number finally split is:1+ [W0/R0]=5 piece, so dividing the image into as the equal subgraph of 5 block sizes, now
Its pixel of the subgraph of segmentation is:W1*H0, wherein, W1=W0/ (1+ [W0/R0])=180.
Similarly, Fig. 4 is referred to, in the step S600, when H0/G0 and W0/R0 is integer, by described image point
It is segmented into(H0/G0)*(W0/R0)The equal subgraph of block size, now, W1=R0, H1=G0;When H0/G0 and W0/R0 be not to be whole
During number, described image is divided into(1+[H0/G0])*(1+[W0/R0])The equal subgraph of block size, now, W1=W0/ (1+
[W0/R0]), H1=H0/ (1+ [H0/G0]);When H0/G0 is integer and W0/R0 is not integer, image is divided into(H0/G0)*
(1+[W0/R0])The equal subgraph of block size, now, H1=G0, W1=W0/ (1+ [W0/R0]);When H0/G0 for integer and
When W0/R0 is integer, image is divided into(1+[H0/G0])*(W0/R0)The equal subgraph of block size, now, H1=H0/ (1+
[H0/G0]), W1=R0, wherein [] represents rounding operation.For example, when the resolution ratio W0*H0 of the image of required amplification is 400*
800, and when the size R0*G0 of image memory is 200*400 in mobile terminal, now H0/G0 is integer 2, and W0/R0 is integer 2,
Image is divided into 4 pieces of pixels and is 200*400 subgraph, as shown in figure 4, subgraph is designated as into A, B, C, D successively, first will
Subgraph A is put into the image being amplified in image memory after being amplified, then subgraph B is put into image memory and put
Subgraph C, is then put into the image being amplified in image memory after being amplified by the image after being amplified greatly, finally will
Subgraph D is put into the image being amplified in image memory after being amplified, and then splices the image after 4 pieces of amplifications successively,
The image of amplification needed for obtaining.And for example, when the resolution ratio W0*H0 of the image of required amplification is 900*900, and scheme in mobile terminal
When as the size R0*G0 of internal memory being 200*200, now W0/R0 is not integer:4.5, H0/G0 be not integer:4.5, i.e. 1+
[W0/R0]=5 piece, 1+ [H0/G0]=5 piece, so dividing the image into as 5*5=equal subgraph of 25 block sizes, now split
Subgraph its pixel be:W1*H1, wherein, W1=W0/ (1+ [W0/R0])=180, H1=H0/ (1+ [H0/G0])=180.
In addition, the present invention also provides a kind of image enhanced processing system based on small image memory, as shown in figure 5, it is wrapped
Include:
Data obtaining module 100, for obtaining the resolution ratio W0*H0 of the image amplified needed for mobile terminal, and obtain
The size R0*G0 of image memory in mobile terminal;
Comparison module 200, for comparing W0*H0 and R0*G0 size, as W0≤R0 and H0≤G0, perform first and put
Big module 300;As W0≤R0 and H0 > G0, the second amplification module 400 is performed;As W0 > R0 and H0≤G0, the 3rd is performed
Amplification module 500;As W0 > R0 and H0 > G0, the 4th amplification module 600 is performed;
First amplification module 300, processing is amplified for the view data of described image to be put into image memory;
Second amplification module 400, for by described image be divided into several resolution ratio be W0*H1 subgraph, and according to
The secondary view data of subgraph is put into image memory is amplified processing, the image being then spliced into after amplification and display;
The quantity of its neutron image is determined by H0 and G0;
3rd amplification module 500, for by described image be divided into several resolution ratio be W1*H0 subgraph, and according to
The secondary view data of subgraph is put into image memory is amplified processing, the image being then spliced into after amplification and display;
The quantity of its neutron image is determined by W0 and R0;
4th amplification module 600, for by described image be divided into several resolution ratio be W1*H1 subgraph, and according to
The secondary view data of subgraph is put into image memory is amplified processing, the image being then spliced into after amplification and display;
The quantity of wherein sub-image data is determined by H0, G0, W0 and R0;
Display module 700, for being shown to the image of amplification.
Preferably, in second amplification module 400, when H0/G0 is integer, described image is divided into H0/G0 blocks
Equal-sized subgraph;When H0/G0 is not integer, described image is divided into the equal subgraph of 1+ [H0/G0] block size
Picture, wherein [] represents rounding operation.
Similarly, in the 3rd amplification module 500, when W0/R0 is integer, described image is divided into W0/R0 blocks
Equal-sized subgraph;When W0/R0 is not integer, described image is divided into the equal subgraph of 1+ [W0/R0] block size
Picture, wherein [] represents rounding operation
Similarly, in the 4th amplification module 600, when H0/G0 and W0/R0 is integer, described image is split
For(H0/G0)*(W0/R0)The equal subgraph of block size;When H0/G0 and W0/R0 are not integer, described image is split
For(1+[H0/G0])*(1+[W0/R0])The equal subgraph of block size;When H0/G0 is integer and W0/R0 is not integer, figure
As being divided into(H0/G0)*(1+[W0/R0])The equal subgraph of block size;When H0/G0 is not integer and W0/R0 is integer,
Image is divided into(1+[H0/G0])*(W0/R0)The equal subgraph of block size, wherein [] represents rounding operation.
In summary, a kind of image enlargement processing method and system based on small image memory of the present invention, its elder generation
Judge image resolution ratio W0*H0 and image memory R0*G0 size, and according to the different choice of the two size different image point
Mode is cut, the larger image of pixel is split and amplified respectively, then the subgraph after amplification is spliced by former order,
So as to obtain the enlarged drawing of high pixel image processing in image memory hour, it can cause the higher pixel of resolution ratio in smaller space
Remain to effectively amplify when depositing, reduce requirement of the pixel to image memory size, effectively solve the high picture in mobile phone in the prior art
Number cameras the problem of required internal memory is big, cost of manufacture is high when image amplifies.
It should be appreciated that the application of the present invention is not limited to above-mentioned citing, for those of ordinary skills, can
To be improved or converted according to the above description, all these modifications and variations should all belong to the guarantor of appended claims of the present invention
Protect scope.