Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Maximum Likelihood Classifier

358 views
Skip to first unread message

ahmed

unread,
Apr 21, 2005, 6:01:53 AM4/21/05
to
hi
i am working on supervised classification of remotely sensed
images(3 band). i want to extract features like water,urban
areas,land and vegetation.

this can be done by maximum likelihood classification of the images
and finding the corresponding classes.

can anybody help me in the code for this or any thing helpful.

i shall be thankful.

Bill

unread,
Aug 13, 2005, 3:19:04 PM8/13/05
to
What are you trying to do exactly?

ahmed

unread,
Aug 14, 2005, 1:38:19 AM8/14/05
to
well i want to turn the satellite image into a thematic map of
different classes like "water,urban,forest,land" etc each represented
by a different color.

Bill

unread,
Aug 14, 2005, 10:08:07 AM8/14/05
to
I have done that before. Which part of code you need?

This is the main formula after calculating the mean value and the
covariance for each training area.

for i2=1:number_of_classes;


g{i2} = double((-log(det(covariance{i2}))-(x-m{i2})))*inv
(covariance{i2})*(x-m{i2})';

end

Hope this helps

Bill

ahmed

unread,
Aug 15, 2005, 7:25:43 AM8/15/05
to
thanks for the help Bill,

but can u tell me that how u computed the covariance for the RGB
image i.e when ROI(region of intrest) is supplied to the algorithm
then how it calculates the covariance and then the likelihood for
each class.

i mean the code snippet for mean,covariance,and then the
corresponding likelihood for that ROI.

ahmed

unread,
Aug 15, 2005, 7:25:26 AM8/15/05
to

Bill

unread,
Aug 16, 2005, 5:44:26 AM8/16/05
to
Have you got the ROI's ? If yes then for each area you can reshape
the area into nX3 matrix that represenet red,green and blue, for
eaxample:
for i=1:number_of_ROI;
red=ROI(i)(:,:,1);
green=ROI(i)(:,:,2);
blue =ROI(i)(:,:,3);
rgb=[reshape(red',[],1)reshape(green',[],1)reshape(blue',[],1)];
%to reshape the matrix into thrre columns(red,green,blue).
ROI_mean=mean(rgb);
ROI_Covariance=cov(rgb);
end

Try this it might solve your problem

ahmed

unread,
Aug 17, 2005, 2:35:47 PM8/17/05
to
thanks a lot Bill, I really appericiate ur help.

Bill

unread,
Aug 19, 2005, 6:59:24 AM8/19/05
to
What technique you use to get the ROI's?

ahmed

unread,
Aug 20, 2005, 2:30:56 PM8/20/05
to
well i used the matlab function 'roipoly'

ranjini

unread,
Apr 21, 2012, 10:25:21 PM4/21/12
to
can you send me the code of this project.
Bill <billu...@yahoo.com> wrote in message <ef03...@webx.raydaftYaTP>...

bushra....@gmail.com

unread,
Sep 27, 2017, 6:02:39 AM9/27/17
to

bushr...@cs.uol.edu.pk

unread,
Oct 3, 2017, 1:44:42 AM10/3/17
to
i also need code of maximum likelihood classification on landsat images in matlab. can you send me?

m201...@gmail.com

unread,
Apr 4, 2020, 7:47:43 PM4/4/20
to
hello. I need the maximum likelihood classification code in matlab. can any one help me? I shal be thankful.
0 new messages