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

Home » Public Forums » archive » Re: Scale many regions in one image without using xroi
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: Scale many regions in one image without using xroi [message #81661 is a reply to message #81660] Thu, 11 October 2012 03:29 Go to previous messageGo to previous message
eeaal is currently offline  eeaal
Messages: 4
Registered: October 2012
Junior Member
On Tuesday, October 9, 2012 4:20:48 PM UTC+1, Brian J. Daniel wrote:
> Without knowing all the gritty details, I suggest that given a scaling factor (xscale, yscale),
>
>
>
> s2 = size(array2)
>
> scale_array2 = Congrid(array2, s2[1]*xscale, s2[2]*yscale)
>
>
>
> Optionally, you can crop your carray2 back to the original size.
>
>
>
> new_s2 = size(scale_array2) ; new dimensions
>
> tmp = Shift(carray,-1.0*(new_s2[1]-s2[1])/2.0,-1.0*(new_s2[2]-s2[2 ])/2.0) ; shifts to new 0,0 location
>
> crop_scale_array2 = scale_array[0,s2[1]-1,0,s2[2]-1] ; crop
>
>
>
> -Brian
>
>
>
> On Monday, October 8, 2012 9:12:52 AM UTC-4, (unknown) wrote:
>
>> Hi,
>
>>
>
>>
>
>>
>
>> I've been searching all morning and can't find an answer to a problem
>
>>
>
>> I'm having:
>
>>
>
>>
>
>>
>
>> I have two 2-D arrays which have clusters of 1s in an array of 0s.
>
>>
>
>> I'm interested these clusters (shapes). Some of the shapes are
>
>>
>
>> present in both arrays, some are missing from one or the other and in
>
>>
>
>> array 2 the shapes are too small. I want to scale up the shapes in
>
>>
>
>> array 2 so that the coincident shapes are the same size in both
>
>>
>
>> arrays. I can use label_region to find the shapes and calculate a
>
>>
>
>> correction factor. I just need a way to scale the shapes, presumeably
>
>>
>
>> by growing them from a central point.
>
>>
>
>>
>
>>
>
>> Any ideas? I want to include this in a program which loops round
>
>>
>
>> hundreds of images so using XROI is not really an option...
>
>>
>
>>
>
>>
>
>> Thanks in advance.
>
>>
>
>>
>
>>
>
>> AA

Thanks Brian,

I thought of this, but if I scale up array2 so that the objects are the right size, then they will be displaced with respect to the objects in array 1. It is important that they are co-located as I am going to stack the arrays.

Unless you can tell me of a way to only scale the 1 pixels and then reposition them individually somehow?

Amb
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: contour plots on map with Coyote Graphics System in postscript
Next Topic: Re: Help with WV_CWT

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

Current Time: Wed Oct 08 13:53:43 PDT 2025

Total time taken to generate the page: 0.00406 seconds