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


Groups > comp.lang.python > #7664

Re: working with raw image files

Date 2011-06-14 22:13 -0400
From Dave Angel <davea@ieee.org>
Subject Re: working with raw image files
References (9 earlier) <bf3f66ae-9b8f-4bd9-8827-bf0cd59bd3e7@j23g2000yqc.googlegroups.com> <mailman.231.1308083252.11593.python-list@python.org> <e62e7c74-6169-42e7-acd4-3bb45c8a875b@p13g2000yqh.googlegroups.com> <mailman.241.1308093964.11593.python-list@python.org> <3c42b351-4745-4b35-aa9f-cefb53f846e1@t14g2000yqc.googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.250.1308104044.11593.python-list@python.org> (permalink)

Show all headers | View raw


On 01/-10/-28163 02:59 PM, kafooster wrote:
> On 15 Cze, 01:25, Dave Angel<da...@ieee.org>  wrote:
>> On 01/-10/-28163 02:59 PM, kafooster wrote:
>>
>>> On 14 Cze, 22:26, MRAB<pyt...@mrabarnett.plus.com>    wrote:
>>
>>>> Multiply the numpy array by a scaling factor, which is
>>>> float(max_8bit_value) / float(max_16bit_value).
>>
>>> could you please explain it a little? I dont understand it. like
>>> multiplying each element?
>>
>> You said in an earlier message to ignore the RAW format.  However, if
>> your file matches a typical camera's raw file, there are several problems:
>>
>> 1) the data is typically 12 to 14 bits per pixel, only rarely 16 (very
>> expensive cameras)
>> 2) the data does not have R, G and B values for each pixel, but only one
>> of these.  The others are generated by Bayer interpolation.
>> 3) the data is linear (which is what the hardware produces), and
>> traditional image data wants to be in some non-linear color space.  For
>> example, most jpegs are sRGB 8*3 bits per pixel.
>>
>> The first would mean that you'd need to do a lot of shifting and
>> masking.  The second would mean a pretty complex interpolation
>> algorithm.  And the third would require an exponential function at the
>> very least.
>>
>> DaveA
>
> well, I am only working with grayscale MRI medical images(mainly 8 or
> 16bits), saved as .raw. I do not need to worry about rgb.
>

Well, since you've already gotten results you like (per another msg from 
you), the gamma adjustment must already be made.  So they're an entirely 
different meaning of raw than used by DSLR's, for example.

Glad it's working for you.

DaveA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

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

csiph-web