Re: adding subset image into larger one [message #70170 is a reply to message #70169] |
Tue, 23 March 2010 17:53   |
Suguru Amakubo
Messages: 24 Registered: March 2010
|
Junior Member |
|
|
Unfortunately if I do that the function of the line (I think) will
change.
I intend the line to add the subset on top of the bigger image in a
while loop and the definition of the temp_image is done on the
previous line.
The original code was like:
a=0
b=-1
;while loop that runs through the array and places blocks on top of
the image
while a LT n_elements(mc_point[0,*]) do begin
;extracting the block from the original image
temp_image = new_image2[mc_point[0,b+1]:mc_point[0,b
+1]+L-1,mc_point[1,a]:mc_point[1,a]+L-1]
;adding the subset to a 400x400 image
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
;adding an 30x30 array of 1s to a blank 400x400 image
population
population = population[tr_point[0,a]:tr_point[0,a]
+L,tr_point[1,a]:tr_point[1,a]+L] + coverage_image
a=a+1
b=b+1
endwhile
So the temp_image (a 30x30 array) was added to new_image(400x400) and
ditto with population and coverage_image
I am under the impression that
new_image[tr_point[0,a]:tr_point[0,a] $
+L-1,tr_point[1,a]:tr_point[1,a]+L-1] += temp_image
will define the portion of new_image as temp_image (please tell me if
I am making a critical mistake) :)
|
|
|