This algorithm detects object contours in an image through the local derivation of neighboring pixel values. Therefore, RGB-colored micrographs are transformed to 8-bit grey value images. As the standard edge detection procedure the algorithm uses the Prewitt filter with the Prewitt operator as the kernel of this filter. This operator determines the gradient in x-direction and y-direction of the image. With the original image A the vertical and horizontal operators are
The operation * represents the 2D convolution of kernel k (the matrix in Eq. 3) and image A. Because the matrices are not continuous functions the discrete formulation of a 2D convolution is utilized:
For every pixel the algorithm calculates the gradient magnitude from both contributions in Eq. (3) as
The result is a matrix of derivative approximations for every pixel, where a threshold filter creates binary entries from the calculated magnitude values. The background is now black (0) and the found edges white (1). In Fig. 1(b) a typical result is shown. Detected edges are marked as points and stripes with a width of one pixel. A dilation of these white structures in horizontal and vertical direction, as depicted in Fig. 1c, connect the whole cell boundary (adjustable in the configuration file expansion factor for cell detection; default value: 5). In Fig. 2, the process is schematically displayed for a single point and for multiple lines. To fill enclosed areas within the cell wall outline the algorithm uses the MATLAB ® function imfill. The so detected and marked cell areas are bigger than indicated by the edge detection filter. A correction is applied by an erosion filter with a diamond-shaped structuring element of tunable size (adjustable in the configuration file factor for adjusting dilation in cell detection; default value: 2). This filter skims white pixels on the 2D-surface of the areas. The resulting detected objects render the cells in the original image, as shown clearly in Fig. 1f.
Gradient based algorithm. a The original micrograph with two rosettes, one single pRBC and multiple healthy RBC. b The Prewitt filter is applied and the threshold of the resulting gradient map displayed. c The edges from b are dilated like shown in Fig. 2. d Capsuled parts of the cells are filled. e The diamond shaped erosion filter shrinks the outline of the marked areas to a size comparable to the before detected outermost edges. f The edges are taken as outlines and plotted onto the original image for better visualization
Schematic cell boarder dilation. The single white pixel in image a gets dilated in two steps: b first in vertical direction by a factor of five (c) and this operation is applied to the dilated image in horizontal direction also with a factor of five. In d a typical segment of the binary detected edges image is shown, in e a vertical dilation of all pixels (factor five) and in f an horizontal dilation of all pixels (factor five). g The eroded white areas. The suggest outline from the top left image is now clearly visible
The advantages of this algorithm are the ability to handle a wide range of object shapes, sizes and structure without the need for an image dependent pre-processing. For images with pronounced noise a blur- or smooth-preprocessing step helps to avoid erroneous edge-detections. Since ARAM is intended to be fast, applicable to all kinds of images without significant preprocessing and without the operator input the gradient-based algorithm is used for detecting cell objects on micrographs as default detection algorithm in both above named operation modes.
Do you have any questions about this protocol?
Post your question to gather feedback from the community. We will also invite the authors of this article to respond.