Detecting Object in an Image

1. How to detect an object in an image?
Determining the features from the object that you want to detect is the key. The feature in this case is something that differentiates the object from others, such as color, shape, size, etc…

2. What are the techniques for object detection?
The image processing techniques such as morphology or color processing usually did this job. A simple example in MATLAB® of detecting ‘white rabbit’ is shown as follow, in this case, ‘color’ is the feature used to distinguish the white rabbit from other:

% Original Image
S = imread('pic3b.jpg');

% Gray scale image
S2 = rgb2gray(S);

% Find the white color
S3 = S2>180;

% Morphology technique, image erosion to erase the unwanted components
se = strel('line',10,90);
S4 = imerode(S3,se);
se = strel('line',10,0);
S4 = imerode(S4,se);

% Labeled the component(s), and plot the centroid on the original image
S5 = bwlabel(S5);
hold on;plot(mean(y),mean(x),'r*')

More information of image processing techniques can be found by searching "morphology", "morphological" from the search engine or the google search bar at the right hand site of this page.

* MATLAB® is the registered trademarks for The MathWorks, Inc