adding subset image into larger one [message #70184] |
Tue, 23 March 2010 08:00  |
Suguru Amakubo
Messages: 24 Registered: March 2010
|
Junior Member |
|
|
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
|
|
|
|
Re: adding subset image into larger one [message #70261 is a reply to message #70184] |
Wed, 24 March 2010 07:42  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Suguru Amakubo writes:
> Sorry just a small question regarding the matter. What do you all do
> when you run out of memory? After solving the issue of new_image I got
> a runtime error:
>
> Array subscript for POPULATION must have same size as source
> expression.
>
> I use windows 7, idl 6.4 and have 4 GB of RAM so I thought it will be
> ok but after reading this:
>
> http://www.dfanning.com/misc_tips/submemory.html
>
> I didn't quite know how to deal with it.
I doubt very much you have run out of memory. I think
you just have a problem with your subscripts. Print them
out, along with the size of the images you are working
with so you can see what the problem is. Remember that
IDL uses 0 based array subscripting.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: adding subset image into larger one [message #70263 is a reply to message #70184] |
Wed, 24 March 2010 05:35  |
Suguru Amakubo
Messages: 24 Registered: March 2010
|
Junior Member |
|
|
Sorry just a small question regarding the matter. What do you all do
when you run out of memory? After solving the issue of new_image I got
a runtime error:
Array subscript for POPULATION must have same size as source
expression.
I use windows 7, idl 6.4 and have 4 GB of RAM so I thought it will be
ok but after reading this:
http://www.dfanning.com/misc_tips/submemory.html
I didn't quite know how to deal with it.
I am really sorry for posting repeatedly on a different issue I know I
shouldn't really do this but did not quite know where else to post.
Thank you in advance for your help.
|
|
|
|