Path: news.mathworks.com!not-for-mail
From: "Yumnam Kirani" <kirani.singh@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to pass a 2-D image to a function
Date: Tue, 31 Jan 2012 11:58:10 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 10
Message-ID: <jg8l0i$kti$1@newscl01ah.mathworks.com>
References: <jg7oha$v8$1@newscl01ah.mathworks.com> <jg7qit$6le$1@newscl01ah.mathworks.com> <jg7r03$7kr$1@newscl01ah.mathworks.com>
Reply-To: "Yumnam Kirani" <kirani.singh@gmail.com>
NNTP-Posting-Host: www-06-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1328011090 21426 172.30.248.38 (31 Jan 2012 11:58:10 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 31 Jan 2012 11:58:10 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1030755
Xref: news.mathworks.com comp.soft-sys.matlab:756250

"Sadik " <sadik.hava@gmail.com> wrote in message <jg7r03$7kr$1@newscl01ah.mathworks.com>...
> Yes, I reproduced the problem. The matrix multiplication can result in values much larger than 255 [the uint8 max], so even if you use casting to double, you may want to make a decision about how to proceed with values outside the 0-255 range.
> 
> Best.

If you simply want to assign all values greater than 255, you can simply use uint8 function. Otherwise, you need to scale the image after the multiplication to the desired range.

Yumnam Kirani Singh
Tronglaobi Awang Leikai