Code about getting different features from the image

Hello everyone,
I have attached an image which is basically the output of my code. It performs in the same way as dwt2 function does except that I have written it myself this time. I've been wondering: why is the background black while it should be grey. What are your intuitive thoughts at the first look?

 Accepted Answer

It may be a uint8 image. They clip negative numbers so the lowest you get is 0. So you're seeing only the positive numbers, and they're dark. If you have an image that went from, say, -5 to +5 doing imshow(doubleImage) will show only values from 0 to +5 and they'll be 0 to +5. If you use imshow(doubleImage, []) then it will scale so that -5 shows as 0, +5 shows as 255 (brightest white), and 0 (which is in the middle) will show as 128, which is the gray you were expecting.

6 Comments

Well, I'm already showing image using imshow(myimage,[]) and the output's image minimum is -136 and max is 508.
Are you displaying them is two separate axes? Or did you somehow stitch them together and display in a single axes?
Yes, I did stitch them together to display in a single axes. Is there any problem with that?
If you want to see them together, you'll have to match the dynamic ranges otherwise one will be way brighter or darker than the other.
and how are the dynamic ranges matched?
Try running them both through mat2gray(), or imadjust().

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!