2.5

2.5 | 2 ratings Rate this file 84 Downloads (last 30 days) File Size: 3.98 KB File ID: #33592

image segmentation based on Markov Random Fields

by lin

 

02 Nov 2011

I have written codes for image segmentation based on Markov Random Fields.

| Watch this File

File Information
Description

The file includes two parts,main_seg and 7 functions. Test image maybe any image of Matlab.

MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (5)
22 Nov 2011 Yunjin Chen

what's the matter?

22 Nov 2011 Yunjin Chen

Error in ==> NeiX at 2
[s,t,K]=size(X);

??? Output argument "XN" (and maybe others) not assigned during call to "C:\Users\chen\Documents\MATLAB\Markov
segmentation\NeiX.m>NeiX".

Error in ==> EnergyOfLabelField at 4
Nei8=imstack2vectors(NeiX(segmentation));

Error in ==> ICM at 11
    E1=EnergyOfLabelField(segmentation,potential,width,height,class_number);

Error in ==> main_seg at 9
seg=ICM(I,class_number,potential,maxIter);

25 Jan 2012 Tai Fei  
08 Feb 2012 Sk Massich

the output of NeiX, XN is not assigned.

Neix Function is supposed to assign the potential of a click being well classified depending on its neighbors.

Xu, Xur, Xr, Xdr, Xd Xd1 and X1 store the neighbors labels. Although there's NO comment at all which makes things unlikely to be properly solved,a possible solution is adding a potential function such as the ratio of coincident neighbors with the central pixel.

XN=sum(cat(3,Xu1==X,Xu==X,Xur==X,Xr==X,Xdr==X,Xd==X,Xd1==X,X1==X),3)/8;

However the result obtained is far from what I was expecting.

02 Apr 2012 Hossein

Hi there
How can I understand this code and run it?

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
image segmentation markov lin 03 Nov 2011 10:33:45
image segmentation markov Yunjin Chen 22 Nov 2011 10:56:46
image segmentation markov Li Cheng 01 Dec 2011 09:05:08
image segmentation markov Xin 23 Feb 2012 22:19:59
image segmentation markov Hossein 02 Apr 2012 21:40:45

Contact us at files@mathworks.com