CN100379249C - A method and apparatus for changing digital image size during process of shooting - Google Patents

A method and apparatus for changing digital image size during process of shooting Download PDF

Info

Publication number
CN100379249C
CN100379249C CNB2005100647347A CN200510064734A CN100379249C CN 100379249 C CN100379249 C CN 100379249C CN B2005100647347 A CNB2005100647347 A CN B2005100647347A CN 200510064734 A CN200510064734 A CN 200510064734A CN 100379249 C CN100379249 C CN 100379249C
Authority
CN
China
Prior art keywords
image
convergent
divergent
module
view data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CNB2005100647347A
Other languages
Chinese (zh)
Other versions
CN1665269A (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.)
GUANGDONG ZHONGXING ELECTRONICS Co Ltd
Original Assignee
Vimicro Corp
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 Vimicro Corp filed Critical Vimicro Corp
Priority to CNB2005100647347A priority Critical patent/CN100379249C/en
Publication of CN1665269A publication Critical patent/CN1665269A/en
Application granted granted Critical
Publication of CN100379249C publication Critical patent/CN100379249C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)

Abstract

The present invention discloses a method for changing the size of digital images during filming, which comprises the steps: configuring the input information and the filter factor information of images and the zoom multiple information of image display and image capturing; carrying out low pass filtering on images which need processing according to the filter factor information; zooming the size of image data which is after the process of low pass filtering transversely and vertically in two ways according to the zoom multiple information of image display and image capturing, and finishing zooming the size of the images transversely and vertically according to the input information of the images. The present invention also discloses a device for changing the size of digital images during filming. The present invention zooms the size of the image data transversely and vertically in two ways, meets the requirements for image display and image storage, reduces the time of image zoom, and realizes the real-time processing of the image data.

Description

