Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

how to convert plot image into normal imge

Asked by senthil kumar on 9 Oct 2012

i convert an image is boundary format but it can display plot format. i am using saveas command function only display in out side of matlab .i am using imshow does not show anything.please help me how to store image in matlab readable format.

and how can i get x,y coordinate values boundary B{k}

clear;
close all;
i1=imread('76.jpg');
i1=rgb2gray(i1);
i2=im2bw(i1,.4);
i2= wiener2(i2,[5 5]);
i2=imfill(i2,'holes');
%i2=~i2;
m=bwperim(i2);figure,imshow(m);
e=length(B);
labeledImage = bwlabel(i2, 8);
blobMeasurements = regionprops(labeledImage, i1, 'all'); 
imshow(i2)
hold on
set(gcf, 'Position', get(0, 'ScreenSize'));
for k = 1:e
  boundary = B{k};
 plot(boundary(:,2), boundary(:,1), 'g', 'LineWidth', 0.2)
end

**%i get this plot format. please help how to convert into matlab readable format because i can not do next processing**

0 Comments

senthil kumar

3 Answers

Answer by Walter Roberson on 9 Oct 2012

Perhaps you want to poly2roi() ?

1 Comment

Walter Roberson on 9 Oct 2012

[x,y] coordinate values for the boundary are already in B{k} for each k.

If you want the all together in one array, but without any indication of where any of the boundaries ends, use

vertcat(B{:})
Walter Roberson
Answer by senthil kumar on 9 Oct 2012
if true
  just save separate and the object.please help me
end

0 Comments

senthil kumar
Answer by Image Analyst on 10 Oct 2012

You never defined B. It looks like it should have come from a call to bwboundaries(i2). See my tutorial for an example: http://www.mathworks.com/matlabcentral/fileexchange/25157-image-segmentation-tutorial-blobsdemo

0 Comments

Image Analyst

Contact us