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

Home » Public Forums » archive » adding subset image into larger one
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
adding subset image into larger one [message #70184] Tue, 23 March 2010 08:00 Go to next message
Suguru Amakubo is currently offline  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 #70260 is a reply to message #70184] Wed, 24 March 2010 17:06 Go to previous message
Suguru Amakubo is currently offline  Suguru Amakubo
Messages: 24
Registered: March 2010
Junior Member
Thank you very much. You are absolutely right I was caught out on the
0 base subscript (forgot to put -1 on the population array).

Thank you for your help. :)
Re: adding subset image into larger one [message #70261 is a reply to message #70184] Wed, 24 March 2010 07:42 Go to previous message
David Fanning is currently offline  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 Go to previous message
Suguru Amakubo is currently offline  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.
Re: adding subset image into larger one [message #70266 is a reply to message #70184] Tue, 23 March 2010 19:25 Go to previous message
Suguru Amakubo is currently offline  Suguru Amakubo
Messages: 24
Registered: March 2010
Junior Member
I guess I am missing something else where in that case like last time.

Thank you all for your help, will give it a fresh eye tomorrow
morning. :)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: overlaying wind vectors on a map
Next Topic: histogram

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

Current Time: Wed Oct 08 15:49:19 PDT 2025

Total time taken to generate the page: 0.00638 seconds