A kind of method and device that in shooting process, changes digital image size
Technical field
The present invention relates to technical field of image processing, relate to a kind of method and device that in shooting process, changes digital image size or rather.
Background technology
Current, camera technique has entered the digital imagery epoch, and Sheng Hang roll film camera is progressively replaced by digital camera before.According to statistics, the shipment amount of digital camera in 2004 has reached up to ten million.Along with development of digital image, digital imagery is widely used in the electronic product of digital camera, Digital Video, mobile phone and computer camera and so on.
In digital imaging technology, how as required original image to be carried out size change over is a difficult problem all the time.This mainly be because: different processing modules is to the requirement difference of picture size, and these processing modules are often used same image source, this just needs the digital terminal equipment of digital camera and so on can go out the image of different size according to same image source conversion, and this conversion should be finished very fast.
Such as, the size of liquid crystal display screen generally can not surpass 1/4th video graphics arrays (QVGA) in the digital camera, the resolution of QVGA is 320 * 240, and the picture size of take pictures storage and printing is much bigger, general digital camera all has millions of pixels, special digital camera even can reach up to ten million pixels, but the shown image of liquid crystal display screen and the image of digital camera storage all derive from same data source, i.e. imageing sensor.Wherein, the extraneous light signal of imageing sensor handle changes into the signal of telecommunication, and further is converted into digital signal output from analog signal.
Therefore, how be converted to the image of the required different size of different output equipments according to same image source, all very big to performance, the cost impact of system.
At present, in the image processing of computer, the amplification of image or dwindle mostly by software and realize typically uses the secondary linear interpolation, cubic curve interpolation scheduling algorithm is handled, and software processes need take very many cpu resources, and is very high to the requirement of processing apparatus in the computer.Digital terminal equipment for digital camera, Digital Video and mobile phone and so on, because the function of CPU is not very powerful, concerning the processing of digital picture size change over, be nowhere near, therefore realize that by software video scaling is impossible basically, this just need solve the problem of image processing with hardware.
Because the digital terminal equipment of digital camera, Digital Video and mobile phone and so on is when carrying out the picture size conversion, to carry out convergent-divergent to the DID that imageing sensor sends according to the requirement of display screen on the one hand, in display screen, to show this image; On the other hand, after having chosen the object or scene that to take shooting person, leave in the memory with certain form according to the size that sets in advance, therefore, existing hardware solution generally all is the handling process that adopts Digital Image Processing chip shown in Figure 1 to be provided.
Specifically, this handling process comprises following several stages:
1, memory phase.At first will carry out preliminary treatment, such as interpolation, denoising, go bad point and filtering etc., and be stored in the external memory storage by memory control module according to the form of YUV422 from the view data of imageing sensor.This memory generally is volatile memory, such as being SRAM and SDRAM etc.
2, the demonstration stage.Before taking, image need be displayed on the screen, and observes and determine whether to need to carry out next step shooting work for photographer.In this stage, be stored in view data in the memory and be stored the device control module and read out, this image is carried out the amplification of appropriateness or dwindle through the display image Zoom module, and be presented on the liquid crystal display screen by the liquid crystal display control module.
3, photographing phase.Photographer is determining suitable view or object and is pressing soon behind the door, the next frame image of imageing sensor output will be stored in the memory, be read out again afterwards, process seizure image zoom module is amplified this image or is dwindled according to the resolution of prior setting, and carry out image compression by image compression module, compressed code flow leaves in the memory through memory control module.Because the image or the video flowing of photographing phase may be filed, memory that therefore should the stage should adopt non-volatility memorizer, and industry generally adopts the Flash memory at present.In addition, in the photographing phase, when image compression being stored, also need this image to be presented on the liquid crystal display screen by display image Zoom module and liquid crystal display control module by seizure image zoom module.
In above-mentioned solution, the image of imageing sensor output need be left in the outer memory of sheet by memory control module, and after a frame had been deposited, the Digital Image Processing chip just can read this frame image data and handle.And in processing procedure, the view data that imageing sensor outputs to the Digital Image Processing chip also will continue to leave in the memory.That is to say that this memory should be stored the data of two two field pictures at least.
This shows that present processing scheme has conspicuous shortcoming:
1, need to deposit two frame original images in the chip external memory, need canned data more, therefore need the chip external memory of big memory space, and present chip external memory is generally SDRAM, its cost is higher;
2, this scheme need be after a two field picture leaves memory in fully, and ability is amplified it or dwindled, so input picture and the bigger delay of output image existence, and this postpones can't accomplish real-time processing often greater than a frame time;
3, because present processing scheme can not realize real-time processing, some elementary errors of scene when therefore the image that photographs is often with shooting is other, and this difference is difficult for controlling.
Summary of the invention
In view of this, subject matter to be solved by this invention is to provide a kind of method that changes digital image size in shooting process, handles image is carried out real-time convergent-divergent, and can reduce the realization cost.
Another problem to be solved by this invention is to provide a kind of device that changes digital image size in shooting process.
A kind of method that in shooting process, changes digital image size of the present invention, the convergent-divergent multiple information of the input information of configuration image, filter factor information and image demonstration and picture catching, this method further may further comprise the steps:
A. according to filter factor information pending image is carried out low-pass filtering;
B. the view data of the convergent-divergent multiple information of convergent-divergent multiple information that shows according to image and picture catching after to low-pass filtering divides two-way to comprise respectively laterally and the processing of longitudinal size convergent-divergent, and according to the input information of image finish to image laterally and the longitudinal size convergent-divergent handle;
Among the described step b, if described convergent-divergent is treated to downscaled images, then described longitudinal size convergent-divergent is handled and is comprised: the previous row view data of working as previous row view data and storage is before calculated, and stored after calculating when the previous row view data;
If described convergent-divergent is treated to enlarged image, then described longitudinal size convergent-divergent is handled and is comprised: store continuous multirow view data, the multirow view data of storage is repeatedly calculated, and store the view data that receives when carrying out described calculating.
Among the described step b, describedly view data laterally reached the longitudinal size convergent-divergent be treated to:
Earlier view data is carried out the lateral dimension convergent-divergent and handle, preserve the view data after horizontal convergent-divergent is handled, the view data after more horizontal convergent-divergent being handled is afterwards carried out the longitudinal size convergent-divergent and is handled;
Perhaps be: the view data after the preservation low-pass filtering, view data to be carried out the longitudinal size convergent-divergent handle, the view data after again the longitudinal size convergent-divergent being handled is afterwards carried out the lateral dimension convergent-divergent and is handled.
A kind of device that in shooting process, changes digital image size of the present invention, described device is connected with host computer, and receive the view data that the image pretreatment module is sent, described host computer is used for the convergent-divergent multiple information of configuration image input information, low-pass filtering coefficient and image demonstration and picture catching, and described configuration information sent to described device, described device comprises with lower module:
The order sending module is used for the low-pass filtering coefficient of host computer configuration is sent to the pre-filtering module, and with the image demonstration of host computer transmission and the convergent-divergent multiple information of picture catching, and the image input information sends to the picture size Zoom module;
The pre-filtering module is used for carrying out low-pass filtering according to the view data that the low-pass filtering coefficient sends the image pretreatment module, and the view data after the low-pass filtering is sent to the picture size Zoom module;
The picture size Zoom module, be used for transmitting the next image demonstration and the convergent-divergent multiple information of picture catching according to the order sending module, divide two-way to comprise respectively laterally and the processing of longitudinal size convergent-divergent to the view data that the pre-filtering module is sent, and determine according to the image input information whether laterally reach vertical processing finishes;
Wherein, if described convergent-divergent is treated to downscaled images, then the picture size Zoom module calculates the previous row view data of storage before the previous row view data is with it, and the previous row view data is worked as in storage after calculating, and handles to realize the longitudinal size convergent-divergent;
If described convergent-divergent is treated to enlarged image, then the picture size Zoom module is stored continuous multirow view data, multirow view data to its storage is repeatedly calculated, and stores the view data that receives when carrying out described calculating, handles to realize the longitudinal size convergent-divergent.
The present invention program comprises the convergent-divergent of lateral dimension and longitudinal size respectively by view data being divided two-way, satisfied the demand that image shows and image is stored, and when the longitudinal size convergent-divergent, also has only the delay of several row, not needing just can carry out after a two field picture has been stored as prior art the convergent-divergent that image shows and image is stored handles, reduced view data has been carried out the employed time of convergent-divergent, realized real-time processing view data.
The present invention program preserves the view data that is used for the longitudinal size convergent-divergent at most only needs the triplex row line buffer, requirement to video memory is very low, need externally to deposit two frame original images in the memory than prior art, the required hardware resource of the present invention program is less, greatly reduces the processing cost of image zoom.
The present invention program also handles by carrying out the longitudinal size convergent-divergent earlier, after carry out the lateral dimension convergent-divergent and handle, make described processing unit only need a row buffering module, further reduced required hardware resource, further reduced the processing cost of image zoom.
The present invention program by also when the pre-filtering by two-dimensional filtering being converted into two one-dimensional filterings, and the convergent-divergent of two dimensional image is converted into the convergent-divergent of two one dimension images, significantly reduced the use of multiplier, thereby the cost of chip reduced greatly.
Prior art must be used divider when realizing that digital image size changes, well-known, and divider is difficult for realizing, and the present invention program has avoided the use divider, thereby has further reduced the cost of chip.
In addition, because prior art is before realizing that image zoom is handled, some specific constants often need prestore in hardware, the present invention program does not then need the constant that prestores, only need dispose various configuration informations by host computer, and deposit the order sending module in, so the present invention program has further simplified the processing of image zoom.
Description of drawings
The Digital Image Processing chip structure schematic diagram of Fig. 1 for being used at present realize that image zoom is handled;
Fig. 2 is the bilinear interpolation schematic diagram;
Fig. 3 is the present invention program's realization flow figure;
Fig. 4 is the present invention program's a structured flowchart;
Fig. 5 is the structured flowchart of order sending module among the present invention;
Fig. 6 is the structured flowchart of register module in the order sending module of the present invention;
Fig. 7 is a kind of realization schematic diagram of picture size Zoom module among the present invention;
Fig. 8 realizes schematic diagram for the another kind of picture size Zoom module among the present invention;
Fig. 9 is the schematic diagram of the another kind of structure of picture size Zoom module shown in Figure 8;
Figure 10 is the structure drawing of device that the present invention is based on picture size Zoom module shown in Figure 7;
Figure 11 is the realization flow figure of image longitudinal size convergent-divergent among the present invention;
Figure 12 is the realization flow figure of image lateral dimension convergent-divergent among the present invention.
Embodiment
Below in conjunction with drawings and the specific embodiments the present invention program is described in further detail.
For solving image processing, in general video card, video frequency collection card, typically use the image zoom that the secondary linear interpolation realizes hardware by hardware.Since amplify or dwindle after a pixel of image will inevitably drop between four pixels of original image, therefore, suppose amplification or dwindle after image in a pixel P (x ', y ') drops on four pixel P (x of original image, y), P (x, y+1), P (x+1, y) and P (x+1, y+1) between, this correlation as shown in Figure 2, according to above-mentioned algorithm, this pixel P (x ', y ') color value can represent with the color value of these four pixels, specifically as shown in Equation (1).
P(x′,y′)=(1-a)(1-b)P(x,y)+(1-a)bP(x,y+1)+a(1-b)P(x+1,y)+abP(x+1,y+1);(1)
Wherein, { 0≤a, b≤1}.
For the brightness value and the chromatic value of pixel, can calculate with this formula.
The present invention at first changes the bilinear interpolation formula of above-mentioned formula (1) into following formula (2).
P(x′,y′)=(1-a)[(1-b)P(x,y)+bP(x,y+1)]+a[(1-b)P(x+1,y)+bP(x+1,y+1)];(2)
Wherein, { 0≤a, b≤1}.
From above-mentioned formula (2) as can be seen, the processing of a two dimensional image can be converted into two one dimension treatment of picture, so just can simplify operand and hardware resource.Such as, at first carry out horizontal amplification or dwindle, the data that lateral processes is obtained exist in the memory then, these data are amplified longitudinally afterwards again or dwindle.Certainly, also can at first store data, carry out convergent-divergent longitudinally then, carry out horizontal convergent-divergent again.
Need to prove, dwindle if carry out image, when vertically handling, owing to only may produce delegation's dateout between per two line data when image dwindles, that is to say, only need calculate longitudinally according to two line data, therefore current needs storing one row view data also promptly only needs delegation's line buffer to store data as memory.When second line data arrives, first line data is read from line buffer, first line data of preservation and second line data of current arrival are calculated, and store this second line data, continue to calculate with this afterwards, till a two field picture has calculated.
Amplify if carry out image, then when vertically handling,, that is to say because two passed through and may produce two line output data between the data of lateral processes, may need to calculate twice, therefore this two line data all need be kept in the line buffer by this two line data.And when this two line data being carried out second time computing, may have the input of the third line data, therefore need the triplex row line buffer.
Owing to need in the shooting process view data is handled to be used for storage, also need view data is handled to be used for showing that therefore, technical scheme of the present invention specifically may further comprise the steps as shown in Figure 3:
The input information of step 301, configuration image, filter factor information and convergent-divergent multiple information.
Wherein, the convergent-divergent multiple information that is disposed comprises convergent-divergent multiple that the view data that is used to store is required and the required convergent-divergent multiple of view data that is used to show, because the view data that is used to store is the image that is caught in, therefore these two convergent-divergent multiples are called the convergent-divergent multiple of picture catching and the convergent-divergent multiple that image shows again.
Step 302, pending image is carried out low-pass filtering according to the filter factor information that is disposed.
Step 303, laterally reach size scaling longitudinally, and finish the convergent-divergent laterally and longitudinally of image is handled according to the input information of image according to the view data of the convergent-divergent multiple information that is disposed after to low-pass filtering.
Wherein, carrying out convergent-divergent when handling, can when view data is carried out convergent-divergent according to the convergent-divergent multiple of picture catching, carry out convergent-divergent according to the convergent-divergent multiple that image shows this view data.
Based on above-mentioned handling principle, in conjunction with Fig. 4 the present invention program is described in further detail again below.
Among Fig. 4, the image zoom processing unit is connected with image pretreatment module and host computer respectively, receives the instruction that host computer sends, and handles according to the view data that this instruction is sent the image pretreatment module.Wherein, the image pretreatment module receives the view data that imageing sensor sends, and these data are carried out preliminary treatment, sends to the image zoom processing unit afterwards.The image zoom processing unit comprises order sending module, pre-filtering module and picture size Zoom module.
In above-mentioned module, host computer at first will be finished the image input information, amplify and dwindle the configuration of information such as information and filter factor, to guarantee that the image zoom treatment system can operate as normal.This configuration specifically comprises: input picture width, input picture height, pre-filtering coefficient, image zoom multiple.Wherein, the pre-filtering coefficient that host computer disposed, promptly the low-pass filtering coefficient should dispose according to the scaling of image.Specifically, image only need not be presented on the display screen when taking, and does not need to catch image, and in this case, the coefficient of filter need be determined according to the scaling that image shows; When carrying out image taking, only take relevant processing at a two field picture, so this moment, the coefficient of filter need be determined according to the scaling of picture catching, show though also need to carry out image this moment, but, can too much influence not arranged to the image that shows owing to only be that a frame image data is determined according to the scaling of picture catching.The image zoom multiple comprises the convergent-divergent multiple of picture catching and the convergent-divergent multiple that image shows.In addition, adjust for the view data after making image lateral dimension Zoom module in the image zoom processing unit and image longitudinal size Zoom module further to handle convergent-divergent according to the output information of image, host computer can also further be finished the configuration to output image width and output image elevation information.
The order sending module sends to the pre-filtering module with host computer according to the low-pass filtering coefficient of image zoom proportional arrangement, and image zoom multiple and image input information that host computer is sent send to the picture size Zoom module.
The image that the pre-filtering module is sent the image pretreatment module carries out low-pass filtering, and the image after the low-pass filtering is sent to the picture size Zoom module.As previously mentioned, the coefficient of this low-pass filtering is shown according to image by host computer or the scaling of picture catching is configured, and is forwarded to this module by the order sending module.
The picture size Zoom module is transmitted the convergent-divergent multiple of the picture catching that comes and the convergent-divergent multiple that image shows according to the order sending module, the view data that the pre-filtering module is sent carry out two-way laterally and longitudinally convergent-divergent handle, and according to the image input information determine respectively this two-way laterally and vertical processing whether finish.The picture size Zoom module also sends to the post processing of image module with the image after the conversion.
The post processing of image module here comprises image compression module that scaled images is compressed and the image display that is used for display image.
By the processing of above-mentioned each module, can realize convergent-divergent to image.
In addition, in above-mentioned image zoom treatment system, the order sending module need be provided for preserving the register of the relevant configuration that host computer sends, and this module specifically can comprise register address decoding module, register read writing module and register module, as shown in Figure 5.Comprise the relevant register address in the configuration information that host computer sends, therefore the register address decoding module is deciphered the register address that host computer sends over, and find the register that will operate, finish write operation by the register read writing module afterwards to this register.And the data in all right readout register of host computer, at this moment, at first the register address that host computer sends is deciphered by the register address decoding module, and find the register that to read, read corresponding data in this register by the register read writing module afterwards, and according to actual needs these data are sent to corresponding processing module, such as, send to the software of host computer etc.That is to say that the order in this image zoom treatment system sends and finished by the register read writing module.In addition, the register cell that the register address decoding module is found all belongs to register module, comprises a lot of control registers in the register module.
The control register that register module comprised specifically can have: input picture width register (IMAGE_WIDTH), input picture height register (IMAGE_HEIGHT), pre-filtering coefficient register (FIR_COEF), display image convergent-divergent multiple register (DISPLAY_RATIO) and seizure image zoom multiple register (CAPTURE_RATIO).And convergent-divergent multiple register specifically can comprise integer part (ZOOM_INT) and fractional part (ZOOM_FRAC).
If host computer provides image output information, then this control register also should comprise seizure picture traverse register (CAPTURE_WIDTH), catch picture altitude register (CAPTURE_HEIGHT), display image width register (DISPLAY_WIDTH) and display image height register (DISPLAY_HEIGHT).The register module that comprises these control registers as shown in Figure 6.Before starting image zoom, host computer need configure the value of these registers, to guarantee system's operate as normal.The configuration information of register should be finished from disposing before the image pretreatment module sends to the image zoom processing unit at image.
Above-mentioned picture size Zoom module specifically can carry out the lateral dimension convergent-divergent earlier, carries out the longitudinal size convergent-divergent again; Also can carry out the longitudinal size convergent-divergent earlier, carry out the lateral dimension convergent-divergent again.
At first be scaled example to carry out lateral dimension earlier.The picture size Zoom module can show that lateral dimension Zoom module, image show that convergent-divergent row buffering module and image show the longitudinal size Zoom module by image, and picture catching lateral dimension Zoom module, picture catching convergent-divergent row buffering module and picture catching longitudinal size Zoom module are formed.This picture size Zoom module as shown in Figure 7.Can show that lateral dimension Zoom module, image show that convergent-divergent row buffering module and image show that the longitudinal size Zoom module at first finishes the lateral dimension convergent-divergent that is used for the image data presented, finish the longitudinal size convergent-divergent again by image; And finish the lateral dimension convergent-divergent of the data that are used for picture catching earlier by picture catching lateral dimension Zoom module, picture catching convergent-divergent row buffering module and picture catching longitudinal size Zoom module, finish the longitudinal size convergent-divergent again.Because the concrete handling process that this two-way convergent-divergent is handled is identical, therefore only, the convergent-divergent that is used for the image data presented is described in detail below so that being handled.
Specifically, image shows the image zoom multiple that the lateral dimension Zoom module is transmitted according to the order sending module, the image after the pre-filtering module filtered is carried out horizontal convergent-divergent handle, and processed images is stored in the image zoom row buffering module.It also determines according to the image input information whether lateral processes finishes carrying out horizontal convergent-divergent when handling.
Image shows that convergent-divergent row buffering module then is used to preserve the view data that image shows that the lateral dimension Zoom module sends.At this moment, the width of line buffer equals horizontal scaled images width.
Image shows the image zoom multiple that the longitudinal size Zoom module is transmitted according to the order sending module again, image is shown that the image in the convergent-divergent row buffering module carries out the conversion of vertical scale, and the image after the conversion sent to post processing of image module, i.e. image display.It also determines according to the image input information whether vertical processing finishes carrying out vertical convergent-divergent when handling.
Above-mentioned picture size Zoom module can also carry out the longitudinal size convergent-divergent earlier.In this case, the picture size Zoom module shows that by image convergent-divergent row buffering module, image show that longitudinal size Zoom module and image show the lateral dimension Zoom module, and picture catching row buffering module, picture catching longitudinal size Zoom module and picture catching lateral dimension Zoom module are formed, at first finish the convergent-divergent of longitudinal size by these modules, finish the convergent-divergent of lateral dimension again.This picture size Zoom module as shown in Figure 8.
Equally, this two-way is handled identical, therefore only is treated to example with the convergent-divergent to the data that are used for the image storage and describes.Specifically, at first preserve the view data that the pre-filtering module is sent by picture catching convergent-divergent row buffering module.The width of this line buffer equals the width of original image.
Picture catching longitudinal size Zoom module is transmitted the picture catching convergent-divergent multiple information of coming according to the order sending module, the view data of preserving in the picture catching convergent-divergent row buffering module is carried out convergent-divergent processing longitudinally, and the view data after will vertically handling sends to picture catching lateral dimension Zoom module.It also can determine whether the longitudinal size processing finishes according to the image input information in the process of carrying out image longitudinal size convergent-divergent.
Picture catching lateral dimension Zoom module is then transmitted the picture catching convergent-divergent multiple of coming according to the order sending module, and the view data that picture catching longitudinal size Zoom module sends is carried out the lateral dimension convergent-divergent.It can determine whether the lateral dimension processing finishes according to the image input information equally in the process of carrying out image lateral dimension convergent-divergent.
Obviously, in the picture size Zoom module shown in Figure 8, picture catching convergent-divergent row buffering module and image show that the data of preserving in the convergent-divergent row buffering module are identical, therefore, these two row buffering modules can be united two into one, that is to say, what picture catching and image showed employing is same buffer module, as shown in Figure 9, and than picture size Zoom module shown in Figure 7, a row buffering module can be saved, and three line buffers can be saved at most.
Again the concrete convergent-divergent processing procedure based on device shown in Figure 4 is elaborated below.Wherein, adopt the realization effect of Fig. 7, Fig. 8 or picture size Zoom module shown in Figure 9 identical, so difference is mainly still carried out vertical convergent-divergent earlier at the horizontal convergent-divergent of advanced row, and it is embodied as different.In addition, if handle based on picture size Zoom module shown in Figure 7, then the convergent-divergent processing scheme that shows at image storage and image is identical, the different just width of row buffering module--the width of line buffer is identical with picture traverse after the horizontal convergent-divergent processing in the row buffering module.If handle based on picture size Zoom module shown in Figure 8, not only the convergent-divergent processing scheme of image storage and image demonstration is identical, and the width of line buffer is also identical in two row buffering modules.And if handle based on picture size Zoom module shown in Figure 9, then two convergent-divergent processing schemes are identical, and employing is same row buffering module.
Therefore, only so that storage is scaled example to image based on picture size Zoom module shown in Figure 9, the device of the picture size Zoom module among employing Fig. 9 as shown in figure 10 below.
When image is imported, at first by the pre-filtering module it is carried out filtering, this system can take the two-dimentional low-pass filtering of n * n, and choosing of filter factor will be determined according to the scaling of image, to guarantee that image does not have high-frequency noise after convergent-divergent, also have than the distinct image quality simultaneously.Such as, can adopt 7 * 7 linear interpolation, be example with the color value, the color numerical value of a pixel is on average obtained through linear weighted functions by 7 * 7 picture elements on every side after the filtering, so just 7 * 7=49 multiplier of needs.For reducing multiplier, the pre-filtering module specifically can be made up of two one-dimensional filtering devices, and at horizontal filtering and vertically filtering, like this, each one-dimensional filtering device only needs 4 multipliers respectively.
Owing to be seven rank low-pass filtering, so prefilter can use 6 every trade buffers to come the horizontal scaled images data of buffer memory, so that vertically handle after lateral processes.
After through horizontal and vertical filtering, the high frequency noise of image is removed, but therefore the not change of the size of image sends to image zoom row buffering module, so that the processing of follow-up convergent-divergent.As previously mentioned, dwindle if carry out image, then this image zoom row buffering module can be to have only a line buffer; If image amplifies, then this image zoom row buffering module should have three line buffers.
Afterwards, by picture catching longitudinal size Zoom module the view data in the image zoom row buffering module being carried out vertical convergent-divergent handles.The Zoom method that the present invention program adopted is a bilinear interpolation, and the employed interpolation coefficient of image zoom is configured by host computer.Its scaling specifically can be by ZOOM_INT register in this register and the decision of ZOOM_FRAC register according to the CAPTURE_RATIO register decision in the order sending module.Such as, by 160 * 120 to 128 * 96, its scaling should be 1.25, we change into a binary number with six integers, 12 decimals with 1.25, obtain 1.25d=000001.0100000000b, then order ZOOM_INT=000001b=0 * 01 in the CAPTURE_RATIO register of sending module, ZOOM_FRAC=0 * 0100000000=0 * 100, thus picture catching longitudinal size Zoom module and picture catching lateral dimension Zoom module can be determined scaling according to these two registers.
Present embodiment is that image is dwindled, and therefore as long as in the image zoom row buffering module delegation's view data has been arranged, and receives another row view data, then can carry out vertical convergent-divergent and handle.The employed interpolation coefficient of image zoom is configured by host computer, and the image zoom ratio is determined according to the CAPTURE_RATIO register in the order sending module then as mentioned above.
Vertically convergent-divergent is handled needs a counter, and this counter is row step-length counter (LINE_STEP), in the time of can determining to have in image zoom row buffering module new delegation to arrive according to this counter, whether needs to produce a new row.Specifically, every delegation this counter of view data will add 1 automatically, if the value of finding this counter is greater than the image zoom multiple, then can produce a new row, the pixel value of this row simultaneously can be with the value subtracted image convergent-divergent multiple of this counter by delegation's decision of the delegation that has just imported and its front.This processing procedure specifically as shown in figure 11, wherein, whether the line output of image finishes specifically to determine according to linage-counter (LINE_CNT).
If image is amplified, then the image zoom multiple is a decimal, and have three line buffers at least in the picture catching convergent-divergent row buffering module, therefore counter LINE_STEP is after adding one according to new delegation's arrival, if the current number of counter is greater than the image zoom multiple, then should carries out vertical convergent-divergent and handle at the current two row view data that are kept at picture catching convergent-divergent row buffering module and import this buffer module at first.Because the image zoom multiple is a decimal, so at after vertically the finishing dealing with of this two line data, catch convergent-divergent row buffering module even without new view data input picture, counter LINE_STEP also may be also greater than the image zoom multiple, in this case, if that of Chu Liing two row view data also existed just now, then picture catching longitudinal size Zoom module also can carry out vertical convergent-divergent processing to this two row view data, has therefore realized producing two line output data according to the view data after the two row lateral processes.
If picture catching longitudinal size Zoom module has all been done processing according to foregoing description to all view data, the size of then every row view data has just become 96 by 120, but length still is 160, therefore need carry out the lateral dimension convergent-divergent.Each row of data after vertically convergent-divergent is handled can directly be transferred to picture catching lateral dimension Zoom module, by picture catching lateral dimension Zoom module the view data of input is carried out horizontal convergent-divergent and handles.
In the picture catching lateral dimension Zoom module of native system, a pixel step-length counter (PIXEL_STEP) is arranged equally,, whether need to produce a new pixel so that when determining that a pixel of current line of input arrives.Every this Counter Value of pixel will add 1 automatically, if the value of finding this counter is greater than the image zoom multiple, then can produce a new pixel, the value of this pixel simultaneously can be with the value subtracted image convergent-divergent multiple of this counter by the pixel decision of the pixel of just having imported and its front.When certain line output in the two field picture finishes or a new frame pixel when arriving this counter O reset.This processing procedure specifically as shown in figure 12, wherein, whether the line output of image finishes specifically to determine according to pixel counter (PIXEL_CNT).
Because new output pixel must appear between two input pixels of firm arrival, and is obtained by the weighted average calculation of these two input pixels, with the color value example still, suppose that two pixels that just arrived are P 1And P 2, then new pixel color value can calculate by following formula: P New=(1-a) * P 1+ a*P 2
Wherein, coefficient a can be according to new pixel P NewWith P 1Between distance, the difference of the value of promptly current PIXEL_STEP register and image zoom multiple is obtained, its formula is: a=PIXEL_STEP-ZOOM_INT-ZOOM_FRAC.A and (1-a) be interpolation coefficient.
Through above-mentioned processing, just finished convergent-divergent processing to the view data that is used to store.
The present invention program is not restricted to utilization listed in specification and the execution mode, it goes for various suitable fields fully, for those skilled in the art, can realize additional advantage easily and carry out corresponding modification, therefore under the situation of the spirit and scope of the universal that does not deviate from claim and equivalency range and limited, the present invention program is not limited to the examples shown that specific details, representational equipment and this specification illustrate and describe.

