Summary of the invention
The technical problem to be solved in the present invention is, for the above-mentioned defect of prior art, and the Forecasting Methodology of photo files size and system when a kind of mobile terminal camera preview is provided.Just view data calculating can be carried out for the scene of preview opening when camera application carries out preview, again in conjunction with the photo files size that the Size calculation of taking pictures of user's choosing finally takes, photo size when it can predict preview, conveniently stores in time, provides users with the convenient.
The technical scheme that technical solution problem of the present invention adopts is as follows:
A Forecasting Methodology for photo files size during mobile terminal camera preview, wherein, comprising:
Frame image data when A, acquisition camera preview, carries out format compression to this frame image data and generates previewing photos;
B, obtain the previewing photos that generates, the size of described previewing photos file is calculated, the size calculating photo files of taking pictures is set according to the size of previewing photos file and photo size of taking pictures;
C, the size of the previewing photos file calculated is presented on screen, the prediction of photo files size when completing camera preview.
The Forecasting Methodology of photo files size during described mobile terminal camera preview, wherein, carries out compressed format to frame image data when obtaining camera preview in described steps A consistent with the compressed format being compressed into photo when taking pictures.
The Forecasting Methodology of photo files size during described mobile terminal camera preview, wherein, also comprised before described steps A:
The operational order of S, reception user opens camera-enabled, and when opening camera-enabled, shot timers starts.
The Forecasting Methodology of photo files size during described mobile terminal camera preview, wherein, described step B specifically comprises:
B1, store the corresponding relation array of a previewing photos file size and file size of taking a picture in advance in the terminal;
B2, to find in array corresponding photo files size of taking pictures according to previewing photos file size.
The Forecasting Methodology of photo files size during described mobile terminal camera preview, wherein, storing a previewing photos file size in described step B1 in advance in the terminal with the corresponding relation array of file size of taking a picture is preview [i] [j]
Described step B2 specifically comprises:
Step S501, temporary variable i is set, j, and all zero setting, perform step S502 afterwards;
Step S502, obtain take pictures photo size assignment that user selects in camera is arranged to j, execution step S503 afterwards;
Step S503, judge whether i is less than Imax, if it is perform step S504, otherwise perform step S509; Wherein Imax is the number of preview [] [] element;
Step S504, judge whether previewing photos file size is less than preview [i] [0], if it is perform step S506, otherwise perform step S505;
Step S505, i=i+1, perform step S503 afterwards;
Step S506, compare the size of (previewing photos file-preview [i-1] [0]) and (preview [i] [0]-previewing photos file), if the former is greater than latter perform step S508, otherwise perform step S507;
Step S507, prediction photo files size of taking pictures are preview [i-1] [j];
Step S508, prediction photo files size of taking pictures are preview [i] [j];
Step S509, exceed computer capacity, cannot calculate.
A prognoses system for photo files size during mobile terminal camera preview, wherein, comprising:
Obtain and compression processing module, for obtaining frame image data during camera preview, format compression being carried out to this frame image data and generates previewing photos;
Computing module, for obtaining generated previewing photos, calculates the size of described previewing photos file, arranges according to the size of previewing photos file and photo size of taking pictures the size calculating photo files of taking pictures;
Graphics Processing module, for the size of the previewing photos calculated file is presented at screen, the prediction of photo files size when completing camera preview.
The prognoses system of photo files size during described mobile terminal camera preview, wherein, it also comprises:
Open processing module, open camera-enabled for the operational order receiving user, when opening camera-enabled, shot timers starts.
The prognoses system of photo files size during described mobile terminal camera preview, wherein, described computing module comprises:
Pre-set unit, for storing a previewing photos file size in advance in the terminal and the corresponding relation array of file size of taking a picture;
Calculation processing unit, for finding photo files size of taking pictures corresponding in array according to previewing photos file size.
During described mobile terminal camera preview, the prognoses system of photo files size, is characterized in that, carries out compressed format consistent with the compressed format being compressed into photo when taking pictures to frame image data when obtaining camera preview.
The Forecasting Methodology of photo files size and system during a kind of mobile terminal camera preview provided by the present invention, just view data calculating can be carried out for the scene of preview opening when camera application carries out preview owing to have employed, again in conjunction with the photo files size that the Size calculation of taking pictures of user's choosing finally takes, the function of photo files size is predicted when it makes the terminal of band camera function have camera preview, when the photo data predicted is greater than memory space, prompting user deletes other data in time to store current taking pictures in time, provides users with the convenient.
Embodiment
For making object of the present invention, technical scheme and advantage clearly, clearly, developing simultaneously referring to accompanying drawing, the present invention is described in more detail for embodiment.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
The Forecasting Methodology of photo files size and system during a kind of mobile terminal camera preview provided by the present invention, just view data calculating can be carried out for the scene of preview opening when camera application carries out preview, then in conjunction with the photo files size that the Size calculation of taking pictures of user's choosing finally takes.
In the present invention, when using camera-enabled to carry out preview, first central processing unit is arranged camera, control the view data (for resolution 640*480 pixel) that camera exports the size needed for preview, camera just on a frame-by-frame basis exports the view data of 640*480, and central processing unit receives these view data and changes into the image data format that can show on a display screen and be shown on display screen.
And when using camera-enabled to take pictures, first central processing unit is arranged camera, control the view data (here for resolution 1600*1200 pixel) that camera exports required size of taking pictures, camera just on a frame-by-frame basis exports the view data of 1600*1200, and central processing unit receives a wherein frame image data being carried out and is compressed into picture and preserves in memory.Wherein compress selected form and in the mobile terminal such as mobile phone, camera, generally select jpeg format at present.
In the prior art, photo size needs to take just to be known afterwards, and one frame image data (640*480) is carried out JPEG and is compressed into photo by the Forecasting Methodology of photo files size when the invention provides a kind of mobile terminal camera preview when preview, then calculate the file size of this photo, then according to certain method (hereafter will describe in detail) calculate surely just taking photo (1600*1200) time photo files size.
Refer to Fig. 1, the flow chart of the preferred embodiment of the Forecasting Methodology of photo files size when Fig. 1 is mobile terminal camera preview of the present invention.As shown in Figure 1, the Forecasting Methodology of photo files size during described mobile terminal camera preview, comprises the following steps:
Frame image data when S100, acquisition camera preview, carries out format compression to this frame image data and generates previewing photos.
Such as, obtain frame image data during camera preview, X format compression is carried out to it and generates previewing photos; Wherein, in described step S100, complete and compression generation photo is carried out to view data during preview, wherein compressed format can be any, but need be consistent with compressed format when taking pictures, generally adopt JPEG compressed format when such as, taking pictures in the mobile terminal such as current camera, mobile phone, then also adopt JPEG compressed format to carry out compression to frame image data during preview in this step and generate photo.
S200, obtain the previewing photos that generates, the size of described previewing photos file is calculated, the size calculating photo files of taking pictures is set according to the size of previewing photos file and photo size of taking pictures.By calculating the photo files size finally taken to previewing photos file size.
Wherein, in described step S200, the method being calculated photo files size of taking pictures by previewing photos file size is, store a previewing photos file size in advance in the terminal and the corresponding relation array of file size of taking a picture, find photo files size of taking pictures corresponding in array according to previewing photos file size.It should be noted that previewing photos file size needs to carry out test when mobile terminal is produced with the corresponding relation of file size of taking a picture and obtains, and a kind of compressed format need there is one group of previewing photos file size and the corresponding relation of file size of taking a picture.
In the specific implementation, shown in figure 2, according to photo size option of taking pictures shown in Fig. 2, previewing photos file size corresponding array preview [] [] is as follows:
preview[ ][ ]={
/*{preview picture file size,1024*768 capture picture file size,1600*1200 capture picture file size,2048*1536 capture picture file size},*/
{0,0,0,0},/*when preview picture file size is 0*/
{10k,35k,50k,60k},/*when preview picture file size is 10k*/
{20k,37k,55k,62k},/*when preview picture file size is 20k*/
{30k,40k,56k,67k},/*when preview picture file size is 30k*/
……
}
Two-dimensional array preview [] [] in example, when previewing photos file size is 10k, if user selects photo size when taking pictures to be 1024*768, the photo files size taken is 35k, if user selects photo size when taking pictures to be 1600*1200, the photo files size taken is 50k, if user selects photo size when taking pictures to be 2048*1536, the photo files size taken is 60k.
Two-dimensional array preview [] [] in example, when previewing photos file size is 20k, if user selects photo size when taking pictures to be 1024*768, the photo files size taken is 37k, if user selects photo size when taking pictures to be 1600*1200, the photo files size taken is 55k, if user selects photo size when taking pictures to be 2048*1536, the photo files size taken is 62k;
Two-dimensional array preview [] [] in example, when previewing photos file size is 30k, if user selects photo size when taking pictures to be 1024*768, the photo files size taken is 40k, if user selects photo size when taking pictures to be 1600*1200, the photo files size taken is 56k, if user selects photo size when taking pictures to be 2048*1536, the photo files size taken is 67k;
Wherein, the element value definition that two-dimensional array preview [] [] in this example is inner is only explanation the present invention, during actual use, need to test one by one when producing, and the interval that previewing photos file size is got (being 10k in this example) also can define according to actual conditions.
S300, the size of the previewing photos file calculated is presented on screen, for reference; The prediction of photo files size when completing camera preview.
Be described in further details by the Forecasting Methodology of photo files size during a concrete Application Example mobile terminal camera preview of the present invention below:
As shown in Figure 3, be the embody rule embodiment flow chart of the Forecasting Methodology of photo files size during mobile terminal camera preview of the present invention.
Step S1, the shot timers TIMER startup when opening camera-enabled, perform step S2 afterwards.
Step S2, judge that whether timer TIMER is overtime, if it is perform step S3, otherwise continue to judge that whether timer TIMER is overtime.
Step S3, obtain a frame preview image data and be compressed into photo.Such as, obtain preview image data from camera, and be compressed into photo, perform step S4 afterwards.
The file size of step S4, acquisition previewing photos, performs step S5 afterwards.
Step S5, the size that calculates photo files of taking pictures is set and shows according to the size of previewing photos file and photo size of taking pictures.Such as greatly search corresponding array by photo files of taking pictures by previewing photos file size and user arranging the size of taking a picture selected in menu, calculate the photo files size showing of taking pictures.
Wherein, described step S2, timer TIMER perform a step S3 ~ step S5 at regular intervals, namely often how often upgrade the display about photo files size prediction of taking pictures on a display screen 200; The time-out time of timer TIMER can be fixing, also can be dynamic, such as by the motion of sensor senses mobile terminal, if motion of mobile terminals frequently, thinks that the view data obtained changes greatly, timer TIMER time-out time is arranged smaller value by this; If motion of mobile terminals is very little or static, think that the view data change obtained is less, timer TIMER time-out time is arranged higher value by this.
Wherein, described step S3, should become the compress mode of photo consistent the Image Data Compression got from camera with when taking pictures the compress mode being compressed into photo from camera acquisition preview image data;
Wherein, described step S5, as shown in Figure 4, specifically comprises the following steps:
Step S501, temporary variable i is set, j, and all zero setting, perform step S502 afterwards;
Step S502, obtain take pictures photo size assignment that user selects in camera is arranged to j, execution step S503 afterwards;
Step S503, judge whether i is less than Imax, if it is perform step S504, otherwise perform step S509;
Step S504, judge whether previewing photos file size is less than array preview [i] [0], if it is perform step S506, otherwise perform step S505;
Step S505, i=i+1, perform step S503 afterwards;
Step S506, compare the size of (previewing photos file-preview [i-1] [0]) and (preview [i] [0]-previewing photos file), if the former is greater than latter perform step S508, otherwise perform step S507;
Step S507, prediction photo files size of taking pictures are preview [i-1] [j];
Step S508, prediction photo files size of taking pictures are preview [i] [j];
Step S509, exceed computer capacity, cannot calculate.
Wherein, described step S502, according to photo size setting options of taking pictures shown in Fig. 2, if user's selection is taken pictures, photo size is 1024*768, j=1; If user's selection is taken pictures, photo size is 1600*1200, j=2; If user's selection is taken pictures, photo size is 2048*1536, j=3;
Wherein, described step S503, Imax are the number of preview [] [] element, and such as, for preview [] [] below, Imax is 6;
preview[ ][ ]={
/*{preview picture file size,1024*768 capture picture file size,1600*1200 capture picture file size,2048*1536 capture picture file size},*/
{0,0,0,0},
{10k,35k,50k,60k},
{20k,37k,55k,62k},
{30k,40k,56k,67k},
{40k,48k,59k,71k},
{50k,55k,64k,79k},
}。
Therefore, the Forecasting Methodology of photo files size when the invention provides a kind of mobile terminal camera preview.Just view data calculating can be carried out for the scene of preview opening when camera application carries out preview, again in conjunction with the photo files size that the Size calculation of taking pictures of user's choosing finally takes, photo size when it can predict preview, convenient storage in time, provide users with the convenient, there will not be the phenomenon that cannot store because of insufficient memory after taking pictures.
Based on above-described embodiment, the prognoses system of photo files size when present invention also offers a kind of mobile terminal camera preview, as shown in Figure 5, described system comprises:
Obtain and compression processing module 510, for obtaining frame image data during camera preview, format compression being carried out to this frame image data and generates previewing photos; Specifically as described in above-mentioned steps.
Computing module 520, for obtaining generated previewing photos, calculates the size of described previewing photos file, arranges according to the size of previewing photos file and photo size of taking pictures the size calculating photo files of taking pictures; Specifically as described in above-mentioned steps.
Graphics Processing module 530, for the size of the previewing photos calculated file is presented at screen, the prediction of photo files size when completing camera preview; Specifically as described in above-mentioned steps.
Further, the prognoses system of photo files size during described mobile terminal camera preview, as shown in Figure 5, it also comprises:
Open processing module 501, open camera-enabled for the operational order receiving user, when opening camera-enabled, shot timers starts; Specifically as described in above-mentioned steps.
Wherein, described computing module comprises:
Pre-set unit, for storing a previewing photos file size in advance in the terminal and the corresponding relation array of file size of taking a picture; Specifically as described in above-mentioned steps.
Calculation processing unit, for finding photo files size of taking pictures corresponding in array according to previewing photos file size; Specifically as described in above-mentioned steps.
The prognoses system of photo files size during described mobile terminal camera preview, wherein, carries out compressed format to frame image data when obtaining camera preview consistent with the compressed format being compressed into photo when taking pictures.
In sum, the Forecasting Methodology of photo files size and system during a kind of mobile terminal camera preview provided by the present invention, just view data calculating can be carried out for the scene of preview opening when camera application carries out preview owing to have employed, again in conjunction with the photo files size that the Size calculation of taking pictures of user's choosing finally takes, the function of photo files size is predicted when it makes the terminal of band camera function have camera preview, when the photo data predicted is greater than memory space, prompting user deletes other data in time to store current taking pictures in time, provide users with the convenient.
Should be understood that, application of the present invention is not limited to above-mentioned citing, for those of ordinary skills, can be improved according to the above description or convert, and all these improve and convert the protection range that all should belong to claims of the present invention.