From: saurabh pandey on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <2904bdb7-d633-492c-9b1d-271251c80bb5(a)i28g2000yqa.googlegroups.com>...
> On Jul 7, 2:36 am, "saurabh pandey"
> > now for this particular image i can fill the holes by using imfill function,but if i have another images. it doesn't work so efficiently.how can i do this for cameraman image or any other image.
> ----------------------------------
> You might have to close up the gaps in the edges with imclose().

thank you very very much for your support.
From: saurabh pandey on
"saurabh pandey" <sathiya_saurabh(a)yahoo.co.in> wrote in message <i1a70n$jbl$1(a)fred.mathworks.com>...
> ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <2904bdb7-d633-492c-9b1d-271251c80bb5(a)i28g2000yqa.googlegroups.com>...
> > On Jul 7, 2:36 am, "saurabh pandey"
> > > now for this particular image i can fill the holes by using imfill function,but if i have another images. it doesn't work so efficiently.how can i do this for cameraman image or any other image.
> > ----------------------------------
> > You might have to close up the gaps in the edges with imclose().
>
> thank you very very much for your support.




hello sir
i want to select some particular objects in image to segment them. so i start using roipoly.it gives a mask.now how can i use this mask to perform my morphological segmentation in that selected portion(for example i take coins.png.i select 4 coins using roipoly.now how can i go for further morphological segmentation in that selected area)..
thank you very much..
From: us on
"saurabh pandey" <sathiya_saurabh(a)yahoo.co.in> wrote in message <i1a9qt$78i$1(a)fred.mathworks.com>...
> "saurabh pandey" <sathiya_saurabh(a)yahoo.co.in> wrote in message <i1a70n$jbl$1(a)fred.mathworks.com>...
> > ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <2904bdb7-d633-492c-9b1d-271251c80bb5(a)i28g2000yqa.googlegroups.com>...
> > > On Jul 7, 2:36 am, "saurabh pandey"
> > > > now for this particular image i can fill the holes by using imfill function,but if i have another images. it doesn't work so efficiently.how can i do this for cameraman image or any other image.
> > > ----------------------------------
> > > You might have to close up the gaps in the edges with imclose().
> >
> > thank you very very much for your support.
>
>
>
>
> hello sir
> i want to select some particular objects in image to segment them. so i start using roipoly.it gives a mask.now how can i use this mask to perform my morphological segmentation in that selected portion(for example i take coins.png.i select 4 coins using roipoly.now how can i go for further morphological segmentation in that selected area)..
> thank you very much..

a hint:
- use the mask returned by ROIPOLY to carve out your objects...
- use BWLABEL to identify your objects...
- use REGIONPROPS to compute your objects' characteristics...

us
From: Image Analyst on
"saurabh pandey" <sathiya_saurabh(a)yahoo.co.in> wrote in message <i1a9qt$78i$1(a)fred.mathworks.com>...
> hello sir
> i want to select some particular objects in image to segment them. so i start using roipoly.it gives a mask.now how can i use this mask to perform my morphological segmentation in that selected portion(for example i take coins.png.i select 4 coins using roipoly.now how can i go for further morphological segmentation in that selected area)..
> thank you very much..
------------------------------------------------------------
Did you see my code:
http://www.mathworks.com/matlabcentral/fileexchange/25157-blobsdemo
It finds the coins, measures them all, and extracts each to a separate subimage.
Basically you can use roipoly() or (my preference) roipolyold() to get the user drawn polygon, then turn it into a mask with poly2mask().
maskImage = poly2mask(xCoords, yCoords, rows, columns);
Then multiply the mask by the image to zero out the stuff outside the mask (or inside).
maskedImage = grayImage .* uint8(maskImage);
Then just do the usual threshold (preceded by morphological operations if that is what you want to do), bwlabel(), and regionprops().
binaryImage = maskedImage > thresholdValue;
labeledImage = bwlabel(binaryImage, 8); % Label each blob so we can make measurements of it
% Get all the blob properties. Can only pass in originalImage in version R2008a and later.
blobMeasurements = regionprops(labeledImage, grayImage , 'all');
From: saurabh pandey on
"Image Analyst" <imageanalyst(a)mailinator.com> wrote in message <i1ar7l$nfj$1(a)fred.mathworks.com>...
> "saurabh pandey" <sathiya_saurabh(a)yahoo.co.in> wrote in message <i1a9qt$78i$1(a)fred.mathworks.com>...
> > hello sir
> > i want to select some particular objects in image to segment them. so i start using roipoly.it gives a mask.now how can i use this mask to perform my morphological segmentation in that selected portion(for example i take coins.png.i select 4 coins using roipoly.now how can i go for further morphological segmentation in that selected area)..
> > thank you very much..
> ------------------------------------------------------------
> Did you see my code:
> http://www.mathworks.com/matlabcentral/fileexchange/25157-blobsdemo
> It finds the coins, measures them all, and extracts each to a separate subimage.
> Basically you can use roipoly() or (my preference) roipolyold() to get the user drawn polygon, then turn it into a mask with poly2mask().
> maskImage = poly2mask(xCoords, yCoords, rows, columns);
> Then multiply the mask by the image to zero out the stuff outside the mask (or inside).
> maskedImage = grayImage .* uint8(maskImage);
> Then just do the usual threshold (preceded by morphological operations if that is what you want to do), bwlabel(), and regionprops().
> binaryImage = maskedImage > thresholdValue;
> labeledImage = bwlabel(binaryImage, 8); % Label each blob so we can make measurements of it
> % Get all the blob properties. Can only pass in originalImage in version R2008a and later.
> blobMeasurements = regionprops(labeledImage, grayImage , 'all');

thanks for your response. i have R2007b version of matlab.so i cant run your code.
suppose i am doing like this.

my code
%calculte area in selected rectangle.
I = imread('coins.png'); %-- load the image
m = zeros(size(I,1),size(I,2)); %-- create initial mask
%m(111:222,123:234) = 1;
imshow(I)
r2=getrect
m(r2(2):r2(2)+r2(4), r2(1):r2(1)+r2(3))=1;
figure,imshow(m)



L=bwlabel(I);
STATS=regionprops(L,'Area');
disp('area using regionprops')
s=[STATS.Area];
w=sum(s)
it will calculate area of whole image i think.how should it be so that it will calculate area in selected rectangle.
or how can this be done by using roipoly where each points selected by user manually and it will do further processsing in that selected portion?
i am unable to understand how to do it.please help.
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5
Prev: mse
Next: UDP communication with dynamic server port