Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

I need region based segmentation code urgently

1 vue (au cours des 30 derniers jours)
komal kella
komal kella le 12 Juil 2017
Clôturé : Walter Roberson le 12 Juil 2017
% Demo of "Region Based Active Contours" % % Example: % seg_demo % % Coded by: Shawn Lankton (www.shawnlankton.com)
I = imread('ex.jpg'); %-- load the image m = zeros(size(I,1),size(I,2)); %-- create initial mask m(111:222,123:234) = 1; % m(333:444,345:234) = 1;
I = imresize(I,.5); %-- make image smaller m = imresize(m,.5); % for fast computation
subplot(2,2,1); imshow(I); title('Input Image'); subplot(2,2,2); imshow(m); title('Initialization'); subplot(2,2,3); title('Segmentation');
seg = region_seg(I, m, 150); %-- Run segmentation
subplot(2,2,4); imshow(seg); title('Global Region-Based Segmentation');
n=size(m);
M=n(1);
N=n(2);
MSE = sum(sum((m-seg).^2))/(M*N);
PSNR = 10*log10(256*256/MSE);
fprintf('\nMSE: %7.2f ', MSE);
fprintf('\nPSNR: %9.7f dB', PSNR);

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by