after if condition the value is not assigning, the default value 255 is coming
Show older comments
% seeded region growing algorithm %
clear all; clc;
I = imread('7.jpg');
Is = imresize(I,[256 256]);
Ig = rgb2gray(Is);
impixelinfo(imshow(Ig));
% determine how many clusters for an image %
c1 = 300; c2 = 500; c3 = 600;
%determine how many seed points u reqire%
p1 = 228;
p2 = 198;
p3 = 100;
%difference of pixel values of seed point to neighbouring pixels%
for i =1:256
for j =1:256
if abs(p1 - Ig(i,j)) <= 5
Ig(i,j) = 300;
elseif abs(p2 -Ig(i,j)) <= 5
Ig(i,j) = 600;
else
Ig(i,j) = 700;
end
end
end
Accepted Answer
More Answers (0)
Categories
Find more on Image Filtering and Enhancement in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!