Array resize with arbitrary arithmetic [message #52945] |
Mon, 12 March 2007 13:23 |
rpertaub@gmail.com
Messages: 43 Registered: January 2007
|
Member |
|
|
I have this 640x240 array. I need to change it to a 320x240 array.
However, in first array, consecutive 2 pixels hold information for 1
pixel in second array and I need to do a certain bit of arithmetic to
obtain that. This should not be too difficult, except I keep getting
errors and I am not sure why:
This is what I do:
pro compress_image
image=read_bmp('9 March 2007\775u.bmp') ; 640x240 array
comp_image=make_array(76800,/long) ;1x76800 array that I can
reform to 320x240array later
temp=0
for j=0,239 DO BEGIN
for i=0,319 DO BEGIN
comp_image[0,temp]= image[2*i,j]*256 + image[2*i+1,j] ;
arithmetic necessary
temp=temp+1
endfor
endfor
end
Any insight would really be appreciated!
Thanks
Radha
|
|
|