CN100356405C - Method and apparatus for changing digital image size - Google Patents

Method and apparatus for changing digital image size Download PDF

Info

Publication number
CN100356405C
CN100356405C CNB2005100568928A CN200510056892A CN100356405C CN 100356405 C CN100356405 C CN 100356405C CN B2005100568928 A CNB2005100568928 A CN B2005100568928A CN 200510056892 A CN200510056892 A CN 200510056892A CN 100356405 C CN100356405 C CN 100356405C
Authority
CN
China
Prior art keywords
image
module
zoom
convergent
divergent
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.)
Expired - Fee Related
Application number
CNB2005100568928A
Other languages
Chinese (zh)
Other versions
CN1652155A (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.)
Vimicro Corp
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 CNB2005100568928A priority Critical patent/CN100356405C/en
Publication of CN1652155A publication Critical patent/CN1652155A/en
Application granted granted Critical
Publication of CN100356405C publication Critical patent/CN100356405C/en
Expired - Fee Related 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, which has the steps: configuring the input information, the filter coefficient information and the zoom multiple information of images; carrying out low pass filtering on images which need processing according to the filter coefficient information; zooming the size of image data which is after the process of low pass filtering transversely and vertically according to the zoom multiple information, 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. The present invention zooms the size of the image data transversely and vertically in turn, reduces the time desired by the zoom processing of the image data in the prior art, realizes the real-time processing on the image data, and greatly reduces processing cost.

Description

