Detect the lean meat region in a beef steak image.
Beucher's paradigm is applied for delineating sharply the lean meat region in the beef steak image. An internal and an external marker are necessary for the filtering step of the paradigm. In this step, small regions that does not have meat are eliminated.
The gray-scale image of the beef steak is read.
1. from ia870 import * 2. 3. a = adreadgray('beef.tif') 4. adshow(a)
The input image is simplified by the application of a a small closing. The dark area (inner lean part) is closed from the fat white area.
1. b=iaclose(a,iasedisk(2)) 2. adshow(b)
External marker 1/2
The external marker is built from the detection of the complete beef region and the extraction of its internal edge. As the beef is dark, it is detected by a low value threshold. After this threshold, small residual regions are eliminated by the binary areaclose operator.
1. c = a >= 10 2. d = iaareaclose(c,200) 3. adshow(d)
External marker 2/2
The internal edge generated is 13 points thick. It is created by the residues of an erosion by a large structuring element.
1. e = iagradm(d,iasecross(1),iasebox(13)) 2. adshow(e)
The internal marker is a severe erosion of the steak. Both markers are combined by union and displayed as overlay on the gradient image.
1. f = iaero(d,iasecross(80)) 2. g = iaunion(e,f) 3. h = iagradm(b) 4. adshow(iagshow(h,g))
Constrained watershed of the gradient of the smoothed image, restricted to the internal and external markers.
1. i = iacwatershed(h,g) 2. adshow(i)
Superposition of the dilated detected contour on the original image.