Brightness and contrast

imadjust – change brightness or contrast in Matlab by percentage.

newImage = imadjust(originalImage, [a b], [c d]);

Where variables abc and d are between 0 and 1.

    • To decrease contrast: increase a
    • To increase contrast: decrease b
    • To increase brightness: increase c
    • To decrease brightness: decrease d

Here is full example increasing contrast by 20%:

originalImage = imread('img.tif');

 %show original image
figure;
imshow(originalImage)
title('Original Image');
contrastImage = imadjust(originalImage, [0 0.8], [0 1]);
 %show contrast image
figure;
imshow(contrastImage)
title('Contrast Image');
increases the combination of brightness and contrast of the image: image(uint8(double(originalImage(:,:,:)) * 2));

mesh(double(cartman(:,:,3))); In this example, we are examining layer 3 = blue. Before meshing the image, we convert it to data type double.

To view thered intensity image and a corresponding intensity color bar, we issue: image(cartman(:,:,1)), colorbar;The first colon denotes all rows, the second colon all columns, and the third index denotes the color Red.

When I attempt to cluster my integer data using KMEANS, I receive the following error
??? Error using ==> minus
Integers can only be combined with integers of the same class, or scalar doubles.

Solution:

This error is the expected behavior for passing an integer data type to the KMEANS function. KMEANS and many other statistical functions are not designed to work with integer data in MATLAB 7.2 (R2006a).

The only workaround is to convert the integer data to a double data type before passing it to KMEANS. For more information, refer the following documentation page on the DOUBLE function:

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

生活在西班牙

自己动手丰衣足食

BlueAsteroid

Just another WordPress.com site

Jing's Blog

Just another WordPress.com site

Start from here......

我的心情魔方

天才遠私廚

希望能做一個分享各種資訊的好地方

语义噪声

西瓜大丸子汤的博客

笑对人生,傲立寰宇

Just another WordPress.com site

Where On Earth Is Waldo?

A Project By Melanie Coles

the Serious Computer Vision Blog

A blog about computer vision and serious stuff

Cauthy's Blog

paper review...

Cornell Computer Vision Seminar Blog

Blog for CS 7670 - Special Topics in Computer Vision

datarazzi

Life through nerd-colored glasses

Luciana Haill

Brainwaves Augmenting Consciousness

槑烎

1,2,∞

Dr Paul Tennent

and the university of nottingham

turn off the lights, please

A bunch of random, thinned and stateless thoughts around the Web

%d bloggers like this: