comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Given many images, find bounding box
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Given many images, find bounding box [message #17821 is a reply to message #17632] Fri, 05 November 1999 00:00 Go to previous message
hhpt is currently offline  hhpt
Messages: 3
Registered: August 1999
Junior Member
Hi Dick,

Well, this is not correct, for example, if I havbe only one patch,
the upper left hand corner has the coordinate (1,10) (lon, lat) and the
box has lon_size = 6 and lat_size = 8

then the expected answer should be:
left = 1
right 7
top = 10
bottom = 2
but using your formular the answers would be:
left = 1
right 6
top = 10
bottom = 3

Also, it will be nice some how if it could take care of the +/- degrees
too...... seems tricky....

-- Herbert

> This is pretty straightforward, but I have to make a few assumptions:
>
> - you have four arrays (lat, lon, rows, cols) containing values
> for each of your patches
> - all four are measured in pixels
> - 'lat' increases as you go up, 'lon' increases as you go to the right
> (no wrapping at lat +/- 90 or lon +/- 180 here, do you need that?
> My, that would be interesting...)
> - you want the *smallest* bounding box that contains the patches
>
> Then the four edges of that bounding box are:
>
> left = Min(lon)
> top = Max(lat)
> right = Max(lon + cols - 1)
> bottom = Min(lat - rows + 1)
>
> Hope this helps!
>
> Cheers,
> -Dick
>
> Dick Jackson Fanning Software Consulting, Canadian Office
> djackson@dfanning.com Calgary, Alberta Voice/Fax: (403) 242-7398
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Default font size for a widget
Next Topic: Re: Two widget questions

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 16 02:15:29 PDT 2025

Total time taken to generate the page: 1.20239 seconds