Skip to main content

[JAI] Warp and ROI

7 replies [Last post]
Anonymous

Hi list,
I have just a simple question.
I am working with perspective warp in order to georectify some beach
surveying images. I managed to make perspective warp work perfectly,
but right now I am trying to optimized things by making it work only
on a chosen are of the original image (a ROI).
Is there any way to associate a ROI to a warp JAI operation?

Simone.

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Brian Burkhalter

What happens to the area outside the ROI? Is it devoid of data?

Brian

On Sun, 13 Nov 2005, simone giannecchini wrote:

> Hi list,
> I have just a simple question.
> I am working with perspective warp in order to georectify some beach
> surveying images. I managed to make perspective warp work perfectly,
> but right now I am trying to optimized things by making it work only
> on a chosen are of the original image (a ROI).
> Is there any way to associate a ROI to a warp JAI operation?
>
> Simone.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> For additional commands, e-mail: interest-help@jai.dev.java.net
>
>

----------------
Brian Burkhalter
Java Multimedia, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

simone giannecchini

I am trying to prevent the WARP operation from working on certain
areas of the unrectified image, in order to speed up the rectification
step.
Simply using a rectangle (that by the way I am already using) does not
help much because often the camera is somehow aligned with a diagonal
of the unrectified image, therefore by using a rectangle I would still
include a lot of unused pixels which, during the WARP operation, lead
to waste of computation reasources.

I hope I made myself clear!

Simone.

On 11/14/05, Brian Burkhalter wrote:
> What happens to the area outside the ROI? Is it devoid of data?
>
> Brian
>
> On Sun, 13 Nov 2005, simone giannecchini wrote:
>
> > Hi list,
> > I have just a simple question.
> > I am working with perspective warp in order to georectify some beach
> > surveying images. I managed to make perspective warp work perfectly,
> > but right now I am trying to optimized things by making it work only
> > on a chosen are of the original image (a ROI).
> > Is there any way to associate a ROI to a warp JAI operation?
> >
> > Simone.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> > For additional commands, e-mail: interest-help@jai.dev.java.net
> >
> >
>
> ----------------
> Brian Burkhalter
> Java Multimedia, Imaging, and Graphics
> Sun Microsystems, Inc.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> This email message is for the sole use of the intended recipient(s)
> and may contain confidential and privileged information. Any
> unauthorized review, use, disclosure or distribution is prohibited.
> If you are not the intended recipient, please contact the sender by
> reply email and destroy all copies of the original message.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> For additional commands, e-mail: interest-help@jai.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

Brian Burkhalter

Well I think if the source image is untiled the only way you can reduce the
computation time is by inserting a "Crop" operation in the chain before the
"Warp". In order for the geometric transformation to remain correct in this
case you would need to change the parameters of the Warp object you are
passing to the operation.

Brian

On Mon, 14 Nov 2005, simone giannecchini wrote:

> I am trying to prevent the WARP operation from working on certain
> areas of the unrectified image, in order to speed up the rectification
> step.
> Simply using a rectangle (that by the way I am already using) does not
> help much because often the camera is somehow aligned with a diagonal
> of the unrectified image, therefore by using a rectangle I would still
> include a lot of unused pixels which, during the WARP operation, lead
> to waste of computation reasources.
>
> I hope I made myself clear!

----------------
Brian Burkhalter
Java Multimedia, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

simone giannecchini

I am already doing the crop and the tiling but in some cases is not enough.
What I am trying to understand is if there is a way to set up a ROI
like I can do for statistics operators but for the WARP operator in
order to tell the WARP operator "do not warp this part of the original
image, just set the destination to the background value".
It is worth to point out that ROI is not a simple rectangle (I am
being obvious I now!!!) but it can be a more complex shape, like a
general linear ring.

Simone.

On 11/14/05, Brian Burkhalter wrote:
> Well I think if the source image is untiled the only way you can reduce the
> computation time is by inserting a "Crop" operation in the chain before the
> "Warp". In order for the geometric transformation to remain correct in this
> case you would need to change the parameters of the Warp object you are
> passing to the operation.
>
> Brian
>
> On Mon, 14 Nov 2005, simone giannecchini wrote:
>
> > I am trying to prevent the WARP operation from working on certain
> > areas of the unrectified image, in order to speed up the rectification
> > step.
> > Simply using a rectangle (that by the way I am already using) does not
> > help much because often the camera is somehow aligned with a diagonal
> > of the unrectified image, therefore by using a rectangle I would still
> > include a lot of unused pixels which, during the WARP operation, lead
> > to waste of computation reasources.
> >
> > I hope I made myself clear!
>
> ----------------
> Brian Burkhalter
> Java Multimedia, Imaging, and Graphics
> Sun Microsystems, Inc.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> This email message is for the sole use of the intended recipient(s)
> and may contain confidential and privileged information. Any
> unauthorized review, use, disclosure or distribution is prohibited.
> If you are not the intended recipient, please contact the sender by
> reply email and destroy all copies of the original message.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> For additional commands, e-mail: interest-help@jai.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

Brian Burkhalter

I would suggest using TiledImage. For example you could use

http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/TiledImage.html#set(java.awt.image.RenderedImage,%20javax.media.jai.ROI)

with first argument equal to the Warp operation result. If your background
value is zero then you are done.

Brian

On Mon, 14 Nov 2005, simone giannecchini wrote:

> I am already doing the crop and the tiling but in some cases is not enough.
> What I am trying to understand is if there is a way to set up a ROI
> like I can do for statistics operators but for the WARP operator in
> order to tell the WARP operator "do not warp this part of the original
> image, just set the destination to the background value".
> It is worth to point out that ROI is not a simple rectangle (I am
> being obvious I now!!!) but it can be a more complex shape, like a
> general linear ring.

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

simone giannecchini

I was afraid that was the only way to do that! I hoped there was some
way to specify a ROI like using setProperty on the input image in
order to see the processing happening only on the ROI.
Anyway for anybody who has my same doubts take a look here....

http://archives.java.sun.com/cgi-bin/wa?A2=ind9908&L=jai-interest&D=0&I=...

Simone.

PS Thanks, Brian.

On 11/14/05, Brian Burkhalter wrote:
> I would suggest using TiledImage. For example you could use
>
> http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/TiledImage.html#set(java.awt.image.RenderedImage,%20javax.media.jai.ROI)
>
> with first argument equal to the Warp operation result. If your background
> value is zero then you are done.
>
> Brian
>
> On Mon, 14 Nov 2005, simone giannecchini wrote:
>
> > I am already doing the crop and the tiling but in some cases is not enough.
> > What I am trying to understand is if there is a way to set up a ROI
> > like I can do for statistics operators but for the WARP operator in
> > order to tell the WARP operator "do not warp this part of the original
> > image, just set the destination to the background value".
> > It is worth to point out that ROI is not a simple rectangle (I am
> > being obvious I now!!!) but it can be a more complex shape, like a
> > general linear ring.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
> For additional commands, e-mail: interest-help@jai.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net

Brian Burkhalter

This might also be of use:

http://archives.java.sun.com/cgi-bin/wa?A2=ind0204&L=jai-interest&P=R165...

On Tue, 15 Nov 2005, simone giannecchini wrote:

> Anyway for anybody who has my same doubts take a look here....
>
> http://archives.java.sun.com/cgi-bin/wa?A2=ind9908&L=jai-interest&D=0&I=...

----------------
Brian Burkhalter
Java Multimedia, Imaging, and Graphics
Sun Microsystems, Inc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai.dev.java.net
For additional commands, e-mail: interest-help@jai.dev.java.net