Claims (20)

1. a method that changes digital image size in shooting process is characterized in that, the convergent-divergent multiple information of the input information of configuration image, filter factor information and image demonstration and picture catching, and this method further may further comprise the steps:
A. according to filter factor information pending image is carried out low-pass filtering;
B. the view data of the convergent-divergent multiple information of convergent-divergent multiple information that shows according to image and picture catching after to low-pass filtering divides two-way to comprise respectively laterally and the processing of longitudinal size convergent-divergent, and according to the input information of image finish to image laterally and the longitudinal size convergent-divergent handle;
Among the described step b, if described convergent-divergent is treated to downscaled images, then described longitudinal size convergent-divergent is handled and is comprised: the previous row view data of working as previous row view data and storage is before calculated, and stored after calculating when the previous row view data;
If described convergent-divergent is treated to enlarged image, then described longitudinal size convergent-divergent is handled and is comprised: store continuous multirow view data, the multirow view data of storage is repeatedly calculated, and store the view data that receives when carrying out described calculating.
2. method according to claim 1 is characterized in that, described filter factor, the convergent-divergent multiple that shows according to image when not taking determine that the convergent-divergent multiple according to picture catching when taking is determined;
Low-pass filtering among the described step a is: adopt two-dimentional low-pass filtering.
3. method according to claim 2 is characterized in that, the low-pass filtering among the described step a is: at first view data is carried out horizontal filtering, then horizontal filtered view data is carried out vertical filtering.
4. method according to claim 1 is characterized in that among the described step b, describedly view data is laterally reached the longitudinal size convergent-divergent is treated to:
Earlier view data is carried out the lateral dimension convergent-divergent and handle, preserve the view data after horizontal convergent-divergent is handled, the view data after more horizontal convergent-divergent being handled is afterwards carried out the longitudinal size convergent-divergent and is handled;
Perhaps be: the view data after the preservation low-pass filtering, view data to be carried out the longitudinal size convergent-divergent handle, the view data after again the longitudinal size convergent-divergent being handled is afterwards carried out the lateral dimension convergent-divergent and is handled.
5. method according to claim 4 is characterized in that,
Described change digital image size is: the downscaled images size;
Among the step b, described preservation view data is: view data is kept in the image zoom row buffering module that comprises delegation's line buffer at least;
Described change digital image size or be: enlarged image size;
Among the step b, described preservation view data is: view data is kept in the image zoom row buffering module that comprises the triplex row line buffer at least.
6. according to claim 1 or 4 described methods, it is characterized in that this method further comprises: the output information of configuration image;
Among the described step b, after view data being carried out the processing of lateral dimension convergent-divergent, further comprise: the view data after according to the output information of image horizontal convergent-divergent being handled is carried out the image adjustment;
Among the described step b, after view data being carried out the processing of longitudinal size convergent-divergent, further comprise: the view data after according to the output information of image vertical convergent-divergent being handled is carried out the image adjustment.
7. according to claim 1 or 4 described methods, it is characterized in that among the described step b, describedly according to convergent-divergent multiple information view data is carried out the lateral dimension convergent-divergent and handle and to comprise: pixel step-length counter is set, when each pixel arrives, this pixel step-length counter adds one, and during greater than the image zoom multiple, current two pixels receiving are weighted on average, simultaneously with this counter subtracted image convergent-divergent multiple value at this counter;
The lateral dimension convergent-divergent that described input information according to image finishes image is handled and is comprised: judge according to the image input information whether delegation's view data disposes, if, then with the counter O reset of described pixel step-length, otherwise whether continuation disposes to delegation's view data according to the image input information is judged.
8. according to claim 1 or 4 described methods, it is characterized in that among the described step b, describedly according to convergent-divergent multiple information view data is carried out the longitudinal size convergent-divergent and handle and to comprise: capable step-length counter is set, when every row arrives, this row step-length counter adds one, and during greater than the image zoom multiple, the current two row pixels of receiving are weighted on average, simultaneously with this counter subtracted image convergent-divergent multiple value at this counter;
The longitudinal size convergent-divergent that described input information according to image finishes image is handled and is comprised: judge according to the image input information whether a frame image data disposes, if, then with described capable step-length counter O reset, otherwise whether continuation disposes to a frame image data according to the image input information is judged.
9. device that in shooting process, changes digital image size, described device is connected with host computer, and receive the view data that the image pretreatment module is sent, described host computer is used for the convergent-divergent multiple information of configuration image input information, low-pass filtering coefficient and image demonstration and picture catching, and described configuration information sent to described device, it is characterized in that described device comprises with lower module:
The order sending module is used for the low-pass filtering coefficient of host computer configuration is sent to the pre-filtering module, and with the image demonstration of host computer transmission and the convergent-divergent multiple information of picture catching, and the image input information sends to the picture size Zoom module;
The pre-filtering module is used for carrying out low-pass filtering according to the view data that the low-pass filtering coefficient sends the image pretreatment module, and the view data after the low-pass filtering is sent to the picture size Zoom module;
The picture size Zoom module, be used for transmitting the next image demonstration and the convergent-divergent multiple information of picture catching according to the order sending module, divide two-way to comprise respectively laterally and the processing of longitudinal size convergent-divergent to the view data that the pre-filtering module is sent, and determine according to the image input information whether laterally reach vertical processing finishes;
Wherein, if described convergent-divergent is treated to downscaled images, then the picture size Zoom module calculates the previous row view data of storage before the previous row view data is with it, and the previous row view data is worked as in storage after calculating, and handles to realize the longitudinal size convergent-divergent;
If described convergent-divergent is treated to enlarged image, then the picture size Zoom module is stored continuous multirow view data, multirow view data to its storage is repeatedly calculated, and stores the view data that receives when carrying out described calculating, handles to realize the longitudinal size convergent-divergent.
10. device according to claim 9, it is characterized in that, described picture size Zoom module comprises: image shows that lateral dimension Zoom module, image show that convergent-divergent row buffering module, image show the longitudinal size Zoom module, and picture catching lateral dimension Zoom module, picture catching row buffering module, picture catching longitudinal size Zoom module, wherein
Image shows the lateral dimension Zoom module, be used for transmitting the convergent-divergent multiple information of the image demonstration that comes according to the order sending module, the view data that the pre-filtering module is sent is carried out horizontal convergent-divergent processing, deposit the view data after the horizontal convergent-divergent processing in image and show convergent-divergent row buffering module, and determine according to the image input information whether lateral processes finishes;
Image shows convergent-divergent row buffering module, is used to preserve the view data that image shows that the lateral dimension Zoom module sends;
Image shows the longitudinal size Zoom module, be used for transmitting the image zoom multiple information of coming according to the order sending module, view data in the image demonstration convergent-divergent row buffering module is carried out convergent-divergent processing longitudinally, view data after vertical convergent-divergent processing is sent, and determine according to the image input information whether vertical processing finishes;
Picture catching lateral dimension Zoom module, be used for transmitting the convergent-divergent multiple information of the picture catching that comes according to the order sending module, the view data that the pre-filtering module is sent is carried out horizontal convergent-divergent processing, deposit the view data after the horizontal convergent-divergent processing in picture catching convergent-divergent row buffering module, and determine according to the image input information whether lateral processes finishes;
Picture catching convergent-divergent row buffering module is used to preserve the view data that picture catching lateral dimension Zoom module sends;
Picture catching longitudinal size Zoom module, be used for transmitting the image zoom multiple information of coming according to the order sending module, view data in the picture catching convergent-divergent row buffering module is carried out convergent-divergent processing longitudinally, view data after vertical convergent-divergent processing is sent, and determine according to the image input information whether vertical processing finishes.
11. device according to claim 9, it is characterized in that, described picture size Zoom module comprises: image zoom row buffering module, image show that longitudinal size Zoom module, image show lateral dimension Zoom module, picture catching longitudinal size Zoom module and picture catching lateral dimension Zoom module, wherein
Image zoom row buffering module is used to preserve the view data that the pre-filtering module is sent;
Image shows the longitudinal size Zoom module, be used for transmitting the convergent-divergent multiple information of the image demonstration that comes according to the order sending module, the view data of preserving in the image zoom row buffering module is carried out convergent-divergent processing longitudinally, view data after vertically handling is sent to image show the lateral dimension Zoom module, and determine according to the image input information whether the longitudinal size processing finishes;
Image shows the lateral dimension Zoom module, be used for transmitting the convergent-divergent multiple information of the image demonstration that comes according to the order sending module, the view data that image demonstration longitudinal size Zoom module sends is carried out the lateral dimension convergent-divergent, and determine according to the image input information whether the lateral dimension processing finishes;
Picture catching longitudinal size Zoom module, be used for transmitting the convergent-divergent multiple information of the picture catching that comes according to the order sending module, the view data of preserving in the image zoom row buffering module is carried out convergent-divergent processing longitudinally, view data after vertically handling is sent to picture catching lateral dimension Zoom module, and determine according to the image input information whether the longitudinal size processing finishes;
Picture catching lateral dimension Zoom module, be used for transmitting the convergent-divergent multiple information of the picture catching that comes according to the order sending module, the view data that picture catching longitudinal size Zoom module sends is carried out the lateral dimension convergent-divergent, and determine according to the image input information whether the lateral dimension processing finishes.
12. device according to claim 11, it is characterized in that, described image zoom row buffering module comprises that further image shows convergent-divergent row buffering module and picture catching convergent-divergent row buffering module, and these two modules are preserved the view data that the pre-filtering module is sent respectively;
Image shows that the longitudinal size Zoom module carries out the longitudinal size convergent-divergent to the view data of preserving in the image demonstration convergent-divergent row buffering module and handles;
Picture catching longitudinal size Zoom module carries out the longitudinal size convergent-divergent to the view data of preserving in the picture catching convergent-divergent row buffering module to be handled.
13., it is characterized in that described image shows that lateral dimension Zoom module and/or picture catching lateral dimension Zoom module further comprise according to claim 10,11 or 12 described devices:
Pixel step-length counter, when having a pixel to arrive, this counter adds one; During greater than the convergent-divergent multiple, described image shows that lateral dimension Zoom module and/or picture catching lateral dimension Zoom module are weighted on average current two pixels receiving at this Counter Value, and with this Counter Value subtracted image convergent-divergent multiple value; Behind delegation's view data end of output, this counter O reset.
14., it is characterized in that described image zoom row buffering module comprises: line buffer according to claim 10,11 or 12 described devices;
Carry out image when dwindling, described image zoom row buffering module is made up of delegation's line buffer at least;
When carrying out the image amplification, described image zoom row buffering module is made up of the triplex row line buffer at least.
15., it is characterized in that described image shows that longitudinal size Zoom module and/or picture catching longitudinal size Zoom module further comprise according to claim 10,11 or 12 described devices:
Row step-length counter, when having delegation's view data to arrive, this counter adds one; At this Counter Value during greater than the image zoom multiple, described image shows that longitudinal size Zoom module and/or picture catching longitudinal size Zoom module obtain two row view data and be weighted on average from image zoom row buffering module, and with this Counter Value subtracted image convergent-divergent multiple value; Behind a frame image data end of output, this counter O reset.
16. device according to claim 9 is characterized in that, described order sending module further comprises:
The register address decoding module, the entrained register address of information that is used for host computer is sent is deciphered, and this information and corresponding decode results are sent to the register read writing module;
The register read writing module, be used for determining relevant register according to the decode results that the register address decoding module sends, and deposit the corresponding informance of this decode results in determined register, and/or the information in the determined register is sent to host computer according to this decode results;
Register module comprises at least one register, is used for the information that the memory register module for reading and writing deposits in.
17. device according to claim 16, it is characterized in that described register module comprises: input picture width register, input picture height register, pre-filtering coefficient register, display image convergent-divergent multiple register and seizure image zoom multiple register.
18. device according to claim 17 is characterized in that, described host computer is further used for configuration image output information;
Register module in the described order sending module further comprises: output image width register and output image height register;
Described picture size Zoom module is further used for transmitting the image output information of coming according to the order sending module view data that laterally reaches after vertical convergent-divergent is handled is adjusted.
19. device according to claim 9 is characterized in that, described pre-filtering module comprises one-dimensional filtering device that is used for horizontal filtering and the one-dimensional filtering device that is used for vertical filtering, and further comprises: pre-filtering row buffering module;
The described one-dimensional filtering device that is used for horizontal filtering carries out horizontal low-pass filtering with the view data that the image pretreatment module is sent, and horizontal filtered view data is sent to pre-filtering row buffering module;
The described one-dimensional filtering device that is used for vertical filtering obtains view data from described pre-filtering row buffering module, it is carried out vertical Filtering Processing, and vertical filtered view data is sent to image lateral dimension Zoom module.
20. device according to claim 19 is characterized in that, described pre-filtering row buffering module is made up of for the low-pass filtering exponent number subtracts one line buffer number.
CNB2005100647347A 2005-04-18 2005-04-18 A method and apparatus for changing digital image size during process of shooting Active CN100379249C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005100647347A CN100379249C (en) 2005-04-18 2005-04-18 A method and apparatus for changing digital image size during process of shooting

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005100647347A CN100379249C (en) 2005-04-18 2005-04-18 A method and apparatus for changing digital image size during process of shooting

