You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Morkulth <fq...@hotmail.com> on 2008/02/24 15:26:31 UTC

Filtering image outlines and contours

Hello everyone.

I am a recent user of Batik , and while enjoying it , i encounter severeal
dificulties.

I want to get from a image in SVG the outlines of VISIBLE shapes.
Example:

I have a huge yellow filled square stroked with black, wich totaly contains
a yellow smaller square stroked and filled in yellow ( not visible).

Is there an easy way of getting only the black outline of the big square
ignoring other information ( inclusive the yellow color and the outer
smaller square element) ?

The only solution i have at the moment is to convert the image to JPEG and
use countour extraction algoritms... not to bright.

I would apreciate any help on this or where to view some batik examples
because this mailing list is the only source of Batik information i have.

Kind regards, Filipe Quinaz 
-- 
View this message in context: http://www.nabble.com/Filtering-image-outlines-and-contours-tp15664700p15664700.html
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Filtering image outlines and contours

Posted by Cameron McCormack <ca...@mcc.id.au>.
Hi Filipe.

Morkulth:
> I want to get from a image in SVG the outlines of VISIBLE shapes.
> Example:
> 
> I have a huge yellow filled square stroked with black, wich totaly contains
> a yellow smaller square stroked and filled in yellow ( not visible).
> 
> Is there an easy way of getting only the black outline of the big square
> ignoring other information ( inclusive the yellow color and the outer
> smaller square element) ?
> 
> The only solution i have at the moment is to convert the image to JPEG and
> use countour extraction algoritms... not to bright.

For cases like you describe (the smaller yellow rectangle not being
visible just because it is on top of another yellow rectangle), then you
will have to use image processing techniques, at least in the general
case.  If you only have rectangles, then you could go through your
document to find them all, determine their extents, check if they
overlap, see if they have the same fill colours, etc.

You can use the convolution filter to do some edge detection, but I’m
not sure if that will give you exactly what you want.

Cameron

-- 
Cameron McCormack, http://mcc.id.au/
	xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Filtering image outlines and contours

Posted by Tonny Kohar <to...@gmail.com>.
Hi,

On Sun, Feb 24, 2008 at 9:26 PM, Morkulth <fq...@hotmail.com> wrote:
>  I am a recent user of Batik , and while enjoying it , i encounter severeal
>  dificulties.
>
>  I want to get from a image in SVG the outlines of VISIBLE shapes.
>  Example:
>
>  I have a huge yellow filled square stroked with black, wich totaly contains
>  a yellow smaller square stroked and filled in yellow ( not visible).
>
>  Is there an easy way of getting only the black outline of the big square
>  ignoring other information ( inclusive the yellow color and the outer
>  smaller square element) ?

If you only want a rectangle outline, you could get it from bbox()
from that particular element. However if you trying to get the outline
shape (can be any shape), you might need to go deep into GVT layer,
from GVT node you can call getOutline() which return the shape.

Cheers
Tonny Kohar
-- 
Sketsa SVG Editor
imagine, design, create ...
http://www.kiyut.com

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org