Thread Subject: How to define or generate a 4 bit or 5 bit image? (how to define image bit rate/resolution)

Subject: How to define or generate a 4 bit or 5 bit image? (how to define image bit rate/resolution)

From: Ross

Date: 19 Dec, 2007 22:19:08

Message: 1 of 5

Typically, I work with 8 bit images. In an 8 bit image, 0
is the lowest intensity and 255 is the highest intensity.

I'm trying to generate a matrix and use imshow to display
that matrix (image) - except it needs to have the
intensities ranging from 0 - 15 with 0 being the lowest and
15 being the highest.

I'm not sure how to define the bit rate/ resolution of an
image. Any suggestions?

Subject: How to define or generate a 4 bit or 5 bit image? (how to define image bit rate/resolution)

From: Bruno Luong

Date: 19 Dec, 2007 22:40:39

Message: 2 of 5

"Ross " <ross.nospam.kozz@yahoo.com> wrote in message
<fkc5cs$4a4$1@fred.mathworks.com>...
> Typically, I work with 8 bit images. In an 8 bit image, 0
> is the lowest intensity and 255 is the highest intensity.
>
> I'm trying to generate a matrix and use imshow to display
> that matrix (image) - except it needs to have the
> intensities ranging from 0 - 15 with 0 being the lowest and
> 15 being the highest.
>
> I'm not sure how to define the bit rate/ resolution of an
> image. Any suggestions?
>

help bitshift

Bruno

Subject: How to define or generate a 4 bit or 5 bit image? (how to define image bit rate/resolution)

From: Ross

Date: 19 Dec, 2007 23:08:43

Message: 3 of 5

Bruno, thanks. I tried using bitshift but it isn't working
for me. I'm probably not doing it right.

I just realised that all the images that I've defined so
far have been in the "double" format. Basically, the range
of the image is [0 1] with 0 being black and 1 being white.
0.5 would be halfway through.

However, I'm not sure how to define a 4 with range [1 15]
or 5 bit image with range [0 31]

While I've worked with 8 bit and 16 bit images in the past,
I'm not sure how to define one so that matlab interprets
the intensity values correctly.

Subject: How to define or generate a 4 bit or 5 bit image? (how to define image bit rate/resolution)

From: Matthew Whitaker

Date: 19 Dec, 2007 23:13:50

Message: 4 of 5

"Ross " <ross.nospam.kozz@yahoo.com> wrote in message
<fkc5cs$4a4$1@fred.mathworks.com>...
> Typically, I work with 8 bit images. In an 8 bit image, 0
> is the lowest intensity and 255 is the highest intensity.
>
> I'm trying to generate a matrix and use imshow to display
> that matrix (image) - except it needs to have the
> intensities ranging from 0 - 15 with 0 being the lowest
and
> 15 being the highest.
>
> I'm not sure how to define the bit rate/ resolution of an
> image. Any suggestions?
>
Ross,
You need to turn your grascale image into andexed image
doc gray2ind %in image processing toolbox
I = imread('cameraman.tif');
[X, map] = gray2ind(I, 16);
imshow(X, map);

Hope this helps
Matt

Subject: How to define or generate a 4 bit or 5 bit image? (how to define image bit rate/resolution)

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 19 Dec, 2007 23:19:42

Message: 5 of 5

In article <fkc5cs$4a4$1@fred.mathworks.com>,
Ross <ross.nospam.kozz@yahoo.com> wrote:
>Typically, I work with 8 bit images. In an 8 bit image, 0
>is the lowest intensity and 255 is the highest intensity.

>I'm trying to generate a matrix and use imshow to display
>that matrix (image) - except it needs to have the
>intensities ranging from 0 - 15 with 0 being the lowest and
>15 being the highest.

Use the two parameter version of imshow:

    IMSHOW(I,[LOW HIGH]) displays the grayscale image I, specifying the display
    range for I in [LOW HIGH]. The value LOW (and any value less than LOW)
    displays as black, the value HIGH (and any value greater than HIGH) displays
    as white. Values in between are displayed as intermediate shades of gray,
    using the default number of gray levels. If you use an empty matrix ([]) for
    [LOW HIGH], IMSHOW uses [min(I(:)) max(I(:))]; that is, the minimum value in
    I is displayed as black, and the maximum value is displayed as white.


See also the property 'clim' (I don't recall at the moment which
object it is a property of.)
--
  "Is there any thing whereof it may be said, See, this is new? It hath
  been already of old time, which was before us." -- Ecclesiastes

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
display Ross 19 Dec, 2007 17:20:07
resolution Ross 19 Dec, 2007 17:20:07
bit rate Ross 19 Dec, 2007 17:20:06
image processing Ross 19 Dec, 2007 17:20:06
image Ross 19 Dec, 2007 17:20:06
rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com