Component Name: Author: Kirsch edge map M. Makridis (makridis@iti.gr) Language: C/C++ Prerequisites: - OpenCV 2.1 or higher (latest 2.3.1) - http://opencv.willowgarage.com/wiki/ Description: This component contains a function required for calculating Kirsch edge strength map Ref: R. Kirsch, “Computer determination of the constituent structure of biological images,” Computers and Biomedical Research, vol. 4, pp. 315–328, 1971 Functions vector<vector<int>> ApplyKirsch: This function calculates Kirsch edge strength map Input parameters: vector<vector<int>> SrcData: int Bckgr: Background color. In cases of sherd classification (the reason of Kirsch implementation) a background value is needed in order to discard background pixels from calculations. In case of other problem background can be set to a random negative value (disarm it). int bh: Image height int bw: Image width Output parameter: vector<vector<int>>: A 2D vector in the size of the corresponding image. The vector contains edge strength values normilized from 0 (dark - strong) to 255 (white - weak). Theory Kirsch edge map: Kirsch edge map has the dimensions of the sherd and each pixel value corresponds to the edge strength of the pixel. Similarly to contrast feature, kirsch edge map can lead to misclassification in non-uniformly textured images. Kirsch edge detection algorithm implementation is summarized in the next paragraph. Kirsch edge detection is based on image filtering with eight masks. Kirsch masks detect edges in horizontal and vertical directions, 45, 135, 225 and 315 degrees angles. Kirsch eight masks are defined as follows: −3 −3 3 [−3 0 −3] , 5 5 5 −3 −3 3 [5 0 −3] , 5 5 −3 5 [5 5 −3 3 0 −3] , −3 −3 5 5 3 [5 0 −3] , −3 −3 −3 (1) 5 5 5 [−3 0 −3] , −3 −3 −3 −3 5 5 [−3 0 5 ], −3 −3 −3 −3 −3 5 [−3 0 5] , −3 −3 5 −3 −3 [−3 0 −3 5 −3 5] 5 For each pixel of the sherd image the largest absolute value is considered as pixel’s edge value. In the following figure, an example of Kirsch edge map is illustrated. (a) (b) Kirsch edge map for a single sherd view