-
Notifications
You must be signed in to change notification settings - Fork 17
Examples
In this example, we show how to read images from a directory, label the images in classes, extract features, select features, select a classifier and evaluate the performance in only 12 lines! see Balu Code. See methodology in this paper.
See how can be used this 10-line code to design automatically a computer vision system to detect faces. In the dataset, there are 60 faces and 200 no-faces. Using only LBP features, Balu is able to select 15 features and a classifier with a performance of 95% validated with cross-validation (warning: the 95% is achieved in this data set, no warranty for other data sets) see Balu Code
In this example, we show how to detect pen tips in pencil cases using a tracking algorithm see Balu Code. Details of the method are published in this paper and video. If you want to use the graphic user interface shown in this video, execute the command Btr_gui
and load the file pencase.mat.
With only this command Bio_segshow('testimg1.jpg')
you can obtain this figure. In addition, you can test any segmentation algorithm using simple commands like the followings bellow. Details of the method are published in this paper.
I = imread('testimg2.jpg');
Bio_segshow(I,'Bim_segpca');
or
R = Bim_segpca(I);
imshow(R)
Try this command to segment in this image the sky, the clouds and the palm:
I = imread('testimg9.jpg');
Bim_segkmeans(I,3,1,1);
With only the following commands you can segment the well-known rice image of Matlab:
I = imread('rice.png');
figure;imshow(I)
[F,m] = Bim_segmowgli(I,[],40,1.5);
figure;imshow(F,[])
In this example, you can see how welding defects can be detected using sliding windows. The example selects 100 'no-defects' and 100 'defects' from a training image (where the ideal segmentation is apriori known). Afterward, LBP features are extracted and an LDA classifier is trained using SFS selected features. Finally, the trained classifier is used to segment a test image see Balu Code. Details of the method are published in this paper.
Sometimes you need to separate certain objects of an image, and no segmentation approach works fine. Try the function Bim_regiongrow
with this image, it is easy for example to separate the pen tips using this tool.
If you want to calibrate your computer vision system in order to process Lab color images (see our paper), first you have to estimate the parameters of the model M that converts from RGB to Lab* using the function Bim_labparam
, and second you can convert an RGB image X using the command:
Y = Bim_rgb2lab(X,M);
if you don't want to calibrate the computer vision system you can use the theoretical conversion implemented in the function Bim_rgb2lab0
.