Background technology
Zoom technology receives much concern in Medical Image Processing always.In recent years, because digital image device, as digital video camera, being extensive use of of High Resolution Display is the image demonstration in high quality on the vision facilities of different resolution that realizes equal resolution, and the digital image scaling technology causes researcher's attention once more.At present, very abundant about the technology and the document of digital image scaling both at home and abroad, because it should have the purpose difference, evaluation criterion mainly is a shape facility, topological characteristic, multiple factor such as computational complexity.Image-scaling method at present commonly used is as contiguous method, bilinear interpolation, and bicubic interpolation has provided the general processing of image zoom, is common in during business software and general image software convergent-divergent handle.In existing image processing techniques research, image dwindles directions such as trend large scale, many characteristic synthetics.And method commonly used is when carrying out Flame Image Process, be to be model with the point, image carried out single linear handle, do not consider the relation between the image pixel, as the influence of the zone of edge, texture, therefore can't produce the multiresolution data of satisfying the demand to image zoom.
People such as Kim have proposed the interpolation algorithm based on area, and this method combines contiguous method and keeps the advantage of high frequency response of image and the advantage that Bilinear Method keeps image smoothness, can produce higher picture quality.Afterwards, occurred,, and the two has been applied in the method that inserts in the fuzzy inference system, carried out the Zoom method of interpolation along boundary direction in conjunction with the pixel grey scale value difference based on area-method.These methods provide aspect shape facility than the higher-quality image of traditional interpolation method.These interpolation methods generally are used to handle gray level image, and are applicable to that zoom factor is no more than 2 o'clock situation more.Handle bianry image and carry out the big factor when dwindling when using it for, the topological structure of image falls destroyed.
In general natural image, shape is the principal element that the human visual system discerns, and image dwindles algorithm generally by keeping shape to reach good visual effect.And in pattern-recognition and target search coupling, the content that need come recognition image with topology information, complete or close topological structure is important basis of characterization.The topological structure of image embodies by connectedness, if connective the maintenance better, then topological structure keeps well.
Take up room for a short time because of bianry image has, be convenient to storage and advantage such as transmission, in life, be extensive use of,, propagate and information inquiring the signature in the text image, map etc. as the document of reading.In these were used, the analysis strategy in image detection and the coupling from coarse to meticulous needed the image of different resolution, and it is essential that the convergent-divergent of different scale becomes.Two power power dwindle that the factor has provided the simple of picture structure and effectively pyramid represent.Pyramidal low resolution can be used for analyzing the whole content of big structure or image, and high resolving power can be used for analyzing the characteristic of single body, for the multiresolution check sample is provided in pattern-recognition.
Summary of the invention
(1) technical matters that will solve
The technical problem to be solved in the present invention is the topological structure that keeps the image after big multiple dwindles, and reduces computation complexity, and improves computing velocity.
(2) technical scheme
At the deficiencies in the prior art, a kind of image downscaling method that keeps the image topological structure is provided, may further comprise the steps:
S1 is 2 for size
M-k+1X2
N-k+1Bianry image I
kCarry out piecemeal, wherein, belong to a piecemeal, be divided into into 2 by every 2x2 pixel
M-kX2
N-kPiece, each piecemeal p
k(i j) comprises
Individual object pixel, wherein, k represents number of iterations, and initial value is 1, and m, n, i and j are positive integer, 1≤i≤m, 1≤j≤n,
S2, according to the human visual system with piecemeal p
k(i j) is divided into smooth domain and fringe region;
S3 is to being positioned at the pixel I of smooth domain
K+1(i j), dwindles according to the human visual system; To being positioned at the pixel I of fringe region
K+1(i, j), according to pixel I
K+1(i is j) at bianry image I
kIn the connective sorting result of defined neighborhood template dwindle;
S4 carries out interative computation to image I according to step S1~S3
kDwindle, obtaining dwindling the factor is SF=2
αX2
αTarget image I
α+1, target image I
α+1Size be 2
M-αX2
N-α, wherein, α is a positive integer, α<min{m, n}.
Wherein,
Step S2 is specially: when
Or
The time, with piecemeal p
k(i j) is defined as smooth domain; When
Or
The time, with piecemeal p
k(i j) is defined as fringe region.
Among the step S3, to being positioned at the pixel I of smooth domain
K+1(i, j), the step of dwindling according to the human visual system is specially: when
The time, with pixel I
K+1(i j) is reduced into 1, when
The time, with pixel I
K+1(i j) is reduced into 0; To being positioned at the pixel I of fringe region
K+1(i, j), according to I
K+1(i is j) at bianry image I
kIn the connective sorting result of the defined neighborhood template step of dwindling specifically comprise:
S31, definition I
K+1(i is j) at I
kThe neighborhood template of middle 6x6 is M
k(i, j), M
k(i is j) with p
k(i j) is the center, and has
Individual object pixel;
S32, definition is with I
K+1(i j) is reduced into 0 or at 1 o'clock, and the neighborhood template after the renewal is respectively
With
And definition hor
k(i, j) and ver
k(i, j),
With
With
Be respectively template M
k(i, j), template
And template
Level and vertical connection variable, if the neighborhood template is level or vertical connection, be 1 then, otherwise value is 0 with corresponding horizontal or vertical variable-value;
S33, the pixel I that is positioned at fringe region that obtains according to step S32
K+1(i, the connective situation and the human visual system of three templates j) are to being positioned at the pixel I of fringe region
K+1(i j) dwindles; With I
K+1(i j) is reduced into after 0 or 1, utilizes template M
k(i is j) at I
K+1(i, j) the respective pixel I in
K+1(i-1, j-1), I
K+1(i-1, j), I
K+1(i-1, j+1) and I
K+1(i is j-1) to template M
k(i j) upgrades, and dwindles the connectedness of back image with embodiment.
Wherein, among the step S32, judge template M according to following principle
k(i, j),
Or
Whether be level or vertical connection: if template has a length in level or vertical direction, judges that then template is is level or vertical connection, be not level or vertical connection otherwise be judged as if being 5 8-access (also can be described as the 8-path).
Wherein, described object pixel is black picture element or white pixel, and wherein, 1 as color of object, and 0 is background colour.
(3) beneficial effect
Compared with prior art, technical scheme of the present invention is handled according to each piece zone of connectivity pair of human visual system and local neighborhood, wherein, by dwindling pixel the influence of image local connectedness is judged, the connective maximum possible that has guaranteed downscaled images is consistent with original image, thereby has kept topological structure; Smooth region only needs additive operation and judgement, and fringe region only needs connective judgement, and computation complexity is low; Utilize the piecemeal thinking to handle, computing velocity is fast.Therefore, thisly carry out the method that big multiple dwindles, under the situation of dwindling big multiple, kept the topological structure of original image, and computation complexity is low, computing velocity is fast at bianry image.This technical scheme can also expand to carries out than in the application that multiple dwindles greatly gray scale and coloured image.
Embodiment
Below in conjunction with drawings and Examples, the specific embodiment of the present invention is described in further detail.Following examples are used to illustrate the present invention, but are not used for limiting the scope of the invention.
Fig. 1 shows and generates 2x2 according to one embodiment of present invention, and 4x4 and 8x8 doubly dwindle the synoptic diagram of the image downscaling method of the factor.As shown in Figure 1, at first in step 101, import one 2
mX2
nThe bianry image I of size
1Bianry image I
1Only have two kinds of colors: black and white.Bianry image I
1Can be represented as 2
mX2
nMatrix.Element in this matrix is 0 and 1, wherein 0 represents white pixel, and 1 represents black picture element, and here, the selection black picture element is an object pixel.Original image I
1Can perhaps can directly produce on demand from image source (for example storer or image acquiring apparatus (for example camera)) input by machine or people.
In step 101, the factor 2 is dwindled in input
αX2
αHere, α<min{m, n}, because the present invention adopts process of iteration to carry out dwindling of two power power factor multiple, each iteration is carried out 2x2 with image and is doubly dwindled, and therefore produces and dwindles the factor 2
αX2
αImage, need α step iteration (concrete iterative process is referring to Fig. 2).α generally requires according to picture quality and memory requirement is selected, and when the needs distinct image, selects less α, and it is many that take storage space this moment.When requiring image under discernible situation, during the maximum possible conserve storage, select bigger α, this moment, picture quality relatively can be lower.The selection of α will guarantee that generally downscaled images can be identified, and downscaled images is meaningful.
Then, according to shown in Figure 1, in step 102, with bianry image I
1Carry out piecemeal, every 2x2 pixel belongs to a piecemeal, and entire image is divided into into 2
M-1X2
N-1Piece.
Then, in step 103, with produce above 2
M-1X2
N-1Piecemeal carries out the statistics of black picture element number.To being positioned at the pixel I of smooth domain
K+1(i j), dwindles according to the human visual system: according to the human visual system, when the black picture element number equals 4, this piecemeal is reduced into 1, when the black picture element number equals 0, this piecemeal is reduced into 0.When to being positioned at the pixel I of fringe region
K+1(i when j) dwindling, dwindles the black picture element number and belongs to 1,2, during 3 three kinds of situations, need carry out the connectedness classification this moment and judge that this situation will be carried out following processing in conjunction with human visual system and connectedness:
When the black picture element number equals 1,, should be condensed to white according to the human visual system, but after this piecemeal is condensed to white pixel, the neighborhood of piecemeal place image is connective destroyedly to be fallen, and
classification 2,3,4,7,12 o'clock promptly occur, and this piecemeal is reduced into black picture element.When the black picture element number equals 3,, should be condensed to black according to the human visual system, but after this piecemeal is condensed to black picture element, the neighborhood of piecemeal place image is connective destroyedly to be fallen, and
classification 6,10,13,14,15 o'clock promptly occur, and this piecemeal is reduced into white pixel.When the black picture element number equaled 2, the human visual system can't determine that piecemeal is condensed to black or white.When piecemeal belongs to
classification 2,3,4,5,7,9,12 the time, must keep the connectedness of this piecemeal place neighborhood, it is reduced into black picture element.When piecemeal belongs to
classification 1,6,8,10,11,13,14,15,16 the time, this piecemeal need be reduced into white pixel, could not destroy the connectedness of its place neighborhood.Finish dealing with from I according to this
1To I
2Dwindle processing, the same method of dwindling is carried out iterative processing, obtaining dwindling the factor is 2
αX2
αTarget image.The classification situation is with reference to table 1, and specifically, table 1 is by I
K+1(i, neighborhood template M j)
k(i, j),
With
The pixel classification situation (synoptic diagram of three adjacent mold plate as shown in Figure 3) of dwindling determined of connectedness.
Table 1
Fig. 4 shows according to of the present invention and dwindles the downscaled images I that method obtains
2, I
3And I
4As shown in Figure 4, original image I
1Be black and white binary image, the image size is 256x256, and dwindling the factor is SF=2
3X2
3As can be seen by original image I
1Through 2x2 doubly, 4x4 times, after 8x8 doubly dwindled, though image detail is lost gradually, the connectivity of image was not lost, thereby can keep the topological structure of image under low resolution.
The method of the embodiment of the invention can be used combine to form and generate downscaled images with multi-resolution images such as visual password, picture browsing, is applied on the vision facilities, carries out as digital camera, Video Camera, mp4, computer etc. that multiresolution is browsed and Flame Image Process.And this downscaled images is applicable to that also search field carries out Target Recognition and coupling.
Gray level image and coloured image can be divided into 8 bit planes, and each bit plane is a bianry image, can use the method for this invention to handle respectively 8 bit planes, are reconfigured to gray level image according to 8 bit planes again.
One of application of the method for the embodiment of the invention is as follows: in visual cryptography with encrypted image I
1At first dwindle, produce discernible low-resolution image, use downscaled images to carry out visual cryptography then, produce the close figure of reconstruct with less pixel expansion.
The above only is a preferred implementation of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the technology of the present invention principle; can also make some improvement and modification, these improve and modification also should be considered as protection scope of the present invention.