4 Noise removal
Because of atmospheric noise as well as due to motion on
conveyor belt some blurs effect comes in picture. So filtering
is required here. We checked all the filters and found that
median filter of 3X3 size is working best .its syntax is
diff_im = medfilt2 (diff_im, [3 3]);
5. Image binarisation for boundary extractionGray image is
converted to binary image by deciding a particular threshold
value. All pixels having value greater than decided threshold
value is grouped in one region and others to other region.
Corresponding syntax is
diff_im = im2bw(diff_im, threshold value);
Threshold value determination is tough job, however here we
have decided it by finding histogram plot.After binarisation,
object of focus is extracted from boundary, after that some
morphological operations are applied. These operation
increases the speed of detection as well as increase the
accuracy. There are some very small areas of pixels are
present which are of insignificant nature, so they are removed
by function „bwareaopen ()‟ command.
Its syntax is
diff_im = bwareaopen(diff_im, p)