Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.
In order to illustrate technical solutions according to the invention, illustrated below by specific embodiment.
Fig. 1 shows the implementation process for the x-ray chest radiograph image processing method that one embodiment of the invention is provided, this method process
Details are as follows:
In step S101, the positional information and the positional information of backbone of body's border in x-ray chest radiograph are obtained.
Exemplary, the present embodiment is carried out true by watershed algorithm to the position of body's border in x-ray chest radiograph and backbone
It is fixed.It should be noted that why the present embodiment selects watershed algorithm, it is because the basic thought of watershed algorithm is to scheme
As regarding that the gray value of each pixel in the topological landforms in geodesy, image represents the height above sea level of the point as, each
Local minimum and its influence area are referred to as reception basin, and the border of reception basin then forms watershed, and by gradient magnitude image
Split as the input picture of watershed algorithm.Based on this, the present embodiment will it is smooth after image(15 × 15 medium filterings
Handle the image obtained)Instead of input picture (I of the gradient magnitude image as watershed algorithmsmooth), the advantage so handled
The over-segmentation phenomenon of watershed algorithm is reduction of, while obvious body's border and backbone in x-ray chest radiograph can be obtained
Position.
Watershed algorithm output image in addition to comprising required body's border and backbone position, also exist rib,
The border interference of the transverse direction bone such as clavicle, the present embodiment also filters out the dry of horizontal boundary by the opening operation in vertical direction
Disturb, only retain body's border and the backbone position of longitudinal direction.3 maximum connected domains of longitudinal length are extracted, and according to position of centre of gravity
Abscissa judge right boundary and the backbone position of body, the position of its center of gravity is respectively from left to right body left margin, ridge
Post and body right margin(As shown in Figure 2).
In step s 102, according to the positional information of the body's border, the body region in the x-ray chest radiograph is determined,
And relevant matches are carried out by the multiple body marker templates and the body region being pre-created, by correlation highest body mould
Image outside plate is set to zero to obtain initial pictures.
Because different personal shape is different, the present embodiment is according to the body shape of people(The especially journey of becoming thin of shoulder
Degree)Create M(M is the integer more than 0, M=3 preferably)Individual body marker template(As shown in Figure 3), and according to the body's border
Positional information calculation obtains shoulder width, according to the shoulder width, the side that the M body marker template of establishment is passed through into scaling
Formula carries out relevant matches with the body region(As shown in Figure 4), correlation highest body marker template is obtained, and by correlation
Image outside highest body marker template is set to zero to obtain initial pictures.
Wherein, the relevant matches calculation formula is:
f(X, y) represent original image(When body marker template is matched, the artwork is the body region image;In rib mould
When plate is matched, the artwork is left and right Bone images), w(X, y) matching template is represented, F (u, v) represents f(X, y) Fourier
Conversion, H (u, v) represents w(X, y) Fourier transformation, "." correlation operation is represented, " * " represents complex conjugate.
Image outside correlation highest body marker template is set to zero by the present embodiment, only the image inside reservation, it is to avoid
The interference that bone outside skull, clavicle and other bodies is positioned to rib.
In step s 103, Bone images are extracted from the initial pictures by medium filtering thresholding algorithm.
Particularly, minor radius median filter process is carried out to the initial pictures and obtains smoothed image Ismooth;
Large radius median filter process is carried out to the initial pictures(Image is after large radius median filter process, figure
The information that the details of picture includes rib will be filtered out), and by the image I after large radius median filter processremove detailMake
The smoothed image is split for threshold plane, i.e. Idetail=|Ismooth-Iremove detail|, obtain Bone images
Idetail, as shown in Figure 5.IdetailThe rib information of the overwhelming majority is contained in image, while eliminating uneven background;
According to predetermined threshold value(Preferably 3)Binary conversion treatment is carried out to the Bone images, detailed process example is as follows, if
Brightness value is Gray, and the Gray pixels for being more than or equal to threshold value 3 are placed in into white, and the Gray pixels for being less than threshold value 3 are put
In black.
In step S104, the Bone images are divided into by two parts in left and right according to the positional information of the backbone;
In step S105, carried out respectively with described two parts in left and right by the multiple left and right rib templates being pre-created
Relevant matches are divided with obtaining dependency graph picture to the dependency graph picture, obtain left and right rib in x-ray chest radiograph
Positional information.
The present embodiment is before relevant matches are carried out to the rib head portrait, it is necessary to will according to the positional information of the backbone
The Bone images are divided into left and right two parts, i.e. left and right Bone images, and by the multiple left and right rib templates being pre-created
(As shown in Figure 6)Relevant matches are carried out with described two parts in left and right respectively by way of scaling and/or rotating, phase is obtained
Closing property image(As shown in 7a, 7b in Fig. 7, wherein Fig. 7 a are left rib dependency graph picture, and Fig. 7 b are right rib dependency graph
Picture).
It should be noted that the present embodiment is pre-created multiple left and right rib templates according to the average shape of rib.And root
According to the positional information of the body's border obtained before, estimate the width of rib, left and right rib template is zoomed to and the rib
Width identical size.Because the angle of inclination of rib in different templates is different, this implementation is needed to the left and right rib template
The rotation of 0~15 ° of progress, carries out relevant matches, acquisition is related by each postrotational left and right rib template with Bone images
Property image.
Further, the present embodiment also includes:
With the N of the maximum related value obtained in phase relation matching process(It is preferred that N=0.7)Times for thresholding to the correlation
Image is divided, and obtains one or more rib matched positions(As shown in Figure 8), the N is normal more than zero but less than 1
Number.As shown in figure 8, each connected domain represents one or more rib matched positions.Preferably, the present embodiment in order to split away from
From close rib matched position, with 0.7 times of the maximum related value in connected domain for thresholding, each connected domain is carried out again
Threshold segmentation, the rib matched position separated(As shown in Figure 9), each connected domain only represents an independent rib in Fig. 9
Matched position.It is rib matched position coordinate, i.e. rib template to take the coordinate in each connected domain where maximum related value
Starting point coordinate.Starting point coordinate is limited in the range of certain abscissa, and the starting point coordinate of left rib is limited in a body left side
Border 20 pixels of a left side are in right 50 pixel coverage, and the starting point coordinate of right rib is limited in backbone 20 pixels of a left side to right 50 pixel model
In enclosing.Simultaneously to avoid the multiple matching problem of same rib, the close coordinate of starting point ordinate is taken by preset rules
Give up, the preset rules can be:1)Longitudinal average headway of starting point coordinate is calculated, if the longitudinal pitch in the presence of 2 points is less than
The half of average headway, then depending on there is any to need to reject in this 2 points, but except the starting point of first and second rib;2)Respectively
Calculate 1)Described in 2 points with nearest starting point(Do not include at this 2 points)The distance between, retain and the nearest starting point
Point in larger distance, rejects point in small distance.Complete after Weeding, by remaining starting point coordinate and postrotational rib
Template coordinate is added as rib matched position.
Preferably, the present embodiment constructs to select the anglec of rotation best with the Bone images matching effect
One is weighed the whether optimal parameter of angle, i.e.,Wherein left rib K span is 0.8
The constant of≤K≤1.2, L span is the constant of 0.02≤L≤0.03, K=1, L=0.025 preferably;Right rib K's takes
It is worth the constant that scope is 0.8≤K≤1.2, L span is the constant of 0.8≤L≤1.2, K=1, L=1 preferably.In this reality
Apply in example, parameter Z linear degree is better, illustrate that the position distribution of rib in Bone images is distributed closer to experience.This implementation
Example selects optimal matching angle by calculating the linear degree of parameter Z under each anglec of rotation(As shown in Figure 10).
Further, in order to ensure that each region only has a rib, the present embodiment also includes:
The center line of adjacent rib template matches position is obtained, and according to the center line, goes out to make by least square fitting
For the conic section in rib region line of demarcation(As shown in figure 11).
The beneficial effect that the embodiment of the present invention exists compared with prior art is:(1)Image after will be smooth is used as a point water
The input picture of ridge algorithm obtains the positional information of body's border and the positional information of backbone in x-ray chest radiograph, can effectively reduce
The over-segmentation phenomenon of watershed algorithm, while the positional information of obvious body's border and backbone in x-ray chest radiograph can be obtained;
(2)Gauss curved thresholding algorithm is replaced by medium filtering thresholding algorithm, when picture quality is preferable, rib segmentation effect is approached
In Gauss curved thresholding algorithm, when picture quality is poor, rib part still can be obtained as far as possible, the general of algorithm is improved
Adaptive, in figure 12 it can be seen that compared with Gauss curved thresholding algorithm, the medium filtering thresholding algorithm of the present embodiment is in processing
Had a clear superiority during the x-ray chest radiograph image of shooting quality difference, Figure 12 c are more more complete than what Figure 12 b Bone images were preserved, press down simultaneously
The interference of its hetero-organization of the body interior such as backbone is made, wherein Figure 12 a are the poor x-ray chest radiograph images of shooting quality, and Figure 12 b are
The Bone images that Gauss curved thresholding algorithm is obtained, Figure 12 c are the Bone images that the present embodiment medium filtering thresholding algorithm is obtained;
(3)In rib positioning, by body marker template and rib template the progress relevant matches of establishment independent of x-ray chest radiograph figure
The geometry and position distribution of rib as in, the size of template is adjusted according to the information of image itself, the Shandong of algorithm is improved
Rod;(4)Rib is positioned by relevant matches, compared with Hough transformation, the processing time of image is greatly reduced
(About 50 seconds), realize the quick positioning of rib;(5)The parameter for weighing matching result is constructed, by analyzing different rotary angle
Spend the linear character of the lower parameter to obtain best matching result so that the positioning of rib is more accurate.
Figure 13 shows the composition structure for the x-ray chest radiograph image processing system that another embodiment of the present invention is provided, in order to just
In explanation, the part related to the embodiment of the present invention illustrate only.
The x-ray chest radiograph image processing system can be applied to various image processing terminals, such as pocket computer(Pocket
Personal Computer, PPC), palm PC, computer, notebook computer, personal digital assistant(Personal
Digital Assistant, PDA)Deng software unit, hardware cell or software and hardware in these terminals can be operate in
The unit being combined, can also be integrated into these terminals or run on the application system of these terminals as independent suspension member
In.
The x-ray chest radiograph image processing system includes location information acquiring unit 131, initial pictures acquiring unit 132, rib
Image acquisition unit 133, image division unit 134 and rib position determination unit 135.Wherein, the concrete function of each unit
It is as follows:
Believe location information acquiring unit 131, the position for obtaining the positional information of body's border and backbone in x-ray chest radiograph
Breath;
Initial pictures acquiring unit 132, for the position of the body's border obtained according to the location information acquiring unit 131
Confidence ceases, and determines the body region in the x-ray chest radiograph, and multiple body marker templates and the body region by being pre-created
Relevant matches are carried out, the image outside correlation highest body marker template is set to zero to obtain initial pictures;
Bone images acquiring unit 133, for extracting rib from the initial pictures by medium filtering thresholding algorithm
Image;
The Bone images are divided into left and right two by image division unit 134 for the positional information according to the backbone
Individual part;
Rib position determination unit 135, for multiple left and right rib templates by being pre-created respectively with it is described left and right
Two parts carry out relevant matches to obtain dependency graph picture, and the dependency graph picture is divided, and obtain x-ray chest radiograph
The positional information of middle left and right rib.
Further, the relevant matches calculation formula is:
Wherein, f(X, y) represent original image, w(X, y) matching template is represented, F (u, v) represents f(X, y) Fourier become
Change, H (u, v) represents w(X, y) Fourier transformation, "." correlation operation is represented, " * " represents complex conjugate.
Further, the Bone images acquiring unit 133 includes:
Smoothed image acquisition module 1331, obtains smooth for the initial pictures to be carried out with minor radius median filter process
Image;
Bone images acquisition module 1332, for the initial pictures to be carried out with large radius median filter process, and will be big
Image after median radius filtering process is split as threshold plane to the smoothed image, obtains Bone images;
Binary conversion treatment module 1333, for carrying out binary conversion treatment to the Bone images according to predetermined threshold value.
Further, the rib position determination unit 135 includes:
Correlation image collection module 1351, for by the multiple left and right rib templates being pre-created by scaling and/or
The mode of rotation carries out relevant matches with described two parts in left and right respectively, obtains dependency graph picture;
First position determining module 1352, for being door with N times of maximum related value obtained in phase relation matching process
Limit is divided to the dependency graph picture, obtains one or more rib matched positions, and the N is more than zero but less than 1
Constant;
Second place determining module 1353, for described N times be thresholding to one or more of rib matched positions
Divided with the matched position of each rib after being separated;
Wherein, the optimal rotation angle of left and right rib template is obtained by below equation:
Wherein left rib K span is the constant of 0.8≤K≤1.2, and L span is 0.02≤L≤0.03
Constant, K=1, L=0.025 preferably;Right rib K span is the constant of 0.8≤K≤1.2, and L span is 0.8
The constant of≤L≤1.2.
Further, the system also includes:
Fitting unit 136, the center line for obtaining adjacent rib template matches position, and according to the center line, by most
Small square law fits the conic section as rib region line of demarcation.
It is apparent to those skilled in the art that, for convenience and simplicity of description, only with above-mentioned each function
Unit, the division progress of module are for example, in practical application, as needed can distribute above-mentioned functions by different work(
Can unit, module complete, i.e., the internal structure of described system is divided into different functional unit or module, to complete above description
All or part of function.Each functional unit or module in embodiment can be integrated in a processing unit, can also
That unit is individually physically present, can also two or more units it is integrated in a unit, above-mentioned integrated list
Member or module can both be realized in the form of hardware, it would however also be possible to employ the form of SFU software functional unit is realized.In addition, each function
Unit, the specific name of module are also only to facilitate mutually differentiation, is not limited to the protection domain of the application.Above-mentioned system
Unit, the specific work process of module, may be referred to the corresponding process of preceding method embodiment, will not be repeated here in system.
In summary, the beneficial effect that the embodiment of the present invention exists compared with prior art is:(1)Image after will be smooth
The positional information of body's border and the positional information of backbone in x-ray chest radiograph are obtained as the input picture of watershed algorithm, can
The over-segmentation phenomenon of watershed algorithm is effectively reduced, while obvious body's border and backbone in x-ray chest radiograph can be obtained
Positional information;(2)Gauss curved thresholding algorithm is replaced by medium filtering thresholding algorithm, when picture quality is preferable, rib point
Effect is cut close to Gauss curved thresholding algorithm, when picture quality is poor, rib part still can be obtained as far as possible, is improved
The universality of algorithm, in figure 12 it can be seen that compared with Gauss curved thresholding algorithm, the medium filtering threshold value of the present embodiment
Algorithm is had a clear superiority when handling the x-ray chest radiograph image of shooting quality difference, and Figure 12 c are preserved more than Figure 12 b Bone images
Completely, while inhibiting the interference of its hetero-organization of the body interior such as backbone, wherein Figure 12 a are the poor x-ray chest radiographs of shooting quality
Image, Figure 12 b are the Bone images that Gauss curved thresholding algorithm is obtained, and Figure 12 c are that the present embodiment medium filtering thresholding algorithm is obtained
The Bone images taken;(3)In rib positioning, relevant matches are carried out by the body marker template and rib template of establishment and disobeyed
Rely the geometry and position distribution of the rib in x-ray chest radiograph image, the size of template is adjusted according to the information of image itself, is carried
The high robustness of algorithm;(4)Rib is positioned by relevant matches, compared with Hough transformation, figure is greatly reduced
The processing time of picture(About 50 seconds), realize the quick positioning of rib;(5)The parameter for weighing matching result is constructed, by dividing
Analyse the linear character of the parameter under different rotary angle to obtain best matching result so that the positioning of rib is more accurate.This hair
Bright embodiment has stronger usability and practicality.
Those of ordinary skill in the art are further appreciated that all or part of step realized in above-described embodiment method is can
To instruct the hardware of correlation to complete by program, described program can be stored in a computer read/write memory medium
In, described storage medium, including ROM/RAM, disk, CD etc..
Above content is to combine specific preferred embodiment further description made for the present invention, it is impossible to assert
The specific implementation of the present invention is confined to these explanations.For general technical staff of the technical field of the invention,
Some equivalent substitutes or obvious modification are made on the premise of not departing from present inventive concept, and performance or purposes are identical, all should
It is considered as belonging to the scope of patent protection that the present invention is determined by the claims submitted.