Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #7543 > unrolled thread

working with raw image files

Started bykafooster <dmozejko@gmail.com>
First post2011-06-13 11:18 -0700
Last post2011-06-15 02:33 +0100
Articles 2 on this page of 22 — 7 participants

Back to article view | Back to comp.lang.python


Contents

  working with raw image files kafooster <dmozejko@gmail.com> - 2011-06-13 11:18 -0700
    Re: working with raw image files Terry Reedy <tjreedy@udel.edu> - 2011-06-13 14:49 -0400
    Re: working with raw image files Wanderer <wanderer@dialup4less.com> - 2011-06-13 13:08 -0700
      Re: working with raw image files Wanderer <wanderer@dialup4less.com> - 2011-06-13 13:20 -0700
        Re: working with raw image files MRAB <python@mrabarnett.plus.com> - 2011-06-13 21:36 +0100
        Re: working with raw image files kafooster <dmozejko@gmail.com> - 2011-06-13 13:41 -0700
          Re: working with raw image files Wanderer <wanderer@dialup4less.com> - 2011-06-13 13:52 -0700
            Re: working with raw image files kafooster <dmozejko@gmail.com> - 2011-06-13 13:58 -0700
              Re: working with raw image files Wanderer <wanderer@dialup4less.com> - 2011-06-13 14:28 -0700
                Re: working with raw image files Martin De Kauwe <mdekauwe@gmail.com> - 2011-06-14 00:49 -0700
                  Re: working with raw image files Terry Reedy <tjreedy@udel.edu> - 2011-06-14 12:24 -0400
                    Re: working with raw image files kafooster <dmozejko@gmail.com> - 2011-06-14 13:13 -0700
                      Re: working with raw image files MRAB <python@mrabarnett.plus.com> - 2011-06-14 21:26 +0100
                        Re: working with raw image files kafooster <dmozejko@gmail.com> - 2011-06-14 14:20 -0700
                          Re: working with raw image files MRAB <python@mrabarnett.plus.com> - 2011-06-14 23:06 +0100
                            Re: working with raw image files kafooster <dmozejko@gmail.com> - 2011-06-14 16:59 -0700
                              Re: working with raw image files MRAB <python@mrabarnett.plus.com> - 2011-06-15 01:24 +0100
                          Re: working with raw image files Dave Angel <davea@ieee.org> - 2011-06-14 19:25 -0400
                            Re: working with raw image files kafooster <dmozejko@gmail.com> - 2011-06-14 17:02 -0700
                              Re: working with raw image files Dave Angel <davea@ieee.org> - 2011-06-14 22:13 -0400
                            Re: working with raw image files Nobody <nobody@nowhere.com> - 2011-06-15 02:29 +0100
                      Re: working with raw image files Nobody <nobody@nowhere.com> - 2011-06-15 02:33 +0100

Page 2 of 2 — ← Prev page 1 [2]


#7660

FromNobody <nobody@nowhere.com>
Date2011-06-15 02:29 +0100
Message-ID<pan.2011.06.15.01.28.30.219000@nowhere.com>
In reply to#7644
On Tue, 14 Jun 2011 19:25:32 -0400, Dave Angel wrote:

> You said in an earlier message to ignore the RAW format.  However, if 
> your file matches a typical camera's raw file

It doesn't. He's dealing with a raw array of fixed-size integers (i.e.
what you would get if you took a C array and wrote the memory directly to
a file).

[toc] | [prev] | [next] | [standalone]


#7662

FromNobody <nobody@nowhere.com>
Date2011-06-15 02:33 +0100
Message-ID<pan.2011.06.15.01.33.10.532000@nowhere.com>
In reply to#7628
On Tue, 14 Jun 2011 13:13:07 -0700, kafooster wrote:

> Ok, I solved the problem with matplotlib
> 
> fileobj = open("hand.raw", 'rb')
> data = numpy.fromfile(fileobj,dtype=np.uint16)
> data = numpy.reshape(data,(96,470,352))
> imshow(data[:,:,40],cmap='gray')
> show()
> 
> the error was caused by different order of data, however it still
> reads the dataset as half of it size. whatever.
> 
> please leave the part about .raw, lets just start thinking of it from
> level of numpy array.
> 
> I would like to visualize this data with PIL, but PIL works only with
> 8bit data. How could I resample my array from 16bit to 8bit?

Why bother? NumPy is a much better image-processing library than PIL. The
only reason I use PIL is for its import/export routines.

If you are going to use PIL, apply any corrections (gamma correction,
histogram equalisation, etc) before reducing the data to 8 bits.

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.python


csiph-web