METHOD AND APPARATUS FOR IMPROVED IDENTIFICATION OF PROBABLE DEFECTS IN A WORKPIECE
Technical Field
This invention relates to a method and apparatus for improved identification of probable defects in a workpiece. and in particular to automated high speed linear x-ray lumber grading.
Background of the Invention
It has become a serious consideration in the lumber industry to improve grading of lumber and therefore improve secondary breakdown decisions. By optimizing the recovery of "good wood" against a slate of desired products, the value of the lumber can be increased. "Good wood" refers to wood which meets a prescribed criteria. For different uses, what is considered "good wood" can vary. For example, for fine furniture it may be unacceptable to have any knots in the wood. However, for furniture intended to have a more rustic appearance, a certain number of knots can in fact be desirable. In general though it is desirable to identify certain "defects" in the lumber and to locate them with respect to a spatial reference system. One method of doing this is to have a human visually inspect each piece of lumber prior to it being cut into secondary boards. This is slow and prone to error. Further, even if the defect is identified, the information must still somehow be communicated to a saw operator in a meaningful manner to allow the defect to be isolated, yet allow wood recovery to be optimized against a desired product slate.
There have been some improvements in the area of grading lumber, for example Lumber Optimizer (US Patent 4,879,753 to Aune et al) using x-ray. Method of Estimating the Strength of Wood (US Patent 4.941,357 to Schajer) also using x-ray. Dielectric Sensor Apparatus (US Patent 5.654.643 to Bechtel et al) Detector for Heterogeneous Materials (US Patent 5.585.732 to Steele et al) also a dielectric sensing device, and Flaw Detection System Using Microwaves (US Patent 4.514.680 to Heikkila et al) which uses microwaves to measure lumber flaws.
Defects include features such as knots, rot. splits, sap. holes, and the like. Defects can be further subclassified. for example a knot can be a sound knot or an unsound knot. Most defects have some attribute which allows them to be detected by automated scanning, for example reflective inspection (laser or gray-scale video) can detect stain and sap in wood. Transmissive inspection techniques (such as x-ray) can detect density variations, and thus knots and rot and the like. However, past efforts to identify defects automatically, particularly with transmissive energy inspection techniques, have met with limited success due to the natural variation in wood density across a board. This is due to the inherent randomness of wood properties, being a naturally occurring, non-homogeneous substance. Thus, what might appear to an automatic density sensor to be a large area of rot (low density) in a board, might in-fact just be an area of naturally occurring low density within the board.
Some past methods of automated lumber grading have had limited success in identifying defects. However, the techniques used often result in more good wood being cut from the board than is necessary. For example, referring to Fig. 1 , prior methods might identify the defects 2, 3 and 4 in board 1 , but would bracket them with zones 5 and 6. leaving section 9 as waste and only section 7 as "good wood." It is desirable if a method and apparatus could be provided which would give the preferred results shown in Fig. 2 where the defects 2. 3 and 4 are confined to waste section 1 1, leaving section 8 as "good wood."
In addition to the difficulty of identifying defects and isolating them to a reasonable area within the board, variations in the equipment used to sense the board have contributed to errors in detecting and identifying defects. For example, x-ray scanners, used to measure board density, are inherently "noisy" with scatter, and also tend to "drift" in power output during their warm-up period of operation. Similarly, the sensors or detectors used to measure the x-rays passing through a board are prone to drift.
Therefore, what is needed is an improved method and apparatus for detecting defects within a board. Further, there is a need for improved methods of localizing defects once they are detected within a board to increase yield of "good wood" from the board. There is also a need for an improved x-ray board defect detecting apparatus which accounts for drift and variation in the source and detectors used in x-ray imaging of the board. Preferably, it is desirable to have an x- ray system that allows high speed and accurate lumber grading, improving the location and identification of defects in lumber, thereby improving yield from boards.
Summary of the Invention
A method for identifying probable locations of defects within a workpiece is disclosed. The method is particularly applicable to workpieces comprising wood, lumber, or other media wherein a natural variation in a property such as density is found in the medium which can obscure defects which are identifiable by the same naturally varying characteristic. The method comprises the following steps: providing a workpiece to be surveyed for probable locations of defects, wherein the workpiece is capable of being identified by selected regions; providing an energy source which can impinge energy on the workpiece to produce a resulting energy signal indicative of a physical property of the workpiece; and providing a plurality of detectors capable of receiving at least a portion of the energy signal which is produced by the workpiece and generating a detector signal in response to the energy signal. The method includes the step of positioning the workpiece relative to the energy source and the detectors to allow the detectors to receive the resulting energy signals. In the method the workpiece and the detectors are moved relative to one another while the energy from the energy source is impinged onto the workpiece to produce a series of detector signals which are representative of the physical property of the workpiece at different spatial positions along the workpiece. The detector work signals are stored in a memory device in a manner such that the signals are identifiable by the associated spatial position on the workpiece.
The detector signals are processed in the following manner to produce a defect map indicative of the locations and types of probable defects within the workpiece. An average is determined for at least some of the detector signals to generate a bulk average detector signal for the overall workpiece. The bulk average detector signal is then adaptively filtered for selected regions on the workpiece to establish a localized average detector signal, wherein the adaptive filtering is configured to account for variance in the average of the detector signals as compared to the bulk average detector signal. Such a filter can also be known as a "moving average" since the average is adjusted relative to movement along the workpiece. After a moving average for the workpiece has been established, a defect threshold range is established. The defect threshold range is a function of the localized average detector signal (the moving average) such that signals outside of the threshold range can be attributed to a defect in the workpiece. Finally, for at least some of the regions, spatial positions along the workpiece are identified as having corresponding detector signals which are outside of the threshold range, those identified positions corresponding to probable locations of defects.
More particularly, the workpiece is divided into a plurality of zones which are oriented in the direction in which the workpiece is moved relative to the detectors. Rather than establish a bulk average for the entire workpiece, bulk averages are established zone by zone. This reduces the effect that a variance in a physical property such as density across the workpiece will have on the bulk average. Moving averages are established for each zone rather than for the overall board. Likewise, defect thresholds are established for each zone rather than for the overall board. In the step wherein the signals are compared to the threshold, defect thresholds between adjacent zones are interpolated to account for variations in physical property across the workpiece. For those zones which are adjacent to an edge of the board, the defect threshold is extrapolated to the edge of the workpiece.
The method can further include a step of smoothing the detector signals prior to establishing the long-term average. The step of smoothing the signals is performed to reduce the
effects that noise and inherent signal randomness can have on the data. Smoothing is accomplished by filtering the raw data. The filter can comprise a 3 x 3 low pass filter wherein the gain and offset are determined by obtaining detector readings with the detectors first fully exposed to an energy source, and then isolated from the energy source to establish a two-point gain/offset correction (respectively).
The invention also includes an apparatus for performing the above-described method. The apparatus comprises an energy source to impinge energy on a workpiece. detectors configured to detect energy signals resulting from the impinged energy on the workpiece, a mechanism for causing relative motion between the workpiece and the detectors, and a computer having a memory configured to store the detector signals and to perform the steps of the described method.
The invention further includes a computer readable medium having computer executable instructions for performing the described method.
The invention also includes an apparatus for projecting an energy beam onto a workpiece. The apparatus is preferably used to perform the above-described method. The apparatus for projecting an energy beam comprises an energy conduit to which at a first end is attached an energy source. Energy from the energy source can exit at a second end of the energy conduit. The apparatus further includes a first aperture device for collimating energy from the energy source into the energy conduit. The apparatus also includes a plurality of calibration shutters, each of the calibration shutters being configured to be operably positionable within the energy conduit to intersect energy within the conduit and produce an attenuated energy beam which can be impinged upon a detector array.
The apparatus preferably further includes a second aperture device disposed within the energy conduit between the first aperture device and the plurality of shutters. The apparatus can further comprise a primary shutter disposed within the energy conduit between the energy source
and the first aperture device to allow energy produced by the energy source to be isolated from the energy conduit. The apparatus may further comprise a plurality of detectors held in selective position a distance from the energy conduit outlet, and is further provided with a detector aperture device to focus energy from the energy source onto the detectors. Preferably, the aperture devices comprise a plate having a hole disposed therethrough to act as the aperture, wherein the edge of the hole is chamfered on the side of the plate which is facing the energy source.
The invention provides other advantages which will be made clear in the description of the preferred embodiments.
Brief Description of the Drawings
Preferred embodiments of the invention are described below with reference to the following accompanying drawings.
The invention will be better understood by reference to drawings, wherein:
Figure 1 is a plan view of a board showing defects and how defects can be cut away from the board.
Figure 2 shows the board of Fig. 1 but with a preferred defect removal schedule to increase yield of "good wood" from the board.
Figure 3 is an isometric schematic diagram showing a modern lumber mill and the system for determining the presence of defects in a board and making optimization decisions based thereon.
Figure 4 is a side elevation view ot a preferred embodiment of an x-ray scanner which can be used to detect defects in a workpiece.
Figure 5 is a schematic plan view of a board defect image map showing grouped defects.
Figure 6 is a graph showing cross-board density variations.
Figure 7 is a plan schematic diagram of a board model segmented into zones for localized long term average density determination.
Figure 8 is a graph showing the moving long term average density variation in a board, the defect thresholds, and two defects.
Figure 9 is a flowchart for performing the method described herein.
Figure 10 is a block diagram of a variation of the system shown in Fig. 3, further including a plurality of sensing systems and a defect assembler.
Detailed Description of a Preferred Embodiments of the Invention
The method and apparatus for automated lumber grading, preferably high speed linear x-ray lumber grading, provides improved identification and location of defects in wood such as rot, knots, sap pockets and voids, and provides higher recovery data (yield of "good wood") for cutting lumber.
Overview of the system
Fig. 3 shows an overview of the system 10 for grading and handling graded lumber, including the cutting of boards, which is generally found in a sawmill or more generally, a plant. Lumber or a workpiece 1 generally advances into the plant from a planer 14 on a feed belt 13 adjacent a fence 18. The workpiece 1 enters a scanner system 100, whereby the workpiece 1 is scanned to detect defects. Although in the present description the invention is described particularly with respect to an x-ray scanner, it is to be appreciated that other types of scanners can also work with the present invention. Although the terms "x-ray" scanner can be used when generally describing the invention, this should not be considered as precluding the use of other types of scanners, particularly when describing the method and apparatus for determining the probable presence of defects in the workpiece. Other types of scanners include, without by way of limitation, a laser scanner, microwave scanners, optical scanners, and computer aided tomography scanners.
When a workpiece 1 enters the scanner station 100 its presence can be detected by a barrier photoeye. although the scanner itself can also be used for this purpose, as will become apparent in the detailed description below. The speed of the workpiece 1 can be tracked using encoder wheels or other means such as a doppler-effect device. Within the scanner 100, image maps (also referred to herein "frames") of the workpiece are collected from the scanner one frame at a time as the workpiece passes through the scanner. The frames are represented by data collected from the scanner which is recorded on a computer readable medium. When a frame has been recorded it is processed and evaluated in a computer system 200 for features and defects of the workpiece.
Probable defects are identified, as well as their location on the workpiece. in a data modeler. The data modeler can comprise either the computer system 200, or the host computer 330. In a system having a plurality of sensing systems, for example, an x-ray system 100. a profile system 102, and a visual scanning system 104, the data modeler can be replaced with a defect assembler (DFA) 325 as shown in Fig. 10. The defect assembler combines the three models which result from the three
sensor systems to produce a more accurate and complete representation of the workpiece. In either case, the resulting data, which is representative of a workpiece such as a board, can properly be described as a "virtual board." since it is a computer model of the board, including those defects which the scanner is capable of identifying. This data representation of the board can also be properly called the "board model."
As indicated in Fig. 10, which shows in block diagram form a variation on the configuration of the system shown in Fig. 3, the x-ray computer 200 communicates with the rest of the system 10 through a communication system 300 which links together the various components of the system. The system 10 can further comprise a control subsystem 310 which can be used to track workpieces as they move through the system, and can also be used to control computer controllable saws 400 and 410. The control subsystem 310 can also be used to control a programmable logic control (PLC) device 315 which controls field devices such as workpiece routers for routing the workpiece through the system. The system 10 can also include a network server or host 330 which can be used for, among other things, storing the board model and other data, as well as various computer programs utilized by the various other subsystems in the system, on computer readable medium such as a hard drive 332 or a tape drive (not shown). The network server can support human/machine interfaces such as the graphical user interfaces or terminals 340. The network server can also perform other known functions such as communication with remote devices through modem 350 (Fig. 3), and interfacing with other computer systems in the mill or other facilities through line 360. For example, the network server 330 can provide production information to an accounting or shipping office. It should be appreciated that collection of processors in the overall system 10, including the DFA 325 when used, can be considered as a "computer." even though it is comprised of various components. Alternately, each of the components such as the control unit 310, the DFA 325, the PLC 315, the x-ray computer 200, and the network server 330 can also properly be considered separately as computers. While the system 10 is shown and described herein in particular configurations in Figs. 3 and 10. it should be appreciated by one skilled in the art that the necessary functions of the invention, as
described fuller herein below, can be accomplished with any one of a variety of system configurations.
The system 10 further preferably includes an optimizer/decision processor 320, known herein as the "optimizer" for brevity. The optimizer is provided the board model from x-ray computer 200 or. when more than one sensor subsystems are employed, from the defect assembler
325. Based on the board model, the optimizer can make decisions on the best way to cut the workpiece to optimize yield, consistent with the probable existence of defects in the workpiece.
The optimizer is more preferably provided with a rule set to compare against the board model, the rule set being a standard by which defects in the board model can be compared to determine if the defect identified in the board model rises to the level where the defect should be excluded from final product. More preferably, the optimizer is provided with a product slate of desired products and quantities. The optimizer can be configured to compare the board model against the product slate to determine if the board can be cut so as to generate a product which is indicated as being required by the product slate. Once a board fitting a product criteria is identified, the product slate can be updated by the control system 300 to revise the quantity of product needed to fill a product order. All of the optimizer functions can be accomplished by a computer program or programs. Optimizers and optimizer programs are known in the art and will not be described further herein.
Once the optimizer has made a decision regarding a particular workpiece. the decision is preferably communicated to the programmable logic controller 310 for execution. The PLC 310 preferably includes computer readable medium for storing computer programs. Examples of computer readable medium include, without limitation, ROM, RAM, a hard drive, a diskette and diskette drive, a CD ROM and CD drive, a tape and tape drive, and an EPROM. The controller 310 can decide whether the board is to be cut or not, and if so, by which saw. Typically a plant has a plurality of computer controllable saws 400 and 410. Such ensures that the sawing of the boards do not become a bottleneck for throughput through the plant. Further, depending on the
type of cut to be made (for example, rip or cross-cut), one saw can be preferably configured over the other. Boards can be routed to a selected saw via a conveyor interchange 500 which can be for example a pneumatically actuated conveyor interchange system actuated by the controller 310. The conveyor interchanger 500 can move a workpiece from first conveyor 13 to second conveyor 510. The programmable logic controller 310, preferably in conjunction with the network server 330, can track each board as it progresses through the plant.
The system 10 is preferably provided with sensors (not shown) to allow the tracking and detection of workpieces as they move through the system. Workpieces can be marked with bar code or other marking as they exit the scanner 100. allowing the board to be tracked as it moves through the plant. For workpieces such as lumber where it can be undesirable to visibly mark boards, bar coding can be accomplished by using ink which can only be read by non-visible light frequencies (such as ultraviolet). Methods and apparatus for tracking workpieces as they move through a plant are known, and will not be describe further herein.
In a preferred embodiment of the invention, a workpiece (lumber or a board) is transported through the x-ray scanner or imager 100 longitudinally at a relatively high speed (approximately 3.6 meters per second (700 feet per minute) in one example). The conveyor or feed belt 13 can be angled at approximately 20 degrees to the direction of travel of the board to help insure that the lumber keeps in constant contact with the fence 18 as the lumber moves through the scanner 100.
Such ensures that a corner reference point for the board remains along a constant, known reference line, being the fence 18. As boards enter the x-ray scanner station 100, the feed belt 13 can briefly separate at the scanner 100 so as to provide a better image quality, especially when the scanner scans wood species that can cause pitch build up on the feed belt 13.
The method for identifying probable types and locations of defects within a workpiece will now be describe in detail, as well as a preferred embodiment of an x-ray scanner.
Preferred embodiment of an x-ray scanner
Referring to Figure 4, a preferred embodiment of an x-ray scanner 100 is shown. The x- ray scanner 100 can be used with the method and apparatus for defect detection described fuller herein. The x-ray scanner 100 comprises a electron source 20 (which can be described more generally as an energy source) which projects electrons onto a target 21 which in turn generates a stream of photons or x-rays directed towards sensor array 40. Workpieces such as boards 1 are moved by the conveyor 13 into the path of the x-rays. X-rays penetrating the workpiece 1 are detected by detectors or sensors 44. The sensors produce a signal in response thereto which can be recorded or further processed as more fully described below.
The x-ray source 20 is preferably a ceramic x-ray tube assembly or similar type where x- rays are produced and directed by the source 20 towards the sensor array below. A reflector 21 can be incorporated to reduce the height of the apparatus 100. The source 20 and reflector 21 are preferably housed in a box 120 comprising lead to reduce spurious x-rays from escaping. X-rays can exit the box 120 through opening 122 and are projected into the energy conduit 22 towards sensors 44 The conduit 22 can also act as a frame to support the components of the apparatus 100.
Directly below opening 122 is a primary shutter 24. Shutter 24 is preferably fabricated from tungsten or similar material resistive to long-term x-ray damage. The primary shutter 24 is provided with an opening 123 to allow x-rays to pass through opening 122 and into the energy conduit 22. The primary shutter 24 can be translated from side to side by primary shutter actuator 124 to cause the plate 125 to block the stream of x-rays exiting opening 122. Actuator 124 can be a solenoid or a pneumatic actuator. Primary shutter 24 can be used to block the x-ray source from the sensors 44 for purposes such as calibration of the sensors or where it is desirable to isolate the x-ray source from the energy conduit 22 for human health reasons during maintenance of the apparatus 10 and the like. Another purpose for the primary shutter 24 is that the source 20 life expectancy can be lengthened if the power to the source remains on during temporary shut downs when there is no need to shut the power off to the source.
12
SUBSTΓΓUTΈ SHEET (RULE 26)
Immediately below the primary shutter 24 within the conduit 22 is a first collimator or aperture device 26. Collimator 26 is preferably fabricated from lead or other similar material impenetrable to x-rays. Disposed through collimator 26 is aperture 126. An exemplary dimension for aperture 126 is approximately 6 mm by 50 mm (1/4 of an inch by 2 inches) to limit the x-rays projected onto the linear detector array 40. First collimator 26 provides a reduction in both scatter and quantity of x-rays projected towards the workpiece. Below the first collimator 26 within the conduit 22 is a second collimator or aperture device 28. An exemplary dimension between the first and second aperture devices is approximately 45 cm (18"). Preferably, the second aperture device 28 can be translationally positioned by positioners 130 to allow positioning of the x-ray beam onto the sensors 44. Disposed through collimator 28 is aperture 128. An exemplary dimension for aperture 128 is approximately 2.5 mm by 330 mm (1/10 of an inch by 13 inches) to project the x-rays onto a similarly dimensioned detector array 40. Preferably, the top edge of each collimator's aperture 126 and 128 has a chamfer 127 and 129 (respectively) to improve scatter reduction of the x-ray beam onto the detector array 40.
The sensor array 40 (as well as the x-ray source 20) can be calibrated by exposing the sensors 44 to the x-rays without a workpiece in place, as shown in Figure 4. The x-rays can also be blocked by first shutter 24 to provide a "black-out" reading for calibration. Calibration is desirable due to drift in the intensity of the x-ray source as the source 20 warms up, drift in the response of the detectors 44 due to a variety of factors, and differences in the base response of detectors 44 due to manufacturing variances and environmental conditions (dust on a sensor, etc).
More preferably the apparatus is provided with a device allowing intermediate calibration levels beyond fully exposed and no exposure. This can be accomplished by the calibration device
30 shown in Fig. 4. Disposed between the second aperture device 28 and the detector array 40 is a multi-stage calibration shutter 30 having a plurality of calibrations shutters 32. 34 and 36 which can be positioned within the energy conduit 22 to partially block x-rays from the sensors 44. The
shutters 32, 34 and 36 are positionable within the energy conduit 22 by respective calibration shutter actuators 33. 35 and 37, which can be solenoids or pneumatic actuators. Preferably, actuation of the calibration shutters is computer controlled to allow frequent calibration of the apparatus during a warm-up period, and less frequent calibration thereafter. The shutters 32, 34 and 36 are fabricated from a material which allows passage of an attenuated amount of energy from the source 20 to the detectors 44. In this manner, intermediate calibrations can be accomplished. When three calibration shutters are used as shown. 7 combinations of intermediate calibration can be accomplished. That is, shutters 32, 34 and 36 can be used separately, shutters 32 and 34, or 32 and 36. or 34 and 36 can be used in combination, or all three shutters can be used in combination. This provides for 9 levels of calibration overall (including full-open and fully blocked) for the apparatus 10. Preferably, the shutters 32. 34 and 36 are fabricated from a homopolymer polyformaldehyde, known by its trade name is Delrin or other suitable material which allows partial transmission of x-ray energy.
The apparatus 100 can be further provided with a detector collimator (not shown) positioned just below the path of the workpieces adjacent the sensors 44. This assists in giving a final reduction in both scatter and quantity of x-rays projected onto the sensor array 40. An exemplary dimension for the aperture in the detector collimator is approximately 2.5 mm by 330 mm (1/10 of an inch by 13 inches). An exemplary dimension for mounting of the detector collimator is about 6 mm (1/4 inch) directly above the sensors 44. This detector collimator is preferably fabricated from lead or tungsten inserted into aluminum or a similar material.
The apparatus 100 can be further provided with sensor array 40. In one embodiment, the sensor array 40 consists of 128 individual sensors in a single line where each sensor is approximately 2.5 mm (1/10 inch) by 2.5 mm (1/10 inch). Each sensor can thus be considered as a "pixel". Each sensor is mounted in the path of the projected x-rays and in the path of the workpiece 1, where the workpiece is moved over the array 40 and through the path of the x-rays by conveyor 13 having conveyor belt 16 and conveyor pulley 140. The conveyor pulley 140 can
further comprise a measurement device 142 such as an encoder wheel for determining the lineal distance that the workpiece 1 has moved past the sensor array 40. The encoder can also be used to determine the arrival of a workpiece by detecting the leading edge of the workpiece as it enters the scanner. This event can then be used to trigger the scanning of the workpiece by the sensor subsystem. In a less preferred embodiment, the workpiece 1 can be temporarily held stationary while the apparatus 10 moves over the workpiece. The sensors typically generate an analog signal which can be communicated by signal line 52 to an analog-to-digital (A/D) converter 50. Use of the A/D converter allows the signals to be processed by a digital computer.
Method for determining the probable existence and location in a workpiece of defects
Referring to Fig. 3, a workpiece or board 1 enters the x-ray scanner 100 longitudinally and is sensed using the scanner 100. An x-ray scanner as described above is preferably employed to identify defects having density variations. High density defects or variations in a board include knots and compression wood. Low density defects or variations in a board include rot, voids, and large cracks. A detector or sensor array 40 (of Fig. 4) covering the width of the workpiece is preferably used. The signals from the resulting scan are preferably converted to digital signals using A D converter 50, and are stored in a computer readable memory for further processing.
The workpiece or board is preferably scanned in a longitudinal direction such that the major dimension of the board is perpendicular to the detector array and the short dimension of the board (or the width) is parallel to the detector array. The board is oriented in coordinate axes with one corner of the board designated as (x.y) = (0,0). Boards of thickness up to 4 inches may be accommodated by the system described herein. Greater thicknesses can be accommodated with higher powerful energy sources. Preferably, the board is between 1 inch and 4 inches thick. Also preferably, the board width is less than or equal to the width of the detector array.
The detectors typically generate an analog signal in response to energy which is transmitted through the board. High density regions in the board will cause less energy to be transmitted, resulting in a lower signal produced by a detector within the detector array. The analog signals produced by the detectors can be converted to a 12-bit digital signal using an analog-to-digital converter. The 12-bit signal can then be provided to a video frame assembler which assembles the data to a line scan configuration. This can be accomplished by an image processing card and a computer. Thus, data from the scan is collected and organized within a computer memory in a configuration such that the 12-bit digital signals are organized with respect to their spatial position on the board in accordance with the (x,y) coordinate system.
In a further embodiment of the invention, detector arrays may be oriented radially about the board at 120 degree intervals. Each detector array so provided is preferably provided with its own energy source. In this manner, data may be collected and assembled into a 3-dimensional model of the board.
Preferably the board is scanned every 2.5 mm (1/10 inch) as the board passes across the detectors. Thus, each 0.1 inch of board scanned may be properly termed as a "line scan." The expression "line scan" will be used herein, and is understood to designate a single transverse scan of the board. Thus, a complete scan of the board is made up of a plurality of line scans as the board progresses longitudinally across the detector array.
When the analog signals are converted into 12-bit binary signals, a signal range or pixel value of 0 to 4095 can be achieved. For an exemplary board, an average overall board density of approximately 1500 counts is typical. Signals which exceed the normal count by a predefined amount are indicative of areas of high energy transmissivity, indicating the presence of a high density defect such as a knot. Signals which are less than the average count by a predefined amount are the result of areas of low density within the board and are indicative of defects such as rot or a hole.
In one example, a sensor array of 128 sensors or pixels spaced approximately 2.5 mm apart is used, for a total scanned width of approximately 32.5 cm or 12.8". Typical board lengths from 4 feet to 20 feet (1.3 m to 6 m) or more can be accommodate by the system. Since the minimum board length commercially encountered is typically no less than 4 feet, a "board" length of 4 feet is used for data processing purposes. An actual workpiece can thus comprise several "board models" of 48 inches. In the following example, it will be assumed that the workpiece is a board approximately 12" wide, although it is to be appreciated that various widths of a workpiece can be accommodated by changing the number of sensors or the sensor spacing. Scanning in the longitudinal direction (the direction of travel of the workpiece) can be performed every 2.5 mm (1/10 inch), giving an image of the board of 480 pixels by 128 pixels. The rate of scanning can be performed at 1440 Hz. This provides a signal from the sensors that can be converted to a 12 bit digital signal, allowing a range of 0 to 4095 counts or different density measurements. In the preferred embodiment of the method, a "board" or frame comprises 48" of a first frame plus 4" of the next frame. This provides smooth data continuity from one frame to the next.
The method for identifying the existence and location of probable defects within the workpiece is shown in flowchart form in Fig. 9. The block diagram flowchart 800 can be implemented by reducing each described step to computer program steps to produce a computer program which can be stored on computer readable media and executed by a computer.
In the first step 810 of the method, the workpiece is scanned by passing a workpiece between an energy source and sensors to detect energy transmitted through the workpiece to generate raw data which is preferably converted into 12 bit data by an analog to digital converter to produce a set of signals which will be processed to determine the presence and location of probable defects in the workpiece. Next, in step 820, the sensors or detectors which are used to sense energy transmitted through the board, and the x-ray source are calibrated. Calibration is performed by exposing the detectors directly to the energy source to establish a gain value. The
17
SUBSTTrUTE SHEET (RULE 26)
detectors are then completely blocked from the energy source to establish the response of the detectors in the absence of any energy from the energy source which establishes an offset. Then the raw data collected in step 810 is calibrated using a two-point gain offset correction. In the third step 830 the raw data collected in step 820 is smoothed using a low pass spatial filter. More preferably, the filter is a 3x3 low pass filter, using the signal established in step 820. In step 835 probable defects, known as "candidate objects" are generated using an adaptive thresholding filter, preferably on a longitudinal zone basis, as will be more fully described herein. The resulting product of the candidate object generation step 835 is a series of high density and low density candidate objects and their corresponding location on the board or workpiece.
In step 840. the candidate objects are grouped together to "grow" probable defect objects. This is performed by grouping candidate objects identified in step 830 which are within a predetermined distance of one another. In step 850, a candidate object feature vector is produced. The candidate object feature is extracted from the shape or geometric candidate objects generated in step 840, such as the height, width, aspect ratio, area, and perimeter length of the candidate object. In step 860. the features extracted from the candidate object 850 are compared against a rule-base to reject candidate objects which are unlikely to in fact be defects. This step can also properly be described as "defect filtering," since the objective is to remove phantom defects. In step 870. the remaining candidate objects are located dimensionally on the workpiece by converting their digital pixel space into spatial (x,y) coordinates which can be provided to a defect assembler and an optimizer for scheduling the cutting of the workpiece into smaller pieces.
Each step of the method will now be described more fully.
Calibration
Due to natural variations in equipment such as the x-ray source and the detectors, which can be introduced by operating temperature and the like, it is preferable to calibrate the detectors
based on variances in the energy source and based on their own variation. Typically calibration is performed more frequently early on while the equipment is warming up, and less frequently later. For example, early calibration frequencies of even,' 5 minutes and later calibration frequencies of every 30 minutes can be used effectively.
The image is calibrated using a two-point gain and offset approach by which the value of each pixel (i.e. each of the 128 detector pixels) is corrected based on a predetermined fully exposed detector reading (white level) and a fully blocked detector reading (dark level). The detector is fully exposed by taking readings from the detectors when no workpiece or calibration shutter is disposed between the x-ray source and the detector (this is also referred to as the white level correction factor value). The detector is fully blocked by isolating the x-ray source from the detectors. This is also referred to as the dark correction value and can also be considered background signal. Calibrated pixel data for real density calibration is generated using the following: v(m)=[y(m)*g(m)]+o(m) (Equation 1) where "m" is the pixel number, "y" is the measured value, g is the gain ("white level"), "o" is the offset ("dark level"), and v is the calibrated pixel value.
Smoothing the Data
The calibrated image is first smoothed using a low pass convolution filter (which is a spatial smoothing filter) which reduces signal noise due to amplification and detector speckle. The use of this type filter is preferable due to its noise removal properties and its ease of implementation. The calibrated image data is preferably smoothed using a 3x3 spatial low pass filter, as follows:
(Equation 2) where a(k,l)=l/9 are the filter weights.
Additional approaches to smoothing the data such as median filters or morphological filters (e.g. dilations and erosions) have also been verified as equally as effective.
Candidate Object Generation and Adaptive Thresholding
Turning to Fig. 6, an exemplary single line scan of a board is shown. The line scan shows the intensity of the count on the vertical axis and the width across the board on the horizontal axis.
It is seen that moving across the board from a position y of 0 to a position y of 12.8 that the count drops from approximately 3200 to 1000. This difference may be the result of natural variation in the density of the wood and not indicative of the presence of a defect. An example of a defect is shown at y = 7 inches where the count intensity has risen from approximately 1700 to approximately 2500. The cross-board variation shown in Fig. 6 can also exist in the longitudinal direction of the board. The method preferably is configured to account for the natural cross-board density variation as well as the longitudinal density variation in the board, absent variations due to defects.
Natural cross-board density variation is accounted for by dividing the board into a plurality of zones as shown in Fig. 7 wherein the workpiece one is divided into 6 zones. 401 through 406. Although the number of zones selected is not particularly pertinent, in one example, 10 zones were selected. For each zone then a long-term average in the longitudinal or x direction is determined. The long-term average is then adaptively filtered to obtain a moving average, as will be described further herein. Thus, segmenting the board into transverse zones in the y direction accounts for natural cross-board density variations, while adaptive filtering of a long-term average in the x direction accounts for natural density variations in the longitudinal direction.
The adaptive filter adapts the digital signal data to the clear wood density of the board. It is preferable to establish this clear wood density in a first section of the board, for example, in
the first meter (36 inches) of the board, to initialize the filter. As shown in Fig. 7, a "board" is defined as being 480 line scans long. When each line scan is 0.1 inch long, this corresponds to 48 inches or 4 feet. In fact, the actual length of the board may be longer, but for the data processing purposes described herein, it is preferable to select a single dimension as a defined "board length." The board is divided into frames so that defects can be generated as the board passes through the scanner, and to limit processing of data to a maximum size (for example, 52 inches). An additional benefit of dividing the board into frames is that such allows variable length material to be processed consistently. The frame length is preferably less than the shortest anticipated input material length. Thus, in scanning the board, and in processing the data, a 480 line scan board length is used. Preferably, 40 line scans from the next "board" are incorporated into each board model to allow interpolation and extrapolation of the board model at its end points. Thus, a board model or "frame" of 520 pixels by 128 pixels results.
In the first step of the candidate object generation, the initial or starting clear wood density for each cross-board zone is established. It is preferable to establish this initial value within the first 36 inches of the board. The assumption is that the most frequently occurring pixel value will represent the clear wood density of the first several feet of the board. This can be accomplished by assembling a histogram of the pixel counts within the first 36 inches (360 line scans) of a zone and selecting the most frequent pixel value in the histogram. Preferably, the program for selecting the most frequent pixel in the histogram looks only within a certain limit of anticipated clear wood density. If no peak value is found within the selected range, it is indicative of a major defect in the wood or an equipment problem, in which case the clear wood density value from the previous frame is used. The initial piece of the zone which is examined to determine an average clear wood density may be know as the region of interest (ROI). The most frequent value in the histogram is established as the initial or bulk long-term average (LTA0), and is used to seed the adaptive thresholding filter. LTA0 is calculated for each zone across the board.
The next step is to process each line scan in the frame (520 pixels x 128 pixels in the example) by first calculating a short-term average (STA) filter value for each zone across the board. The short-term average filter value for a zone is calculated by determining the mean of those pixels in the current line scan of the zone which fall within predetermined upper and lower bounds (upper and lower percentages) of the current long-term average value. Once the short-term average filter value has been determined for a line scan within a zone, the long-term average is adjusted based on a fraction of the short-term average. This fraction is predetermined by defining the length of the long-term tracking window. The resulting effect is that the short-term filter value for each line scan within a zone biases the long-term filter value either up or down based on whether the short-term filter value is above or below the long-term filter value, respectively. Various schemes can be employed in defining the relationship between the short-term and long- term filters. In essence, this can be viewed as a control system in which the long-term filter is attempting to track the slowly varying density map topology while the short-term filter is providing the feedback as to the direction and rate at which the long-term filter should be moving. The approach employed can be considered a linear feedback loop with hard rejection points. Nonlinear or other approaches can be employed based on particular image characteristics or desired result.
For the technique employed, LTAi+1 = LTAi (fltsta,)), where i is the current line scan, and f is a function. The short-term average can be limited such that it is not greater than nor less than 1.15LTAi5 for example. This prevents high and low readings from defects artificially driving up or down the clear wood density average. LTAi+, can be properly described as the "long-term moving signal average" for a zone.
At this point, the long-term average value has been determined for each zone for the current line scan being processed. Next, high and low density candidate object threshold levels are established for each zone based on predetermined high and low density percentages above and
below the clear wood density long term average (filter) value, respectively. For instance, high density objects are thresholded (separated) out whenever a pixel is determined to have a value greater than twenty percent (or other predetermined percentage) of the moving clear wood density long term average (filter) value (pixel) value. That is, T, = LTA, (1 ± P), where T is the candidate object threshold count, and P is <1 (preferably 0.5>P>0.1). For example, if a 20% band is established as the threshold, P = ± 0.2, so T, = 0.8 LTA, to 1.2 LTA,.
The adaptive thresholding is used to separate high and low density candidate objects from the density map. Here the term "candidate object" refers to the fact the object is a candidate (i.e. it has potential to become part of a defect). Typically several "candidate objects" are joined to form a candidate defect object. Candidate objects are separated using adaptive thresholding and are then joined to form candidate defect objects which are then classified as belonging to a specific defect type, as described below.
Linear interpolation is preferably performed between adjacent zone moving long-term average (filter) values in order to remove discontinuities between zones and to better approximate the varying cross-board density. Linear extrapolation is also preferably performed beyond the mid-point of the first and last zones to better handle the effects near the edge of the board. A piecewise linear interpolation/extrapolation approach was determined to be satisfactory for determining high and low density objects. A polynomial or similar curve fitting approach can also be employed. Each pixel in the line scan is then determined to either belong to a high density object, a low density object, or neither, based on the previously determined high and low density threshold maps (hereinafter referred to as object(s)).
Referring to Fig. 8, a graphical representation of the moving long-term average is shown. Line 180 tracks the workpiece signal density (the actual instantaneous density measured by the sensors). The centerline 160 tracks the moving long-term average LTA,. Line 162 marks the
lower threshold limit TAL. Pixel values below or less than line 162 are candidates for low density defects. Line 164 tracks the upper threshold limit TAH. Pixel values above line 164 are candidates for high density defects. An example of a low density defect is shown at 166, while an example of a high density defect is shown at 168. Line 170 is the short-term average (STA) of any given line scan. It can be seen that as the short-term average line 170 moves up and down, the long-term average line 160 generally tracks the motion of the short-term average line 170. Also, during an excursion (166 or 168) the short term average is not generated, and the last LTA is used until the signal returns to within the threshold limits.
The resulting data model may properly be referred to as a density map, a defect map, or a candidate map.
The adaptive thresholding algorithm is summarized as follows:
- Initialize long-term pixel average for each cross board zone if this is the first image frame of the board.
= nk(τnax),
where rj is the tth gray level, « is the number of pixels in the image with that gray level. ri^max is the maximum value of exclusive of background pixel values, and k = 0,1,2...., L - 1.
- Step line by line through the image frame and perform the following for each cross board zone:
Calculate the line pixel average within the cross-board zone.
Modify the zone long-term pixel average based on the line pixel average.
Calculate the zone low and high density thresholds based on a percentage of the long-term pixel average.
Threshold line for low and high density objects (linear interpolation is performed between zones).
The next step is to perform localized joining of similar candidate object types. This is performed using a region growing technique that merges like-candidate objects (high density or low density) that are within a predetermined neighborhood or distance of one another. This is performed in both the width and length directions. Typically several candidate objects will form a high or low density object grouping.
Like candidate (high or low density) objects are joined using local object merging if the distance between adjacent objects is less than a preselected distance. The following is performed: R is merged with Rj if \R,-(x,y) - Rj(x,y)\ ≤d where R denotes a region.
Referring to Fig. 5, an example of local object merging is shown. A board model 150 is shown with identified defects. The board model may be considered as an image map or a defect map. Although the board model may be displayed graphically to a user, it can also be stored as a digital representation in a computer readable medium for further processing by the method as described herein. In the example shown, the candidate object generation has identified potential defects 420, 421, 422, 423, 427, 428, and 430. Prior methods of merging defect objects might attempt to merge defect objects 420, 427, 428, 421, 422 and 423 into a single defect bounded by boundary 426. In the preferred method of candidate object merging defects 420, 427 and 428 are merged and surrounded by boundary 424. Defect object 421 may be added to the defect bounded by boundary 424 by increasing the boundary with boundary line 425. Alternately, defect 421 may be isolated to its own defect boundary. It is apparent that bounding defects by boundaries local to the defects decreases the quantity of wood which may need to be removed as waste product.
Likewise, prior methods of bounding defect 430 would produce a defect boundary 433 which would result in loss of area 434. Preferably, defect 430 is bounded by rectangles 431 and 432 thus allowing area 434 to be salvaged as good wood.
The next step is to extract a feature vector from the candidate defect object which will be used to classify or validate the high or low density objects. Some of the features extracted are the object width, height, pixel area, and aspect ratio of the defect object. Additional features such as the object's average pixel value, elongation, orientation, second and third moments, perimeter length, etc. can also be utilized.
The following features are generated for each candidate object:
bounding box locations (Xmin, Xmax, Ymin, Ymaχ) pixel area (Parea) - aspect ratio
The features from the feature vector are then used to either reject the candidate defect object as invalid, in which it is discarded, or to determined the type of high or low density defect detected. The classification approach taken is one of a rule base in which several rules are compared to the generated feature vector. For example, the following criteria is preferably be satisfied: minimum and maximum width and height criteria Width: ( 'max - 'm,n) ≥ ^min and ( max - ^mjπ) < Wmm, Height: (.γma - ,γmιn) > Hmm and (xmax - xm < Hmax
minimum and maximum area criteria:
Area: Am„ and RαrM < A
minimum and maximum aspect ratio criteria: Aspect Ratio: (xmax - xmin) I (ymaχ -ymin) ≥ R. and
(ymax ~ y'min) I (xmin ' xmin) ≥ R
More sophisticated approaches such as using a fuzzy logic and neural networks can also be used. Any candidate objects not rejected are probable defect types, such as rot or knot, that have been detected and classified from the candidate high and low density objects.
Defect objects are then converted from internal pixel unit space to external measurement unit space preferably in thousandths of inches (0.000"). In addition, length (x) and width (y) correction scale factors and offset are applied to correctly reference the coordinate space to some given datum reference. The following conversions are performed: x External = x Internal xSscaleFactor y External ~ ( 'Internal * ySscaleFactor) + > 'Offset
In compliance with the statute, the invention has been described in language more or less specific as to structural and methodical features. It is to be understood, however, that the invention is not limited to the specific features shown and described, since the means herein disclosed comprise preferred forms of putting the invention into effect. The invention is, therefore, claimed in any of its forms or modifications within the proper scope of the appended claims appropriately interpreted in accordance with the doctrine of equivalents.