Path: news.mathworks.com!not-for-mail
From: "dormant " <rod.stewart@uwiseismic.com>
Newsgroups: comp.soft-sys.matlab
Subject: reduce size of high-quality image
Date: Sun, 20 Apr 2008 17:52:02 +0000 (UTC)
Organization: University of the West Indies
Lines: 29
Message-ID: <fufvs2$m68$1@fred.mathworks.com>
Reply-To: "dormant " <rod.stewart@uwiseismic.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1208713922 22728 172.30.248.35 (20 Apr 2008 17:52:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 20 Apr 2008 17:52:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 768564
Xref: news.mathworks.com comp.soft-sys.matlab:464163


I need to reduce the size of a high quality image, read from
a TIFF file.

Say I want to reduce the image size by a factor of N
(normally 4). I would average the image using NxN blocks,
then decimate by N and use the output to create a new image. 

But that would lose the increase in dynamic range that comes
from the averaging process. I want to retain that dynamic
range somehow, which means I have to change variable type
and then somehow create an image file that uses uint16 or
floating point values.

I've had a stab at this, but can't get anywhere. I can't
even get blkproc to work as follows:

>> fun = @mean2;
>> IM2 = blkproc( IM1, [4 4], fun);
??? Subscripted assignment dimension mismatch.

Error in ==> blkproc at 89
aa(border(1)+(1:ma),border(2)+(1:na)) = a;

Any suggestions for:

1) How to get over the blkproc problem.

2) How to add the precision change.