Publications (2)

Publication Number Publication Date
CN1665269A CN1665269A (en) 2005-09-07
CN100379249C true CN100379249C (en) 2008-04-02

Family

ID=35036142

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005100647347A Active CN100379249C (en) 2005-04-18 2005-04-18 A method and apparatus for changing digital image size during process of shooting

Country Status (1)

Country Link
CN (1) CN100379249C (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10139613B2 (en) * 2010-08-20 2018-11-27 Sakura Finetek U.S.A., Inc. Digital microscope and method of sensing an image of a tissue sample
CN104539846B (en) * 2014-12-26 2018-02-23 小米科技有限责任公司 Shoot the method, apparatus and terminal of picture

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5574572A (en) * 1994-09-07 1996-11-12 Harris Corporation Video scaling method and device
US6724826B1 (en) * 2000-02-25 2004-04-20 Ampex Corporation Method and apparatus for improving the image quality of transmitted video signals via pre-filtering
CN1516458A (en) * 2003-08-28 2004-07-28 上海交通大学 Control method of video format converter by adopting two-dimensional multiphase interpolation filter

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5574572A (en) * 1994-09-07 1996-11-12 Harris Corporation Video scaling method and device
US6724826B1 (en) * 2000-02-25 2004-04-20 Ampex Corporation Method and apparatus for improving the image quality of transmitted video signals via pre-filtering
CN1516458A (en) * 2003-08-28 2004-07-28 上海交通大学 Control method of video format converter by adopting two-dimensional multiphase interpolation filter

Also Published As

Publication number Publication date
CN1665269A (en) 2005-09-07

Similar Documents

Publication Publication Date Title
CN100356405C (en) Method and apparatus for changing digital image size
KR101350193B1 (en) Taken-image signal-distortion compensation method, taken-image signal-distortion compensation apparatus, image taking method and image-taking apparatus
US9787922B2 (en) Pixel defect preprocessing in an image signal processor
US20060188147A1 (en) Method and apparatus applying digital image filtering to color filter array data
US8189944B1 (en) Fast edge-preserving smoothing of images
EP2709057A2 (en) System, method and computer program product for image processing, in particular for introducing blurring effects to an image
WO2011084279A2 (en) Algorithms for estimating precise and relative object distances in a scene
CN100474890C (en) Image display device
US8723969B2 (en) Compensating for undesirable camera shakes during video capture
US20100061650A1 (en) Method And Apparatus For Providing A Variable Filter Size For Providing Image Effects
EP2008238A1 (en) Techniques to facilitate use of small line buffers for processing of small or large images
CN108401110A (en) Acquisition methods, device, storage medium and the electronic equipment of image
CN100379249C (en) A method and apparatus for changing digital image size during process of shooting
CN108513068A (en) Choosing method, device, storage medium and the electronic equipment of image
JPH06105241A (en) Picture element defect correction method
US20090179913A1 (en) Apparatus for image reduction and method thereof
TW200949759A (en) Image processing apparatus and method
US20090087119A1 (en) Method and apparatus for arbitrary ratio image reduction
KR100719988B1 (en) Image signal processing device
CN102694962B (en) Noise-reduction method and device
CN1293514C (en) Pantograph treatment system of digital picture
US20080310751A1 (en) Method And Apparatus For Providing A Variable Blur
CN102118598B (en) Device and method for processing videos
CN2736865Y (en) Zoom processing system for digital image
TWI424371B (en) Video processing device and processing method thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
DD01 Delivery of document by public notice

Addressee: Shen Yingming

Document name: Notification that Application Deemed not to be Proposed

C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20151222

Address after: 519031 Guangdong city of Zhuhai province Hengqin Baohua Road No. 6, room 105 -478

Patentee after: GUANGDONG ZHONGXING ELECTRONICS CO., LTD.

Address before: 100083, Haidian District, Xueyuan Road, Beijing No. 35, Nanjing Ning building, 15 Floor

Patentee before: Beijing Vimicro Corporation