Soybean Seed Coat and Cotyledon Crack Detection by Image

J. agric. Engng Res. (1988) 41, 139-148
Soybean Seed Coat and Cotyledon Crack Detection
by Image Processing
S.
GUNASEKARAN*
;
T. M. COOPER? ; A. G.
BERLAGE~
A computer vision system was used to evaluate seed coat and cotyledon cracks in soybeans.
White light in the front-lighting
mode with a black background
for the soybeans was the best
condition for acquiring video images of soybeans suitable for subsequent
processing.
Image
processing algorithms were developed using the software supplied with the vision system computer.
Crack detection was most successful when seeds were positioned carefully such that the cracked
region of the soybean was viewed directly by the camera of the vision system. Using the algorithms
developed, 96% of the soybeans with seed coat cracks and 100% of the soybeans with cotyledon
cracks were correctly detected from the samples tested.
1. Introduction
Two of the major categories
of damage
to soybeans
are seed coat cracking and cotyledon
cracking. Seed coat cracking is the rupturing of the outer covering of the soybean seeds. The
cotyledon crack is the partial separation or opening of the two cotyledons in the seed. Initial
damage to the coat and cotyledons of soybean seed occurs early in the field while combine
harvesting. Impact forces from the threshing action induce the seed coat to crack and in severe
cases induce the cotyledon crack’ also. This initial damage is further aggravated by various
handling and processing operations.
There have been a number of studies on the effect of
impact forces on soybean seed such as those encountered
during handling and conveying
operations.2-5
Soybean moisture content and drying conditions also influence the extent of damage caused.
Typically, soybeans at moisture contents below 11% (wet basis) were more susceptible to
damage5 than those above 11%. Seed coat damage has been reported in both thin-layer and
deep-bed drying of soybeans.6*7 Hot air used for dry’m g has been found to cause both seed
coat and cotyledon cracks. 8-S Drying related soybean damage increases the breakage during
subsequent handling and conveying.”
Soybean seed coat and cotyledon damage lowers the market grade and economic value.
High levels of these damage categories reduce germination
and seedling vigour and lead to
microbial and insect infestation. ” Furthermore,
damaged beans potentially
reduce oil yield
and quality. ‘**13Therefore soybeans are routinely evaluated for the presence of seed coat and
cotyledon cracks.
Currently soybean seed coat damage is detected by use of chemicals such as tetrazo1ium’4
or indoxyl acetate.15*16 Soybeans treated in such chemicals develop a distinct colour at the
seed coat cracks which can be detected either visually or by electronic colour sorters. Rodda
et af.17 reported a method based on the fact that cracked soybeans absorb moisture faster and
swell in size more than undamaged
soybeans. All these methods are fairly indirect and labour
* Delaware Agricultural Experiment Station, Department of Agricultural Engineering, College of Agricultural
Sciences, University of Delaware, Newark, DE 19717-1303, USA
t USDA-ARS, Oregon State University, Corvallis, OR 9733 1, USA
Published as Miscellaneous Paper No. 1224 of the Delaware Agricultural Experiment Station
Received 21 September 1987; accepted in revised form 23 April 1988
139
002lL8634/88/lOOl39+10 %03.00/O
U:>1988The British Society for Research in Agricultural Engmeering
140
SOYBEAN
CRACK
DETECTION
intensive. Therefore, there is a need for quick, reliable and fully automated soybean seed
quality evaluation. In the past, spectrophotometric methods have been used extensively for
quality evaluation of agricultural and biological materials.‘* However, image processing techniques using computer vision systems were found to be most suitable for automatic grain
quality evaluation.” Optical imaging or image processing is a relatively new technique that
holds promise for automatic, on-line quality evaluation and control of a wide-range of
materials.20*2’This method essentially simulates what the eye sees. A typical image processing
system receives light from a source ; converts the light into an electrical signal proportional to
the intensity of the light received ; processes the analogue electrical signals into a digital form
usable by a computer; measures and analyses various characteristics of the digital data
representing the image ; and interprets the image data to obtain useful information. The
resolution of the digital image depends on the number of pixels (picture elements) digitized
for each scan line and on the number of scan lines used. Proper lighting conditions are very
important for processing speed and efficiency.20,22,23
Image processing applications for grain and food quality evaluation are rapidly expanding.
Quality evaluation of various biological materials such as apples,24 brown rice,*’ fish,** seed
contaminants,** tomatoes*’ and corn kernels**,*’ has been achieved by image processing.
This article presents the application of the image processing technique for detecting seed
coat and cotyledon cracks in soybeans.
2. Objectives
The objectives of this investigation were to :
(1) determine optimum conditions for acquiring video images of soybeans using a computer
vision system ;
(2) develop image processing algorithms to detect soybean seed coat and cotyledon cracks.
3. System description
A commercial vision system, Intelledex V200, was acquired. It was developed with special
hardware to interface with cameras and display monitors and with software to implement
processing algorithms. Fig. 1 shows a block diagram of the system hardware.
A Hitachi KP-120 solid state video camera was used for image acquisition. A C-mount to
bayonet adaptor allowed use of a 35 mm SLR photographic lens system. The camera was
mounted on a vertically adjustable stand for necessary magnification and resolution. The stand
also provided support for lighting sources.
In the vision system, the analogue camera image is sent to the system computer. The
computer consists of three modules : (a) camera/monitor interface, (b) digitizer/display
module, and (c) a processing module. The camera/monitor interface module passes information between the digitizer/display and the camera and monitor. It also controls the gain,
timing, and selection of data from which the image is produced.
The digitizer/display module converts the analogue camera signal to a digital form that the
computer can process and store. Each of the 256 camera scan lines is digitized into a series of
256 discrete picture elements (pixels). Each pixel in this 256 x 256 array has a six-bit value
(range : 0 to 63) representing the average light intensity over its area. A value of zero is black
while a value of 63 is white. This numerical index is known as the grey scale value of the
corresponding pixel. The hardware digitizes an image in 0.0167 s. The module has 64 k x 6
bits of static random access memory (RAM) which is used for storing a single digitized image.
This image buffer or display RAM holds a single frame for processing or display.
S. GUNASEKARAN
E7’
141
AL
VISION system computer
_______P----_------
I
I
--I
I
Processtng -
I
I
I
Fig. I. Block diagram of the vision system hardware
The processing module contains an 8 MHz 8086 central processing unit (CPU), an 8087
numeric coprocessor, 132 kbyte of read only memory (ROM) for VISION BASIC,256 kbyte of
dynamic RAM, and 96 kbyte of CMOS battery-backed RAM. This module executes the vision
commands which control the operation of the vision system. Vision generated data are used
in decision-making algorithms which are fixed step-by-step procedures for accomplishing a
given computational task.
The host microcomputer serves as an intelligent terminal. Its main function is to execute the
host program which gives the vision system computer access to the host microcomputer’s disk
drives, screen, and keyboard. A 23 cm black-and-white monitor displays the contents of the
vision diplay RAM. This can be a stored image, or a processed image.
4. Procedure
4.1. Sample preparation
Two soybean varieties, Williams and locally grown Delaware, were used in the experiments.
The original sample contained only a small amount of damaged seeds. Therefore, seed coat
and cotyledon damage were induced by running the samples through a centrifugal impactor.
This was to simulate the mechanical impact forces of harvesting and handling. Seed coat and
cotyledon-cracked soybeans were hand-picked for the experiments. Twenty-five seeds of each
variety and damage category were viewed individually under the vision system for image
acquisition. An equal number of undamaged seeds were also used in the investigation.
142
SOYBEAN
CRACK
DETECTION
4.2. Illumination
Soybeans were placed directly under the camera and illuminated
by front-lighting,
backlighting and side-lighting
modes. Front-lighting
(illuminating
from directly above the seeds)
and back-lighting
(illuminating
from directly below the seeds) were provided using a Schott,
Model KL1500 fibre optic-light source. This light source had a maximum of 150 W power
rating and provided a maximum light-intensity
of about 10 Mlx at the fibre optic light guide.
A ring light guide mounted on the camera lens was used to obtain shadow free diffuse lighting.
Side-lighting was provided by means of a pair of 18 W incandescent
lamps positioned at a 45”
angle on either side. The wavelength of light received by the camera was controlled by mounting
a suitable filter over the camera lens. A series of Wratten filters in the wavelength range of 370
nm to 610 nm was used. Three backgrounds
of frosted glass, milky-white
glass, and blackcoated wooden plates were used with both front- and side-lighting
to determine the optimal
conditions for image acquisition.
Fig. 2 shows the sample viewing section of the vision system
with camera, light source and monitor.
4.3. Image processing
The video images generated as mentioned above are digitized and processed using a variety
of image processing commands
available with the vision system. A brief description
of the
commands used in the image processing algorithm is presented in the following paragraphs.
4.3.1. Seed coat crack detection
The pixels (picture elements) representing
a seed coat crack have grey scale values significantly different from the pixels of the rest of the soybean surface. On average, the grey
scale value for the pixels representing
the crack is 9 more than that for the untracked
region
(for example, 28 compared to 19). Therefore, grey scale levels of the pixels representing
the
seed coat crack were extracted by a process similar to high-pass filtering. First, the pixels
Fig. 2. Sample viewing section of the vision system. (A) monitor; (B) camera; (C) jbre optic light
source ; (D) light guide for back-lighting; (E) light guide,for front-lighting ; (F) black plate background
S. GUNASEKARAN
ET
AL.
143
having grey scale values that differ markedly from the surrounding
pixels (cracked region)
were removed. This newly created image was subtracted from the initial image to obtain only
those pixels that represent the crack. This high-pass filtering procedure passes high frequencies
in the grey scale value, i.e., it passes the pixels with a large change in grey scale values in
relation to the neighbouring
pixels but not necessarily those pixels with high grey scale values.
In the following, a brief description is given of the function of various processing commands
(the bold-faced, capitalized terms) presented in the sequence they were used in the seed coat
crack detection algorithm.
VSNAP acquires the real-time image of the object under the camera, digitizes the image
and stores it in the display RAM.
VDIG is a mode command and does not perform any processing function. It switches the
signal shown on the monitor to the current image in display RAM. This step is required only
to see the actual processing of the image. The VDIG display is static, and is not affected by
the object under the camera. Therefore, once VSNAP and VDIG are performed the sample
can be removed from the viewing position. This makes it possible to acquire several images
at one time for later processing.
VSIMAGE stores the digitized image in an image buffer. This original image is later used
in the VSUBTRACT
step to extract the seed coat crack details.
VENHANCE
performs an image enhancement
operation on the contents of display RAM.
Each pixel in the image is arithmetically
averaged with its eight surrounding
pixels and a new
pixel value is obtained. The action is similar to low-pass filtering; and has the effect of smoothing the contrast of the pixels representing
the seed coat cracks that have significantly
high
grey-scale value compared to their surrounding
pixels.
VSUBTRACT
numerically subtracts the grey scale value of each pixel of the image obtained
after the VENHANCE
operation
from the corresponding
pixels of the original image
stored in the image buffer (obtained by VSIMAGE).
As mentioned above, this has the effect
of passing those pixels with large rate of change of grey scale value.
VTHRESH operation is based on the threshold grey-scale value used (the numeral following
the command).
All the pixels with grey-scale value less than the threshold are set to the binary
value of zero (black); the rest are set to one (white). Thus, VTHRESH
produces a purely
black and white image.
The images obtained using the above steps showed white streaks corresponding
to the
the
presence of seed coat cracks ; but they also contained some spurious streaks representing
image noise which could be mistaken for seed coat cracks. To eliminate these spurious streaks
the image-smoothing
step, VENHANCE
was repeated several times before VSUBTRACT
operation.
Additional
VENHANCE
operations
eliminated the spurious streaks, but it also
eroded the streaks representing
seed coat cracks. After several trials, repeating VENHANCE
three times was found to be optimal.
In order to obtain better seed coat crack recognition,
a contrast enhancement
algorithm
(VMAP) was added to the program prior to VENHANCE
operation.
VMAP enables remapping of any or all pixel grey-scale values to new values as specified.
In the program used, all pixels with grey-scale values less than a chosen lower limit (XL) were
set to zero. The pixels with grey-scale values greater than (XL+32)
were set to 63. Those
pixels with grey-scale values from XL to (XL+ 31) were remapped as 2 x (I-XL), where I is
the grey-scale value of the current pixel. This operation has the effect of doubling the contrast
of those pixels with grey scale values from XL to (XL+ 31). The lower limit XL was chosen
to be 20 by examining the grey-scale histogram of the original image.
The program with VMAP eliminated the spurious streaks, that is, the spots within the kernel
boundary,
more effectively. However, this also caused the streaks representing
the seed coat
cracks to split and shorten. Therefore, an image-structuring
algorithm VDILATE was added
to the program.
144
SOYBEAN
CRACK
DETECTION
VCOMPRESS compresses the image in display RAM into bit plane zero. A bit plane is a
contiguous 8 kbyte block of RAM located in a saved image buffer. The vision system has bit
planes 0 to 7 representing 64 k RAM. VCOMPRESS is necessary for the VDILATE operation.
VDILATE algorithm dilates contents of bit plane zero by a linear structuring element.
Dilation of an image by a structuring element is the process of spreading the differences in
grey-scale levels to all the surrounding pixels to create a smoothened image. The software
allows use of eight structuring elements, each in a different direction. For seed coat crack
detection, structuring elements in any two opposite directions were found most suitable.
Further refinement of the processed image was obtained by repeating the VENHANCE and
VDILATE operations.
A BASIC program of the final version of this processing algorithm is given in the Appendix.
4.3.2. Cotyledon crack detection
Detecting cotyledon cracks was easier than detecting the seed coat cracks because of the
huge contrast between the cracked and undamaged regions. Because of the partial separation
of the cotyledons the cotyledon cracked soybeans have no seed material directly under the
crack to reflect light and hence reveals the background on which the seed is placed. Therefore
the grey-scale value of the pixels representing the area corresponding to the cotyledon crack
is different from that of the pixels representing the soybean surface. This difference is very
pronounced using the black plate as a background. Therefore, the pixels representing the
cotyledon crack were extracked by a simple thresholding algorithm. The sequence of the
commands used was VSNAP, VDIG and VTHRESH. These processing commands perform
functions as explained in the previous section. Since the soybean seed surface had a minimum
grey-scale value of about 25, a threshold value lower than 25, namely 20 was chosen for the
VTHRESH step. At this step, the cotyledon crack region, having grey-scale values less than
20, were converted into pure black (grey-scale value of 0) and the rest of the soybean surface
was converted into pure white (grey-scale value of 63). Therefore, the result was a black-andwhite image with black positions representing the cotyledon crack.
5. Results and discussion
For both seed coat crack and cotyledon crack detection side-lighting generally produced
images with lower contrast between the damaged and good seed surface than front-lighting.
Back-lighting produced a low contrast image in the case of seed coat cracks and had too much
light passing through in the case of cotyledon cracks which was damaging to the camera. The
frosted glass and milky white glass plates used as backgrounds for placing the soybeans did
not give good results because of light diffraction and bright spots around the seed. The black
plate provided the best contrast and eliminated the light dispersion around the seed. When
filters of various wavelengths were used the light intensity reaching the camera lens was
diminished and hence a lower contrast image was obtained. Therefore, it was determined that
white light, with no filters, in the front-lighting mode with a black plate as the background
was the optimal lighting and viewing condition to acquire video images suitable for subsequent
processing.
The original and processed images of seed coat cracked soybeans are presented in Fig. 3.
In this figure a bright white line defines the seed boundary; and the white streak inside the
boundary represents the seed coat crack. The algorithm performed very satisfactorily in
detecting soybeans with seed coat cracks. It was necessary to place the soybeans manually
under the camera such that the cracked region faced the camera lens. In each of the two
soybean varieties, only one out of 25 seed coat cracked soybeans tested was not detected. In
other words, 96% of the seeds with cracked seed coats were correctly detected.
S. GUNASEKARAN
ET
AL
Fig. 3. Original (top) and processed (bottom) images of good and seed coat-cracked soybeans
Fig. 4. Original (top) and processed (bottom) images of good and cotyledon-cracked soybeans
145
146
SOYBEAN
CRACK
DETECTION
Fig. 4 presents the good and cotyledon cracked soybean seeds as black and white images.
The good soybean was pure white, whereas the cotyledon-cracked seed has a black streak
across the seed representing the cotyledon crack. Some careful repositioning of the seed under
the camera was necessary in the case of one soybean of Williams variety to detect the cotyledon
crack which was not readily detected initially. For the rest of the soybeans of both varieties,
a total of 50 cracked beans were easily detected. However, proper placement of the seeds under
the camera was critical. Therefore, with careful positioning of soybeans all the seeds (100%)
with cotyledon cracks were correctly detected. The above algorithms correctly identified all
the undamaged soybeans tested. The algorithms were fast in detecting the damage and required
only a few seconds to process each image.
6. Conclusions
White light in the front-lighting mode with a black background was the best lighting and
viewing condition for acquiring video images of soybeans suitable for image processing.
2. Image processing algorithms were developed to detect both seed coat crack and cotyledon
cracks in soybeans.
3. Proper orientation of the soybeans toward the camera is essential for successful detection
of both the seed coat and cotyledon cracks.
4. The algorithms developed were able to detect about 96% of the soybeans with seed coat
cracks and 100% of the soybeans with cotyledon cracks in the samples tested.
1.
References
’ Haugh, C. G. ; Bartsch, J. A : Harvesting
’
3
4
5
6
’
*
’
lo
”
”
”
l4
l5
and processing seed for quality. Proceedings of the Seventh
Seed Research Conference. The American Seed Trade Association, Washington,
DC, 1977
Bar&h, J. A. ; Haugh, C. G. ; Athow, K. L. ; Peart, R. M. Impact damage to soybean seed. Transactions
of the ASAE 1986,29(2) : 582-586
Cain, D. F. ; Holmes, R. G. Evaluation of soybean seed impact damage. Paper No. 77-l 552. American
Society of Agricultural Engineers, St. Joseph, MI, 1977
Fiscus, D. E. ; Foster, G. H. ; Kaufmann, H. H. Physical damage of grain caused by various handling
techniques. Transactions
of the ASAE 1971, 14(3) : 48&485,491
Paulsen, M. R. ; Nave, W. R. ; Gray, L. E. Soybean seed quality as affected by impact damage.
Transactions
of the ASAE 1981,24(6) : 1577-1582, 1589
Ting, K. C. ; White, G. M. ; Ross, I. J. ; Loewer, 0. J. Seed coat damage in deep-bed drying of soybeans. Transactions
of the ASAE 1980,23(5) : 1293-1300
White, G. M. ; Bridges, T. C. ; Loewer, D. J. ; Ross, I. J. Seed coat damage in thin-layer drying of
soybeans. Transactions
of the ASAE 1980,23(l) : 224-227
Overhults, D. G. ; White, G. M.; Hamilton, H. E. ; Ross, I. J. Drying soybeans with heated air.
Transactions
of the ASAE 1973,16( 1) : 112-l 13.
Walker, R. J. ; Barre, H. J. The effect of drying on soybean germination
and crackage. Paper No.
72-8 17. American Society of Agricultural Engineers, St. Joseph, MI, 1972
Rojanasaroj, C. ; White, G. M. ; Loewer, 0. J. ; Engli, D. B. Influence of heated air drying on soybean
impact damage. Transactions
of the ASAE 1976,19(2) : 372-376
White, G. M. ; Loewer, D. J. ; Ross, I. J. ; Engli, D. B. Storage characteristics
of soybeans dried with
heated air. Transactions
of the ASAE 1976, 19(2) : 306-310
List, G. R. ; Evans, C. D.; Warner, K. ; Beal, R. E. ; Kwolek, W. F.; Black, L. T.; Moulton, K. J.
Quality of oil from damaged soybeans. Journal of American Oil Chemists Society 1977,54: 8-14
Robertson, J. A. ; Morrison III, W. H. ; Burdick, D. Chemical evaluation of oil from field- and storagedamaged soybeans. Journal of American Oil Chemists Society 1973,54: 8-14
Moore, R. P. Tetrazolium
testing techniques. Proceedings
of the 38th Annual Meeting Society of
Commercial Seed Technologists,
1960, pp 45-5 1
French, R. C. ; Thompson, J. A. ; Kingsolver, C. H. Indoxyl acetate as an indicator of cracked seed
coats of white beans and other light coloured legume seeds. Proceedings of the American Society
of Horticultural
Sciences 1962, 80: 377-386
S.
GUNASEKARAN
ET
147
AL.
l6 Paulsen M. R. ; Nave, W. R. Improved
indoxyl acetate test for detecting soybean seed coat damage.
Traniactions
of the ASAE 1979, 22(6) : 1475-1479
” Rodda, E. D. ; Steinberg, M. P. ; Wei, L. S. Soybean damage detection and evaluation for food use.
Transactions of the ASAE 1973, 16(2) : 365-366
” Gunasekaran, S. ; Paulsen, M. R. ; Shove, G. C. Optical methods for nondestructive
quality evaluation
of agricultural and biological materials. Journal of Agricultural Engineering Research 1985, 32 :
209-124 1
Gunasekaran, S.; Paulsen, M. R. Automatic nondestructive
detection of corn kernel defects. International advances in nondestructive
testing. Vol. 12, Gordon and Breach Science Publishers, NY,
1986, pp 95-I 16.
Gagliardi, G. R. ; Sullivan, D. ; Smith, N. F. Computer-aided
video inspection.
Food Technology
1984,42(4) : 53-57, 59
Kahwati, G.; Law, P. Machine vision system assures product quality. Research and Development
1985, October: 118-I 19
Berlage, A. G. ; Cooper, T. M. ; Carone, R. A. Seed sorting by machine vision. Agricultural Engineering
1985,65(10) : 14-17
Paulsen, M. R.; McClure, W. F. Illumination for computer vision systems. Transactions of the ASAE
1985,29(5) : 1398-1404
Graf, G. L. ; Rehkugler, G. E. ; Miller, W. F. ; Throop, J. A. Automatic detection of surface flaws
on apples using digital image processing. Paper No. 81-3537, American Society of Agricultural
Engineeers, St. Joseph, MI, 1981
Matshuisa, T.; Hosokawa, A. Possibilities of checking cracks of brown rice using illumination
by
oblique ray and image data processing system. Journal of the Society of Agricultural Machinery
1981,42(4) : 515-520
Shimatachi, Y. ; Nomura, Y. ; Ide, T. ; Itoh, 0. Application of pattern measurement
technique to fish
selection. Mitsubishi Electronic Technical Report 1982, 56(3) : 44-48
Sarkar, N. ; Wolfe, R. R. Feature extraction techniques for sorting tomatoes by computer vision.
Transactions
of the ASAE 1985, 28(3) : 97&974,979
Gunasekaran, S. ; Cooper, T. M. ; Berlage, A. G. ; Krishnan, P. Image processing for stress cracks in
corn kernels. Transactions
of the ASAE 1987,30( 1) : 266271
Gunasekaran, S. ; Cooper, T. M.; Berlage, A. G. Quality evaluation of grains by image processing.
Proceedings
of the International
Symposium on Agricultural
Mechanization
and International
Cooperation
in High Technology Era, Tokyo, Japan, 1987, pp. 327-341
Appendix
:
BASIC
program
to implement image processing algorithm for detecting soybean seed
_
coat cracks in the I&lledex V200 vision system
to process soybean image to detect seed coat cracks.
‘Choose a lower limit for VMAP operation. A lower limit of
‘20 is suggested based on image histogram grey-scale levels.
‘VMAP enhances contract between pixels representing cracks
‘and rest of the pixels by doubling the grey-scale value of
‘pixels defined by a window.
10 ‘Program
20
30
40
SO
60
70
80
90
DIM IMAP (63)
INPUT “Enter the low limit”, XL
FOR I = 0 TO XL: IMAP(1) = 2*(I-XL)
: NEXT
FOR I = XL TO XL+31 : IMAP
= 0: NEXT I
FOR I = XL+32
TO 63 : IMAP
= 63 : NEXT I
VMAP IMAP
100
110
120
130
140
150 ‘Store contrast-enhanced
image in image buffer zero.
the image three times
160 ‘VENHANCE
170
0
180 VSIMAGE
I
148
SOYBEAN
190 For I = 1 to 3 : VENHANCE
’
200
210
220
230
240
250
260
270
280
290
300
310
320
330
340
350
360
370
380
390
400
4 10
420
430
440
450
460
470
480
490
500
510
520
1: NEXT I
‘Subtract grey-scale value of each pixel of the image after
‘VENHANCE from corresponding pixels of image stored in
‘buffer zero (VSIMAGE 0) and add 20. A value of 20 was
‘chosen arbitrarily to make the image appear good to the
‘viewer. This, however, will not affect the end result.
‘One can choose any value.
’
VSUBTRACT
20, 0
’
‘Choose a threshold value of 22 (this value is relative
‘to the number 20 used in the VSUBTRACT step). VTHRESH
‘converts all pixels of grey-scale value less than the
‘threshold value to pure black (0) and the rest of the
‘pixels to pure white (63). Compress the image after
‘VTHRESH in bit plane zero.
’
VTHRESH 22
VCOMPRESS 0
’
‘Restructure cracks using two directly opposite linear
‘structuring elements. Repeat VENHANCE three times.
’
FOR I = 3 to 4: VDILATE I : NEXT I
VEXPAND 0
FOR I = 1 to 3 : VENHANCE 3 : NEXT I
’
‘Repeat image restructuring
’
VCOMPRESS 0
FOR I = 3 to 4: VDILATE
VEXPAND 0
END
I : NEXT I
CRACK
DETECTION