Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'mrab': 0.05; 'scaling': 0.05; 'bits': 0.07; 'linear': 0.07; 'space.': 0.07; '>>>>': 0.09; 'subject:files': 0.09; 'subject:image': 0.09; 'pm,': 0.10; '>>>': 0.12; 'wrote:': 0.14; 'adjustment': 0.16; 'exponential': 0.16; 'factor,': 0.16; 'gamma': 0.16; 'grayscale': 0.16; 'numpy': 0.16; 'subject:raw': 0.16; 'cc:addr:python-list': 0.17; '(which': 0.20; 'header:In-Reply-To:1': 0.21; 'ignore': 0.21; 'file,': 0.22; 'cc:2**0': 0.22; 'cc:no real name:2**0': 0.23; 'example.': 0.23; 'values': 0.25; 'function': 0.25; 'typically': 0.28; 'made.': 0.29; 'matches': 0.29; 'cc:addr:python.org': 0.30; 'second': 0.30; 'array': 0.30; 'shifting': 0.30; 'subject:working': 0.30; 'it.': 0.31; 'does': 0.33; 'file': 0.34; 'however,': 0.34; 'expensive': 0.34; 'example,': 0.35; 'there': 0.35; 'header:User-Agent:1': 0.35; 'typical': 0.35; 'format.': 0.36; 'several': 0.36; 'another': 0.37; 'pretty': 0.37; 'could': 0.38; 'but': 0.38; 'data': 0.38; 'third': 0.38; 'earlier': 0.38; 'hardware': 0.38; 'worry': 0.38; 'subject:: ': 0.38; 'some': 0.38; 'received:192': 0.38; 'explain': 0.39; 'said': 0.39; 'subject:with': 0.39; 'entirely': 0.40; 'meaning': 0.40; 'received:192.168.1': 0.40; 'results': 0.60; 'your': 0.60; 'you.': 0.62; 'medical': 0.65; 'glad': 0.66; 'traditional': 0.68; 'header:Reply-To:1': 0.72; 'reply-to:no real name:2**0': 0.72; '02:59': 0.84; 'bayer': 0.84 Date: Tue, 14 Jun 2011 22:13:33 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10 MIME-Version: 1.0 To: kafooster Subject: Re: working with raw image files References: <0cd64f09-bd32-4b67-9266-46003dbea4b7@m4g2000yqk.googlegroups.com> <1f7a452a-8bae-43e0-ab9f-9bfed55ee206@b21g2000yqc.googlegroups.com> <57d6da80-59db-477f-b507-cabf01a2976d@j23g2000yqc.googlegroups.com> <720bec5b-4892-4cd7-83e1-f67ce78591be@y30g2000yqb.googlegroups.com> <71140671-4273-417d-8d2f-3986663acdb2@k16g2000yqm.googlegroups.com> <2c095413-ea59-4339-8419-ae4b688e219d@17g2000prr.googlegroups.com> <3c42b351-4745-4b35-aa9f-cefb53f846e1@t14g2000yqc.googlegroups.com> In-Reply-To: <3c42b351-4745-4b35-aa9f-cefb53f846e1@t14g2000yqc.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:rcZOeSzJjQMdN98jMghJFkw2tNbKrrx4sWozBPnvLCE HGYhNsWqpgT32L8gIotxozhx0JtC0MKeVS11cg4Kk44I9aRRtC D8cibFIhqYEkYuyz+8Yz4JyIsaalnzWcAdPZBOxxSXVny2uTIL ZAQUFFG2dEoD8eheaRZSh7/KltpvKAlMDpPGZYA8I5+cedSEgj 5xIB7d4aDcPnDzoCa2duw== Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: davea@ieee.org List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 41 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1308104044 news.xs4all.nl 49174 [::ffff:82.94.164.166]:55624 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7664 On 01/-10/-28163 02:59 PM, kafooster wrote: > On 15 Cze, 01:25, Dave Angel wrote: >> On 01/-10/-28163 02:59 PM, kafooster wrote: >> >>> On 14 Cze, 22:26, MRAB 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