Forums

imwrite

Started by aidan mooney March 5, 2002
dear all,
I have a problem whichI hope somebody can help me
with. I have an image ranging in values from 0 to 255.
I have to modify some of the pixels to say 103.234
I therefore have values with decimal places. however
the problem is when I go and save image again using
imwrite() function I loose these decimal placed values
and am left with 103 rather than 103.234
I hope that somebody can help me with this.

Kind Regards
Aidan

=====
Nil an tintean mar do thintean fein



Hi,

The image values that you mentioned show that its a gray scale image with only 256 shades of gray. So a fractional value will be quantized to the nearest integer and you'll only be able to store integars from 0 to 255. In other words by 103.234 that you are trying to store, you are defining a shade of gray which is impossible to be represented by a gray scale. With a precision ranging to 3 decimal positions, you need some thing like 65536 levels of quantization !

Btw just for your info, human eye is only sensitive to 256 shades of gray so a further resolution cannot be processed by our brains.

Regards.

Imran.

>From: aidan mooney
>To: m...@yahoogroups.com
>Subject: [matlab] imwrite
>Date: Tue, 5 Mar 2002 17:05:10 +0000 (GMT)
>
>dear all,
> I have a problem whichI hope somebody can help me
>with. I have an image ranging in values from 0 to 255.
>I have to modify some of the pixels to say 103.234
>I therefore have values with decimal places. however
>the problem is when I go and save image again using
>imwrite() function I loose these decimal placed values
>and am left with 103 rather than 103.234
>I hope that somebody can help me with this.
>
> Kind Regards
> Aidan
>
>=====
>Nil an tintean mar do thintean fein
>


Join the worlds largest e-mail service with MSN Hotmail. Click Here