Info

この質問は閉じられています。 編集または回答するには再度開いてください。

I need region based segmentation code urgently

5 ビュー (過去 30 日間)
komal kella
komal kella 2017 年 7 月 12 日
閉鎖済み: Walter Roberson 2017 年 7 月 12 日
% 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);

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by