CN107977973A - The method and device on beam-defining clipper irradiation field border in a kind of acquisition medical diagnostic images - Google Patents
The method and device on beam-defining clipper irradiation field border in a kind of acquisition medical diagnostic images Download PDFInfo
- Publication number
- CN107977973A CN107977973A CN201610942122.1A CN201610942122A CN107977973A CN 107977973 A CN107977973 A CN 107977973A CN 201610942122 A CN201610942122 A CN 201610942122A CN 107977973 A CN107977973 A CN 107977973A
- Authority
- CN
- China
- Prior art keywords
- edge
- border
- pending image
- irradiation field
- image
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10116—X-ray image
Abstract
The embodiment of the invention discloses a kind of method for obtaining beam-defining clipper irradiation field border in medical diagnostic images, including:Obtain pending image;Obtain the vertical gradient image and horizontal gradient image of the image;The gradient for obtaining every straight line in vertical gradient image and horizontal gradient image adds up and obtains first set and second set;Maximum and minimum value in first set and second set are searched, determines that the straight line in first set and second set corresponding to maximum and minimum value is the first edge, the second edge, the 3rd edge and the 4th edge respectively;Determine the border that the first edge, the second edge, the 3rd edge and the 4th edge are beam-defining clipper irradiation field in pending image.Method provided in an embodiment of the present invention, the weak and affected by noise and incoherent beam-defining clipper irradiation field in border of border contrast can be accurately detected, easy to the region beyond beam-defining clipper irradiation field in image be removed during subsequent treatment, improve the precision of later image handling result.
Description
Technical field
The present invention relates to beam-defining clipper irradiation field in technical field of image processing, more particularly to a kind of acquisition medical diagnostic images
The method and device on border.
Background technology
In order to make the x-ray dose that patient receives few as far as possible, usually using beam-defining clipper to X in medical imaging equipment
Ray is blocked, and stops injury of the X-ray to human body with this.Beam-defining clipper generally blocks four borders using four blocks of stereotypes
On X-ray, X-ray is only irradiated to remaining region interested.At this time, in the original image that X-ray images, beam is limited
The gray scale of device occlusion area can be less than other regions.In the processing and display subsequently for image, the occlusion area of beam-defining clipper
It can influence the speed and display effect of image procossing.Therefore, it is necessary to beam-defining clipper in image is accurately detected before image procossing
The position of irradiation field, beam-defining clipper occlusion area is removed, to improve the precision of the performance of image procossing and handling result.
It is now the most frequently used that the scope of beam-defining clipper irradiation field is obtained based on the detection method of Hough transformation.This method needs first
The bianry image of original image is calculated, bianry image is then transformed into parameter space using Hough transformation, edge is examined
Survey problem be converted into parameter space find peak value the problem of.However, in some original images that practical operation obtains, beam is limited
The gray scale of device occlusion area may be very close with de-occlusion region gray scale, and the contrast of beam-defining clipper irradiation field boundary is weak.Also, scheme
As noise can also have an impact binary segmentation, this causes to be difficult to carry out appropriate two-value point when bianry image is calculated
Cut, cause that the beam-defining clipper irradiation field border that is detected with Hough transformation is discontinuous, result is not accurate, influence successive image processing
The precision of accuracy and handling result.
Therefore, those skilled in the art need to provide a kind of side for obtaining beam-defining clipper irradiation field border in medical diagnostic images
Method and device, can accurately detect position of the beam-defining clipper irradiation field in original image, to improve later image handling result
Precision.
The content of the invention
In order to solve prior art problem, the present invention provides one kind to obtain beam-defining clipper irradiation field side in medical diagnostic images
The method and device on boundary, can accurately detect position of the beam-defining clipper irradiation field in original image, to improve at later image
Manage the precision of result.
An embodiment of the present invention provides a kind of method for obtaining beam-defining clipper irradiation field border in medical diagnostic images, including:
Obtain pending image;
Each pixel is obtained in the pending image respectively in gradient both vertically and horizontally;
Obtain in the pending image on every straight line all pixels point add up in the gradient of vertical direction and, obtain the
One set;
Obtain in the pending image all pixels point gradient in the horizontal direction on every straight line add up and, obtain the
Two set;
Maximum and minimum value in the first set are searched, determines the straight line corresponding to maximum in the first set
For the first edge, it is the second edge to determine the straight line in the first set corresponding to minimum value;
Maximum and minimum value in the second set are searched, determines the straight line corresponding to maximum in the second set
For the 3rd edge, it is the 4th edge to determine the straight line in the second set corresponding to minimum value;
It is described pending to determine first edge, second edge, the 3rd edge and the 4th edge
The border of beam-defining clipper irradiation field in image.
Preferably, it is described to obtain in the pending image each pixel respectively in ladder both vertically and horizontally
Degree, specifically includes:
All pictures in the first preset range, the second preset range, the 3rd preset range and the 4th preset range are obtained respectively
The gray average of vegetarian refreshments, obtains the first gray average, the second gray average, the 3rd gray average and the 4th gray average;
Wherein, first preset range is located at the surface of preset, and second preset range is positioned at described default
The underface of point, the 3rd preset range are located at the front-left of the preset, and the 4th preset range is positioned at described pre-
The front-right to set up an office, first preset range, second preset range, the 3rd preset range and the described 4th preset
The size of scope is identical and distance between the preset is identical, and the preset is any pixel in the pending image
Point;
According to first gray average and second gray average, ladder of the preset in vertical direction is obtained
Degree;
According to the 3rd gray average and the 4th gray average, preset ladder in the horizontal direction is obtained
Degree.
Preferably, it is described to determine that first edge, second edge, the 3rd edge and the 4th edge are
The border of beam-defining clipper irradiation field, specifically includes in the pending image:
When the absolute value of maximum in the first set is more than the first initial threshold, it is determined that first edge is
First border of beam-defining clipper irradiation field in the pending image;
When the absolute value of minimum value in the first set is more than the second initial threshold, it is determined that second edge is
The second boundary of beam-defining clipper irradiation field in the pending image;
When the absolute value of maximum in the second set is more than three initial thresholds, it is determined that the 3rd edge is
3rd border of beam-defining clipper irradiation field in the pending image;
When the absolute value of minimum value in the second set is more than four initial thresholds, it is determined that the 4th edge is
4th border of beam-defining clipper irradiation field in the pending image.
Preferably, further include:
Obtain the low-frequency image of the pending image;
Region of the Y-axis coordinate in the low-frequency image less than (H/2)-H × f is determined as the beam-defining clipper irradiation field border
Upper moving area, region of the Y-axis coordinate in the low-frequency image more than (H/2)+H × f is determined as the beam-defining clipper and is irradiated
The lower moving area on wild border;
Region of the X-axis coordinate in the low-frequency image less than (W/2)-W × f is determined as the beam-defining clipper irradiation field border
Move left region, region of the X-axis coordinate in the low-frequency image more than (W/2)+W × f is determined as the beam-defining clipper irradiates
Wild border moves right region;
Determine first edge, second edge, the 3rd edge and the 4th edge and the upper movement
Region, the lower moving area, described move left region and the correspondence moved right between region, each moving area
A corresponding edge;
The upper moving area, the lower moving area are calculated respectively, described moved left region and described are moved right region
The gray average of middle all pixels point, it is equal to obtain top gray average, lower part gray average, left part gray average and right part gray scale
Value;
When the top gray average is greater than or equal to A, the judgment threshold of the upper moving area is equal to default maximum
Judgment threshold;When the top gray average is less than or equal to B, the judgment threshold of the upper moving area is equal to default minimum
Judgment threshold;When the top gray average is more than B and the top gray average is less than A, then according to the top gray scale
Average, sets the judgment threshold of the upper moving area;
When the lower part gray average is greater than or equal to A, the judgment threshold of the lower moving area is equal to described preset
Maximum judgment threshold;When the lower part gray average is less than or equal to B, the judgment threshold of the lower moving area is equal to described
Default minimum judgment threshold;When the lower part gray average is more than B and the lower part gray average is less than A, then according to
Lower part gray average, sets the judgment threshold of the lower moving area;
When the left part gray average is greater than or equal to A, the judgment threshold for moving left region is equal to described default
Maximum judgment threshold;When the left part gray average is less than or equal to B, the judgment threshold for moving left region is equal to described
Default minimum judgment threshold;When the left part gray average is more than B and the left part gray average is less than A, then according to
Left part gray average, the judgment threshold in region is moved left described in setting;
When the right part gray average is greater than or equal to A, the judgment threshold for moving right region is equal to described default
Maximum judgment threshold;When the right part gray average is less than or equal to B, the judgment threshold for moving right region is equal to described
Default minimum judgment threshold;When the right gray average in the portion is more than B and the right part gray average is less than A, then according to
Right part gray average, the judgment threshold in region is moved right described in setting;
Wherein, H be the low-frequency image Y-axis coordinate maximum, W be the low-frequency image X-axis coordinate maximum, f
To preset truncation function, A is default maximum gray average, and B is default minimal gray average;
First initial threshold, second initial threshold, the 3rd initial threshold and the 4th initial threshold
Moving area corresponding to respectively equal to described first edge, second edge, the 3rd edge and the 4th edge
Judgment threshold.
Preferably, it is described to determine that first edge, second edge, the 3rd edge and the 4th edge are
The border of beam-defining clipper irradiation field, specifically includes in the pending image:
When in the maximum and first straight line in the first set all pixels point add up in the gradient of vertical direction and
The absolute value of difference when being more than the first preset difference value, it is beam-defining clipper irradiation field in the pending image to determine first edge
The first border;
When in the minimum value and second straight line in the first set all pixels point add up in the gradient of vertical direction and
The absolute value of difference when being more than the second preset difference value, it is beam-defining clipper irradiation field in the pending image to determine second edge
The second boundary;
When on the maximum in the second set and the 3rd straight line all pixels point gradient in the horizontal direction add up and
The absolute value of difference be more than the 3rd preset difference value, it is beam-defining clipper irradiation field in the pending image to determine the 3rd edge
3rd border;
When on the minimum value in the second set and the 4th straight line all pixels point gradient in the horizontal direction add up and
The absolute value of difference when being more than four preset difference values, it is beam-defining clipper irradiation field in the pending image to determine the 4th edge
The 4th border;
Wherein, the distance in the first straight line and the pending image between the first preset and first border with
The absolute value of the difference of distance between first preset is less than the first distance;In the second straight line and the pending image
The absolute value of the difference of the distance between distance and the second boundary and second preset between second preset is less than second
Distance;Distance and first border and the described 3rd in 3rd straight line and the pending image between the 3rd preset
The absolute value of the difference of distance between preset is less than the 3rd distance;The 4th is default in 4th straight line and the pending image
The absolute value of the difference of the distance between distance and the 4th border and the 4th preset between point is less than the 4th distance.
Preferably, further include:
When definite first border and the second boundary are beam-defining clipper irradiation field in the pending image at the same time
Border and/or do not determine that the 3rd border and the 4th border are beam-defining clipper irradiation field in the pending image at the same time
Border when, search the border of the beam-defining clipper irradiation field again in the region for not determining border;
Wherein, it is described not determine that the region on border belongs to the pending image.
Preferably, it is described to determine that first edge, second edge, the 3rd edge and the 4th edge are
The border of beam-defining clipper irradiation field, specifically includes in the pending image:
Whether parallel first edge and second edge and the 3rd edge and the described 4th are judged respectively
Whether edge is parallel;
When first edge is parallel with second edge and the 3rd edge is parallel with the 4th edge, after
It is continuous to judge that two edges adjacent in first edge, second edge, the 3rd edge and the 4th edge are
It is no orthogonal;
When two sides adjacent in first edge, second edge, the 3rd edge and the 4th edge
When edge is orthogonal, determine that first edge, second edge, the 3rd edge and the 4th edge are described
The border of beam-defining clipper irradiation field in pending image.
Preferably, it is described to obtain pending image, further include afterwards:
Trimming processing is carried out to the pending image, removes the picture of the first default quantity of the pending image border
Vegetarian refreshments;
After the convolutional calculation renewal pending image is carried out to the pending image, the pending image side is removed
The pixel of the default quantity of the second of edge;
Down-sampled processing is carried out to the pending image, updates the pending image;
Wherein, the sampling interval when size of convolution kernel used in the convolutional calculation is equal to the down-sampled processing.
The embodiment of the present invention additionally provides a kind of device for obtaining beam-defining clipper irradiation field border in medical diagnostic images, bag
Include:First acquisition module, the second acquisition module, the 3rd acquisition module, the 4th acquisition module, the first determining module and second determine
Module;
First acquisition module, for obtaining pending image;
Second acquisition module, for obtaining in the pending image each pixel respectively in vertical direction and water
Square to gradient;
3rd acquisition module, for obtaining in the pending image on every straight line all pixels point in Vertical Square
To gradient add up and, obtain first set;
4th acquisition module, for obtaining in the pending image on every straight line all pixels point in level side
To gradient add up and, obtain second set;
First determining module, for searching maximum and minimum value in the first set, determines first collection
Straight line in conjunction corresponding to maximum is the first edge, and it is the second side to determine the straight line in the first set corresponding to minimum value
Edge;
First determining module, is additionally operable to search maximum and minimum value in the second set, determines described second
Straight line in set corresponding to maximum is the 3rd edge, and it is the 4th to determine the straight line in the second set corresponding to minimum value
Edge;
Second determining module, for determining first edge, second edge, the 3rd edge and described
4th edge is the border of beam-defining clipper irradiation field in the pending image.
Preferably, second determining module, including:First determination sub-module;
First determination sub-module, is more than the first initial threshold for the absolute value when maximum in the first set
When, it is determined that first edge is the first border of beam-defining clipper irradiation field in the pending image;
First determination sub-module, the absolute value for being additionally operable to work as minimum value in the first set are more than the second initial threshold
During value, it is determined that second edge is the second boundary of beam-defining clipper irradiation field in the pending image;
First determination sub-module, the absolute value for being additionally operable to work as maximum in the second set are more than the 3rd initial threshold
During value, it is determined that the 3rd edge is the 3rd border of beam-defining clipper irradiation field in the pending image;
First determination sub-module, the absolute value for being additionally operable to work as minimum value in the second set are more than the 4th initial threshold
During value, it is determined that the 4th edge is the 4th border of beam-defining clipper irradiation field in the pending image.
Preferably, second determining module, including:Border determination sub-module;
The border determination sub-module, for when all pixels point in the maximum and first straight line in the first set
The gradient of vertical direction add up the absolute value of sum its difference be more than the first preset difference value when, determine that first edge is treated to be described
Handle the first border of beam-defining clipper irradiation field in image;
The border determination sub-module, is additionally operable to work as all pixels in the minimum value and second straight line in the first set
Point the gradient of vertical direction add up the absolute value of sum its difference be more than the second preset difference value when, determine that second edge is described
The second boundary of beam-defining clipper irradiation field in pending image;
The border determination sub-module, the maximum and all pixels on the 3rd straight line for being additionally operable to work as in the second set
The add up absolute value of sum its difference of point gradient in the horizontal direction is more than the 3rd preset difference value, determines that the 3rd edge is treated described in being
Handle the 3rd border of beam-defining clipper irradiation field in image;
The border determination sub-module, the minimum value and all pixels on the 4th straight line for being additionally operable to work as in the second set
Point gradient in the horizontal direction adds up the absolute value of sum its difference when being more than four preset difference values, determines that the 4th edge is described
4th border of beam-defining clipper irradiation field in pending image;
Wherein, the distance in the first straight line and the pending image between the first preset and first border with
The absolute value of the difference of distance between first preset is less than the first distance;In the second straight line and the pending image
The absolute value of the difference of the distance between distance and the second boundary and second preset between second preset is less than second
Distance;Distance and first border and the described 3rd in 3rd straight line and the pending image between the 3rd preset
The absolute value of the difference of distance between preset is less than the 3rd distance;The 4th is default in 4th straight line and the pending image
The absolute value of the difference of the distance between distance and the 4th border and the 4th preset between point is less than the 4th distance.
Preferably, further include:Searching module;
The searching module, for ought not determine that first border and the second boundary are the pending figure at the same time
The border of beam-defining clipper irradiation field and/or do not determine that the 3rd border and the 4th border are the pending figure at the same time as in
As in during the border of beam-defining clipper irradiation field, the border of the beam-defining clipper irradiation field is searched again in the region for not determining border;
Wherein, it is described not determine that the region on border belongs to the pending image.
Preferably, second determining module, specifically includes:4th judging submodule, the 5th judging submodule and the 9th
Determination sub-module;
4th judging submodule, for judge respectively first edge and second edge it is whether parallel and
Whether the 3rd edge and the 4th edge are parallel;
5th judging submodule, for judging first edge and described second when the 4th judging submodule
Edge is parallel and when the 3rd edge is parallel with the 4th edge, continue to judge first edge, second edge,
Whether two adjacent edges are orthogonal in 3rd edge and the 4th edge;
9th determination sub-module, for judging first edge, described second when the 5th judging submodule
When two adjacent edges are orthogonal in edge, the 3rd edge and the 4th edge, determine first edge,
Second edge, the 3rd edge and the 4th edge are the border of beam-defining clipper irradiation field in the pending image.
Preferably, further include:First processing module, Second processing module and the 3rd processing module;
The first processing module, for carrying out trimming processing to the pending image, removes the pending image
After the pixel of the default quantity of the first of edge, the Second processing module is triggered;
The Second processing module, updates the pending image for carrying out convolutional calculation to the pending image
Afterwards, after the pixel of the second default quantity for removing the pending image border, the 3rd processing module is triggered;
3rd processing module, for carrying out down-sampled processing to the pending image, updates the pending figure
Picture;
Wherein, the sampling interval when size of convolution kernel used in the convolutional calculation is equal to the down-sampled processing.
Compared with prior art, the present invention has at least the following advantages:
The method on beam-defining clipper irradiation field border, is counted respectively first in acquisition medical diagnostic images provided in an embodiment of the present invention
Pending image is calculated in gradient both vertically and horizontally, then calculates in pending image all pixels point on every straight line
Add up in vertical direction and gradient in the horizontal direction and, obtain every straight line in pending image vertical gradient add up and and
Horizontal gradient add up and.Afterwards, respectively search maximum perpendicular gradient adds up, maximum horizontal gradient adds up and, minimum vertical gradient
It is cumulative and and minimum level gradient add up and corresponding straight line, obtain four edges edge.This four edges edge is pending image
The boundary line of middle beam-defining clipper irradiation field.Beam-defining clipper irradiation field is the inner area that this four edges edge is surrounded in pending image
Domain.The method on beam-defining clipper irradiation field border, can be accurately detected in acquisition medical diagnostic images provided in an embodiment of the present invention
The weak and affected by noise and incoherent beam-defining clipper irradiation field in border of border contrast, obtains continuous beam-defining clipper irradiation field side
Boundary, easy to remove the region beyond beam-defining clipper irradiation field in image during subsequent treatment, improves later image handling result
Precision.
Brief description of the drawings
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, below will be to embodiment or existing
There is attached drawing needed in technology description to be briefly described, it should be apparent that, drawings in the following description are only this
Some embodiments described in application, for those of ordinary skill in the art, without creative efforts,
Other attached drawings can also be obtained according to these attached drawings.
Fig. 1 is that the hand bone normotopia X-ray original image obtained after unnecessary X-ray is blocked using beam-defining clipper;
Fig. 2 is that the flow of beam-defining clipper irradiation field boundary method embodiment in acquisition medical diagnostic images provided by the invention is shown
It is intended to;
Fig. 3 a are the vertical gradient image of the hand bone normotopia X-ray original image shown in Fig. 1;
Fig. 3 b are the horizontal gradient image of the hand bone normotopia X-ray original image shown in Fig. 1;
Fig. 4 a are vertical gradient operator schematic diagram provided in an embodiment of the present invention;
Fig. 4 b are horizontal gradient operator schematic diagram provided in an embodiment of the present invention;
Fig. 5 is the flow diagram of gradient computational methods provided in an embodiment of the present invention;
Fig. 6 a are the part matrix in pending image provided in an embodiment of the present invention;
The matrix that Fig. 6 b are generated by the part matrix in pending image provided in an embodiment of the present invention after row is cumulative;
Fig. 6 c lifes after row is cumulative and row are cumulative by the part matrix in pending image provided in an embodiment of the present invention
Into matrix;
Fig. 7 a are the vertical line integral image of the hand bone normotopia X-ray original image shown in Fig. 1;
Fig. 7 b are the horizontal line integral image of the hand bone normotopia X-ray original image shown in Fig. 1;
Fig. 8 a are that the hand bone normotopia X-ray original image shown in Fig. 1 obtains medical diagnosis figure through provided in an embodiment of the present invention
The method on beam-defining clipper irradiation field border detects the schematic diagram of boundary line as in;
Fig. 8 b are patella axial X-ray original image through beam-defining clipper in acquisition medical diagnostic images provided in an embodiment of the present invention
The method on irradiation field border detects the schematic diagram of boundary line;
Fig. 8 c are lumbar vertebrae normotopia X-ray original image through beam-defining clipper in acquisition medical diagnostic images provided in an embodiment of the present invention
The method on irradiation field border detects the schematic diagram of boundary line;
Fig. 8 d are rumpbone normotopia X-ray original image through beam-defining clipper in acquisition medical diagnostic images provided in an embodiment of the present invention
The method on irradiation field border detects the schematic diagram of boundary line;
Fig. 9 is the structure of the device embodiment on beam-defining clipper irradiation field border in acquisition medical diagnostic images provided by the invention
Schematic diagram.
Embodiment
In order to make those skilled in the art more fully understand the present invention program, below in conjunction with the embodiment of the present invention
Attached drawing, is clearly and completely described the technical solution in the embodiment of the present invention, it is clear that described embodiment is only this
Invention part of the embodiment, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art exist
All other embodiments obtained under the premise of creative work are not made, belong to the scope of protection of the invention.
Before the method and device on beam-defining clipper irradiation field border in introducing acquisition medical diagnostic images provided by the invention,
Introduce first it is a kind of in X-ray camera system using beam-defining clipper after obtained original image.As shown in Figure 1, the figure is to use
Beam-defining clipper blocks the hand bone normotopia X-ray original image obtained after unnecessary X-ray.Figure includes the white of hand bone normotopia x-ray image
Region is the irradiation field of beam-defining clipper in the image, is rectangle or square.It can be seen that, outside the gray scale and irradiation field at wrist
The gray scale of dark border approaches, when using existing beam-defining clipper irradiation field acquisition methods, it is difficult to appropriate binary segmentation is carried out,
And then influence the accuracy of successive image processing and the precision of handling result.
For this reason, an embodiment of the present invention provides a kind of method for obtaining beam-defining clipper irradiation field border in medical diagnostic images.
After pending image is got, each pixel is first obtained on pending image respectively in ladder both vertically and horizontally
Degree, and calculate in pending image on every straight line all pixels point add up in gradient both vertically and horizontally and.Again
The greatest gradient of pending image in the vertical direction and the horizontal direction is searched respectively to add up and corresponding straight line and minimum
Gradient adds up and corresponding straight line, obtains four edges edge.This four edges beam-defining clipper irradiation field along as pending image
Boundary line.Through the above method, those skilled in the art can be accurately detected the border weak and affected by noise and border of contrast
The irradiation field of beam-defining clipper in incoherent original medical diagnostic image, obtains continuous beam-defining clipper irradiation field border, easy to follow-up
The region beyond beam-defining clipper irradiation field in image is removed during processing, improves the precision of later image handling result.
In order to make the foregoing objectives, features and advantages of the present invention clearer and more comprehensible, below in conjunction with the accompanying drawings to the present invention
Embodiment be described in detail.
Embodiment of the method:
Referring to Fig. 2, which is that the method on beam-defining clipper irradiation field border in acquisition medical diagnostic images provided by the invention is real
Apply the flow diagram of example.
The method on beam-defining clipper irradiation field border in acquisition medical diagnostic images provided in this embodiment, including:
S201:Obtain pending image;
In the preferred embodiment of the present invention, acquired pending image can also be pre-processed.Due to original
Beginning image is disturbed by influence factors such as noises, and in the acquisition process to beam-defining clipper irradiation field, these noises can be in image
The precision of limb recognition has an impact.Therefore, noise reduction process can be carried out to original image, to reduce influence of noise.Also, due to
The resolution ratio of original image is larger, generally can reach 3000 × 3000 pixels, first can carry out dot interlace sampling processing to original image,
To reduce calculation amount, the efficiency that beam-defining clipper irradiation field obtains is improved.
As an example, acquired pending image can be pre-processed by following steps:
First, trimming processing is carried out to the pending image, removes the first present count of the pending image border
The pixel of amount;
Since the image information that image border part includes is less, and marginal portion is affected by noise larger, therefore, at this
In a example, remove the partial invalidity pixel close to original image edge first, to reduce follow-up calculation amount.For example, edge
10 pixels at place.
Down-sampled before processing is being carried out to pending image, in order not to lose original image information, need to used between sampling
Convolution kernel away from formed objects carries out convolutional calculation to pending image.That is, convolutional calculation is carried out more to the pending image
The new pending image.And since convolutional calculation can bring skirt response, in this example, further to go to roll out
The partial pixel of pending image border after product calculates.Second that the pending image border is removed after convolutional calculation is pre-
If the pixel of quantity.
Finally, then to the pending image down-sampled processing is carried out, updates the pending image.
S202:Each pixel is obtained in the pending image respectively in gradient both vertically and horizontally;
It is understood that image gradient algorithm is to calculate each pixel and pixel in its some neighborhood in image
Between grey scale change process, it is specific to obtain pixel and pixel in its some neighborhood in image by gradient operator when calculating
Between grey scale change.Such as:Image function f (x, y) is a vector with size and Orientation in the gradient of point (x, y),
Specifically available Gx represents that in the gradient in x-axis direction, gradient of the point (x, y) in y-axis direction is represented with Gy for point (x, y).By image ladder
The image that degree is formed is known as gradient image.Gradient of each pixel in x-axis and y-axis direction can be distinguished in image function f (x, y)
It is approximately Gx=f (x, y)-f (x-1, y) and Gy=f (x, y)-f (x, y-1).When there are limiter of speed photograph in image function f (x, y)
During launched field edge, due to having larger difference, grey scale change between the gray scale of the gray scale of edge and its neighbouring non-edge
It is larger, therefore the pixel on the edge necessarily has larger Grad in x-axis or y-axis direction.On the contrary, work as image function f
When having smoother part in (x, y), the grey scale change in the region is smaller, then in the corresponding region pixel gradient
It is smaller.
Since in pending image, the boundary line of beam-defining clipper irradiation field is generally horizontal linear or vertical line.Therefore, exist
In the horizontal gradient image of pending image, due in the pixel on horizontal border line and its horizontal direction other pixels it
Between grey scale change it is smaller so that do not have in the gradient image of boundary line in the horizontal direction in pending image in horizontal direction
Highlight, the boundary characteristic of horizontal direction can not be obtained.Similarly, the boundary line in pending image in vertical direction is being hung down
Do not highlighted in straight gradient image, the boundary characteristic of vertical direction can not be obtained.Therefore, in order to accurately obtain pending figure
The four edges boundary line of beam-defining clipper irradiation field, need to calculate the gradient of pending image in the vertical and horizontal direction respectively as in, with
Guarantee completely detects the edge of beam-defining clipper irradiation field in pending image.Fig. 3 a are that the hand bone normotopia X-ray shown in Fig. 1 is original
Image vertical direction (i.e. y-axis) gradient image, Fig. 3 b be Fig. 1 shown in hand bone normotopia X-ray original image in the horizontal direction
The gradient image of (i.e. x-axis).
Explanation is needed exist for, those skilled in the art can use any one gradient calculating side according to actual conditions
Method and gradient operator (such as Laplace operator, Sobel Operator) obtain in pending image each pixel in Vertical Square
Limited to the gradient in horizontal direction, the present invention not to this, the embodiment that gradient obtains is herein no longer one by one
Enumerate.
In some possible implementations of the present embodiment, in order to reduce the influence of noise, make to limit beam in gradient image
Device irradiation field marginal position becomes apparent from, and used vertical gradient operator and horizontal gradient operator be respectively such as during gradient calculates
Shown in Fig. 4 a and Fig. 4 b.Correspondingly, referring to Fig. 5, those skilled in the art can be calculated every in pending image by following steps
A pixel is in gradient both vertically and horizontally.
At this time, each pixel is obtained in the pending image respectively in gradient bag both vertically and horizontally
Include:
S2021:Obtain respectively in the first preset range, the second preset range, the 3rd preset range and the 4th preset range
The gray average of all pixels point, it is equal to obtain the first gray average, the second gray average, the 3rd gray average and the 4th gray scale
Value;
Wherein, first preset range is located at the surface of preset, and second preset range is positioned at described default
The underface of point, the 3rd preset range are located at the front-left of the preset, and the 4th preset range is positioned at described pre-
The front-right to set up an office, first preset range, second preset range, the 3rd preset range and the described 4th preset
The size of scope is identical and distance between the preset is identical, and the preset is any pixel in the pending image
Point;
A certain picture is being calculated it can be seen from the horizontal gradient operator shown in the vertical gradient operator and Fig. 4 b shown in Fig. 4 a
During the gradient of vegetarian refreshments, the first preset range is 5 × 5 pixels directly over the pixel with two pixels in pixel interval
Point region, the second preset range are 5 × 5 pixel areas immediately below the pixel with two pixels in pixel interval
Domain, the 3rd preset range for the pixel front-left and two pixels in pixel interval 5 × 5 pixel regions, the
Four preset ranges are the pixel front-right and 5 × 5 pixel regions of two pixels in pixel interval.
In one example, it is described to obtain respectively in pending image corresponding to a certain pixel to reduce calculation amount
The gray average of all pixels point in first preset range, the second preset range, the 3rd preset range and the 4th preset range, into
One step includes:
First, first area in the pending image corresponding to each preset range, second area, the 3rd are obtained respectively
In region and the 4th region all pixels point gray scale cumulative and, obtain the first value, second value, the 3rd value and the 4th value;
In the example shown in Figure 4, it is assumed that four vertex of the first preset range of some pixel in pending image
For point (x1,y1)、(x2,y2)、(x3,y3) and (x4,y4) (as shown in fig. 4 a).So, the first area is in pending image
Coordinate (x1-1,y1- 1) pixel and square region, coordinate (x determined by the pixel of coordinate (0,0)1-1,y1- 1) picture
Line between the pixel of vegetarian refreshments and coordinate (0,0) is a diagonal of first area;The second area is coordinate
(x2-1,y2) pixel and coordinate (0,0) pixel determined by square region, coordinate (x2-1,y2) pixel and seat
Mark the diagonal that the line between the pixel of (0,0) is second area;3rd region is coordinate (x3,y3- 1)
Pixel and square region, coordinate (x determined by the pixel of coordinate (0,0)3,y3- 1) picture of pixel and coordinate (0,0)
Line between vegetarian refreshments is one article of diagonal in the 3rd region;4th region is coordinate (x4,y4) pixel and coordinate
Square region determined by the pixel of (0,0), coordinate (x4,y4) pixel and coordinate (0,0) pixel between line
For one article of diagonal of four-range;Wherein, coordinate (0,0) is the coordinate of pending image left upper pixel;
Similarly, the firstth area corresponding to the second preset range of the pixel, the 3rd preset range and the 4th preset range
First area corresponding to domain, second area, the 3rd region and four-range coordinate range and above-mentioned first preset range, the
Two regions, the 3rd region are similar with four-range coordinate range, no longer repeat one by one here.
As an example, the first preset range, the second preset range, the 3rd can be obtained using the method that ranks add up
The gray average of all pixels point in preset range and the 4th preset range, further to reduce calculation amount, improves calculating speed.
The method that ranks add up is specific as follows:First according to formulaCalculate coordinate in pending image
For the row accumulated value sum_l of (m, n) pixelm,n, wherein, Gm,iFor the gray scale that coordinate in pending image is (m, i) pixel;
According still further to formulaCalculate all pictures in region of the coordinate corresponding to (m, n) pixel
Vegetarian refreshments gray scale and cumulative and sum_allm,n;Wherein, the coordinate can be respectively first area, the secondth area for (m, n) pixel
The pixel in domain, the 3rd region or the 4th region lower right corner.
In the example shown in Figure 4, the pixel in first area, second area, the 3rd region and the 4th region lower right corner
Coordinate be respectively (x1-1,y1-1)、(x2-1,y2)、(x3,y3- 1) and (x4,y4)。
Similarly, can also be first according to formulaIt is (m, n) pixel to calculate coordinate in the pending image
The row accumulated value sum_r of pointm,n, wherein, Gi,nFor the gray scale that coordinate in the pending image is (i, n) pixel;According still further to
FormulaCalculate all pixels point ash in region of the coordinate corresponding to (m, n) pixel
Degree and cumulative and sum_allm,n, coordinate can be respectively first area, second area, the 3rd region or for (m, n) pixel
The pixel in the four regions lower right corner.
It is understood that above-mentioned ranks accumulation step, which is first carried out, obtains each pixel of pending image and image original
The accumulated value of all pixels point gray scale in region determined by point, the accumulated value of all pixels point gray scale in a certain scope is obtained
When, only need to be according to the seat of the first area corresponding to the scope, second area, the 3rd region and the 4th region lower right corner pixel
Mark, directly obtains the accumulated value of all pixels point gray scale in first area, second area, the 3rd region and the 4th region, reduces
Calculation amount.
Secondly, first value is subtracted into the second value plus the 4th value and subtracts the 3rd value again, obtain the
Cumulative and acquisition first preset range, second preset range, the described 3rd of all pixels point gray scale in one scope
In preset range and the 4th preset range all pixels point gray scale cumulative and;
Finally, you can according to first preset range, second preset range, the 3rd preset range and described
In 4th preset range all pixels point gray scale cumulative and, obtain first preset range, second preset range, institute
State the gray average of all pixels point in the 3rd preset range and the 4th preset range.
In order to facilitate understanding, with reference to Fig. 6 a- Fig. 6 c, to owning in a certain preset range of acquisition described in above-mentioned example
The method of the gray average of pixel is illustrated.
Part matrix in the exemplified pending images of Fig. 6 a.Numeral is the gray scale of corresponding pixel points in pending image.
When the gray average of whole pixels inside square frame in Fig. 6 a need to be calculated, with the gray scale of a line pixel in first accumulated matrix,
Obtain Fig. 6 b.Specifically, the numerical value of each coordinate points is equal in Fig. 6 a the pixel with a line positioned at the pixel left side in Fig. 6 b
The sum of gray scale of point adds the gray scale.It is and then same in the matrix to be added up shown in Fig. 6 b by the way of same as described above
The gray scale of one row pixel, obtains Fig. 6 c.At this time, the numerical value in Fig. 6 c in each coordinate points is equal in Fig. 6 a with the coordinate points institute
Line is all in cornerwise square region between corresponding pixel and pending image origin (upper left angle value is 1 point)
Pixel gray level cumulative and.All pixels point gray scale adds up and equal to K1+K4-K2-K3=5 inside square frame shown in Fig. 6 a
+ 161-42-53=71, its gray average are equal to 71/25.
Wherein, a diagonal of first area is Fig. 6 a midpoint a and pending image origin (i.e. company between point e)
Line, the line of a diagonal of second area between Fig. 6 a midpoint b and pending image origin, one article of the 3rd region are right
Line of the linea angulata between Fig. 6 a midpoint c and pending image origin, one article of diagonal of four-range are Fig. 6 a midpoint d with treating
The line between image origin is handled, K1 is the above-mentioned first value, and K2 is above-mentioned second value, and K3 is the above-mentioned 3rd value, and K4 is above-mentioned
4th value.
It is similar, you can to calculate the first preset range in pending image corresponding to each pixel, the second default model
Enclose, in the 3rd preset range and the 4th preset range all pixels point gray average, i.e. the first gray average, the second gray scale are equal
Value, the 3rd gray average and the 4th gray average.
S2022:When first preset range, second preset range, the 3rd preset range or the described 4th
When lacking pixel in preset range, then according to the gray scale of the pending image edge pixels point, preset range described in completion
Interior pixel;
It is understood that the ladder of pixel in pending image is being calculated using the gradient operator shown in Fig. 4 a and Fig. 4 b
When spending, since partial pixel point is likely located at the edge of pending image, its some or several preset ranges in pixel
It is incomplete or there is no pixel.In this way, the gradient of these pixels is being calculated using the method described in above-mentioned steps S2021
When, the result of calculation of the gray average of all pixels point is inaccurate in preset range.When lacking pixel in preset range, ash
The result of degree average is less than its actual value;When pixel is not present in preset range, gray average zero.Obviously, this can
There is mistake in the gradient result of calculation made, influences the acquisition to beam-defining clipper irradiation field border in pending image.
In one example, can be according to the gray scale of the pending image edge pixels point near preset range, to mend
Pixel in full preset range.At this time, can be in the last by pending image of image preprocessing process for convenience of calculation
Edge outwards expands, and makes pixel in the preset range in its either direction of each pixel of the pending image before expansion complete
It is whole.For example, when using the vertical gradient operator and horizontal gradient operator shown in Fig. 4 a and Fig. 4 b, can be in advance by pending image
Edge outwards expand 7 pixels, the principle of expansion is the gray scale of multiimage edge pixel point.
S2023:According to first gray average and second gray average, the preset is obtained in vertical direction
Gradient;
S2024:According to the 3rd gray average and the 4th gray average, the preset is obtained in the horizontal direction
Gradient;
Each picture in pending image can so be obtained one by one according to the method described in above-mentioned steps S2021-S2024
The gradient of vegetarian refreshments in the vertical and horizontal direction.
In one example, can be according to each pixel in the pending image of the following formula calculating in the gradient of vertical direction
Gradv:
Wherein, mean_up is the first gray average of any pixel point in pending image, and mean_down is the pixel
Second gray average of point, max (mean_down, mean_up) are the first gray average and the second gray average of the pixel
In higher value.
Correspondingly, each gradient of pixel in the horizontal direction in pending image can be calculated according to the following formula
Gradh:
Wherein, mean_right is the 4th gray average of any pixel point in pending image, and mean_left is the picture
3rd gray average of vegetarian refreshments;Max (mean_right, mean_left) is the 3rd gray average and the 4th ash of the pixel
Spend the higher value in average.
Further, since influenced be subject to the noise in pending image or tissue image, beam-defining clipper irradiation field region
Internal pixel may also can be there are gradient, its gradient will be generally less than the ladder of pixel on the border of beam-defining clipper irradiation field
Degree.If the pixel inside beam-defining clipper irradiation field region there are gradient is also served as into beam-defining clipper irradiation field side in pending image
The position candidate on boundary, then can increase the calculation amount required at beam-defining clipper irradiation field border in obtaining medical diagnostic images, also have
It may influence whether border detection result.As the preferred implementation of the application, those skilled in the art can be according to reality
Border situation sets a Grads threshold.When the gradient of a certain pixel is less than Grads threshold, its gradient is set to zero, makes the picture
The gradient of vegetarian refreshments is not involved in follow-up calculating.In this way, can not only reduce the calculation amount of subsequent step, can be with a degree of
Reduce influence of the disturbing factor to beam-defining clipper irradiation field border detection result.
Has a speech, each pixel obtained respectively in the pending image is both vertically and horizontally
Further included after gradient:Judge whether each pixel is more than first in the gradient of vertical direction in the pending image one by one
Predetermined gradient, if it is not, then gradient of the pixel in vertical direction is set to zero;Judge one by one every in the pending image
Whether a pixel gradient in the horizontal direction is more than the second predetermined gradient, if it is not, then the pixel is in the horizontal direction
Gradient is set to zero.
It should be noted that can be seen that from Fig. 3 a and Fig. 3 b, in gradient image, irradiation field border in pending image
It is more prominent compared with other straight lines detected in gradient schematic diagram.
Therefore, all pixels point can be added up in pending image on every straight line in ladder both vertically and horizontally
Degree, obtains that vertical gradient adds up and (i.e. first set) and horizontal gradient add up and (i.e. second set).Find out maximum respectively again
Vertical gradient add up and, maximum horizontal gradient add up and, minimum vertical gradient adds up and minimum level gradient adds up and corresponding
Straight line, totally four.These straight lines are the border of beam-defining clipper irradiation field in pending image.It is specific as follows:
S203:Obtain in the pending image on every straight line all pixels point add up in the gradient of vertical direction and,
Obtain first set;
S204:Obtain in the pending image all pixels point gradient in the horizontal direction on every straight line add up and,
Obtain second set;
In some possible implementations of the present embodiment, usable thunder step on (Radon) conversion obtain first set and
Second set, it is specific as follows:According to each pixel in the pending image in the gradient of vertical direction, generation vertical gradient
Image;Radon transform is carried out to the vertical gradient image, obtains the first set.According to each in the pending image
Pixel gradient in the horizontal direction, generates horizontal gradient image;Radon transform is carried out to the horizontal gradient image, obtains institute
State second set.
Under two dimensional image, Radon conversion is understood generally as:Along different straight lines to f (x, y) in one image f (x, y)
Do line integral, straight line and image origin (i.e. in image coordinate for (0,0) pixel) distance be d, deflection α, obtains
Image F (d, α) be exactly image f (x, y) Radon conversion.That is, the value each put in image F (d, α) has corresponded to original
The line integral value of certain straight line of beginning image f (x, y).
It should be noted that every straight line can be random length and and water in pending image in the pending image
Square in a line segment at any angle.However, for the ease of the follow-up standard calculated and judge, improve the acquisition of beam-defining clipper border
True rate, the interference for reducing internal information in pending image, every straight line is with pending image in above-mentioned pending image
Edge is two endpoints, through pending image.
, can be respectively by pending image on every straight line in addition, in a preferred embodiment of the present embodiment
All pixels point adds up and is depicted as vertical line integral image and horizontal line integrogram in gradient both vertically and horizontally
Picture, in order to subsequently judge and verification process, facilitates user to observe.Fig. 7 a are the hand bone normotopia X-ray original image shown in Fig. 1
Vertical line integral image, Fig. 7 b are the horizontal line integral image of the hand bone normotopia X-ray original image shown in Fig. 1.
In this way, for any straight line in pending image, the distance of itself and pending image center for d, with
Angle between horizontal direction is θ.All pixels point is calculated in pending image on every straight line both vertically and horizontally
Gradient add up and (i.e. line integral result), and recorded corresponding position in corresponding line integral image respectively.For example, line accumulates
What the abscissa of partial image represented is the angle, θ of angle between straight line and horizontal direction, and what ordinate represented is straight line to pending
The distance d of image center.At this moment, can be (d by coordinate in vertical line integral image1,θ1) pixel gray scale, be arranged to
With the distance at its center it is d in pending image1And angle angle is θ between horizontal direction1Straight line on all pixels point hang down
Nogata to gradient add up and;It is (d by coordinate in horizontal line integral image2,θ2) pixel gray scale, be arranged to described and treat
The distance handled in image with its center is d2And with the angle of horizontal direction it is θ2Straight line on all pixels point in the horizontal direction
Gradient add up and.It is understood that those skilled in the art can also draw line according to actual conditions using other modes
Integral image, will not enumerate herein.
S205:Maximum and minimum value in the first set are searched, is determined in the first set corresponding to maximum
Straight line be the first edge, it is the second edge to determine the straight line in the first set corresponding to minimum value;
S206:Maximum and minimum value in the second set are searched, is determined in the second set corresponding to maximum
Straight line be the 3rd edge, it is the 4th edge to determine the straight line in the second set corresponding to minimum value;
According to the definition of gradient, if some position is there are straight line in pending image, the straight line and its
Affirmed between surrounding gray scale there is larger difference, all pixels point is in vertical direction or level side on this corresponding straight line
To gradient add up and necessarily very big or very little, be embodied in line integral image that to be exactly that there are one on corresponding coordinate to be most worth
Point.By taking vertical line integral image as an example, the maximum and minimum value of gray scale in vertical line integral image are found, the maximum and most
The coordinate of small value corresponds to the distance between the border of beam-defining clipper irradiation field and pending image center in pending image respectively
And the angle between horizontal direction.
To sum up, can be seen that in the hand bone normotopia X-ray original image shown in Fig. 1, beam-defining clipper shines below image
In the case that the contrast of launched field border is not strong, due to pixel and other pixels around it on beam-defining clipper irradiation field boundary line
Contrast is stronger compared to the contrast of pixel and other pixels around it on the straight line inside beam-defining clipper irradiation field.At this time,
By calculate all pixels point in pending image on every straight line in vertical direction and horizontal direction gradient cumulative and,
With the cumulative of gradient and it is foundation, the boundary line of beam-defining clipper irradiation field in pending image can be distinguished.Also, through above-mentioned steps
The boundary line drawn is four continuous straight lines.
S207:Determine that first edge, second edge, the 3rd edge and the 4th edge are treated to be described
Handle the border of beam-defining clipper irradiation field in image.
Obviously, beam-defining clipper irradiation field is the first edge, the second edge, the 3rd edge and the 4th edge in pending image
The region surrounded.
In order to further improve the accuracy of beam-defining clipper irradiation field acquisition, the first edge, the can be verified according to preset rules
Two edges, the 3rd edge and the 4th edge whether be beam-defining clipper irradiation field in pending image border, come determine the first edge,
Second edge, the 3rd edge and the 4th edge are beam-defining clipper irradiation field border in pending image.During specific implementation, first is determined
Edge, the second edge, the 3rd edge and the 4th edge are beam-defining clipper irradiation field border, at least three kinds of possibility in pending image
Implementation, be described in detail separately below.
The first possible implementation, it is pending to determine the first edge, the second edge, the 3rd edge and the 4th edge
The method on beam-defining clipper irradiation field border includes in image:
Whether parallel first edge and second edge and the 3rd edge and the described 4th are judged respectively
Whether edge is parallel;When first edge is parallel with second edge and the 3rd edge is parallel with the 4th edge
When, continue to judge two sides adjacent in first edge, second edge, the 3rd edge and the 4th edge
Whether edge is orthogonal;When adjacent in first edge, second edge, the 3rd edge and the 4th edge
Two edges it is orthogonal when, first edge, second edge, the 3rd edge and the 4th edge are
The border of beam-defining clipper irradiation field in the pending image.
It is understood that since in practical operation, two stereotypes of beam-defining clipper in an opposite direction are parallel two-by-two, phase
Two stereotypes on adjacent direction are vertical two-by-two.Therefore, it should ensure that relative direction upper edge is put down two-by-two in four edges detected
Capable, adjacent direction upper edge is vertical two-by-two.
If the judging result of above-mentioned steps is no, need to consider whether the calculated value of first set and second set is correct.
It should be noted that in practical applications, because of situations such as the influence of operating error or equipment error, pending figure
Four borders of beam-defining clipper irradiation field are not necessarily substantially parallel or vertically as in, generally can there are the error in several years.Therefore, for
Any two beam-defining clipper irradiation field boundary line, need to ensure that its angular deviation is less than the angle threshold of setting, such as 2 degree.
At this time, the angle of the angle between the angle between the first edge and the second edge and the 3rd edge and the 4th edge
Degree need to be more than 180a-2 degree and be less than 180a+2 degree, and a is integer.First edge, second edge, the 3rd edge
And the angle of angle need to be more than 90b-2 degree and be less than 90b+2 degree between adjacent two edges in the 4th edge, b is whole
Number.
Second of possible implementation, it is pending to determine the first edge, the second edge, the 3rd edge and the 4th edge
Beam-defining clipper irradiation field border includes in image:
When in the maximum and first straight line in the first set all pixels point gradient in vertical direction it is cumulative
When the absolute value of its difference of sum is more than the first preset difference value, first border is beam-defining clipper irradiation field in the pending image
Border;
When in the minimum value and second straight line in the first set all pixels point gradient in vertical direction it is cumulative
When the absolute value of its difference of sum is more than the second preset difference value, the second boundary is beam-defining clipper irradiation field in the pending image
Border;
When on the maximum in the second set and the 3rd straight line all pixels point gradient in the horizontal direction add up and
The absolute value of difference be more than the 3rd preset difference value, the 3rd border is the side of beam-defining clipper irradiation field in the pending image
Boundary;
When on the minimum value in the second set and the 4th straight line all pixels point gradient in the horizontal direction add up and
The absolute value of difference when being more than four preset difference values, the 4th border is the side of beam-defining clipper irradiation field in the pending image
Boundary;
Wherein, the distance in the first straight line and the pending image between the first preset and first border with
The absolute value of the difference of distance between first preset is less than the first distance, the second straight line with the pending image
The absolute value of the difference of the distance between distance and the second boundary and second preset between second preset is less than second
Distance, distance and first border and the described 3rd in the 3rd straight line and the pending image between the 3rd preset
The absolute value of the difference of distance between preset is less than the 3rd distance, and the 4th is default in the 4th straight line and the pending image
The absolute value of the difference of the distance between distance and the 4th border and the 4th preset between point is less than the 4th distance.
Those skilled in the art can specifically set the first border and first straight line, the second boundary and second according to actual conditions
Range difference between straight line, the 3rd border and the 3rd straight line and the 4th border and the 4th straight line, i.e., the first distance, second distance,
3rd distance and the 4th distance, will not enumerate herein.In addition, the first preset difference value, the second preset difference value, the 3rd default poor
Value and the 4th preset difference value also can specifically be set according to actual conditions.
It should be noted that due to up and down on four direction, at most only being deposited in each direction in pending image
On the border of a beam-defining clipper irradiation field.Therefore, it is straight corresponding to the maximum and minimum value in first set in pending image
The gradient of all pixels point adds up and should be much smaller than first set on certain straight line in region beyond certain span of line
Maximum or the minimum value much larger than first set.Similarly, in pending image, in maximum and the minimum value institute of second set
The gradient of all pixels point adds up and should be much smaller than second on certain straight line in region beyond certain span of line correspondence
The maximum of set or the minimum value much larger than second set.
Show in vertical line integral image and horizontal line integral image, be exactly certain span of gray scale maximum point with outskirt
The gray scale of certain point is much smaller than the gray scale of the gray scale maximum point in domain, and the certain span of gray scale smallest point is with certain point in exterior domain
Gray scale is much larger than the gray scale of the gray scale smallest point.When the condition above of satisfaction, you can according to vertical line integral image and horizontal line
Integral image, distance and angle corresponding to lookup maximum and minimum value, so that the border for obtaining beam-defining clipper irradiation field is being treated
Handle the position in image and angle.
In the third possible implementation, the first edge, the second edge, the 3rd edge and the 4th edge are determined to wait to locate
Beam-defining clipper irradiation field border includes in reason image:
When the absolute value of maximum in the first set is more than the first initial threshold, it is determined that first edge is
First border of beam-defining clipper irradiation field in the pending image;When the absolute value of minimum value in the first set is more than second
During initial threshold, it is determined that second edge is the second boundary of beam-defining clipper irradiation field in the pending image;When described
When the absolute value of maximum is more than three initial thresholds in second set, it is determined that the 3rd edge is the pending image
3rd border of middle beam-defining clipper irradiation field;When the absolute value of minimum value in the second set is more than four initial thresholds, then
Determine the 4th border that the 4th edge is beam-defining clipper irradiation field in the pending image.When not definite certain edge is limit
During the border of beam device irradiation field, then judge that there is no beam-defining clipper irradiation field on the direction in pending image corresponding to the edge
Border.
It is understood that other detectable edges usually in the more pending image in boundary line of beam-defining clipper irradiation field
It is more obvious, in pending image on irradiation field boundary line all pixels point gradient vertically and horizontally add up with it is long-range
In or much smaller than on other straight lines for detecting in corresponding gradient map the gradient of all pixels point add up and.At this time, it is raising
The accuracy rate of judgement, at the beginning of those skilled in the art can be set according to actual conditions the first initial threshold, the second initial threshold, the 3rd
Beginning threshold value and the 4th initial threshold.When the absolute value of the maximum in first set and second set is more than corresponding to the maximum
Initial threshold, the absolute value of first set and the minimum value in second set be more than initial threshold corresponding to the minimum value
When, you can real beam-defining clipper irradiation field border in judging the maximum or edge corresponding to minimum value for pending image.
In one preferred embodiment, the first initial threshold, the second initial threshold, can be set by the following method
Three initial thresholds and the 4th initial threshold.
The first step, obtains the low-frequency image of the pending image;
It is understood that having filtered out the minutia of pending image in low-frequency image, image to be handled is only preserved
Grey scale change trend.In this way, gray feature in low-frequency image come obtain the first initial threshold, the second initial threshold,
3rd initial threshold and the 4th initial threshold, can reduce the interference of pending image medium-high frequency information (i.e. minutia), make knot
Fruit is more accurate.
In specific implementation, multi-resolution pyramid algorithm can be used to decompose the pending image and obtain a low frequency figure
Picture.In the present embodiment, existing Gauss or laplacian pyramid algorithm can be used.It should be noted that looked into for guarantee
The accuracy of result is looked for, larger operator need to be used to calculate the low-frequency image of pending image.
Second step, is determined as the beam-defining clipper by region of the Y-axis coordinate in the low-frequency image less than (H/2)-H × f and shines
The upper moving area on launched field border, is determined as the limit by region of the Y-axis coordinate in the low-frequency image more than (H/2)+H × f
The lower moving area on beam device irradiation field border;Region of the X-axis coordinate in the low-frequency image less than (W/2)-W × f is determined as
The beam-defining clipper irradiation field border moves left region, and X-axis coordinate in the low-frequency image is more than to the region of (W/2)+W × f
Be determined as the beam-defining clipper irradiation field border moves right region;Wherein, H be the low-frequency image Y-axis coordinate maximum, W
For the maximum of the low-frequency image X-axis coordinate, f is default truncation function.
It is understood that height and width are that zero point is the pixel in the image upper left corner in pending image.
Explanation is needed exist for, in practical applications, the beam-defining clipper irradiation field in pending image is generally placed at figure
The center of picture, the border of beam-defining clipper irradiation field are generally present in close to the region of pending image border.Also, due to
In the actual design of beam-defining clipper, there are a maximum to block scope for the stereotype of beam-defining clipper so that beam-defining clipper cannot will shelter from whole
X-ray.Therefore, those skilled in the art are according to this actual conditions, and the default truncation function of setting one is (i.e. f), for counting
Calculate maximum moving range of four borders of beam-defining clipper irradiation field in pending image all directions.At this time, sentence to improve
Disconnected accuracy, the first initial threshold, the second initial threshold, the 3rd initial threshold and the 4th initial threshold can be corresponding according to its
The actual conditions of moving area belonging to edge are specifically set.
3rd step, determine first edge, second edge, the 3rd edge and the 4th edge with it is described
Upper moving area, the lower moving area, described move left region and the correspondence moved right between region, Mei Geyi
Dynamic region corresponds to an edge;
4th step, obtains the upper moving area, the lower moving area, described move left region and described move to right respectively
The gray average of all pixels point, obtains top gray average, lower part gray average, left part gray average and right part in dynamic region
Gray average;
5th step, when the top gray average is greater than or equal to default maximum gray average A, the upper moving area
Judgment threshold be equal to default maximum judgment threshold;When the top gray average is less than or equal to default minimal gray average B
When, the judgment threshold of the upper moving area is equal to default minimum judgment threshold;Preset most when the top gray average is more than
When small gray average B and the top gray average are less than default maximum gray average A, then according to the top gray average,
The judgment threshold of the upper moving area is set;
6th step, when the lower part gray average is greater than or equal to default maximum gray average A, the lower moving area
Judgment threshold be equal to the default maximum judgment threshold;When the lower part gray average is equal less than or equal to default minimal gray
During value B, the judgment threshold of the lower moving area is equal to the default minimum judgment threshold;When the lower part gray average is more than
Default minimal gray average B and when the lower part gray average is less than default maximum gray average A, then according to the lower part gray scale
Average, sets the judgment threshold of the lower moving area;
7th step, it is described to move left region when the left part gray average is greater than or equal to default maximum gray average A
Judgment threshold be equal to the default maximum judgment threshold;When the left part gray average is equal less than or equal to default minimal gray
During value B, the judgment threshold for moving left region is equal to the default minimum judgment threshold;When the left part gray average is more than
Default minimal gray average B and when the left part gray average is less than default maximum gray average A, then according to the left part gray scale
Average, the judgment threshold in region is moved left described in setting;
8th step, it is described to move right region when the right part gray average is greater than or equal to default maximum gray average A
Judgment threshold be equal to the default maximum judgment threshold;When the right part gray average is equal less than or equal to default minimal gray
During value B, the judgment threshold for moving right region is equal to the default minimum judgment threshold;When the right part gray average is more than
Default minimal gray average B and when the right part gray average is less than default maximum gray average A, then according to the right part gray scale
Average, the judgment threshold in region is moved right described in setting;
9th step, at the beginning of first initial threshold, second initial threshold, the 3rd initial threshold and the described 4th
Beginning threshold value is respectively equal to the shifting corresponding to first edge, second edge, the 3rd edge and the 4th edge
The judgment threshold in dynamic region.
Those skilled in the art can be set according to actual conditions default maximum judgment threshold, preset maximum judgment threshold, be pre-
If maximum gray threshold and default minimal gray threshold value, will not enumerate herein.
Briefly, when the gray average of any moving area is greater than or equal to default maximum gray threshold, then the shifting
The judgment threshold in dynamic region is equal to default maximum judgment threshold;When the gray average of the moving area is less than or equal to default minimum
During gray threshold, then the judgment threshold of the moving area is equal to default minimum judgment threshold;When the gray average of the moving area
, then should according to the setting of the gray average of the moving area during less than default maximum gray threshold and more than default minimal gray threshold value
The judgment threshold of moving area.
During due to the use of X-ray camera system, beam-defining clipper irradiation field in the X-ray original image that different body parts are generated
Border contrast it is different.Therefore, preset most when the gray average of a certain moving area is less than default maximum gray threshold and is more than
During small gray threshold, body part type and the movement that those skilled in the art can be different according to pending image
The gray average in region sets the judgment threshold of the moving area, to improve the accuracy judged irradiation field border.
It should be noted that above-mentioned determine the first edge, the second edge, the 3rd edge and the when it is implemented, can use
Four edges are one kind in three kinds of possible implementations of beam-defining clipper irradiation field boundary method in pending image, also be can be combined
Using above-mentioned three kinds of possible implementations, such as first adopted again using the verification method described in second of possible implementation
With the verification method described in the third possible implementation.
Further, since in some usage scenarios, beam-defining clipper has not necessarily been blocked and blocked on four direction,
The boundary line of beam-defining clipper irradiation field is not necessarily present on some direction of i.e. pending image.So so that in pending image
One or more border of beam-defining clipper irradiation field be pending image border.Also, due to pending image self-information
The interference of the factor such as complexity and outside noise, through above-mentioned second possible implementation and the third possible implementation
Described in method validation when, it is also possible to occur that a certain bar or multiple summits are irradiated along beam-defining clipper in pending image is not determined as
The situation on wild border.Therefore, it need to determine whether that above-described embodiment is drawn definite the result is that no correct.
In a kind of preferred embodiment of the present embodiment, in order to further improve the accurate of beam-defining clipper irradiation field acquisition
Degree, need to be in above-mentioned testing result when a certain bar or multiple summits are not along when being determined as beam-defining clipper irradiation field border in pending image
On the basis of carry out quadratic search, determine that the side of beam-defining clipper irradiation field is really not present in pending image on the direction at the edge
Boundary.
In one example, first region of the Y-axis coordinate in the pending image less than (H/2)-H × f can be determined as
The upper region on the beam-defining clipper irradiation field border, Y-axis coordinate in the pending image is true more than the region of (H/2)+H × f
It is set to the lower region on the beam-defining clipper irradiation field border, X-axis coordinate in the pending image is less than to the area of (W/2)-W × f
Domain is determined as the left region on the beam-defining clipper irradiation field border, and X-axis coordinate in the pending image is more than (W/2)+W × f
Region be determined as the right region on the beam-defining clipper irradiation field border, H is the maximum of the low-frequency image Y-axis coordinate, and W is institute
The maximum of low-frequency image X-axis coordinate is stated, f is default truncation function.First edge, second edge, institute are determined again
State between the 3rd edge and the 4th edge and the upper region, the lower region, the left region and the right region
Correspondence, each region correspond to an edge;
At this moment, do not determine that first border and the second boundary shine for beam-defining clipper in the pending image at the same time when
The border of launched field and/or do not determine that the 3rd border and the 4th border are that beam-defining clipper shines in the pending image at the same time
During the border of launched field, the border of the beam-defining clipper irradiation field is searched again in the region for not determining border;Wherein, it is described not true
The region of deckle circle is the region not being determined as in the pending image corresponding to the edge on beam-defining clipper irradiation field border.
As an example, the border bag for searching the beam-defining clipper irradiation field again in the region for not determining border
Include:
First, the initial threshold according to corresponding to the definite edge, sets secondary judgment threshold;
It is understood that secondary judgment threshold need to be less than the judgement for not determining that borderline region corresponding first searches region
Threshold value, and secondary judgment threshold should be the number more than or equal to zero.Those skilled in the art can specifically set two according to actual conditions
Secondary judgment threshold, will not enumerate herein.
Secondly, judge all pixels point on the definite edge the gradient of vertical direction add up sum absolute value whether
More than the secondary judgment threshold, or, judge it is described do not determine on edge all pixels point gradient in the horizontal direction add up with
Absolute value whether be more than the secondary judgment threshold;If it is not, then pending figure described in the region for not determining border
The edge of picture is the border of the beam-defining clipper irradiation field;If it is, obtain the limit in the region for not determining border
The border of beam device irradiation field.
It is understood that when being unsatisfactory for the condition of above-mentioned quadratic search, then illustrate not determine in the region on border not
There are the border of beam-defining clipper irradiation field.At this time, the edge of pending image is the side of the beam-defining clipper irradiation field in this direction
Boundary.When meeting the condition of above-mentioned quadratic search, illustrate that there may be the side of beam-defining clipper irradiation field in the region on not definite border
Boundary, need to search the border of the beam-defining clipper irradiation field again in the region for not determining border.
In some possible implementations, the beam-defining clipper irradiation field is obtained in the region for not determining border
Border includes:
Step 1:Obtain the low-frequency image of the pending image;
In specific implementation, multi-resolution pyramid algorithm can be used to decompose the pending image and obtain a low frequency figure
Picture.In the present embodiment, existing Gauss or laplacian pyramid algorithm can be used.It should be noted that looked into for guarantee
The accuracy of result is looked for, larger operator need to be used to calculate the low-frequency image of pending image.
Step 2:Determine to obtain first with the corresponding region in region for not determining border in the low-frequency image and look into
Look for region;
Step 3:The described first gray average for searching all pixels point in region is obtained, and according in the lookup region
The gray average of all pixels point, sets first threshold;
It is understood that the gray average of beam-defining clipper irradiation field border affiliated area is not necessarily identical in different images.
Therefore, need to be shown according to the gray average of all pixels point in the first of low-frequency image the lookup region and according to pending image
The predetermined coefficient that the different body parts shown are set, sets the first gray scale judgment threshold.
Step 4:The described first gray average for searching all pixels point on every straight line in region is obtained, obtains the 3rd collection
Close;
Step 5:Judge whether the minimum value in the 3rd set is more than the first threshold;If it is not, then it is described not
The edge for determining pending image described in the region on border is the border of the beam-defining clipper irradiation field;If it is, determine to treat
Boning out is the border of beam-defining clipper irradiation field in the region for not determining border, in the 3rd set corresponding to minimum value
Position of the straight line in the low-frequency image is identical with the position for treating boning out in the pending image.
In one example, whether it is that beam-defining clipper shines for the straight line corresponding to the minimum value in the further set of verification the 3rd
The border of launched field, improves accuracy, determines described to treat boning out for beam-defining clipper irradiation field in the region for not determining border
Border includes:According to the pending image and the low-frequency image, the high frequency imaging of the pending image is obtained;Determine institute
State in high frequency imaging with the corresponding region in region for not determining border, obtain the second lookup region;Obtain described second
The gray average of all pixels point in region is searched, and judges that the described second gray average for searching all pixels point in region is
It is no to be more than second threshold;If it is not, then described treat that boning out is the border of beam-defining clipper irradiation field in the pending image;If
It is that then the edge of pending image described in the region for not determining border is the border of the beam-defining clipper irradiation field.
Explanation is needed exist for, the high frequency imaging only includes the primary high frequency information in pending image, i.e. image
Minutia.Those skilled in the art can also seek multiple high frequency imagings that above-mentioned multi-resolution pyramid algorithm decomposes
With obtain above-mentioned high frequency imaging.
When second searches the boundary line that beam-defining clipper irradiation field is not present in region, in the region detailed information of image compared with
It is more so that the gray average of respective regions is larger in high frequency imaging;When the side in the second lookup region there are beam-defining clipper irradiation field
During boundary line, the detailed information of image is less in the region so that the gray average of respective regions is smaller in high frequency imaging.In this way,
When the gray average of all pixels point in the described second lookup region is more than second threshold, you can determine to be not present in the region
The border of beam-defining clipper irradiation field.
It is understood that those skilled in the art can specifically set second threshold according to actual conditions.For example, according to
Different body parts shown by pending image are set.
In some possible implementations of the present embodiment, to be further ensured that beam-defining clipper irradiation field border obtains result
It is accurate, can be before final result again to result (the first border, the second boundary, the 3rd border and the 4th side determined
Boundary) verified.In one example, the method similar with the first possible implementation can be used to be carried out again to result
Verification, the verification method include:Judge whether first border and the second boundary parallel and the 3rd side respectively
Whether boundary and the 4th border are parallel;When first border is parallel with the second boundary and the 3rd border and described
When 4th border is parallel, continue to judge in first border, the second boundary, the 3rd border and the 4th border
Whether two adjacent borders are orthogonal;When first border, the second boundary, the 3rd border and described
When two adjacent borders are orthogonal in four borders, first border, the second boundary, the 3rd border and institute
State border of the 4th border for beam-defining clipper irradiation field in the pending image.
Explanation is needed exist for, in practical applications, because of situations such as the influence of operating error or equipment error, waits to locate
Four borders of beam-defining clipper irradiation field are not necessarily substantially parallel or vertically in reason image, generally can there are the error in several years.Therefore,
For any two beam-defining clipper irradiation field boundary line, it need to ensure that its angular deviation is less than the angle threshold of setting, such as 2 degree.
At this time, the angle of the angle between the angle between the first border and the second boundary and the 3rd border and the 4th border
Degree need to be more than 180a-2 degree and be less than 180a+2 degree, and a is integer.First border, the second boundary, the 3rd border
And the angle of angle need to be more than 90b-2 degree and be less than 90b+2 degree between adjacent two borders in the 4th border, b is whole
Number.
There is also the need to explanation, when some or multiple borders of beam-defining clipper irradiation field in pending image are image
During edge, it need to equally verify whether the border that the image border is detected with other meets above-mentioned condition.
For the ease of understanding the method on beam-defining clipper irradiation field border in the acquisition medical diagnostic images described in the above, under
Mask body introduces a kind of preferred embodiment of the present embodiment.
After obtaining by the original image according to position using X-ray machine, to reduce noise jamming, reducing calculation amount, first to original
Beginning image carries out preprocessing process, obtains pending image.
Preprocessing process includes:After the partial pixel for removing pending image border, pending image is carried out at convolution
Reason, removes influence of noise;Since convolutional calculation can cause skirt response, the part that pending image border suffers from this need to be removed
Pixel;The method for reapplying dot interlace sampling, dimension-reduction treatment is carried out to image.
Then, each pixel is calculated in pending image respectively in gradient both vertically and horizontally, is hung down
Straight gradient image and horizontal gradient image.The specific method that gradient calculates is as described in above-described embodiment, and which is not described herein again.
Secondly, all pixels point is calculated in pending image on every straight line respectively in ladder both vertically and horizontally
Degree it is cumulative and.Closed respectively according to the position in pending image between every straight line and pending image center and horizontal line again
Adding up for gradient generates vertical line integrogram to all pixels point with (line integral result) in vertical direction in system and the straight line
Picture;According to the position relationship in pending image between every straight line and pending image center and horizontal line and the straight line
Adding up for gradient generates horizontal line integral image to upper all pixels point with (line integral result) in the horizontal direction.
Finally, lookup vertical line integral image and maximum of points and minimum point on horizontal line integral image, totally four.
Four straight lines corresponding to this four points are the border of beam-defining clipper irradiation field in pending image.
On this basis, result need to be judged and verification step, to improve the accuracy of result.Judge and verification walks
It is rapid specific as follows:
The first step, obtains four moving areas on beam-defining clipper irradiation field border, determines which above-mentioned four straight lines are belonging respectively to
One moving area.Again respectively obtain four moving areas judgment threshold, judge the line integral of above-mentioned four straight lines the result is that
It is no to correspond to the judgment threshold of moving area more than it.If so, it can determine that the border that the straight line is beam-defining clipper irradiation field;If not,
The border of beam-defining clipper irradiation field is then not present in the moving area of the line correspondences.The acquisition of the judgment threshold of each moving area
Method is identical with the method described in above-described embodiment, and details are not described herein.
Second step, respectively on vertical line integral image and horizontal line integral image, verifies in the first step and determines the beam that is limited
Most it is worth corresponding to the straight line on device irradiation field border in the region beyond certain span a little and whether there is a bit, its line integral result
It is much larger than or is most worth a little much smaller than this.If not, the border of beam-defining clipper irradiation field is not present in the moving area of the line correspondences.
3rd step, by taking the beam-defining clipper irradiation field border of upper and lower both direction as an example, if only finding one by above-mentioned steps
The boundary line of the beam-defining clipper irradiation field in direction, the border of beam-defining clipper irradiation field is not present on other direction, then needs using secondary
Judge to determine whether another direction is really not present the boundary line of beam-defining clipper irradiation field.Specifically can be secondary by setting one
Judgment threshold, if existed on there is no the direction of beam-defining clipper irradiation field boundary line a bit, the absolute value of its line integral result
More than secondary judgment threshold, then illustrate that there may be the border of beam-defining clipper irradiation field on above-mentioned other direction.Then foundation side at this moment,
Method A and method B continues to search for the border of beam-defining clipper irradiation field in this direction:
Method A:Low-frequency image is verified.According to the gray average of corresponding moving area in the low-frequency image of pending image,
Obtain the first gray scale judgment threshold.It is the direction there is no beam-defining clipper for initial decision, finds the low frequency figure of pending image
As in upper corresponding region on every straight line all pixels point gray average minimum value.If the minimum value judges threshold more than gray scale
Value, then judge border of the direction there are beam-defining clipper irradiation field, the position of the straight line corresponding to the minimum value of gray average is with treating
The boundary position for handling beam-defining clipper irradiation field in image is identical;Otherwise, the border of beam-defining clipper irradiation field is not present in the direction;
Method B:High frequency imaging is verified.A second gray scale judgment threshold is defined, is that there is no limit beam for initial decision
The direction of device, calculates the gray average of all pixels point in corresponding region in the high frequency imaging of pending image.If the pixel
Average is more than the second gray scale judgment threshold, then the border of beam-defining clipper irradiation field is not present in the direction.
High frequency imaging verification is carried out on the basis of low-frequency image verification, i.e., if low-frequency image verification judges
Deposit in one direction there are the border of beam-defining clipper irradiation field, but the border is unsatisfactory for the condition of high frequency imaging verification, then
It can judge that there is no the border of beam-defining clipper irradiation field in this direction.
The quadratic search method on the beam-defining clipper irradiation field border of left and right both direction is similar, and details are not described herein.For treating
Judge to be not present on the direction on the border of beam-defining clipper irradiation field, it is specified that pending image border is irradiated as beam-defining clipper in processing image
Wild border.
4th step, for the border (may be the edge of pending image) of four beam-defining clipper irradiation fields, ensures every two
The angular deviation of angle is less than the angle threshold of setting between border.That is, the result detected to ensure in relative direction (on
Lower or left and right) beam-defining clipper irradiation field border is parallel two-by-two, on different directions the beam-defining clipper irradiation field of (adjacent) border two
Two is vertical.When the conditions set forth above are not met, it need to consider whether the calculating of the accumulated value of gradient is correct.
Initial detecting result is judged and verified by above-mentioned steps, beam-defining clipper in pending image can be obtained and shone
The real position on launched field border, and then obtain the scope of beam-defining clipper irradiation field in pending image.
Fig. 8 a show that the hand bone normotopia X-ray original image shown in Fig. 1 is examined through acquisition medical treatment provided in an embodiment of the present invention
The boundary line that the method on beam-defining clipper irradiation field border detects in disconnected image;Fig. 8 b show that patella axial X-ray original image passes through
The boundary line that the method on beam-defining clipper irradiation field border detects in acquisition medical diagnostic images provided in an embodiment of the present invention;Fig. 8 c
Show lumbar vertebrae normotopia X-ray original image through beam-defining clipper irradiation field side in acquisition medical diagnostic images provided in an embodiment of the present invention
The boundary line that the method on boundary detects;Fig. 8 d show rumpbone normotopia X-ray original image through acquisition provided in an embodiment of the present invention
The boundary line that the method on beam-defining clipper irradiation field border detects in medical diagnostic images.It can be seen that from above-mentioned testing result figure,
The method on beam-defining clipper irradiation field border, can be accurately detected border in acquisition medical diagnostic images provided in an embodiment of the present invention
The weak and affected by noise and incoherent beam-defining clipper irradiation field in border is contrasted, obtains continuous beam-defining clipper irradiation field boundary line.
In successive image processing procedure, those skilled in the art directly can accurately remove in image according to the boundary line got and limit
Region beyond beam device irradiation field, improves the precision of successive image handling result.
The method on beam-defining clipper irradiation field border in acquisition medical diagnostic images provided in this embodiment, calculates treat first respectively
Image is handled in gradient both vertically and horizontally, then calculates in pending image all pixels point on every straight line and is hanging down
Nogata to adding up with gradient in the horizontal direction and, the vertical gradient for obtaining every straight line in pending image adds up and and horizontal
Gradient add up and.Afterwards, search that maximum perpendicular gradient adds up, maximum horizontal gradient adds up respectively and, minimum vertical gradient adds up
With and minimum level gradient add up and corresponding straight line, obtain four edges edge.This four edges is limited along as pending image
The boundary line of beam device irradiation field.Beam-defining clipper irradiation field is the interior zone that this four edges edge is surrounded in pending image.This
The method on beam-defining clipper irradiation field border in the acquisition medical diagnostic images that embodiment provides, it is weak can be accurately detected border contrast
And the affected by noise and incoherent beam-defining clipper irradiation field in border, continuous beam-defining clipper irradiation field border is obtained, easy to follow-up
The region beyond beam-defining clipper irradiation field in image is removed during processing, improves the precision of later image handling result.
The method on beam-defining clipper irradiation field border in the acquisition medical diagnostic images provided based on above-described embodiment, the present invention are real
Apply example and additionally provide a kind of device for obtaining beam-defining clipper irradiation field in medical diagnostic images.
Device embodiment:
Referring to Fig. 9, which is that the device on beam-defining clipper irradiation field border in acquisition medical diagnostic images provided by the invention is real
Apply the structure diagram of example.
The device on beam-defining clipper irradiation field border in acquisition medical diagnostic images provided in this embodiment, including:First obtains
Module 100, the second acquisition module 200, the 3rd acquisition module 300, the 4th acquisition module 400, the first determining module 500 and second
Determining module 600;
First acquisition module 100, for obtaining pending image;
Second acquisition module 200, for obtaining in the pending image each pixel respectively in vertical direction
With the gradient of horizontal direction;
In some possible implementations of the present embodiment, second acquisition module 200, including:5th obtains son
Module, image procossing submodule and the 6th acquisition submodule (being not shown);
5th acquisition submodule, for obtaining the first preset range, the second preset range, the 3rd preset range respectively
With the gray average of all pixels point in the 4th preset range, it is equal to obtain the first gray average, the second gray average, the 3rd gray scale
Value and the 4th gray average;
Wherein, first preset range is located at the surface of preset, and second preset range is positioned at described default
The underface of point, the 3rd preset range are located at the front-left of the preset, and the 4th preset range is positioned at described pre-
The front-right to set up an office, first preset range, second preset range, the 3rd preset range and the described 4th preset
The size of scope is identical and distance between the preset is identical, and the preset is any pixel in the pending image
Point;
Described image handles submodule, for when first preset range, second preset range, the described 3rd pre-
If lack pixel in scope or the 4th preset range, then according to the gray scale of the pending image edge pixels point,
Pixel described in completion in preset range;
6th acquisition submodule, for according to first gray average and second gray average, obtaining institute
State gradient of the preset in vertical direction;
6th acquisition submodule, is additionally operable to, according to the 3rd gray average and the 4th gray average, obtain
The preset gradient in the horizontal direction.
In some possible implementations of the present embodiment, the 5th acquisition submodule, including:7th obtains submodule
Block, the 8th acquisition submodule and the 9th acquisition submodule (being not shown);
7th acquisition submodule, for obtaining first area, second area, the 3rd in the pending image respectively
In region and the 4th region all pixels point gray scale cumulative and, obtain the first value, second value, the 3rd value and the 4th value;
Wherein, the first area is square determined by first point of pixel with the pending image left upper
Region, the second area is square region determined by second point and the pending image left upper pixel, described
3rd region is the square region thirdly determined with the pending image left upper pixel, and the 4th region is institute
State square region determined by pixel and the pending image left upper pixel at the first scope lower right corner, described the
One point coordinates is (x1-1,y1- 1), the coordinate of the second point is (x2-1,y2), the coordinate thirdly is (x3,y3- 1),
The coordinate of left upper pixel is (x in first scope1,y1), the coordinate of lower right-hand corner pixel in first scope
For (x2,y2), the coordinate of pixel is (x at the upper right corner in first scope3,y3), first scope is pre- for described first
If scope, second preset range, the 3rd preset range or the 4th preset range;
8th acquisition submodule, subtracts again for first value to be subtracted the second value plus the 4th value
3rd value, obtains cumulative and acquisition first preset range, described second of all pixels point gray scale in the first scope
In preset range, the 3rd preset range and the 4th preset range all pixels point gray scale cumulative and;
9th acquisition submodule, for according to first preset range, second preset range, the described 3rd
In preset range and the 4th preset range all pixels point gray scale cumulative and, obtain first preset range, described
The gray average of all pixels point in second preset range, the 3rd preset range and the 4th preset range.
In some possible implementations of the present embodiment, the 7th acquisition submodule, including:First calculates submodule
Block and the second calculating sub module (being not shown);
First calculating sub module, for according to formulaCalculate and sat in the pending image
It is designated as the row accumulated value sum_l of (m, n) pixelm,n, wherein, Gm,iIt is (m, i) pixel for coordinate in the pending image
Gray scale;
Second calculating sub module, for according to formulaCalculate the coordinate for (m,
N) all pixels point gray scale and cumulative and sum_all in the region corresponding to pixelm,n;
Wherein, the coordinate is (m, n) pixel for institute first area, the second area, the 3rd region or institute
State the pixel in the 4th region lower right corner.
3rd acquisition module 300, for obtaining, all pixels point is hanging down on every straight line in the pending image
Nogata to gradient add up and, obtain first set;
In some possible implementations of the present embodiment, the 3rd acquisition module 300, specifically includes:First life
Into submodule and the first processing submodule (being not shown);
It is described first generation submodule, for according to each pixel in the pending image in the ladder of vertical direction
Degree, generates vertical gradient image;
The first processing submodule, for carrying out Radon transform to the vertical gradient image, obtains first collection
Close;
4th acquisition module 400, for obtaining in the pending image on every straight line all pixels point in water
Square to gradient add up and, obtain second set;
In some possible implementations of the present embodiment, the 4th acquisition module 400, specifically includes:Second life
Into submodule and second processing submodule (being not shown);
The second generation submodule, for according to each pixel ladder in the horizontal direction in the pending image
Degree, generates horizontal gradient image;
The second processing submodule, for carrying out Radon transform to the horizontal gradient image, obtains second collection
Close.
First determining module 500, for searching maximum and minimum value in the first set, determines described first
Straight line in set corresponding to maximum is the first edge, and it is second to determine the straight line in the first set corresponding to minimum value
Edge;
First determining module 500, is additionally operable to search maximum and minimum value in the second set, determines described
Straight line in two set corresponding to maximum be the 3rd edge, and it is the to determine the straight line in the second set corresponding to minimum value
Four edges;
Second determining module 600, for determine first edge, second edge, the 3rd edge and
4th edge is the border of beam-defining clipper irradiation field in the pending image.
In some possible implementations of the present embodiment, second determining module 600, including:First determines son
Module (is not shown);
First determination sub-module, is more than the first initial threshold for the absolute value when maximum in the first set
When, it is determined that first edge is the first border of beam-defining clipper irradiation field in the pending image;
First determination sub-module, the absolute value for being additionally operable to work as minimum value in the first set are more than the second initial threshold
During value, it is determined that second edge is the second boundary of beam-defining clipper irradiation field in the pending image;
First determination sub-module, the absolute value for being additionally operable to work as maximum in the second set are more than the 3rd initial threshold
During value, it is determined that the 3rd edge is the 3rd border of beam-defining clipper irradiation field in the pending image;
First determination sub-module, the absolute value for being additionally operable to work as minimum value in the second set are more than the 4th initial threshold
During value, it is determined that the 4th edge is the 4th border of beam-defining clipper irradiation field in the pending image.
In some possible implementations of the present embodiment, device provided in this embodiment, further includes:3rd determines mould
Block, the 4th determining module, the 5th acquisition module and threshold setting module (being not shown);
First acquisition module 100, is additionally operable to obtain the low-frequency image of the pending image;
3rd determining module, for region of the Y-axis coordinate in the low-frequency image less than (H/2)-H × f to be determined
For the upper moving area on the beam-defining clipper irradiation field border, Y-axis coordinate in the low-frequency image is more than to the area of (H/2)+H × f
Domain is determined as the lower moving area on the beam-defining clipper irradiation field border;3rd determining module, is additionally operable to the low frequency figure
Region of the X-axis coordinate less than (W/2)-W × f is determined as the region that moves left on the beam-defining clipper irradiation field border as in, by described in
What region of the X-axis coordinate more than (W/2)+W × f was determined as the beam-defining clipper irradiation field border in low-frequency image moves right region;
Wherein, H is the maximum of the low-frequency image Y-axis coordinate, and W is the maximum of the low-frequency image X-axis coordinate, and f cuts to be default
Disconnected coefficient,
4th determining module, for determining first edge, second edge, the 3rd edge and described
4th edge and the upper moving area, the lower moving area, described move left region and described move right between region
Correspondence, each moving area correspond to an edge;
5th acquisition module, for obtaining the upper moving area, the lower moving area respectively, described moving left
Region and the gray average for moving right all pixels point in region, obtain top gray average, lower part gray average, left part
Gray average and right part gray average;
The threshold setting module, for when the top gray average is greater than or equal to default maximum gray average A,
The judgment threshold of the upper moving area is equal to default maximum judgment threshold;Preset when the top gray average is less than or equal to
During minimal gray average B, the judgment threshold of the upper moving area is equal to default minimum judgment threshold;When the top gray scale is equal
Value is more than default minimal gray average B and when the top gray average is less than default maximum gray average A, then according on described
Portion's gray average, sets the judgment threshold of the upper moving area;
The threshold setting module, is additionally operable to when the lower part gray average is greater than or equal to default maximum gray average A
When, the judgment threshold of the lower moving area is equal to the default maximum judgment threshold;Be less than when the lower part gray average or
During equal to default minimal gray average B, the judgment threshold of the lower moving area is equal to the default minimum judgment threshold;Work as institute
State lower part gray average and be more than default minimal gray average B and when the lower part gray average is less than default maximum gray average A,
Then according to the lower part gray average, the judgment threshold of the setting lower moving area;
The threshold setting module, is additionally operable to when the left part gray average is greater than or equal to default maximum gray average A
When, the judgment threshold for moving left region is equal to the default maximum judgment threshold;Be less than when the left part gray average or
During equal to default minimal gray average B, the judgment threshold for moving left region is equal to the default minimum judgment threshold;Work as institute
State left part gray average and be more than default minimal gray average B and when the left part gray average is less than default maximum gray average A,
Then according to the left part gray average, the judgment threshold in region is moved left described in setting;
The threshold setting module, is additionally operable to when the right part gray average is greater than or equal to default maximum gray average A
When, the judgment threshold for moving right region is equal to the default maximum judgment threshold;Be less than when the right part gray average or
During equal to default minimal gray average B, the judgment threshold for moving right region is equal to the default minimum judgment threshold;Work as institute
State the right gray average in portion and be more than default minimal gray average B and when the right part gray average is less than default maximum gray average A,
Then according to the right part gray average, the judgment threshold in region is moved right described in setting;
First initial threshold, second initial threshold, the 3rd initial threshold and the 4th initial threshold
Moving area corresponding to respectively equal to described first edge, second edge, the 3rd edge and the 4th edge
Judgment threshold.
In some possible implementations, device provided in this embodiment, further includes:It is 5th determining module, the 6th true
Cover half block and searching module (being not shown);
5th determining module, for Y-axis coordinate in the pending image is true less than the region of (H/2)-H × f
It is set to the upper region on the beam-defining clipper irradiation field border, Y-axis coordinate in the pending image is more than to the area of (H/2)+H × f
Domain is determined as the lower region on the beam-defining clipper irradiation field border, and X-axis coordinate in the pending image is less than (W/2)-W × f
Region be determined as the left region on the beam-defining clipper irradiation field border, X-axis coordinate in the pending image being more than (W/2)+W
The region of × f is determined as the right region on the beam-defining clipper irradiation field border, and H is the maximum of the low-frequency image Y-axis coordinate, W
For the maximum of the low-frequency image X-axis coordinate, f is default truncation function;
6th determining module, for determining first edge, second edge, the 3rd edge and described
Correspondence between 4th edge and the upper region, the lower region, the left region and the right region, each region
A corresponding edge;
The searching module, for ought not determine that first border and the second boundary are the pending figure at the same time
The border of beam-defining clipper irradiation field and/or do not determine that the 3rd border and the 4th border are the pending figure at the same time as in
As in during the border of beam-defining clipper irradiation field, the border of the beam-defining clipper irradiation field is searched again in the region for not determining border;
Wherein, the region for not determining border is not to be determined as beam-defining clipper irradiation field border in the pending image
Region corresponding to edge.
In some possible implementations of the present embodiment, the searching module, including:Submodule, first is set to sentence
Disconnected submodule, the second determination sub-module and the first acquisition submodule (being not shown);
The setting submodule, for not determining the initial threshold corresponding to edge according to, sets secondary judgement threshold
Value;
First judging submodule, for judging that all pixels point is in the gradient of vertical direction on the definite edge
Whether the absolute value of cumulative sum is more than the secondary judgment threshold, or, does not determine that all pixels point is in water on edge described in judgement
Square to the add up absolute value of sum of gradient whether be more than the secondary judgment threshold;
Second determination sub-module, for when the judging result of first judging submodule is no, determining described
The edge for not determining pending image described in the region on border is the border of the beam-defining clipper irradiation field;
First acquisition submodule, for when first judging submodule judging result for be when, then described
The border of the beam-defining clipper irradiation field is obtained in the region on definite border.
In some possible implementations of the present embodiment, first acquisition submodule, including:Second obtains submodule
Block, the 3rd determination sub-module, second set submodule, the 3rd acquisition submodule, second judgment submodule, the 4th determination sub-module
(it is not shown) with the 5th determination sub-module;
Second acquisition submodule, for obtaining the low-frequency image of the pending image;
3rd determination sub-module, for determining not determining that the region on border is corresponding with described in the low-frequency image
Region, obtain the first lookup region;
Described second sets submodule, for obtaining the described first gray average for searching all pixels point in region, and
According to the gray average of all pixels point in the lookup region, first threshold is set;
3rd acquisition submodule, for obtaining the described first ash for searching all pixels point on every straight line in region
Average is spent, obtains the 3rd set;
The second judgment submodule, for judging whether the minimum value in the 3rd set is more than first threshold
Value;
4th determination sub-module, for when the judging result of the second judgment submodule is no, determining described
The edge for not determining pending image described in the region on border is the border of the beam-defining clipper irradiation field;
5th determination sub-module, for when the judging result of the second judgment submodule is is, determining undetermined
Straight line is the border of beam-defining clipper irradiation field in the region for not determining border, straight corresponding to minimum value in the 3rd set
Position of the line in the low-frequency image is identical with the position for treating boning out in the pending image.
In some possible implementations of the present embodiment, the 5th determination sub-module, including:4th obtains submodule
Block, the 6th determination sub-module, the 3rd judging submodule, the 7th determination sub-module and the 8th determination sub-module (are not shown in figure
Go out);
4th acquisition submodule, for according to the pending image and the low-frequency image, obtaining described waiting to locate
Manage the high frequency imaging of image;
6th determination sub-module, for determining not determining that the region on border is corresponding with described in the high frequency imaging
Region, obtain the second lookup region;
3rd judging submodule, for obtaining the described second gray average for searching all pixels point in region, and
Judge whether the gray average of all pixels point in the second lookup region is more than second threshold;
7th determination sub-module, for when the judging result of the 3rd judging submodule is no, determining described
It is the border of beam-defining clipper irradiation field in the pending image to treat boning out;
8th determination sub-module, for when the judging result of the 3rd judging submodule is is, determining described
The edge for not determining pending image described in the region on border is the border of the beam-defining clipper irradiation field.
In some possible implementations of the present embodiment, second determining module 600, including:Border determines son
Module (is not shown);
The border determination sub-module, for when all pixels point in the maximum and first straight line in the first set
The gradient of vertical direction add up the absolute value of sum its difference be more than the first preset difference value when, determine that first edge is treated to be described
Handle the first border of beam-defining clipper irradiation field in image;
The border determination sub-module, is additionally operable to work as all pixels in the minimum value and second straight line in the first set
Point the gradient of vertical direction add up the absolute value of sum its difference be more than the second preset difference value when, determine that second edge is described
The second boundary of beam-defining clipper irradiation field in pending image;
The border determination sub-module, the maximum and all pixels on the 3rd straight line for being additionally operable to work as in the second set
The add up absolute value of sum its difference of point gradient in the horizontal direction is more than the 3rd preset difference value, determines that the 3rd edge is treated described in being
Handle the 3rd border of beam-defining clipper irradiation field in image;
The border determination sub-module, the minimum value and all pixels on the 4th straight line for being additionally operable to work as in the second set
Point gradient in the horizontal direction adds up the absolute value of sum its difference when being more than four preset difference values, determines that the 4th edge is described
4th border of beam-defining clipper irradiation field in pending image;
Wherein, the distance in the first straight line and the pending image between the first preset and first border with
The absolute value of the difference of distance between first preset is less than the first distance;In the second straight line and the pending image
The absolute value of the difference of the distance between distance and the second boundary and second preset between second preset is less than second
Distance;Distance and first border and the described 3rd in 3rd straight line and the pending image between the 3rd preset
The absolute value of the difference of distance between preset is less than the 3rd distance;The 4th is default in 4th straight line and the pending image
The absolute value of the difference of the distance between distance and the 4th border and the 4th preset between point is less than the 4th distance.
In some possible implementations, device provided in this embodiment, further includes:First judgment module and second is sentenced
Disconnected module (being not shown);
First judgment module, for judging that each pixel is in the ladder of vertical direction in the pending image one by one
Whether degree is more than the first predetermined gradient, if it is not, then gradient of the pixel in vertical direction is set to zero;
Second judgment module, for judging each pixel ladder in the horizontal direction in the pending image one by one
Whether degree is more than the second predetermined gradient, if it is not, then pixel gradient in the horizontal direction is set to zero.
In some possible implementations of the present embodiment, second determining module 600, specifically includes:4th sentences
Disconnected submodule, the 5th judging submodule and the 9th determination sub-module (being not shown);
4th judging submodule, for judge respectively first edge and second edge it is whether parallel and
Whether the 3rd edge and the 4th edge are parallel;
5th judging submodule, for judging first edge and described second when the 4th judging submodule
Edge is parallel and when the 3rd edge is parallel with the 4th edge, continue to judge first edge, second edge,
Whether two adjacent edges are orthogonal in 3rd edge and the 4th edge;
9th determination sub-module, for judging first edge, described second when the 5th judging submodule
When two adjacent edges are orthogonal in edge, the 3rd edge and the 4th edge, determine first edge,
Second edge, the 3rd edge and the 4th edge are the border of beam-defining clipper irradiation field in the pending image.
In some possible implementations, device provided in this embodiment, further includes:3rd judgment module, the 4th sentence
Disconnected module and the 7th determining module (being not shown);
3rd judgment module, for judging whether first border and the second boundary parallel and institute respectively
Whether parallel state the 3rd border and the 4th border;
4th judgment module, for judging first border and the second boundary when the 3rd judgment module
When parallel and described 3rd border is parallel with the 4th border, continue to judge the first border, the second boundary, described
Whether two adjacent borders are orthogonal in 3rd border and the 4th border;
7th determining module, for when the 4th judgment module judge first border, the second boundary,
When two adjacent borders are orthogonal in 3rd border and the 4th border, first border, described second
Border, the 3rd border and the 4th border are the border of beam-defining clipper irradiation field in the pending image.
In some possible implementations, device provided in this embodiment, further includes:First processing module, at second
Manage module and the 3rd processing module (being not shown);
The first processing module, for carrying out trimming processing to the pending image, removes the pending image
After the pixel of the default quantity of the first of edge, the Second processing module is triggered;
The Second processing module, updates the pending image for carrying out convolutional calculation to the pending image
Afterwards, after the pixel of the second default quantity for removing the pending image border, the 3rd processing module is triggered;
3rd processing module, for carrying out down-sampled processing to the pending image, updates the pending figure
Picture;
Wherein, the sampling interval when size of convolution kernel used in the convolutional calculation is equal to the down-sampled processing.
The device on beam-defining clipper irradiation field border in acquisition medical diagnostic images provided in this embodiment, in the first acquisition module
After obtaining pending image, pending image is calculated both vertically and horizontally by the second acquisition module respectively first
Gradient, then hung down by all pixels point on every straight line in the 3rd acquisition module and the pending image of the 4th acquisition module calculating
Nogata to adding up with gradient in the horizontal direction and, the vertical gradient for obtaining every straight line in pending image adds up and and horizontal
Gradient add up and.Afterwards, by the first determining module search that maximum perpendicular gradient adds up, maximum horizontal gradient adds up respectively and,
Minimum vertical gradient add up and and minimum level gradient add up and corresponding straight line, obtain four edges edge.Second determining module
Determine this four edges along the boundary line for being beam-defining clipper irradiation field in pending image.Beam-defining clipper irradiation field is in pending image
The interior zone surrounded for this four edges edge.Beam-defining clipper irradiation field border in acquisition medical diagnostic images provided in this embodiment
Device, the weak and affected by noise and incoherent beam-defining clipper irradiation field in border of border contrast can be accurately detected, obtained
Continuous beam-defining clipper irradiation field border, easy to remove the region beyond beam-defining clipper irradiation field in image during subsequent treatment, is improved
The precision of later image handling result.
It should be noted that each embodiment is described by the way of progressive in this specification, each embodiment emphasis is said
Bright is all the difference with other embodiment, between each embodiment identical similar portion mutually referring to.For reality
For applying system disclosed in example or device, since it is corresponded to the methods disclosed in the examples, so fairly simple, the phase of description
Part is closed referring to method part illustration.
It should also be noted that, herein, relational terms such as first and second and the like are used merely to one
Entity or operation are distinguished with another entity or operation, without necessarily requiring or implying between these entities or operation
There are any actual relationship or order.Moreover, term " comprising ", "comprising" or its any other variant are intended to contain
Lid non-exclusive inclusion, so that process, method, article or equipment including a series of elements not only will including those
Element, but also including other elements that are not explicitly listed, or further include as this process, method, article or equipment
Intrinsic key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that
Also there are other identical element in process, method, article or equipment including the key element.
Can directly it be held with reference to the step of method or algorithm that the embodiments described herein describes with hardware, processor
Capable software module, or the two combination are implemented.Software module can be placed in random access memory (RAM), memory, read-only deposit
Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology
In any other form of storage medium well known in field.
The above described is only a preferred embodiment of the present invention, not make limitation in any form to the present invention.Though
So the present invention is disclosed above with preferred embodiment, but is not limited to the present invention.It is any to be familiar with those skilled in the art
Member, without departing from the scope of the technical proposal of the invention, all using the methods and technical content of the disclosure above to the present invention
Technical solution makes many possible changes and modifications, or is revised as the equivalent embodiment of equivalent variations.Therefore, it is every without departing from
The content of technical solution of the present invention, the technical spirit according to the present invention is to any simple modification made for any of the above embodiments, equivalent
Change and modification, still fall within technical solution of the present invention protection in the range of.
Claims (14)
- A kind of 1. method for obtaining beam-defining clipper irradiation field border in medical diagnostic images, it is characterised in that including:Obtain pending image;Each pixel is obtained in the pending image respectively in gradient both vertically and horizontally;Obtain in the pending image on every straight line all pixels point add up in the gradient of vertical direction and, obtain the first collection Close;Obtain in the pending image all pixels point gradient in the horizontal direction on every straight line add up and, obtain the second collection Close;Maximum and minimum value in the first set are searched, determines straight line in the first set corresponding to maximum for the One edge, it is the second edge to determine the straight line in the first set corresponding to minimum value;Maximum and minimum value in the second set are searched, determines straight line in the second set corresponding to maximum for the Three edges, it is the 4th edge to determine the straight line in the second set corresponding to minimum value;It is the pending image to determine first edge, second edge, the 3rd edge and the 4th edge The border of middle beam-defining clipper irradiation field.
- 2. according to the method described in right 1, it is characterised in that described to obtain each pixel in the pending image respectively and exist Gradient both vertically and horizontally, specifically includes:All pixels point in the first preset range, the second preset range, the 3rd preset range and the 4th preset range is obtained respectively Gray average, obtain the first gray average, the second gray average, the 3rd gray average and the 4th gray average;Wherein, first preset range is located at the surface of preset, and second preset range is located at the preset Underface, the 3rd preset range are located at the front-left of the preset, and the 4th preset range is located at the preset Front-right, first preset range, second preset range, the 3rd preset range and the 4th preset range Size it is identical and distance between the preset is identical, the preset is any pixel point in the pending image;According to first gray average and second gray average, gradient of the preset in vertical direction is obtained;According to the 3rd gray average and the 4th gray average, preset gradient in the horizontal direction is obtained.
- 3. according to the method described in claim 1, it is characterized in that, described determine first edge, second edge, institute The border of the 3rd edge and the 4th edge for beam-defining clipper irradiation field in the pending image is stated, is specifically included:When the absolute value of maximum in the first set is more than the first initial threshold, it is determined that first edge is described First border of beam-defining clipper irradiation field in pending image;When the absolute value of minimum value in the first set is more than the second initial threshold, it is determined that second edge is described The second boundary of beam-defining clipper irradiation field in pending image;When the absolute value of maximum in the second set is more than three initial thresholds, it is determined that the 3rd edge is described 3rd border of beam-defining clipper irradiation field in pending image;When the absolute value of minimum value in the second set is more than four initial thresholds, it is determined that the 4th edge is described 4th border of beam-defining clipper irradiation field in pending image.
- 4. according to the method described in claim 3, it is characterized in that, further include:Obtain the low-frequency image of the pending image;Region of the Y-axis coordinate in the low-frequency image less than (H/2)-H × f is determined as the upper of the beam-defining clipper irradiation field border Moving area, is determined as the beam-defining clipper irradiation field side by region of the Y-axis coordinate in the low-frequency image more than (H/2)+H × f The lower moving area on boundary;Region of the X-axis coordinate in the low-frequency image less than (W/2)-W × f is determined as to the left side on the beam-defining clipper irradiation field border Moving area, is determined as the beam-defining clipper irradiation field side by region of the X-axis coordinate in the low-frequency image more than (W/2)+W × f Boundary moves right region;Determine first edge, second edge, the 3rd edge and the 4th edge and the upper moving area, The lower moving area, it is described move left region and the correspondence moved right between region, each moving area corresponds to One edge;The upper moving area, the lower moving area are calculated respectively, described moved left region and described are moved right institute in region There is the gray average of pixel, obtain top gray average, lower part gray average, left part gray average and right part gray average;When the top gray average is greater than or equal to A, the judgment threshold of the upper moving area is equal to default maximum judgement Threshold value;When the top gray average is less than or equal to B, the judgment threshold of the upper moving area is equal to default minimum judgement Threshold value;When the top gray average, which is more than B and the top gray average, is less than A, then according to the top gray average, The judgment threshold of the upper moving area is set;When the lower part gray average is greater than or equal to A, the judgment threshold of the lower moving area is equal to the default maximum Judgment threshold;When the lower part gray average is less than or equal to B, the judgment threshold of the lower moving area is equal to described preset Minimum judgment threshold;When the lower part gray average is more than B and the lower part gray average is less than A, then according to the lower part Gray average, sets the judgment threshold of the lower moving area;When the left part gray average is greater than or equal to A, the judgment threshold for moving left region is equal to the default maximum Judgment threshold;When the left part gray average is less than or equal to B, the judgment threshold for moving left region is equal to described default Minimum judgment threshold;When the left part gray average is more than B and the left part gray average is less than A, then according to the left part Gray average, the judgment threshold in region is moved left described in setting;When the right part gray average is greater than or equal to A, the judgment threshold for moving right region is equal to the default maximum Judgment threshold;When the right part gray average is less than or equal to B, the judgment threshold for moving right region is equal to described default Minimum judgment threshold;When the right gray average in the portion is more than B and the right part gray average is less than A, then according to the right part Gray average, the judgment threshold in region is moved right described in setting;Wherein, H is the maximum of the low-frequency image Y-axis coordinate, and W is the maximum of the low-frequency image X-axis coordinate, and f is pre- If truncation function, A is default maximum gray average, and B is default minimal gray average;First initial threshold, second initial threshold, the 3rd initial threshold and the 4th initial threshold difference Equal to sentencing for the moving area corresponding to first edge, second edge, the 3rd edge and the 4th edge Disconnected threshold value.
- 5. according to the method described in claim 1, it is characterized in that, described determine first edge, second edge, institute The border of the 3rd edge and the 4th edge for beam-defining clipper irradiation field in the pending image is stated, is specifically included:When all pixels point adds up sum its difference in the gradient of vertical direction in the maximum and first straight line in the first set Absolute value when being more than the first preset difference value, determine that first edge is beam-defining clipper irradiation field in the pending image the One border;When all pixels point adds up sum its difference in the gradient of vertical direction in the minimum value and second straight line in the first set Absolute value when being more than the second preset difference value, determine that second edge is beam-defining clipper irradiation field in the pending image the Two borders;When all pixels point gradient in the horizontal direction adds up sum its difference in the maximum in the second set and the 3rd straight line Absolute value be more than the 3rd preset difference value, determine the 3rd edge be the pending image in beam-defining clipper irradiation field the 3rd Border;When all pixels point gradient in the horizontal direction adds up sum its difference in the minimum value in the second set and the 4th straight line Absolute value when being more than four preset difference values, determine that the 4th edge is beam-defining clipper irradiation field in the pending image the Four borders;Wherein, the distance in the first straight line and the pending image between the first preset and first border with it is described The absolute value of the difference of distance between first preset is less than the first distance;The second straight line and in the pending image second The absolute value of the difference of the distance between distance and the second boundary and second preset between preset is less than second distance; Distance in 3rd straight line and the pending image between the 3rd preset is preset with first border and the described 3rd The absolute value of the difference of distance between point is less than the 3rd distance;In 4th straight line and the pending image between the 4th preset Distance and the 4th border and the 4th preset between the absolute value of difference of distance be less than the 4th distance.
- 6. according to claim 3 to 5 any one of them method, it is characterised in that further include:When the side for not determining first border at the same time and the second boundary is beam-defining clipper irradiation field in the pending image Boundary and/or do not determine the side that the 3rd border and the 4th border are beam-defining clipper irradiation field in the pending image at the same time During boundary, the border of the beam-defining clipper irradiation field is searched again in the region for not determining border;Wherein, it is described not determine that the region on border belongs to the pending image.
- 7. according to the method described in claim 1, it is characterized in that, described determine first edge, second edge, institute The border of the 3rd edge and the 4th edge for beam-defining clipper irradiation field in the pending image is stated, is specifically included:Judge whether first edge and second edge parallel and the 3rd edge and the 4th edge respectively It is whether parallel;When first edge is parallel with second edge and the 3rd edge is parallel with the 4th edge, continue to sentence Whether two adjacent edges are equal in disconnected first edge, second edge, the 3rd edge and the 4th edge It is orthogonal;When two edges adjacent in first edge, second edge, the 3rd edge and the 4th edge are equal When orthogonal, determine that first edge, second edge, the 3rd edge and the 4th edge are waited to locate to be described Manage the border of beam-defining clipper irradiation field in image.
- 8. according to the method described in claim 1, it is characterized in that, the pending image of acquisition, further includes afterwards:Trimming processing is carried out to the pending image, removes the pixel of the first default quantity of the pending image border Point;After the convolutional calculation renewal pending image is carried out to the pending image, the pending image border is removed The pixel of second default quantity;Down-sampled processing is carried out to the pending image, updates the pending image;Wherein, the sampling interval when size of convolution kernel used in the convolutional calculation is equal to the down-sampled processing.
- A kind of 9. device for obtaining beam-defining clipper irradiation field border in medical diagnostic images, it is characterised in that including:First obtains mould Block, the second acquisition module, the 3rd acquisition module, the 4th acquisition module, the first determining module and the second determining module;First acquisition module, for obtaining pending image;Second acquisition module, for obtaining in the pending image each pixel respectively in vertical direction and level side To gradient;3rd acquisition module, for obtaining in the pending image on every straight line all pixels point in vertical direction Gradient adds up and obtains first set;4th acquisition module, for obtaining, all pixels point is in the horizontal direction on every straight line in the pending image Gradient adds up and obtains second set;First determining module, for searching maximum and minimum value in the first set, determines in the first set Straight line corresponding to maximum is the first edge, and it is the second edge to determine the straight line in the first set corresponding to minimum value;First determining module, is additionally operable to search maximum and minimum value in the second set, determines the second set Straight line corresponding to middle maximum is the 3rd edge, and it is the 4th side to determine the straight line in the second set corresponding to minimum value Edge;Second determining module, for determining first edge, second edge, the 3rd edge and the described 4th Edge is the border of beam-defining clipper irradiation field in the pending image.
- 10. device according to claim 9, it is characterised in that second determining module, including:First determines submodule Block;First determination sub-module, for when the absolute value of maximum in the first set is more than the first initial threshold, Then determine the first border that first edge is beam-defining clipper irradiation field in the pending image;First determination sub-module, the absolute value for being additionally operable to work as minimum value in the first set are more than the second initial threshold When, it is determined that second edge is the second boundary of beam-defining clipper irradiation field in the pending image;First determination sub-module, the absolute value for being additionally operable to work as maximum in the second set are more than the 3rd initial threshold When, it is determined that the 3rd edge is the 3rd border of beam-defining clipper irradiation field in the pending image;First determination sub-module, the absolute value for being additionally operable to work as minimum value in the second set are more than the 4th initial threshold When, it is determined that the 4th edge is the 4th border of beam-defining clipper irradiation field in the pending image.
- 11. device according to claim 9, it is characterised in that second determining module, including:Border determines submodule Block;The border determination sub-module, for when in the maximum and first straight line in the first set all pixels point hang down Nogata to gradient add up the absolute value of sum its difference be more than the first preset difference value when, determine first edge to be described pending First border of beam-defining clipper irradiation field in image;The border determination sub-module, is additionally operable to work as all pixels point in the minimum value and second straight line in the first set and exists The gradient of vertical direction adds up the absolute value of sum its difference when being more than the second preset difference value, determines that second edge is waited to locate to be described Manage the second boundary of beam-defining clipper irradiation field in image;The border determination sub-module, is additionally operable to work as the maximum in the second set and exists with all pixels point on the 3rd straight line The add up absolute value of sum its difference of the gradient of horizontal direction is more than the 3rd preset difference value, determines the 3rd edge to be described pending 3rd border of beam-defining clipper irradiation field in image;The border determination sub-module, is additionally operable to work as the minimum value in the second set and exists with all pixels point on the 4th straight line The gradient of horizontal direction adds up the absolute value of sum its difference when being more than four preset difference values, determines that the 4th edge is waited to locate to be described Manage the 4th border of beam-defining clipper irradiation field in image;Wherein, the distance in the first straight line and the pending image between the first preset and first border with it is described The absolute value of the difference of distance between first preset is less than the first distance;The second straight line and in the pending image second The absolute value of the difference of the distance between distance and the second boundary and second preset between preset is less than second distance; Distance in 3rd straight line and the pending image between the 3rd preset is preset with first border and the described 3rd The absolute value of the difference of distance between point is less than the 3rd distance;In 4th straight line and the pending image between the 4th preset Distance and the 4th border and the 4th preset between the absolute value of difference of distance be less than the 4th distance.
- 12. the device according to claim 10 or 11, it is characterised in that further include:Searching module;The searching module, for ought not determine that first border and the second boundary are in the pending image at the same time The border of beam-defining clipper irradiation field and/or do not determine that the 3rd border and the 4th border are in the pending image at the same time During the border of beam-defining clipper irradiation field, the border of the beam-defining clipper irradiation field is searched again in the region for not determining border;Wherein, it is described not determine that the region on border belongs to the pending image.
- 13. device according to claim 9, it is characterised in that second determining module, specifically includes:4th judges Submodule, the 5th judging submodule and the 9th determination sub-module;4th judging submodule, for judging whether first edge and second edge are parallel and described respectively Whether the 3rd edge and the 4th edge are parallel;5th judging submodule, for judging first edge and second edge when the 4th judging submodule When parallel and described 3rd edge is parallel with the 4th edge, continue to judge first edge, second edge, described Whether two adjacent edges are orthogonal in 3rd edge and the 4th edge;9th determination sub-module, for when the 5th judging submodule judge first edge, second edge, When two adjacent edges are orthogonal in 3rd edge and the 4th edge, first edge, described is determined Second edge, the 3rd edge and the 4th edge are the border of beam-defining clipper irradiation field in the pending image.
- 14. device according to claim 9, it is characterised in that further include:First processing module, Second processing module and 3rd processing module;The first processing module, for carrying out trimming processing to the pending image, removes the pending image border The first default quantity pixel after, trigger the Second processing module;The Second processing module, after carrying out the convolutional calculation renewal pending image to the pending image, goes After presetting the pixel of quantity except the second of the pending image border, the 3rd processing module is triggered;3rd processing module, for carrying out down-sampled processing to the pending image, updates the pending image;Wherein, the sampling interval when size of convolution kernel used in the convolutional calculation is equal to the down-sampled processing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610942122.1A CN107977973B (en) | 2016-10-25 | 2016-10-25 | Method and device for acquiring irradiation field boundary of beam limiter in medical diagnosis image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610942122.1A CN107977973B (en) | 2016-10-25 | 2016-10-25 | Method and device for acquiring irradiation field boundary of beam limiter in medical diagnosis image |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107977973A true CN107977973A (en) | 2018-05-01 |
CN107977973B CN107977973B (en) | 2020-08-11 |
Family
ID=62004089
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610942122.1A Active CN107977973B (en) | 2016-10-25 | 2016-10-25 | Method and device for acquiring irradiation field boundary of beam limiter in medical diagnosis image |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107977973B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110910373A (en) * | 2019-11-25 | 2020-03-24 | 西南交通大学 | Identification method of orthotropic steel bridge deck fatigue crack detection image |
CN111161297A (en) * | 2019-12-31 | 2020-05-15 | 上海联影医疗科技有限公司 | Method and device for determining edge of beam limiter and X-ray system |
CN111708022A (en) * | 2020-07-15 | 2020-09-25 | 四川长虹电器股份有限公司 | Method and device for calculating scanning area boundary of millimeter wave radar |
WO2021121234A1 (en) * | 2019-12-20 | 2021-06-24 | Shanghai United Imaging Healthcare Co., Ltd. | Systems and methods for determining collimator edge |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101540040A (en) * | 2008-03-21 | 2009-09-23 | 深圳迈瑞生物医疗电子股份有限公司 | Method and device for automatically detecting boundary of beam-limiting device |
JP2010250387A (en) * | 2009-04-10 | 2010-11-04 | Hitachi Computer Peripherals Co Ltd | Image recognition device and program |
CN102020036A (en) * | 2010-11-02 | 2011-04-20 | 昆明理工大学 | Visual detection method for transparent paper defect of outer package of strip cigarette |
CN102243705A (en) * | 2011-05-09 | 2011-11-16 | 东南大学 | Method for positioning license plate based on edge detection |
CN103208106A (en) * | 2012-01-16 | 2013-07-17 | 上海西门子医疗器械有限公司 | Method and device for detecting collimation side and X-ray imaging device |
CN103985135A (en) * | 2014-06-07 | 2014-08-13 | 山西中创伟业科技有限公司 | License plate location method based on difference edge images |
CN104161531A (en) * | 2014-05-04 | 2014-11-26 | 上海联影医疗科技有限公司 | Beam limiting device edge obtaining method and device and X-ray photographic equipment |
CN104715478A (en) * | 2015-03-05 | 2015-06-17 | 深圳市安健科技有限公司 | A method and system for detecting exposure area in image picture |
-
2016
- 2016-10-25 CN CN201610942122.1A patent/CN107977973B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101540040A (en) * | 2008-03-21 | 2009-09-23 | 深圳迈瑞生物医疗电子股份有限公司 | Method and device for automatically detecting boundary of beam-limiting device |
JP2010250387A (en) * | 2009-04-10 | 2010-11-04 | Hitachi Computer Peripherals Co Ltd | Image recognition device and program |
CN102020036A (en) * | 2010-11-02 | 2011-04-20 | 昆明理工大学 | Visual detection method for transparent paper defect of outer package of strip cigarette |
CN102243705A (en) * | 2011-05-09 | 2011-11-16 | 东南大学 | Method for positioning license plate based on edge detection |
CN103208106A (en) * | 2012-01-16 | 2013-07-17 | 上海西门子医疗器械有限公司 | Method and device for detecting collimation side and X-ray imaging device |
CN104161531A (en) * | 2014-05-04 | 2014-11-26 | 上海联影医疗科技有限公司 | Beam limiting device edge obtaining method and device and X-ray photographic equipment |
CN103985135A (en) * | 2014-06-07 | 2014-08-13 | 山西中创伟业科技有限公司 | License plate location method based on difference edge images |
CN104715478A (en) * | 2015-03-05 | 2015-06-17 | 深圳市安健科技有限公司 | A method and system for detecting exposure area in image picture |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110910373A (en) * | 2019-11-25 | 2020-03-24 | 西南交通大学 | Identification method of orthotropic steel bridge deck fatigue crack detection image |
WO2021121234A1 (en) * | 2019-12-20 | 2021-06-24 | Shanghai United Imaging Healthcare Co., Ltd. | Systems and methods for determining collimator edge |
CN111161297A (en) * | 2019-12-31 | 2020-05-15 | 上海联影医疗科技有限公司 | Method and device for determining edge of beam limiter and X-ray system |
CN111708022A (en) * | 2020-07-15 | 2020-09-25 | 四川长虹电器股份有限公司 | Method and device for calculating scanning area boundary of millimeter wave radar |
Also Published As
Publication number | Publication date |
---|---|
CN107977973B (en) | 2020-08-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Amer et al. | Edge detection methods | |
Kumar et al. | Algorithm and technique on various edge detection: A survey | |
Christoudias et al. | Synergism in low level vision | |
CN107977973A (en) | The method and device on beam-defining clipper irradiation field border in a kind of acquisition medical diagnostic images | |
CN107871322B (en) | Iris image segmentation method and device | |
Luengo-Oroz et al. | Robust iris segmentation on uncalibrated noisy images using mathematical morphology | |
Jin et al. | An adaptive nonlinear diffusion algorithm for filtering medical images | |
Zhong et al. | Image denoising based on wavelets and multifractals for singularity detection | |
CN110349207A (en) | A kind of vision positioning method under complex environment | |
US6885762B2 (en) | Scale-based image filtering of magnetic resonance data | |
Ofir et al. | On detection of faint edges in noisy images | |
Gauch et al. | The intensity axis of symmetry and its application to image segmentation | |
Kutka et al. | Extraction of line properties based on direction fields | |
CN108550145A (en) | A kind of SAR image method for evaluating quality and device | |
CN107194896A (en) | A kind of background suppression method and system based on neighbour structure | |
CN101866420B (en) | Image preprocessing method for optical volume holographic iris recognition | |
CN116468641A (en) | Infrared blood vessel image enhancement processing method | |
CN108665420A (en) | Infrared DIM-small Target Image background suppression method based on variation Bayesian model | |
CN108280448A (en) | The method of discrimination and device of finger intravenous pressing figure refer to vein identification method | |
CN111047619A (en) | Face image processing method and device and readable storage medium | |
CN110458856A (en) | A kind of crater image edge detection method, device and storage medium | |
CN112017148A (en) | Method and device for extracting single-joint skeleton contour | |
CN108764127A (en) | Texture Recognition and its device | |
Gokmen et al. | Edge detection with iteratively refined regularization | |
CN110264531A (en) | A kind of catching for X-comers takes method, apparatus, system and readable storage medium storing program for executing |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |