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

Home » Public Forums » archive » MIP from BMP Images
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: MIP from BMP Images [message #76897 is a reply to message #76838] Fri, 08 July 2011 08:41 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
M R writes:

> I hope I am making some kind of progress here. I have the following
> code and I (fortunately) do not get any errors and of course the
> output is in the form of a blank black pop out screen (I am being too
> optimistic) and think atleast the program works! Below is the code
>
> fil = file_search('filepath*.bmp',COUNT = count)
> imag=read_bmp(fil[0])
> s=size(imag)
>
> arm = bytarr (s[1],s[2],count,/nozero)
>
> for i=0, count-1 do begin
> image = read_bmp(fil[i])
> arm[*,*,i]=image[*,*]
> end
>
> TV,MAX (arm, dimension = 3)
>
> end
>
> (i). imag, arm, image array sizes do not match. They are
>
> IDL> help, arm
> ARM BYTE = Array[3, 2216, 256]
> IDL> help, imag
> IMAG BYTE = Array[3, 2216, 1254]
> IDL> help, image
> IMAGE BYTE = Array[3, 2216, 1254]
>
> Does anyone feel that this mismatch between the array sizes is
> creating the blank black pop out screen instead of an image?

Well, yes, among any number of other things. :-)

I say this with all possible kindness, because I can
see you are making an effort, and I want to help you,
but if this code actually ran I would say it is because
you have a special relationship with the programming gods. :-)

How do you know it "ran"? Did you see *any* images
in the window?

Let's start at the beginning. Can you open and display
just one of the images in your directory? Just without
trying to do a loop or anything. At best, with the
way you are using the TV command (a totally worthless
command IMHO) you will see a tiny sliver of your image
on the left-hand side of your display window. If you
want to use the TV command (a bad idea, as I mentioned),
you might want to try this:

imageFile = Dialog_Pickfile(FILTER='*.bmp')
image = Read_BMP(imageFile)
TV, image, TRUE=1

So, if you want to stuff this 24-bit image into a larger
array (and I pointed out in a previous article why
this is almost pointless, since your images don't contain
any intensity information), then you will have to make
your array a four-dimensional array:

dims = Size(image, /DIMENSIONS)
arms = Make_Array(dims[0], dims[1], dims[2], count, /BYTE)

Then,

arms[*,*,*,j] = image

This, of course, assumes all your images are the same size.

I suspect this program of yours ran, maybe, one time
and with errors you aren't aware of. Do you have
your IDL console window somewhere where you can see
it easily?

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Shell startup file not recognized in IDL 8.0 Workbench
Next Topic: Re: percentile with dimension keyword

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

Current Time: Sun Oct 12 08:48:55 PDT 2025

Total time taken to generate the page: 2.15805 seconds