From: Vassilis on
"Kenneth Galea" <k.galea(a)hotmail.com> wrote in message <hh0cec$1qr$1(a)fred.mathworks.com>...
> ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <5588c2b2-4dd0-4583-bfa0-125efafc56c0(a)3g2000vbp.googlegroups.com>...
> > Kenneth:
> > Again you're working with area. If you want area, fine. But you
> > first said that you wanted the outer perimeter. No I didn't mean
> > MajorAxisLength. I said the "length of the perimeter" and it you
> > examine the regionprops things you can ask for you will see that
> > Perimeter is one of the things listed, but it is the "length" of the
> > perimeter, not the "coordinates" of the perimeter that it gives you.
> > That's why I said to use bwboundaries instead - it WILL give you the
> > actual perimeter (its coordinates), not just it's length.
> >
> > If your objects have holes in them and you don't want the perimeters
> > of the interior holes, then just fill your binary image with imfill()
> > before calling either bwboundaries() or regionprops().
> >
> > Finally, bwperim() is a function that may interest you (but I doubt
> > it).
> >
> > Let me know what parts of my demo are difficult to understand - I can
> > try to make the comments more verbose and explanatory.
> > Regards,
> > ImageAnalyst
> Sorry to ask but I'm really new here and I need to attach an image in order to explain myself better. Is there a way to make this?
> Thanks
If i am right your image (A) is binary with only three connencted components.
you want the outer perimeter of each component.
try this:
B=imfill(A, 'holes');
C=B-imerode(B,ones(3));
From: ImageAnalyst on
Here are some options to upload:
http://www.imageshack.us/
http://www.flickr.com/
http://picasaweb.google.com
http://drop.io/

drop.io is really easy. No account creation necessary.
For example here's an illusion I uploaded:
http://drop.io/ia122409/media

You can find more if you do a web search for "free image hosting."
From: Kenneth Galea on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <bb47f691-adcf-4561-9a66-68a56f249225(a)3g2000vbp.googlegroups.com>...
> Here are some options to upload:
> http://www.imageshack.us/
> http://www.flickr.com/
> http://picasaweb.google.com
> http://drop.io/
>
> drop.io is really easy. No account creation necessary.
> For example here's an illusion I uploaded:
> http://drop.io/ia122409/media
>
> You can find more if you do a web search for "free image hosting."
Check this link
http://drop.io/keep_outer_objects_only#

As explained I need only the square and the big red cirlce only to be displayed. Also my background is white (not black) while my foreground (objects are black not white). This link shows my current stage.
Thanks for your help
From: Vassilis on
i tried this:
A=imread('keep_outer_obj.jpg');
Ag = rgb2gray(A);
A1 = imclose(255-Ag,ones(3));
A2=im2bw(A1);
A3=imfill(A2,'holes');
A4= A3-imerode(A3,ones(3));
A5=imdilate(A4,ones(3));
[x y]=find(A5>0);
C=uint8(ones(size(A))*255);
for ii=1:length(x)
C(x(ii),y(ii),:) = A(x(ii),y(ii),:);
end

is the image C what you want?
From: ImageAnalyst on
OK, then follow this procedure
1. convert to monochrome by using rgb2gray or by taking one of the
three color channels.
Then like I said before
2. threshold
3. imfill
Now you're done! I think - well... you didn't really say what you
want to do after this. You said only that you "need" or "want to
keep" the region inside the outer perimeter. Thresholding and imfill
will do that for you. Now, if you want to make some kinds of
measurements after that, you can do:
4. label - either bwlabel or bwconncomp
5. regionprops
6. Filter blobs according to some property using ismember() to get a
"keeper" subset of blobs
It should be less than ten lines or so. Post your code if you run
into difficulties.