Clear Filters
Clear Filters

How to save a segmented part of a image to a variable

2 views (last 30 days)
I have segmented a HSV image. All i want is to save the segmented part of the image to be saved in a variable
  2 Comments
Jamil
Jamil on 1 Jan 2015
SAME QUESTION 2 ME
I want to use the output to find the contour of the image. It shows correct out while i use 'sm[]' rather 'sm'
I used the code below ----------------
img = imread('o17.jpg');
gfrgb = imfilter(img, fspecial('gaussian', 3, 3), 'symmetric', 'conv');
cform = makecform('srgb2lab', 'whitepoint', whitepoint('d65'));
lab = applycform(gfrgb,cform);
l = double(lab(:,:,1)); lm = mean(mean(l));
a = double(lab(:,:,2)); am = mean(mean(a));
b = double(lab(:,:,3)); bm = mean(mean(b));
sm = (l-lm).^2 + (a-am).^2 + (b-bm).^2;
figure;imshow(sm,[]);
Image Analyst
Image Analyst on 1 Jan 2015
First read this and then post your question in a new discussion thread and post your image and say what you want to measure. Basically you're computing the delta E image from the mean LAB color, but I don't know how this will let you find the "contour of the image" - whatever that is (please define it in your new question).

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 25 Feb 2014
I don't know what it means. You say you have segmented it. So where is that segmented image stored if it's not in a variable? Is it just stored in thin air? Where the heck is it?

Community Treasure Hunt

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

Start Hunting!