You are on page 1of 7

image neg

I1=imread('00001.jpg');
figure, imshow(I1), title('negative')

convertir l'image au niveau de gris

ImNeg = rgb2gray(I);

cooccurence

offsets=[0 1;-1 1;-1 0;-1 -1];


glcm= graycomatrix(ImNeg, 'offset', offsets,'NumLevels', 16);
statsNeg = graycoprops(glcm)

statsNeg =
Contrast: [0.1465 0.2042 0.1372 0.1901]
Correlation: [0.8255 0.7569 0.8369 0.7736]
Energy: [0.3804 0.3483 0.3835 0.3577]
Homogeneity: [0.9291 0.9017 0.9324 0.9100]

VNeg=[statsNeg.Contrast,statsNeg.Correlation,statsNeg.Energy,statsNeg.Homogeneity]

VNeg = 1x16 double

0.1465 0.2042 0.1372 0.1901 0.8255 0.7569 0.8369 0.7736

image pos

I2=imread('00002.jpg');
figure, imshow(I2), title('Test 1')
convertir l'image au niveau de gris

ImT1 = rgb2gray(I2);

cooccurence

offsets=[0 1;-1 1;-1 0;-1 -1];


glcm= graycomatrix(ImT1, 'offset', offsets,'NumLevels', 16);
statsT1 = graycoprops(glcm)

statsT1 =
Contrast: [0.1160 0.1506 0.1124 0.1669]
Correlation: [0.8208 0.7660 0.8257 0.7406]
Energy: [0.4184 0.3951 0.4203 0.3850]
Homogeneity: [0.9424 0.9254 0.9439 0.9174]

VT1=[statsT1.Contrast,statsT1.Correlation,statsT1.Energy,statsT1.Homogeneity]

VT1 = 1x16 double

0.1160 0.1506 0.1124 0.1669 0.8208 0.7660 0.8257 0.7406

image test1

I3=imread('00003.jpg');
figure, imshow(I3), title('Positive')
convertir l'image au niveau de gris

ImPos = rgb2gray(I3);

cooccurence

offsets=[0 1;-1 1;-1 0;-1 -1];


glcm= graycomatrix(ImPos, 'offset', offsets,'NumLevels', 16);
statsPos = graycoprops(glcm)

statsPos =
Contrast: [0.1317 0.1986 0.0939 0.1472]
Correlation: [0.9237 0.8848 0.9453 0.9146]
Energy: [0.7315 0.7203 0.7336 0.7230]
Homogeneity: [0.9559 0.9445 0.9608 0.9502]

VPos=[statsT1.Contrast,statsPos.Correlation,statsPos.Energy,statsPos.Homogeneity]

VPos = 1x16 double

0.1160 0.1506 0.1124 0.1669 0.9237 0.8848 0.9453 0.9146

image test2

I4=imread('00011.jpg');
figure, imshow(I4), title('test2')
convertir l'image au niveau de gris

ImT2 = rgb2gray(I4);

COOCCURRENCE

offsets=[0 1;-1 1;-1 0;-1 -1];


glcm= graycomatrix(ImT2, 'offset', offsets,'NumLevels', 16);
statsT2 = graycoprops(glcm)

statsT2 =
Contrast: [0.1800 0.2696 0.1226 0.1965]
Correlation: [0.9388 0.9085 0.9582 0.9333]
Energy: [0.5395 0.5180 0.5393 0.5219]
Homogeneity: [0.9391 0.9193 0.9453 0.9256]

VT2=[statsT2.Contrast,statsT2.Correlation,statsT2.Energy,statsT2.Homogeneity]

VT2 = 1x16 double

0.1800 0.2696 0.1226 0.1965 0.9388 0.9085 0.9582 0.9333

calculer les distances

D1=pdist2(VT1,VPos,'Minkowski')

D1 = 0.6982

D2=pdist2(VT1,VNeg,'Minkowski')

D2 = 0.1137

D3=pdist2(VT2,VPos,'Minkowski')
D3 = 0.4223

D4=pdist2(VT2,VNeg,'Minkowski')

D4 = 0.4334

Commentaire: l'image test 1 et l'image negative sont presque identiques

Etape 4:

FNeg = extractLBPFeatures(ImNeg,'Upright',false)

FNeg = 1x10 single

0.0402 0.1124 0.1003 0.3770 0.5987 0.5746 0.2673 0.1394

FPos = extractLBPFeatures(ImPos,'Upright',false)

FPos = 1x10 single

0.0653 0.1789 0.1015 0.3295 0.3773 0.5559 0.3092 0.2583

FT1 = extractLBPFeatures(ImT1,'Upright',false)

FT1 = 1x10 single

0.0271 0.1038 0.0630 0.3286 0.5022 0.6294 0.2957 0.1868

FT2 = extractLBPFeatures(ImT2,'Upright',false)

FT2 = 1x10 single

0.0552 0.1605 0.1070 0.3368 0.4766 0.5670 0.3064 0.2254

D1=pdist2(FT1,FPos,'Minkowski')

D1 = 0.2454

D2=pdist2(FT1,FNeg,'Minkowski')

D2 = 0.1895

Commentaire: l'image test 1 et l'image negative sont presque identiques

D3=pdist2(FT2,FPos,'Minkowski')

D3 = 0.1433

Commentaire: l'image test 2 et l'image positive sont presque identiques

D4=pdist2(FT2,FNeg,'Minkowski')

D4 = 0.2364

I5=imread('00029.jpg');
imshow(I5), title('image5')
Im5 = rgb2gray(I5);
I6=imread('00032.jpg');
imshow(I6), title('image6')

Im6= rgb2gray(I6);
F5 = extractLBPFeatures(Im5,'Upright',false)

F5 = 1x10 single

0.0449 0.1233 0.0946 0.3620 0.5780 0.5691 0.2770 0.1728

F6 = extractLBPFeatures(Im6,'Upright',false)
F6 = 1x10 single

0.0416 0.1104 0.1040 0.3629 0.6357 0.5424 0.2543 0.1491

You might also like