A kind of method and device that 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 changes digital image size or rather.
Background technology
Along with developing rapidly of multimedia field application products such as computing machine, mobile phone, people are more and more higher to the requirement that image shows.Because different display techniques has different requirements to size of images, need modified-image size neatly, such as, the resolution of computing machine has the maximum video graphics array (VGA) of " 640 * 480 ", the Super VGA (SVGA) of maximum support " 800 * 600 " and the expansion VGA (XVGA) that maximum is supported " 1024 * 768 " etc. of supporting, and the resolution of mobile phone display screen is usually less than 1/4th VGA (QVGA), just less than 320 * 240.In addition, the unmatched characteristics of display screen and image sensor size also require can change flexibly picture size.Therefore, how to realize that image changes flexibly between different resolution, keep higher picture quality simultaneously, become the problem that current an urgent demand solves.
In the Flame Image Process of computer realm, the amplification of image or dwindle 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 computing machine.But for the terminal device of mobile phone and so on, because the function of CPU is not very powerful, be nowhere near concerning the processing of video scaling, therefore realize that by software video scaling is impossible basically, this just need solve the problem of Flame Image Process with hardware.
For solving Flame Image Process, in general video card, video frequency collection card, use the secondary linear interpolation to realize the image zoom of hardware usually 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 mutual relationship as shown in Figure 1, 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.
Existing image amplifies and dwindles and all utilize above-mentioned formula to realize, Fig. 2 is that existing hardware is realized block diagram.The image of the picture processing chip acceptance pattern image-position sensor output among Fig. 2, and it is left in the outer storer of sheet by writing control module, after a frame had been deposited, picture processing chip was by reading the control module reads image data, and by computing module and s operation control module it carried out computing.In calculating process, the view data that imageing sensor outputs to picture processing chip continues to leave in the storer, that is to say, this storer should store the data of two two field pictures at least.
Implementation is amplified/dwindled to present this digital picture its conspicuous shortcoming:
1, this scheme is owing to need to deposit two frame original images in externally the storer, and institute's canned data of wanting is more, so the more chip external memory of needs, and present chip external memory is generally SDRAM, and cost is higher;
2, this scheme will be after a two field picture leaves storer 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.
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, 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.
For addressing the above problem, the invention provides a kind of method that changes digital image size, the input information of configuration image, filter factor information and convergent-divergent multiple information, this method further may further comprise the steps:
A. according to filter factor information pending image is carried out low-pass filtering, described filter coefficient is determined according to the image zoom ratio;
B. laterally reach the longitudinal size convergent-divergent according to the view data of convergent-divergent multiple information after and handle low-pass filtering, and according to the input information of image finish to image laterally and the longitudinal size convergent-divergent handle, wherein,
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 at this counter 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;
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;
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 at this counter 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;
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.
Low-pass filtering among the described step a is: adopt two-dimentional low-pass filtering.
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.
Among the 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.
Described change digital image size is: the downscaled images size;
Among the step b, the view data after the horizontal convergent-divergent of described preservation is handled is: the view data after horizontal convergent-divergent is handled 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, the view data after the horizontal convergent-divergent of described preservation is handled is: the view data after horizontal convergent-divergent is handled is kept in the image zoom row buffering module that comprises the triplex row line buffer at least.
This method may further include: the output information of configuration image;
Among the described step b, after the view data after the low-pass filtering 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, the view data after horizontal convergent-divergent is handled further comprises after carrying out the processing of longitudinal size convergent-divergent: the view data after according to the output information of image vertical convergent-divergent being handled is carried out the image adjustment.
The present invention also provides a kind of device that 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 configuration image input information, low-pass filtering coefficient and image zoom multiple information, and described configuration information sent to described device, described device comprises with lower module:
The order sending module be used for the low-pass filtering coefficient of host computer configuration is sent to the pre-filtering module, and image zoom multiple information and image input information that host computer is sent sends to the picture size Zoom module;
The pre-filtering module, be used for carrying out low-pass filtering according to the view data that the low-pass filtering coefficient sends the image pretreatment module, and with the image data transmission after the low-pass filtering to image lateral dimension Zoom module, described filter coefficient is determined according to the image zoom ratio;
The picture size Zoom module, be used for transmitting the image zoom multiple information of coming according to the order sending module, the view data that the pre-filtering module is sent laterally reaches convergent-divergent processing longitudinally, and determine laterally and whether vertical processing finishes according to the image input information, this picture size Zoom module also comprises pixel step-length counter and row step-length counter, wherein:
Pixel step-length counter, when having a pixel to arrive, this counter adds one; During greater than the image zoom multiple, described image lateral dimension Zoom module is 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;
Row step-length counter, when having delegation's view data to arrive, this counter adds one; During greater than the image zoom multiple, described image longitudinal size Zoom module obtains two row view data and is weighted on average from image zoom row buffering module at this Counter Value, and with this Counter Value subtracted image convergent-divergent multiple value; Behind a frame image data end of output, this counter O reset.
Described picture size Zoom module comprises: image lateral dimension Zoom module, image zoom row buffering module and image longitudinal size Zoom module, wherein,
Image lateral dimension Zoom module, be used for transmitting the image zoom multiple information of coming 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 zoom row buffering module, and determine according to the image input information whether lateral processes finishes;
Image zoom row buffering module is used to preserve the view data that image lateral dimension Zoom module sends;
Image 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 zoom row buffering module is carried out convergent-divergent processing longitudinally, image data transmission after vertical convergent-divergent processing is gone out, and determine according to the image input information whether vertical processing finishes.
Described picture size Zoom module comprises: image zoom row buffering module, image longitudinal size Zoom module and image 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 longitudinal size Zoom module, be used for transmitting the image zoom multiple information of coming 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, image data transmission after vertically handling is arrived image lateral dimension Zoom module, and determine according to the image input information whether the longitudinal size processing finishes;
Image lateral dimension Zoom module, be used for transmitting the image zoom multiple information of coming according to the order sending module, the view data that image 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.
Described image zoom row buffering module comprises: line buffer;
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.
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 storage register module for reading and writing deposits in.
Described register module comprises: input picture width register, input picture height register pre-filtering coefficient register, image zoom multiple register integral part and image zoom multiple register fraction part.
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.
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 image data transmission is arrived 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 image data transmission is arrived image lateral dimension Zoom module.
Described pre-filtering row buffering module is made up of for the low-pass filtering exponent number subtracts one line buffer number.
Described image lateral dimension Zoom module further comprises:
Pixel step-length counter, when having a pixel to arrive, this counter adds one; During greater than the image zoom multiple, described image lateral dimension Zoom module is 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.
Described image zoom row buffering module comprises: line buffer;
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.
Described image longitudinal size Zoom module further comprises:
Row step-length counter, when having delegation's view data to arrive, this counter adds one; During greater than the image zoom multiple, described image longitudinal size Zoom module obtains two row view data and is weighted on average from image zoom row buffering module at this Counter Value, and with this Counter Value subtracted image convergent-divergent multiple value; Behind a frame image data end of output, this counter O reset.
The present invention program is by carrying out lateral dimension convergent-divergent and longitudinal size convergent-divergent successively to view data, 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 convergent-divergent handles, reduced view data has been carried out the employed time of convergent-divergent, realized real-time processing view data.
The view data that the present invention program preserves after the lateral dimension convergent-divergent is handled 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 storer 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 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
Fig. 1 is the bilinear interpolation synoptic diagram;
Fig. 2 is the structured flowchart of original scheme;
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 reference configuration information of register module shown in Figure 6;
Fig. 8 is a kind of realization synoptic diagram of picture size Zoom module among the present invention;
Fig. 9 realizes synoptic diagram for the another kind of picture size Zoom module among the present invention;
Figure 10 is the structure drawing of device that the present invention is based on picture size Zoom module shown in Figure 8;
Figure 11 is the realization flow figure of image lateral dimension convergent-divergent;
Figure 12 is the realization flow figure of image longitudinal size convergent-divergent among the present invention.
Embodiment
Below in conjunction with drawings and the specific embodiments the present invention program is elaborated.
At first, the bilinear interpolation formula of above-mentioned formula (1) can be changed 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 storer then, these data are amplified longitudinally afterwards again or dwindle.Perhaps at first pre-filtering is handled the data obtain and existed in the storer, amplify longitudinally then or dwindle, again the data after vertical processing are carried out horizontal amplification or dwindle.
Need to prove, dwindle if carry out image, when vertically handling, because when image dwindles, only may produce delegation's output data between per two line data, that is to say, only need calculate according to two line data, therefore current view data that needs storing one row through lateral processes also promptly only needs delegation's line buffer to store the data that lateral processes obtains as storer.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.
By above description as can be seen, 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.
Step 302, pending image is carried out low-pass filtering according to the filter factor information that is disposed.
Step 303, carry out the lateral dimension convergent-divergent according to the view data of the convergent-divergent multiple information that is disposed after and handle, and preserve view data after horizontal convergent-divergent is handled, and handle according to the lateral dimension convergent-divergent that the input information of image finishes image to low-pass filtering;
Step 304, the view data after according to the convergent-divergent multiple information that is disposed horizontal convergent-divergent being handled are carried out the longitudinal size convergent-divergent and are handled, and handle according to the longitudinal size convergent-divergent that the input information of image finishes image.
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 treating apparatus 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.The image zoom treating apparatus comprises order sending module, prefilter 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 disposal 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 also is that the low-pass filtering coefficient should be according to the scaling configuration of image.In addition, adjust for the view data after making image lateral dimension Zoom module in the image zoom treating apparatus 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 prefilter 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 image lateral dimension Zoom module and image longitudinal size Zoom module.
The image that the prefilter module is sent the image pretreatment module carries out low-pass filtering, and the image after the low-pass filtering is sent to image lateral dimension Zoom module.As previously mentioned, the coefficient of this low-pass filtering is configured according to the image zoom ratio by host computer, is forwarded to this module by the order sending module.
The picture size Zoom module image zoom multiple information that forwarding comes according to the order sending module, the view data that the pre-filtering module is sent laterally reaches convergent-divergent processing longitudinally, and determines according to the image input information whether laterally reach vertical processing finishes.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 can be the image compression module that scaled images is compressed, and also can be 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 disposal 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 disposal 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 (IMG_WIDTH), input picture height register (IMG_HEIGHT), prefilter coefficient register (FIR_COEF), image zoom multiple register integral part (ZOOM_INT) and image zoom multiple register fraction part (ZOOM_FRAC).If host computer provides image output information, then this control register also should comprise output image width register (OUT_WIDTH) and output image height register (OUT_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.Such as, if this system's input picture size is 640 * 480, the output image size is 352 * 288, the coefficients by using 0,1/16,3/16,8/16,3/16,1/16,0 of wave filter, and then the configuration of these registers is as shown in Figure 7.These information should be finished from disposing before the image pretreatment module sends to the image zoom disposal system at image.
Above-mentioned picture size Zoom module specifically can be made up of image lateral dimension Zoom module, image zoom row buffering module and image longitudinal size Zoom module, at first finishes the convergent-divergent of lateral dimension by these modules, finishes the convergent-divergent of longitudinal size again.This picture size Zoom module as shown in Figure 8.
Specifically, the image zoom multiple that image lateral dimension Zoom module is transmitted according to the order sending module carries out horizontal convergent-divergent to the image after the prefilter module filtered and handles, 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 zoom row buffering module then is used to preserve the view data that image lateral dimension Zoom module sends.
The image zoom multiple that image longitudinal size Zoom module is transmitted according to the order sending module again carries out the conversion of vertical scale to the image in the image zoom row buffering module, and the image after the conversion is sent to the post processing of image module.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 specifically can also be made up of image zoom row buffering module, image longitudinal size Zoom module and image lateral dimension Zoom module, 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 9.
Specifically, at first preserve the view data that the pre-filtering module is sent by image zoom row buffering module.
Image longitudinal size Zoom module is transmitted the image zoom multiple information of coming 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, and the image data transmission after will vertically handling is to image 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.
Image lateral dimension Zoom module is then transmitted the image zoom multiple information of coming according to the order sending module, and the view data that image 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.
Again the concrete convergent-divergent processing procedure based on device shown in Figure 4 is elaborated below.Wherein, owing to adopt the realization effect of Fig. 8 or picture size Zoom module shown in Figure 9 identical,, therefore only be elaborated below laterally to be scaled example earlier so difference is mainly still carried out vertical convergent-divergent earlier at the horizontal convergent-divergent of advanced row.The device of the picture size Zoom module among employing Fig. 8 as shown in figure 10.
When image is imported, at first by prefilter it is carried out filtering, this system can take the two-dimentional low-pass filtering of n * n, and choosing of filter coefficient will be determined according to the ratio of image zoom, 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 prefilter 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 impact dampers 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 lateral dimension Zoom module, at first it is carried out the convergent-divergent of lateral dimension by image lateral dimension Zoom module.
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 is then by ZOOM_INT register in the order sending module and the decision of ZOOM_FRAC register.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 the ZOOM_INT=000001b=0x01 in the register module of sending module, ZOOM_FRAC=0x0100000000=0x100, thus image lateral dimension Zoom module and image longitudinal size Zoom module can be determined scaling according to these two registers.
In the image lateral dimension Zoom module of native system, a pixel step-length counter (PIXEL_STEP) is arranged,, 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 11, 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 can obtain passing through delegation's view data of horizontal convergent-divergent, and with this image data storage in image zoom line buffer module.
After finishing horizontal convergent-divergent, the size of every row becomes 128 by 160, but height still is 120, and laterally scaled images is stored in image zoom line buffer module and has suffered.As previously mentioned, if image dwindles, then this image zoom line buffer module can be to have only one; If image amplifies, then this image zoom line buffer module should have three.
Present embodiment is that image is dwindled, therefore when the image in the image zoom line buffer module being carried out vertical convergent-divergent by vertical image zoom module, as long as in the image zoom line buffer module delegation's view data has been arranged, and receive another row view data, then can carry out vertical convergent-divergent and handle.Equally, the employed interpolation coefficient of image zoom is configured by host computer, and the image zoom ratio is determined according to register ZOOM_INT in the order sending module and ZOOM_FRAC.Vertically the convergent-divergent processing is identical substantially and laterally for the concrete mode of convergent-divergent processing, it also needs a counter, this counter is row step-length counter (LINE_STEP), in the time of can determining in image zoom row buffering module, to have new delegation to arrive according to this counter, whether need 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 12, wherein, whether the frame of image output 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 image zoom 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 image zoom 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, even without new view data input picture convergent-divergent row buffering module, 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 image 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.
The present invention program is not restricted to utilization listed in instructions and the embodiment, 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 instructions illustrate and describe.

Claims (15)

1, a kind of method that changes digital image size is characterized in that, the input information of configuration image, filter factor information and convergent-divergent multiple information, and this method further may further comprise the steps:
A. according to filter factor information pending image is carried out low-pass filtering, described filter coefficient is determined according to the image zoom ratio;
B. laterally reach the longitudinal size convergent-divergent according to the view data of convergent-divergent multiple information after and handle low-pass filtering, and according to the input information of image finish to image laterally and the longitudinal size convergent-divergent handle, wherein,
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 at this counter 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;
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;
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 at this counter 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;
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.
2, method according to claim 1 is characterized in that, the 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, a kind of device that 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 configuration image input information, low-pass filtering coefficient and image zoom multiple information, and described configuration information sent to described device, it is characterized in that described device comprises with lower module:
The order sending module be used for the low-pass filtering coefficient of host computer configuration is sent to the pre-filtering module, and image zoom multiple information and image input information that host computer is sent sends to the picture size Zoom module;
The pre-filtering module, be used for carrying out low-pass filtering according to the view data that the low-pass filtering coefficient sends the image pretreatment module, and with the image data transmission after the low-pass filtering to the picture size Zoom module, described filter coefficient is determined according to the image zoom ratio;
The picture size Zoom module, be used for transmitting the image zoom multiple information of coming according to the order sending module, the view data that the pre-filtering module is sent laterally reaches convergent-divergent processing longitudinally, and determine laterally and whether vertical processing finishes according to the image input information, this picture size Zoom module also comprises pixel step-length counter and row step-length counter, wherein:
Pixel step-length counter, when having a pixel to arrive, this counter adds one; During greater than the image zoom multiple, described image lateral dimension Zoom module is 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;
Row step-length counter, when having delegation's view data to arrive, this counter adds one; During greater than the image zoom multiple, described image longitudinal size Zoom module obtains two row view data and is weighted on average from image zoom row buffering module at this Counter Value, and with this Counter Value subtracted image convergent-divergent multiple value; Behind a frame image data end of output, this counter O reset.
8, device according to claim 7 is characterized in that, described picture size Zoom module comprises: image lateral dimension Zoom module, image zoom row buffering module and image longitudinal size Zoom module, wherein,
Image lateral dimension Zoom module, be used for transmitting the image zoom multiple information of coming 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 zoom row buffering module, and determine according to the image input information whether lateral processes finishes;
Image zoom row buffering module is used to preserve the view data that image lateral dimension Zoom module sends;
Image 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 zoom row buffering module is carried out convergent-divergent processing longitudinally, image data transmission after vertical convergent-divergent processing is gone out, and determine according to the image input information whether vertical processing finishes.
9, device according to claim 7 is characterized in that, described picture size Zoom module comprises: image zoom row buffering module, image longitudinal size Zoom module and image 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 longitudinal size Zoom module, be used for transmitting the image zoom multiple information of coming 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, image data transmission after vertically handling is arrived image lateral dimension Zoom module, and determine according to the image input information whether the longitudinal size processing finishes;
Image lateral dimension Zoom module, be used for transmitting the image zoom multiple information of coming according to the order sending module, the view data that image 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.
10, according to Claim 8 or 9 described devices, it is characterized in that described image zoom row buffering module comprises: line buffer;
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.
11, device according to claim 7 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 storage register module for reading and writing deposits in.
12, device according to claim 11, it is characterized in that described register module comprises: input picture width register, input picture height register, pre-filtering coefficient register, image zoom multiple register integral part and image zoom multiple register fraction part.
13, device according to claim 12 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.
14, device according to claim 7 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 image data transmission is arrived 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 image data transmission is arrived image lateral dimension Zoom module.
15, device according to claim 14 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.
CNB2005100568928A 2005-03-28 2005-03-28 Method and apparatus for changing digital image size Expired - Fee Related CN100356405C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005100568928A CN100356405C (en) 2005-03-28 2005-03-28 Method and apparatus for changing digital image size

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005100568928A CN100356405C (en) 2005-03-28 2005-03-28 Method and apparatus for changing digital image size

Publications (2)

Publication Number Publication Date
CN1652155A CN1652155A (en) 2005-08-10
CN100356405C true CN100356405C (en) 2007-12-19

Family

ID=34876794

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005100568928A Expired - Fee Related CN100356405C (en) 2005-03-28 2005-03-28 Method and apparatus for changing digital image size

Country Status (1)

Country Link
CN (1) CN100356405C (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8290300B2 (en) * 2008-07-31 2012-10-16 Adobe Systems Incorporated Seam-based reduction and expansion of images with color-weighted priority
KR20110048794A (en) * 2009-11-03 2011-05-12 삼성전자주식회사 Image processor and electric device including the same
JP5972687B2 (en) * 2012-07-02 2016-08-17 株式会社Nttドコモ Moving picture predictive coding apparatus, moving picture predictive coding method, moving picture predictive coding program, moving picture predictive decoding apparatus, moving picture predictive decoding method, and moving picture predictive decoding program
CN103106395A (en) * 2012-12-15 2013-05-15 长春理工大学 Geometry normalization kernel device of license plate character real-time recognition system
CN103903285B (en) * 2012-12-25 2017-05-10 三星电子(中国)研发中心 Thumbnail extraction method of PNG image and BMP image
CN103179324A (en) * 2013-03-27 2013-06-26 珠海全志科技股份有限公司 Image sharpening method and device
CN107508967A (en) * 2017-07-21 2017-12-22 努比亚技术有限公司 A kind of image magnification method, terminal and computer-readable recording medium
CN107657587A (en) * 2017-10-23 2018-02-02 北京嗨动视觉科技有限公司 Image processing method, apparatus and system
CN111369444B (en) * 2020-03-31 2024-02-27 浙江大华技术股份有限公司 Image scaling processing method and device
CN117641063B (en) * 2023-12-05 2024-08-27 北京视睿讯科技有限公司 Video source previewing method and device, electronic equipment and storage medium

Citations (6)

* 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
US20020159655A1 (en) * 2001-04-30 2002-10-31 Kun-Nan Cheng Apparatus and method of using scaling device of pre-filter
US6556193B1 (en) * 1999-04-02 2003-04-29 Teralogic, Inc. De-interlacing video images using patch-based processing
CN1471310A (en) * 2002-07-26 2004-01-28 ������������ʽ���� Camera 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 (6)

* 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
US6556193B1 (en) * 1999-04-02 2003-04-29 Teralogic, Inc. De-interlacing video images using patch-based processing
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
US20020159655A1 (en) * 2001-04-30 2002-10-31 Kun-Nan Cheng Apparatus and method of using scaling device of pre-filter
CN1471310A (en) * 2002-07-26 2004-01-28 ������������ʽ���� Camera device
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
CN1652155A (en) 2005-08-10

Similar Documents

Publication Publication Date Title
CN100356405C (en) Method and apparatus for changing digital image size
US8866646B2 (en) Memory compression technique with low latency per pixel
CN102263880B (en) Image scaling method and apparatus thereof
US8989509B2 (en) Streaming wavelet transform
US8164662B2 (en) Image-processing device for color image data and method for the image processing of color image data
CN1110015C (en) Picture processing apparatus and processing method
CN103916612A (en) Random proportion zoom system and method
US20090033760A1 (en) Apparatus and method for processing image data
US7929777B2 (en) Variable length decoding device, variable length decoding method and image capturing system
CN100379249C (en) A method and apparatus for changing digital image size during process of shooting
CN100562919C (en) Vision signal is carried out the apparatus and method that vertical resolution is adjusted
US20090179913A1 (en) Apparatus for image reduction and method thereof
US20070046792A1 (en) Image compositing
US20090087119A1 (en) Method and apparatus for arbitrary ratio image reduction
TW200949759A (en) Image processing apparatus and method
CN1293514C (en) Pantograph treatment system of digital picture
EP1353510A2 (en) Image processing apparatus and image processing method
CN100551067C (en) The image data processing system and the method for non-standard picture size during the jpeg image compression
CN102694962A (en) Noise reduction method and apparatus
CN2736865Y (en) Zoom processing system for digital image
CN102118598B (en) Device and method for processing videos
CN1327711C (en) Method and apparatus for video decoding and de-interlacing
JP4700838B2 (en) Filter processing device
CN101175141A (en) Image processing device and image processing method
KR20040065806A (en) Cubic convolution interpolation apparatus and method

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
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20071219

Termination date: 20120328