CN107194457B - Method for automatically counting beads of ball type control flexible shaft and marking positions of beads - Google Patents
Method for automatically counting beads of ball type control flexible shaft and marking positions of beads Download PDFInfo
- Publication number
- CN107194457B CN107194457B CN201710446404.7A CN201710446404A CN107194457B CN 107194457 B CN107194457 B CN 107194457B CN 201710446404 A CN201710446404 A CN 201710446404A CN 107194457 B CN107194457 B CN 107194457B
- Authority
- CN
- China
- Prior art keywords
- image
- flexible shaft
- beads
- area
- marking
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 239000011324 bead Substances 0.000 title claims abstract description 41
- 238000000034 method Methods 0.000 title claims abstract description 23
- 238000012545 processing Methods 0.000 claims abstract description 9
- 230000009467 reduction Effects 0.000 claims abstract description 4
- 238000003384 imaging method Methods 0.000 claims description 32
- 238000001514 detection method Methods 0.000 claims description 23
- 230000005855 radiation Effects 0.000 claims description 3
- 238000002372 labelling Methods 0.000 abstract description 3
- 229910000831 Steel Inorganic materials 0.000 description 15
- 239000010959 steel Substances 0.000 description 15
- 238000007599 discharging Methods 0.000 description 13
- 230000001681 protective effect Effects 0.000 description 11
- 230000008569 process Effects 0.000 description 9
- 239000002184 metal Substances 0.000 description 8
- 230000033001 locomotion Effects 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 230000010354 integration Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 206010063385 Intellectualisation Diseases 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 239000000203 mixture Substances 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 238000007619 statistical method Methods 0.000 description 1
- 230000007306 turnover Effects 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06M—COUNTING MECHANISMS; COUNTING OF OBJECTS NOT OTHERWISE PROVIDED FOR
- G06M11/00—Counting of objects distributed at random, e.g. on a surface
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/20—Image enhancement or restoration using local operators
- G06T5/30—Erosion or dilatation, e.g. thinning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/50—Image enhancement or restoration using two or more images, e.g. averaging or subtraction
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
- G06T7/62—Analysis of geometric attributes of area, perimeter, diameter or volume
-
- 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
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Quality & Reliability (AREA)
- Geometry (AREA)
- Analysing Materials By The Use Of Radiation (AREA)
- Length-Measuring Devices Using Wave Or Particle Radiation (AREA)
Abstract
The invention discloses a method for automatically counting beads of a ball type control flexible shaft and marking the positions of the beads, which comprises the following steps: (1) acquiring an original image of the flexible shaft and copying the image to be recorded as f (x, y); (2) binarizing f (x, y) to obtain an image B (x, y); (3) and performing reduction operation on the B (x, y) twice to obtain an image B1(x, y), image B2(x, y), subtracting the two to obtain an image M (x, y); (4) performing expansion operation on the f (x, y) to obtain an image g (x, y), and performing binarization processing to obtain an image R (x, y); (5) performing mathematical addition operation between pixels by using the image M (x, y) and the image R (x, y), and recording the obtained result image as F (x, y); (6) calculating a result image F (x, y), and counting the number of white areas with the area between 0.8 time and 1.2 times S, namely the number of beads of the flexible shaft; (7) and (4) calculating the mass center of each white area left in the step (6), drawing a square with the side length of 9 on the image f (x, y), and completing automatic labeling of the position of the flexible shaft bead. The invention realizes the automatic counting and position marking of the beads on the flexible shaft.
Description
Technical Field
The invention belongs to the field of industrial X-ray nondestructive inspection, and relates to a method for automatically counting beads of a ball type control flexible shaft and marking positions of the beads.
Background
The ball type control flexible shaft is one of control flexible shafts, a core slide bar in the middle of the control flexible shaft is used as the only transmission mechanism of movement and force, and two rows of small steel balls called balls are regularly arranged on the upper side and the lower side of the control flexible shaft and used for guiding the movement of the core slide bar and reducing the friction resistance during the movement. The ball type control flexible shaft assembles an internal structure through the round metal pipe and the protective sleeve, two rows of balls are hidden and invisible, and in order to ensure that any ball is not lost in the assembling process, X-ray transmission imaging equipment is required for detection.
The ball type control flexible shaft is a slender round shaft-shaped object with the diameter of about several centimeters and the length of tens of meters in appearance, the existing ball control flexible shaft X-ray detection equipment, such as the detection equipment disclosed by the patent documents CN205229070U and CN106546608A, places the whole flexible shaft in a linear guide rail, and continuously moves forward through a movable lead room on the guide rail to complete one-time detection. Meanwhile, the existing detection equipment lacks the automatic counting and position labeling functions of beads, the number of the beads needs to be checked and counted manually after each detection, the efficiency is low, the result is easily counted in a missing mode or in a remeasuring mode, and the product application is greatly limited.
Disclosure of Invention
Aiming at the detection requirement and the defects of the existing equipment, the invention provides a method for automatically counting the beads of the ball type control flexible shaft and marking the positions of the beads, so that the automatic detection of the steel balls in the ball type control flexible shaft is realized, and the working efficiency is improved.
The invention adopts the following technical scheme:
a method for automatically counting beads of a ball type control flexible shaft and marking the positions of the beads comprises the following steps:
(1) acquiring an original image of the flexible shaft, and copying an image as f (x, y) at the same time;
(2) using a fixed threshold value T1F (x, y) is binarized, and a flexible shaft imaging area is extracted to obtain an image B (x, y);
(3) and reducing the soft shaft area in B (x, y) in the vertical direction to 80% of the original size for the first time to obtain an image B1(x, y), the second reduction to 30% of the original, resulting in image B2(x, y) Using image B1(x, y) subtracting image B2(x, y) to obtain an image M (x, y);
(4) performing expansion operation on f (x, y) by using vertical linear structural elements to obtain an image g (x, y), and setting a fixed threshold T for g (x, y)2Carry out binarizationProcessing to obtain an image R (x, y);
(5) performing mathematical addition operation between pixels by using the image M (x, y) and the image R (x, y), and recording the obtained result image as F (x, y);
(6) calculating the area of each white area in the result image F (x, y), calculating the average area S of the areas, and then counting the number of the white areas with the area between 0.8 time and 1.2 times S, namely the number of the beads of the flexible shaft;
(7) and (3) calculating the center of mass of each white area left in the step (6), and drawing a square with the side length of 9 on the image f (x, y) by taking the center of mass as the center to finish the automatic marking of the position of the flexible shaft bead.
Further, the specific implementation mode of the step (1) is that after the flexible shaft passes through the X-ray imaging device, the obtained image data is transmitted to the industrial computer host for storing the final original data of the original image detected by the flexible shaft, and meanwhile, one image is copied and marked as f (X, y) for bead detection and position marking in the subsequent steps.
Further, X-ray scanning imaging device include plumbous room, X ray source, linear array detector and flexible axle guide rail, X ray source and linear array detector are installed respectively to plumbous room bottom and top, wherein X ray source's ray radiation center and linear array detector's formation of image center lie in same vertical axis, the middle part of the plumbous room left and right sides sets up the opening, the opening part is installed flexible axle guide rail respectively and is supplied the flexible axle business turn over, the flexible axle guide rail constitute by two sections, one section is fixed in the inside left side opening part of plumbous room, one section is fixed in the inside right side opening part of plumbous room, and the centre leaves the gap, for the flexible axle X-ray imaging region when marcing in the.
Further, the fixed threshold T in the step (2)1Is 200, and the gray value is less than T1The pixel (2) takes 1, and the gray value is more than or equal to T1The pixel of (2) is 0 to obtain a binary image B (x, y), and the white area with the gray value of 1 corresponds to the extracted flexible shaft area to be detected.
Further, in the step (4), preferably, 9 rows and 1 columns of the vertical straight-line type structural elements are used, and a fixed threshold value T is set for g (x, y)2Performing binarization processing to obtain threshold value T2Set to 90, less than threshold T2Is 1 and is greater than the threshold value T2The gray value of the pixel (c) is 0, and the image R (x, y) is obtained.
The invention relates to a method for automatically counting beads and automatically marking positions thereof based on a digital image processing method, which realizes automation and intellectualization of flexible shaft detection.
Drawings
FIG. 1 is a schematic view of the structure of the detecting device of the present invention;
FIG. 2 is a schematic diagram of the method for automatically counting beads and automatically labeling the positions of the beads according to the present invention.
Detailed Description
The following detailed description of embodiments of the present invention is provided in connection with the accompanying drawings and examples. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
As shown in fig. 1, the present invention provides a detection device 15 for a ball-type control flexible shaft, which comprises a flexible shaft transfer device, an X-ray scanning imaging device 2, an image acquisition processing device, and a control device; the flexible shaft transfer device comprises a flexible shaft automatic feeding device 1 and a flexible shaft automatic discharging device 8, the X-ray scanning imaging device 2 comprises a lead room 3, an X-ray source 4, a linear array detector 5 and a flexible shaft guide rail, the flexible shaft guide rail comprises a left flexible shaft guide rail 6 and a right flexible shaft guide rail 7, the image acquisition processing device comprises an industrial computer host 12 and a display 13, and the control device comprises a start button 9, a stop button 10, an electric cabinet 11 and a workbench 14.
Wherein, the feed inlet of flexible axle automatic feed arrangement 1 coincides with the entry of left side flexible axle guide rail 6 mutually, the discharge gate of flexible axle automatic discharging device 8 coincides with the export of right side flexible axle guide rail 7 mutually, flexible axle automatic feed arrangement 1, left side guide rail 6, the axis of right side guide rail 7 and flexible axle automatic discharging device 8 is in same water flat line, ensure that the flexible axle can pass in and out the plumbous room smoothly in the track, flexible axle automatic feed arrangement 1 and flexible axle automatic discharging device 8 are general belt, chain drive mode. The ray radiation center of the X-ray source 4 and the imaging center of the linear array detector 5 are positioned on the same vertical axis, the axis is vertically intersected with the horizontal axis of the left flexible shaft guide rail 6 and the right flexible shaft guide rail 7, and the intersected position is a gap of about 5 cm left by the left flexible shaft guide rail 6 and the right flexible shaft guide rail 7 and is an X-ray scanning imaging area of the flexible shaft. The start button 9 and the stop button 10 are located on the upper left side of the workbench 14 and are respectively connected with the flexible shaft automatic feeding device 1, the flexible shaft automatic discharging device 8, the X-ray source 4, the linear array detector 5 and the industrial computer host 12, after the start button 9 is pressed, the flexible shaft automatic feeding device 1 and the flexible shaft automatic discharging device 8 start to work at a set speed, the X-ray source 4 turns on rays according to a set voltage, the linear array detector 5 receives the rays, and simultaneously imaging data are transmitted to the industrial computer host 12 in real time and are displayed on the display 13. After the stop button 10 is pressed, the flexible shaft automatic feeding device 1 and the flexible shaft automatic discharging device 8 stop working, the X-ray source 4 turns off the ray, the industrial computer host 12 automatically stores the collected flexible shaft original image and the detected flexible shaft label image, and simultaneously generates a detection report form to complete a detection process. The electrical cabinet 11 is located at the lower left side of the worktable 14 and provides electrical connection and power supply for the whole detection device. The industrial computer host 12 is located at the lower part of the right side of the workbench 14, is provided with an automatic counting and position automatic labeling program of the flexible shaft, is responsible for displaying data returned by the linear array detector 5 on the display 13 in real time, automatically detects the number of beads of the flexible shaft, labels the specific positions of the beads, produces a report of detection results, stores an original image of the flexible shaft and a detected labeled image, and is used for checking in the future. The display 13 is located in the upper middle portion of the table 14 to provide an interactive interface for the operator.
When the detection device 15 works, the operating personnel sets the running speeds of the flexible shaft automatic feeding device 1 and the flexible shaft automatic discharging device 8 in advance, sets the working voltage of the X-ray source 4, simultaneously opens the flexible shaft bead automatic detection program on the industrial computer host 12, sends the flexible shaft to be detected into the feeding hole of the flexible shaft automatic feeding device 1, and presses the start button 9 to start the device. Under the action of the automatic feeding device 1, the flexible shaft to be detected advances in the left flexible shaft guide rail 6 at a constant speed according to a set speed, and when the flexible shaft passes through a gap between the left flexible shaft guide rail 6 and the right flexible shaft guide rail 7, X rays emitted by the X-ray source 4 penetrate through the flexible shaft, data are received by the linear array detector 5 and are transmitted to the industrial computer host 12 in real time to be displayed on the display 13, and meanwhile, automatic detection software monitors the number and the positions of beads at the current detected part in real time. The flexible shaft to be detected enters the right guide rail 7 after passing through a gap detected by X-ray, then enters the discharge hole of the flexible shaft automatic discharging device 8, and is moved out of the lead room 3 by the flexible shaft automatic discharging device 8 at a set speed.
After the whole flexible shaft is moved out of the lead house by the automatic discharging device 8, an operator presses the stop button 10, the flexible shaft automatic feeding device 1 and the flexible shaft automatic discharging device 8 stop working, the X-ray source 4 is closed, the flexible shaft automatic detection software running on the industrial computer host 12 respectively stores the collected original flexible shaft X-ray image and the X-ray image of the marked position after detection, and meanwhile, a detection report of the flexible shaft to be detected is produced for the operator to check. The X-ray imaging detection process of the whole flexible shaft is realized by the fact that the flexible shaft penetrates through an X-ray imaging area at a constant speed, and the ray source 4 and the linear array detector 5 do not need to move, so that the detection device can be used for detecting no matter the length of the flexible shaft is several meters, and meanwhile, the main body X-ray scanning imaging device 2 of the equipment can be designed to be small and standard in size and does not change along with the change of the detected flexible shaft.
In order to ensure the uniform motion of the flexible shaft in the imaging process, the running speeds of the flexible shaft automatic feeding device 1 and the flexible shaft automatic discharging device 8 need to be set to be the same, and the specific speed depends on the imaging hardware parameters of the detection equipment. Assuming that the pixel pitch of the linear array detector 5 is a microns, the number of pixel combinations during imaging is n (n is generally an integer of 1, 2, 4, 8, etc.), the integration time is t milliseconds, and the height of the linear array detector 5 from the flexible shaft is h1Mm, the height of the filament focus of the X-ray source 4 from the flexible shaft is h2Mm, the set velocity v is determined by the following equation:
when the velocity setting is larger than the theoretical velocity v, the imaging result of the scanning is narrower than the actual object, and when the velocity setting is smaller than the theoretical velocity v, the imaging result of the scanning is wider than the actual object, which may cause imaging distortion. When the specific parameters of the X-ray scanning imaging device 2 are determined, the running speed of the flexible shaft is also determined, and the operator does not need to set the flexible shaft again after setting once.
The working voltage of the X-ray source 4 is set depending on the specific composition of the ball type control flexible shaft, such as the size of the steel ball, the thickness of the metal tube and the protective sleeve, and the like. In practical application, for a flexible shaft of a certain model, the optimal working voltage is actually needed through experiments in advance, the flexible shaft can just penetrate through the flexible shaft, the shapes of the balls can be clearly distinguished, and the optimal voltage of a common flexible shaft is 90 kv. The setting of the pixel merging number and the integration time of the linear array detector generally depends on the manufacturing process of the linear array detector, and the setting can be carried out according to the optimal parameters given by a production merchant.
The left flexible shaft guide rail 6 and the right flexible shaft guide rail 7 are made of round thin-wall steel pipes and are respectively and directly fixed at the openings on the left side and the right side of the lead room. The size of the opening of the lead room 3 is matched with the diameter of the round thin-wall steel pipe, the actual size depends on the diameter of the detected flexible shaft, about 1.8 times of the diameter of the detected flexible shaft is generally selected to be suitable, the flexible shaft is easy to move due to unstable track to influence the scanning imaging quality, and the flexible shaft is easy to clamp when being small. In the embodiment, a circular opening and a circular thin-wall steel pipe with the diameter of 15 cm are preferably selected, and a flexible shaft with the diameter of about several cm can be detected.
As shown in fig. 2, the present invention further discloses a method for automatically counting beads of a ball-type control flexible shaft and marking the positions of the beads, which specifically comprises the following steps:
(1) and acquiring an original image of the flexible shaft, copying an image as f (X, y), transmitting the acquired image data into an industrial computer host after the flexible shaft passes through an X-ray imaging device, storing the original image detected by the flexible shaft for final original data, and copying an image as f (X, y) for bead detection and position marking in the subsequent steps.
(2) Using a fixed threshold value T1The sum of the values of f (x,y) binaryzation, extracting a soft shaft imaging area to obtain an image B (X, y), wherein the soft shaft imaging area only accounts for one part of the soft shaft X-ray image f (X, y), the soft shaft absorbs X-rays to cause that the gray value of the area is lower, the gray value of X-rays which are not absorbed by other areas is 255, the gray fluctuation generated by the self error of an X-ray receiver is fully considered, and a fixed threshold T is set1Is 200, and the gray value is less than T1The pixel (2) takes 1, and the gray value is more than or equal to T1The pixel of (2) is 0 to obtain a binary image B (x, y), and the white area with the gray value of 1 corresponds to the extracted flexible shaft area to be detected.
(3) And reducing the soft shaft area in B (x, y) in the vertical direction to 80% of the original size for the first time to obtain an image B1(x, y), the second reduction to 30% of the original, resulting in image B2(x, y) Using image B1(x, y) subtracting image B2(X, y) obtaining an image M (X, y), wherein the flexible shaft area extracted in the step 2 is an X-ray scanning imaging area of the whole flexible shaft, all geometric structures including the flexible shaft comprise a protective sleeve, a metal pipe, a ball fixing support, a middle core sliding rod and balls, parts irrelevant to the balls can interfere the calculation of the balls, because the internal structure of the ball type flexible shaft is fixed and reacts on the imaging area of the X-ray, the protective sleeve, the metal pipe, an upper row of balls and supports thereof, the core sliding rod, a lower row of balls and supports thereof, the metal pipe and the protective sleeve are sequentially arranged from top to bottom in the vertical direction, the protective sleeve and the metal pipe on the upper side and the lower side occupy 20% of the vertical direction of the flexible shaft, the balls and supports on the upper row and the lower row occupy 50% of the vertical direction of the flexible shaft, and the sliding core in the middle occupies 30% of the vertical direction of the flexible, the accurate extraction of the upper and lower rows of ball areas can effectively avoid the misjudgment possibly generated by counting, and on the basis of analyzing the geometric structure of the ball type flexible shaft, the image B is obtained by reducing the size to 80% of the original size for the first time1(x, y), the metal tube and the protective sleeve area on the upper and lower sides of the flexible shaft are respectively removed, and the image B is obtained by reducing the area to 30 percent of the original area for the second time2(x, y) leaving only the core rod region in the middle of the soft axis, using image B1(x, y) subtracting image B2(x, y) isThe image M (x, y) is just the upper and lower rows of ball areas of the flexible shaft.
(4) Performing expansion operation on f (x, y) by using vertical linear structural elements to obtain an image g (x, y), and setting a fixed threshold T for g (x, y)2The image R (x, y) is obtained by binarization, expansion operation is one of basic operations of mathematical morphology in digital image processing, the expansion operation on the image by using the selected structural elements is equivalent to local maximum operation, namely, the maximum gray value is selected in the pixel range related to the structural elements and is given to a target pixel, each pixel of the image to be processed is subjected to the same operation, and the final processing result is that the whole image is lightened, and dark details smaller than the structural elements are removed. The X-ray image of the flexible shaft is provided with larger steel balls, which are represented as a circular black area, and the fixed support of the steel balls is a thin steel frame, which is represented as a black connecting line in the horizontal direction between the black circular areas of the steel balls. The horizontal black line formed by the steel frame can be removed by performing expansion operation on f (x, y) by using the vertical linear structural elements, the vertical linear structural elements of 9 rows and 1 columns are preferable in the embodiment, the horizontal black line corresponding to the steel frame can be removed, the circular area of the steel ball is not influenced, and the obtained result image is recorded as g (x, y). Setting a fixed threshold T for g (x, y)2Performing binarization processing to obtain a binary image smaller than a threshold value T2Is 1 and is greater than the threshold value T2The gray value of the pixel(s) is 0 to obtain the image R (x, y), which is the threshold value T in this embodiment2The gray value of the flexible shaft component with larger volume, such as the core slide rod, the ball and the metal tube protective sleeve of the flexible shaft, is set to be 90, the gray value of the component with smaller volume, such as the bracket between the balls, is removed in the expansion process, the gray value of the component with smaller volume is 0 in the binarization process, and the white area in the image R (x, y) is the protective structure of the core slide rod, the ball and the outermost layer of the flexible shaft, and the three are connected together.
(5) And performing mathematical AND operation between pixels by using the image M (x, y) and the image R (x, y), and recording an obtained result image as F (x, y), wherein the image M (x, y) obtained in the step (3) is a ball area of two rows of upper and lower flexible shafts, the image R (x, y) obtained in the step (4) is a core slide rod, a ball and an outermost layer of protective structure area of the flexible shafts, the two are subjected to mathematical AND operation between pixels, the core slide rod area and the outermost layer of protective structure area are removed, only the ball area is reserved, and the obtained result image F (x, y) is a white area of two rows of upper and lower separated white areas and respectively corresponds to the ball part on the flexible shafts.
(6) Calculating the area of each white area in the result image F (x, y), calculating the average area S of the areas, then counting the number of the white areas with the area between 0.8 and 1.2 times S, namely the number of beads of the flexible shaft, wherein the white areas with larger or smaller areas may exist in the result image obtained in the step (5) due to mechanical error or noise interference in the imaging process, and the white areas are not real ball areas and need to be further removed. According to the operation process of the previous step, the white area balls in the result image F (x, y) account for most balls, the sizes of the balls are consistent, the areas of the corresponding white areas are also basically consistent, the ball area and the non-ball area can be identified by using a statistical method, in the embodiment, 0.8 time and 1.2 times of the average area are used as identification intervals, the white area smaller than 0.8 time of the average area is noise interference, the white area larger than 1.2 times of the average area is structural interference generated by mechanical errors in the imaging process, and the purpose of removing false steel balls can be achieved.
(7) And (3) calculating the mass center of each white area left in the step (6), drawing a square with the side length of 9 on the image f (x, y) by taking the coordinate of the mass center as the center, completing the automatic marking of the position of the bead of the flexible shaft, wherein the white area in the step (6) corresponds to the ball area of the flexible shaft, the mass center of the white area corresponds to the central part of the ball, and the concrete position of the detected steel ball can be marked by drawing the square with the side length of 9 by taking the coordinate as the center.
The above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and substitutions can be made without departing from the technical principle of the present invention, and these modifications and substitutions should also be regarded as the protection scope of the present invention.
Claims (3)
1. A method for automatically counting beads of a ball type control flexible shaft and marking the positions of the beads is characterized in that: the method comprises the following steps:
(1) the method comprises the steps of obtaining an original image of a flexible shaft, simultaneously copying an image as f (X, y), transmitting the obtained image data to an industrial computer host after the flexible shaft passes through an X-ray scanning imaging device, storing the original image detected by the flexible shaft for use, simultaneously copying an image as f (X, y) for bead detection and position marking in the subsequent steps, wherein the X-ray scanning imaging device comprises a lead room, an X-ray source, a linear array detector and a flexible shaft guide rail, the bottom and the top of the lead room are respectively provided with the X-ray source and the linear array detector, the radiation center of the X-ray source and the imaging center of the linear array detector are positioned on the same vertical axis, the middle parts of the left side and the right side of the lead room are provided with openings, the flexible shaft guide rail is respectively arranged at the openings for the flexible shaft to pass in and out, and, one section of the flexible shaft is fixed at the left opening inside the lead room, the other section of the flexible shaft is fixed at the right opening inside the lead room, and a gap is left in the middle of the flexible shaft and is an X-ray imaging area when the flexible shaft moves in the lead room;
(2) using a fixed threshold value T1F (x, y) is binarized, and a flexible shaft imaging area is extracted to obtain an image B (x, y);
(3) and reducing the soft shaft imaging area in the B (x, y) in the vertical direction to 80% of the original size for the first time to obtain an image B1(x, y), the second reduction to 30% of the original, resulting in image B2(x, y) Using image B1(x, y) subtracting image B2(x, y) to obtain an image M (x, y);
(4) performing expansion operation on f (x, y) by using vertical linear structural elements to obtain an image g (x, y), and setting a fixed threshold T for g (x, y)2Carrying out binarization processing to obtain an image R (x, y);
(5) performing mathematical addition operation between pixels by using the image M (x, y) and the image R (x, y), and recording the obtained result image as F (x, y);
(6) calculating the area of each white area in the result image F (x, y), calculating the average area S of the white areas, and then counting the number of the white areas with the area between 0.8 time and 1.2 times S, namely the number of the beads of the flexible shaft;
(7) and (3) calculating the center of mass of each white area left in the step (6), and drawing a square with the side length of 9 on the image f (x, y) by taking the center of mass as the center to finish the automatic marking of the position of the flexible shaft bead.
2. The method for automatically counting the beads of the ball-type manipulating flexible shaft and marking the positions of the beads as claimed in claim 1, wherein: the fixed threshold T in the step (2)1Is 200, and the gray value is less than T1The pixel (2) takes 1, and the gray value is more than or equal to T1The pixel of (2) is 0 to obtain a binary image B (x, y), and the white area with the gray value of 1 corresponds to the extracted flexible shaft area to be detected.
3. The method for automatically counting the beads of the ball-type manipulating flexible shaft and marking the positions of the beads as claimed in claim 1, wherein: selecting 9 rows and 1 columns of vertical linear structural elements in the step (4), and setting a fixed threshold T for g (x, y)2Performing binarization processing to obtain threshold value T2Set to 90, less than threshold T2Is 1 and is greater than the threshold value T2The gray value of the pixel (c) is 0, and the image R (x, y) is obtained.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710446404.7A CN107194457B (en) | 2017-06-07 | 2017-06-07 | Method for automatically counting beads of ball type control flexible shaft and marking positions of beads |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710446404.7A CN107194457B (en) | 2017-06-07 | 2017-06-07 | Method for automatically counting beads of ball type control flexible shaft and marking positions of beads |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107194457A CN107194457A (en) | 2017-09-22 |
CN107194457B true CN107194457B (en) | 2020-09-25 |
Family
ID=59878924
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710446404.7A Expired - Fee Related CN107194457B (en) | 2017-06-07 | 2017-06-07 | Method for automatically counting beads of ball type control flexible shaft and marking positions of beads |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107194457B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH11304726A (en) * | 1998-04-24 | 1999-11-05 | Matsushita Electric Ind Co Ltd | Inspection method by x rays and x-ray inspection device |
CN103376270A (en) * | 2013-07-03 | 2013-10-30 | 华南理工大学 | Component-counting method on basis of X-ray linear scanning and counting device thereof |
CN105518442A (en) * | 2013-09-04 | 2016-04-20 | 美国联合包裹服务公司 | X-ray scanning system and method |
CN106546608A (en) * | 2015-09-16 | 2017-03-29 | 丹东市无损检测设备有限公司 | A kind of Non-Destructive Testing automaton for flexible axle |
-
2017
- 2017-06-07 CN CN201710446404.7A patent/CN107194457B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH11304726A (en) * | 1998-04-24 | 1999-11-05 | Matsushita Electric Ind Co Ltd | Inspection method by x rays and x-ray inspection device |
CN103376270A (en) * | 2013-07-03 | 2013-10-30 | 华南理工大学 | Component-counting method on basis of X-ray linear scanning and counting device thereof |
CN105518442A (en) * | 2013-09-04 | 2016-04-20 | 美国联合包裹服务公司 | X-ray scanning system and method |
CN106546608A (en) * | 2015-09-16 | 2017-03-29 | 丹东市无损检测设备有限公司 | A kind of Non-Destructive Testing automaton for flexible axle |
Also Published As
Publication number | Publication date |
---|---|
CN107194457A (en) | 2017-09-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102062739B (en) | Surface examining device | |
CN101539533B (en) | Automatic detecting device and method for battery internal defect | |
CN101566582B (en) | Medicine bottle label information online detection system in powder injection production based on mechanical vision | |
CN207185897U (en) | A kind of full cigarette presentation quality on-line measuring device and its cigarette machine | |
CN203929667U (en) | Ceramic Tiles non-destructive detecting device | |
CN106404796A (en) | On-line detection and repair apparatus and method for circuit board | |
CN110554050B (en) | Screw hole thread inspection device and screw hole thread inspection method for video camera image acquisition | |
CN101221134A (en) | Method and device for detecting tiny bearing surface defect by computer vision technology | |
CN101449149A (en) | Surface examining device | |
CN104122277A (en) | Computed tomography (CT) detector of cables | |
CN104713882B (en) | Bamboo silk or bamboo chip positive and negative discrimination method and its device | |
CN106353336A (en) | Lens coating automatic detection system | |
CN113415574B (en) | Tray conveying system suitable for real-time detection of full perimeter of fruits | |
CN105277560A (en) | Fabric pilling grade evaluation and analysis method and device | |
CN107194457B (en) | Method for automatically counting beads of ball type control flexible shaft and marking positions of beads | |
CN115047015A (en) | Online X-ray nondestructive flaw detection method and system | |
CN109013387A (en) | Electrical core of power battery appearance detecting device | |
CN107271462B (en) | Detection device for ball type control flexible shaft | |
CN104228874A (en) | Rail vehicle exterior outline noncontact detection system | |
CN203720109U (en) | Real-time online industrial CT (Computed Tomography) detection system based on X-ray source array | |
CN109444179B (en) | Full-automatic X-ray detection equipment for semiconductor components | |
CN201434675Y (en) | Automatic detecting device for interior defect of battery | |
CN110116096B (en) | Bead sorting system and method | |
CN110632081A (en) | Bearing appearance detection equipment based on 2D and 3D vision | |
CN208270730U (en) | Notebook function p-wire |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20200925 |
|
CF01 | Termination of patent right due to non-payment of annual fee |