Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: convert binary to gray
Replies: 7   Last Post: Dec 27, 2012 5:08 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Tony Kittler

Posts: 105
Registered: 2/5/11
Re: convert binary to gray
Posted: Dec 27, 2012 12:42 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <9a257a26-211e-4107-8516-dc45e4d65373@iu7g2000pbc.googlegroups.com>...
> On Jan 26, 10:53 am, u-ingenieria bd <u.ingenieria...@gmail.com>
> wrote:

> > how to convert a logical binary image into same size gray image?
> >
> > I have tried y=bin2gray(x,'qam',16) function but here for x this
> > function does not take the binary image directly. all I need to
> > convert the binary image into grayscale image.

>
> ------------------------------------------------
> I never heard of that function. Simply do this:
> grayImage = uint8(binaryImage);
>
> or, if you want the true (1) to be mapped to 255 instead of 1, do
> this:
> grayImage = 255 * uint8(binaryImage);


Hi,

I have two images. They are;
tempBinaryImg : 320x320 double
GrayscaleImg : 320x320 double

When I write that
temp2 = tempBinaryImg.*(GrayscaleImg>0);
PreprocessedGrayscaleImg = uint8(Img).*uint8(temp2);

then I am getting PreprocessedGrayscaleImg as uint8. But I want to get the PreprocessedGrayscaleImg as double. So, I write

PgrayImg = double(PreprocessedGrayscaleImg);

but the PgrayImg is binary, it is not gray. How can I get the PreprocessedGrayscaleImg as double and gray ?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.