Colour Differences in Images of Diseased Mushrooms

Colour Differences in Images of Diseased Mushrooms

Copyright 0 IFAC Control Applications in Post-Harvest and Processing Technology, Budapest, Hungary, 1998 COLOUR DIFFERENCES IN IMAGES OF DISEASED MUS...

1MB Sizes 45 Downloads 134 Views

Copyright 0 IFAC Control Applications in Post-Harvest and Processing Technology, Budapest, Hungary, 1998

COLOUR DIFFERENCES IN IMAGES OF DISEASED MUSHROOMS

Tiinde Vizhanyol, J6zse( FelfOldi1, Robin Tilletr

J

Department ofPhysics and Control, University ofHorticulture and Food Soml6i ut 14-16, Budapest H-1118 [email protected] 2 Si/soe Research Institute, Wrest Park Si/soe, Beds MK45 4HS. UK

Abstract: The aim of the research described in this paper was to find possible methods to enhance colour difference in mushroom images. Discoloration of mushroom (senescence, damage, bacterial infection) is an undesirable phenomenon in mushroom houses and the market. To discriminate the disease caused browning from the natural browning of the mushroom simple cluster analysis was not sufficient enough. By transformation of RGB values to a* and b* colour components and the elimination of intensity a new image was created. These new pseudo-colour images gave a definitely better separation for the diseases. By means of a vcctorial normalisation the best rate of separation was achieved. Copyright© 1998IFAC

Keywords: image analysis, image enhancement, image processing

1. INTRODUCTION relative humidity high in the mushroom house and the surface of the mushroom remains wet (Gandy 1967, Nair 1974). The causative organism of another prevalent disease (ginger blotch) on the farms is Pseudomonas gingerii. The discoloration of ginger blotch is readily distinguishable from the chocolate brown brown blotch. The discoloration is initially a pale yellowish-red-brown, which finally become a reddish, ginger colour (Wong et al. 1982). A third disease which produces brown spots on the mushroom surface is the Dactylium sp. caused disease. The colour of the Dactylium spots is different from the previous two ones.

Quality has always been important for mushroom sales. The increasing production world-wide provokes higher expectations for mushroom quality. Both consumers and retailers become more discerning and critical though they are ready to pay for the higher quality. High quality mushrooms are generally defined as fresh, white, blemish-free, clean, uniform closed cups or buttons (Berendse, 1984). The colour of the cap is the most important consideration of fresh mushrooms, since it is the first characteristic consumers notice. Any colour deviations caused by natural senescence, mechanical damage or presence of different mushroom diseases appear as browning on the mushroom cap.

None of the above mentioned diseases is desirable on the mushroom farms. Nowadays, when more and more farms have mushroom harvester machines (Reed et al. 1995) combined with an appropriate camera and software to select the mushrooms by size for picking image analysis could be used for other tasks as well. Computer vision has been applied for objective measurement of developmental stage of mushrooms (van Loon 1996). Cap opening and gill colour was used to determine quality of mushroom. Heinemann et a1. (1994) has developed

The most important disease on mushroom farms is brown blotch. By the first description of the disease (Tolaas 1915) it induces a discoloration of all or part of the cap with the colour varying from pale yellow to a rich chocolate brown. Pseudomonas tolaasii which causes brown blotch is a very common bacterium and is likely to be present on most mushroom farms. It is generally agreed by growers and scientists that the disease occurs when the

99

an automated mushroom inspection and grading system based on a combination of machine vision and expert system. Intensity in the monochrome image was used for colour grading analysis.

The captured images were resized and converted to 320x200 pixels Windows bitmap files for the later analysis and processing.

Still there is a definite need for research dealing with the combination of machine vision and artificial intelligence techniques for mushroom inspection. By means of a suitable software and learning material an alarm system developed for warning in case of disease outbreaks could enable the grower to stop the spread of the disease in time. Most image analysis based mushroom quality assessment methods use gray scale image for grading though the fine differences between the mechanical damage and the diseases can be found in the colour information.

Fig. l.a. Ginger blotch.

The objective was to find the best method by which the diseased spots can be separated from the healthy but possibly mechanically damaged or matured cap surface. This project applied intensity normalisation and image transformation techniques in order to enhance colour differences in true-colour images of diseased mushrooms. 2. MATERIALS AND METHODS 2.1 Mushroom cultivars

Fig. 1.b. Brown blotch.

Champignon mushrooms (Agaricus bisporus) from strain A12 were used for the investigations. The diseased mushrooms (15 caps of ginger blotch, 30 caps of brown blotch and 24 caps of dactylium spots) were grown and inoculated with the causative organisms (Pseudomonas tolaasii, Pseudomonas gingerii and Dactylium species) in the mushroom houses of Horticultural Research Institute Wellesbourne, UK. Some typical examples of the diseased mushroom groups are represented in Fig. 1.a.b.c. respectively. 2.2 Image acquisition and pre-processing Fig. I.c. Dactylium. Images were captured with a SONY DXC-15l AP Colour Video Camera in a chamber where the lighting conditions were controlled to give diffuse lighting. The size of the chamber was 84Ox840x600 mm.

3. IMAGE TRANSFORMATION METHODS AND RESULTS

3.1 Cluster analysis

The samples were placed on trays covered with a non-reflecting black material as the background of the field of view. The camera was mounted above the top of the chamber with 450 mm distance from the lens to the mushroom samples. The lens type was HOYA 49 mm+l Computar TV Zoom (1:1.6/ 12.5-75) lens. The images were stored at a partial resolution of 768x479 pixels.

The program developed for the cluster analysis of true-colour bitmap images is for classification of the image pixels described by their RGB values into groups of different colour properties. The base of the classification is the Euclidean distance in the RGB colour space. The result of the analysis is a true colour image for each cluster consisting of all the pixels belonging to the given cluster. The cluster

100

As examples the transformed pseudocolour images of the originals shown in Fig. l.c. and b. are represented in Fig. 3.a. and b. respectively. The separation is generally more effective than with the cluster analysis, the darker edges are not involved in the highlighted clusters. The result is acceptable for some cases and diseases (Fig. 3.a.). A problematic case can be seen in Fig. 3.b. where a very dark brown part of the diseased spot can be classified after transformation as healthy mushroom area. In the next method to decrease the intensity effect instead of absolute elimination of the intensity information the normalisation was used.

analysis provides the average RGB values and the pixel number of the clusters as well. As the result of the analysis a clustered part of the mushroom in Fig. l.a consisting of the diseased spots is shown in Fig. 2. The classification was correct for the disease though the cluster also contained those mushroom parts which had similar intensity and colour as the spots. These parts were the pixels on the edge of the mushroom. The analysis of the other samples of this disease and the other two diseases as well gave more or less the same results. Therefore, further steps are needed to enhance the existing colour differences between diseased and damaged areas in the mushroom image.

Fig. 3.a. Pseudocolour image ofa dactylium diseased mushroom (original in Fig. l.c.). Fig. 2. Misclassification of cluster analysis.

3.2 Intensity elimination The reason for misclassification in cluster analysis

was the relatively small Euclidean distance between the categories caused by the similar intensity. Therefore the problem can be solved by image transformation increasing the distance between the clusters of different colours meantime decreasing the effect of the similarity in intensity. The most simple way of the intensity elimination is to choose a colour representation (such as the L*a*b* colour system) in which the intensity information is separated from the colour information.

Fig. 3.b. Misclassification in pseudocolour image of brown blotch.

The RGB values of the images were converted into L*, a* and b* CIELAB colour components using algorithms and coefficients according to Truppel et al. (1996). In order to investigate the difference in colour of the different disease caused discoloration the intensity component (L *) was neglected and a pseudocolour image was calculated to visualise the results of the transformation. The RGB components of the new image were calculated as follows to fit the values into the 0..255 range:

3.3 Intensity normalisation For the appropriate analysis the whole colour range, the natural colour changes of the mushrooms and the trend of the difference of the diseases to the healthy mushroom have to be investigated. Fig. 4.ab. show the colour components of the pixels of a healthy, white mushroom in the BG and BR projection of the RGB colour space. It can be seen that the colour points of the healthy mushroom are situated along a line (Principal axis). According to the further

R = 15·a *+128 G =30· b *+128

B=O

(1)

101

line of the principal axis the extent of the cloud is

analysis, the same principal axis characterises the natural discoloration of mushrooms.

250

small.

This can explain the problem with cluster analysis as well: the distances in the assembly are smaller between the different coloured pixels than the different intensities. Therefore, such image transformation must be applied which is invariant to the position of thepixels along the principal axis but enhances the direction and the measure of the difference of the pixels from the principal axis.

-t====r====r====r====f .="

200 + - - - + - - - + - - - + - - : ISO

-t----I----+--'i'~

=: 100 + - - - + - - 7 I " ' t - . - - - t - - - 1 - - - - - t i SO + - - - - - . - ' F - - - + - - - + - - - l - - - - - H

The simple algebraic nonnalisation such as O-t-----t----f---f---I---___+' o SO 100 ISO 200 250

I=R+G+B

B

(2)

R r=--1·255

Fig. 4.a. BR projection ofRGB space for a single healthy mushroom image.

G

g= 1·255 250 -F=='F"==;====;====r:::;::;~~

b=

ISO

B

1·255

200 + - - - + - - - - + - - - + _ : : +---+----+-"--7.,.....~--+--__H

r+g+ b = 255

o

(3)

100 +---+----:::;JC"R'f"";---+---t---+l

did not provide satisfactory result. Cluster analysis performed on the nonnalised images generally classified the diseased spots correctly but problems which are similar to the ones in the case of L*a*b* normalisation occurred.

SO + - - - - ' + - - - + - - - + - - - + - - _ _ H O+---+-----t-----t----f--__+J SO 250 o 100 ISO 200

B

Fig. 4.b. BG projection ofRGB space for a single healthy mushroom image.

3.4 Vectorial normalisation

250

According to the known trend of the colour variation determined by the trendline equation or the "white" and "brown" endpoints more effective vectornormalisation method can be introduced. The method is represented in Fig. 6.

200 ISO

=: 100 SO

Blue

0 0

SO

• healthy mushroom

100

B

ISO

• brown blotch

200

250

trendlinc ofhealthy

p

I

Fig. 5. Colour points of the diseased mushroom surface (brown blotch) with the averaged trendline of the healthy mushroom colour points.

rincipal axis ofthe colour points of healthy mushroom

Plotting the image of a diseased mushroom (Fig. 5.) it can be seen that the pixels of the diseased spots (brown blotch) form a well distinguishable, separated assembly which runs parallel with the principal axis. The variance of the data is practically produced by the distribution along the principal axis, in the other directions which are perpendicular to the

R

Fig. 6. Base vectors used for the vectorial normalisation.

102

In order to increase the selectivity logistic type transformation function (Fig. 7.) was used for each component.

The transformation of the colour components of each pixels belonging to the mushroom image is based on the average "white point" (A[R.G,B)) and ''brown point" (B[R,G,B)) calculated analysing several healthy or naturally discoloured images.

The same cluster analysis which provided insufficient result for the original images was applied for the images of the diseased mushrooms which were transformed by the above described vectorial normalisation method. The result given by the cluster analysis was compared to the original diseases by an expert panel. By the sensory evaluation of the panel the cluster analysis applied for the tutorial samples (see Fig. 8.a.b.c.) provided good result.

The vectors a and b are pointing to A and B endpoints respectively. The direction of the principal axis is determined by the (4)

vector equation and (5)

is the unit vector of the principal axis.



For each pixel P is the colour point of the pixel in the original RGB space and PI (pointing to this P) is the vector to be transformed. The vector

PI '= PI -a is pointing to P from

Pl

(6)

A. and

= V I X (PI 'xv 1)

Fig. 8.a. Result of the cluster analysis for vectorially normalised image (original: Fig. l.a.); the cluster for the ginger blotch.

(7)

is perpendicular to the principal axis and pointing from the axis to the P colour point. Therefore, Pz represents information only about the distance of P from the axis and tIle information of the intensity is eliminated. The components of the normalised colour vector (Pz) are parameters of relatively small values (generally in the range of -50 .. +50). Therefore, it is necessary to standardise them that is to transform the components to the range of 0... 255.

. ~

..

.... .

c

i

E o

...

"

~

r

'0

]"

1
·100

/

f

/

..../

.-

0

.

Fig. 8.b. Result oftbe cluster analysis for vectorially normalised image (original: Fig. l.b.); the cluster for the brown blotch.

,..J -so

.

so

Vectoc-nonnalised colour c~eDt

100

Fig. 7. Transformation function for vectorially normalised colour components.

103

Gandy, D. G. (1967). The epidemiology of bacterial blotch of the cultivated mushroom. Report Glass-house Crops Research Institute, J966, 150-154.

,•

Heinemann, P.R; Huges, R; Morrow, C.T.; Sommer rn, RI.; Beelman, RB.; Wuest, P.I (1994). Grading of mushrooms using a machine vision system. Transactions of the ASAE, Vol. 37(5), 1671-1677. van Loon, P. C. C. (1996). Het bepalen van het ontwikkelingsstadium bij de champignon De met computer beeldanalyse. Champignoncultuur, 40(9), 347-353.

Fig. 8.c. Result of the cluster analysis for vectorially nonnalised image (original: Fig. 1.c.); the cluster for the dactylium disease.

Nair, Practically, the cluster analysis classified the diseases in the vectorially normalised images and there was no misclassification (neither missing spots of the disease nor mechanically damaged parts were classified as disease).

N.G. (1974). Methods of control for bacteriological blotch disease of the cultivated mushroom with special reference to biological control. Mushroom Journal, 16, 140-144.

Reed, IN.; Crook, S. and He, W. (1995). Harvesting mushrooms by robot. In: Science and Cultivation of Edible Fungi (Elliott, Bd.), pp. 385-391. Balkema, Rotterdam.

4. CONCLUSIONS Methods were tested to recognise bacterial disease caused discoloration in mushroom images recorded by machine vision system. Vectorial nonnalisation method was developed to decrease the effect of the natural discoloration of the mushroom surface and increase the differences in the image caused by disease.

Tolaas, A G. (1915). A bacterial disease of cultivated mushrooms. Phytopathology, 5, 5154. Truppel, I; Herold, B. (1996). Bedentung von Licht und Farbe fUr die Qualitatbeurteilung von Friichten. Bornimer Agrartechnische Berichte, Heft 11, 61-73.

The advantages of the developed technique are: - it is sensitive for the diseases tested so able to recognise them; - it provides a quantitative measure for the stage and the area of the disease.

Wong, W.C.; Fletcher, IT.; Unsworth, B.A; Preece, T.F. (1982). A note on ginger blotch, a new bacterial disease of the cultivated mushroom, Agaricus bisporus. Journal of Applied Bacteriology, 52, 43-48.

Applying the methods developed on the basis of the learning samples a new set of images has to be used as test material to verify the efficiency of the classification algorithms. Further aim could be to distinguish the different diseases or disease groups from each other.

5. ACKNOWLEDGEMENT

The authors wish to thank to Ralph Noble and others at Horticultural Research Institute, WeUesbourne, UK for providing the diseased mushrooms to perform this work.

REFERENCES Berendse, H. (1984). Attitudes to mushrooms revealed in bureau survey. Supplement to the Fruit Trades Journal, November 9.

104