Re: adding subset image into larger one [message #70182 is a reply to message #70181] |
Tue, 23 March 2010 09:14   |
jeanh
Messages: 79 Registered: November 2009
|
Member |
|
|
On 23/03/2010 11:00 AM, Suguru Amakubo wrote:
> Hi I am currently trying to add a subset of image (30x30) into a
> larger image (400x400) in 2 different sinarios:
>
> 1) adding a 30x30 subset taken from a 400x400 image and adding it to
> another 400x400 image.
>
> and
>
> 2) adding a 30x30 subset image into a blank 400x400 image
>
> I have encountered problems in both cases. for case 1) I could not
> find anywhere the syntax of adding the subset into the correct
> position. I used:
>
> new_image = new_image[tr_point(0,a):tr_point(0,a)
> +L-1,tr_point(1,a):tr_point(1,a)+L-1] + temp_image
>
> where tr_point is an array that contains the coordinates of the
> subset to be added and L = 30, temp_image is the subset. But seems
> like the new image does not change.
>
> for 2) aside from the problem I have above when I run the code above
> with the blank image IDL seems to 'crop' the blank 400x400 image into
> a 30x30 image...
>
> Would anybody have a solution to this?
>
> Thank you in advance
>
> Suguru
Hi Suguru,
the problem is that you are indeed subsetting your original image,
"deleting" the reminders!
Try this:
new_image[tr_point(0,a):tr_point(0,a)+L-1,tr_point(1,a):tr_p oint(1,a)+L-1]
+= temp_image
or
new_blank_image[tr_point(0,a):tr_point(0,a)+L-1,tr_point(1,a ):tr_point(1,a)+L-1]
= temp_image
Jean
|
|
|