Edge-based Approach in Object Boundary. Detection on Multiclass Fruit Images. Ema Rachmawati, Masayu Leylia Khodra, Iping Supriana. School of Electrical ...
Edge-based Approach in Object Boundary Detection on Multiclass Fruit Images
Ema Rachmawati, Masayu Leylia Khodra, Iping Supriana School of Electrical Engineering and Informatics, Institut Teknologi Bandung
Object boundary a powerful shape representation
the objects in the image are recognized based on the outline of two dimensions of the objects
extracting the object boundary automatically using a computer with a result that is consistent with human perception is very difficult. a quantitative evaluation of five edgebased contour detection algorithm on multiclass fruit images.
BSD500 dataset
Overview • The importance of contour • The aims • Edge based approach • Canny edge detector, Gaussian filter based, Sobel operator, Prewitt operator, Otsu’s thresholding & contour tracing
• Contour evaluation • Direct pixel comparison • Chamfer matching
The importance of Contour/ Object Boundary • Technically, the object in the image consists of components which are composed of interconnected pixels, • therefore the detection of components of the image is the first thing that should be done. • When the object has been separated from the background, the object should be identified. • For further purposes, the contours (or object boundaries) of the components are often a useful resource for identifying objects.
• Humans recognize objects based on the outline of two dimensions of the object, • so that the contour attributes should play an important role in object recognition [Xu et al. 2012]
Contour Detection • Contour detection aims to quantize the existence of a boundary at a particular location in the image. • Contour is a cue that has not been sufficiently explored for the purpose of object recognition. • This is due to the contour extraction process automatically using a computer with a result that is consistent with human perception is very difficult [Arbeláez et al. 2011]
The aims • This research aims to detect the presence of object contour using the edge based approaches. • Quantitative evaluation of the contours generated from each algorithm is conducted using direct pixel comparison and chamfer matching. • The algorithm being compared namely, Canny edge detection, gradient based (Sobel and Prewitt), Gaussian filter, and blob detection (connected component labelling).
•Contour detection can be done by using three approaches, namely • Region-based approach, • Edge-based approach and oriented lines, • Hybrid approach [Papari and Petkov 2011]
Edge-based Contour Detection • Basically, boundary/contour detection is different with edge detection. • A boundary is a contour in image plane which represents the change of pixel ownership of an object to another object.
• Instead, the edge is generally defined as an abrupt change in low level of image attributes, such as color or brightness level. Based on these characteristics, edge detection is one of the lowlevel technique that is generally used for boundary detection [Martin et al. 2004]
• Canny detector [7] modelled edge as sharp discontinuities in brightness channel, added non-maximum suppression, and hysteresis thresholding.
• Besides edge detection, low-level gradient information can be used to generate contours, such as the use of a Gaussian filter, Sobel and Prewitt operator [8]. Contour is detected by applying a certain threshold value against the size of gradient in pixel. Parameter tuning should be done on the use of Gaussian filter, Sobel, and Prewitt. Therefore, the result presented in this document is the best detection results. • As a comparison, a simple thresholding technique (i.e. Otsu thresholding) is also used to detect the presence of contours. The existence of contours in the binary image as a result of thresholding process, was detected using connected component labeling algorithm. This algorithm detects a number of closed contours in an image or often referred to as blob.
Dataset
Fruit images from RGBD Object Dataset [Lai et al 2011]
7 categories, 32 instances, 21284 images
13
Parameter Setting • Canny edge detector • sigma = -1, blur radius = 5, t_low = 0.04 and t_high = 0.4
• Sobel operator • threshold for gradient magnitude to be considered as edge is 60
• Prewitt, • threshold for gradient magnitude to be considered as edge is 150
• Gaussian, • sigma = -1 and blur radius = 10.
Quantitative Evaluation • comparing the similarity of detected contour with the contour on the ground-truth (further the term used is template). • Contour template was obtained from applying the Canny edge detection on a mask image that has been provided by the dataset [11]. • The measurement was performed using two ways, namely • direct pixel comparison, • chamfer matching
Direct Pixel Comparison • The result of contour detection is compared with template image, by counting the number of edge pixels of detected contour coincide with the edge pixels of the template. • Both the target image and the template image were in the form of a binary image. σ 𝑐𝑜𝑟𝑟𝑒𝑐𝑡 𝑒𝑑𝑔𝑒 𝑝𝑖𝑥𝑒𝑙 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 = σ 𝑝𝑖𝑥𝑒𝑙 𝑜𝑓 𝑑𝑒𝑡𝑒𝑐𝑡𝑒𝑑 𝑐𝑜𝑛𝑡𝑜𝑢𝑟
𝐹1 = 2 ×
σ 𝑐𝑜𝑟𝑟𝑒𝑐𝑡 𝑒𝑑𝑔𝑒 𝑝𝑖𝑥𝑒𝑙 𝑅𝑒𝑐𝑎𝑙𝑙 = σ 𝑒𝑑𝑔𝑒 𝑝𝑖𝑥𝑒𝑙 𝑖𝑛 𝑡ℎ𝑒 𝑡𝑒𝑚𝑝𝑙𝑎𝑡𝑒
𝑝𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 × 𝑟𝑒𝑐𝑎𝑙𝑙 𝑝𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 + 𝑟𝑒𝑐𝑎𝑙𝑙
Direct Pixel Comparison
σ 𝑐𝑜𝑟𝑟𝑒𝑐𝑡 𝑒𝑑𝑔𝑒 𝑝𝑖𝑥𝑒𝑙 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 = σ 𝑝𝑖𝑥𝑒𝑙 𝑜𝑓 𝑑𝑒𝑡𝑒𝑐𝑡𝑒𝑑 𝑐𝑜𝑛𝑡𝑜𝑢𝑟
Direct Pixel Comparison
σ 𝑐𝑜𝑟𝑟𝑒𝑐𝑡 𝑒𝑑𝑔𝑒 𝑝𝑖𝑥𝑒𝑙 𝑅𝑒𝑐𝑎𝑙𝑙 = σ 𝑒𝑑𝑔𝑒 𝑝𝑖𝑥𝑒𝑙 𝑖𝑛 𝑡ℎ𝑒 𝑡𝑒𝑚𝑝𝑙𝑎𝑡𝑒
Direct Pixel Comparison
𝑝𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 × 𝑟𝑒𝑐𝑎𝑙𝑙 𝐹1 = 2 × 𝑝𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 + 𝑟𝑒𝑐𝑎𝑙𝑙
Samples of results
Direct Pixel Comparison • Advantage: • Easy to compute
• Disadvantage • Not tolerance to small shift, though the overall contour is correct
Chamfer Matching Chamfer matching uses distance transform to localize the corresponding maximum number of points between the target image I and template image R (I and R are binary images). This technique uses the distance transform accumulated value as the score of a match Q. In each position (𝑟, 𝑠) from template R, the distance value of foreground pixel is accumulated, with formula 1 𝑄 𝑟, 𝑠 = ∙ 𝐾
𝐷(𝑟 + 𝑖, 𝑠 + 𝑗)
𝑖,𝑗)𝜖𝐹𝐺(𝑅
Distance transform: recorded the distance of each position (𝑢, 𝑣) on target image I to closest foreground pixel
𝐾 = 𝐹𝐺(𝑅) is the number of foreground pixels in the template R; 𝐷 𝑝 is distance transform in position p 𝑑𝑀 𝑝, 𝑝′ = 𝑢 − 𝑢′ + 𝑣 − 𝑣′
Distance value = zero a perfect match
Chamfer Matching Canny: 2.27 Gaussian: 2.86 Blob: 3.38 Prewitt: 5.57 Sobel: 7.53
Samples of incorrect results
Canny
Conclusion • From our experiment we found that the using of direct pixel comparison to evaluate the detected contour was not suitable. As a comparison, we use chamfer matching to evaluate the detected contour.
• Overall, based on the evaluation result, it can be seen that the canny edge detector is better than other algorithm presented in this paper, in detecting contour on color images, although some improvements should be considered in order to get better results.
THANK YOU