# Brightness and contrast

imadjust – change brightness or contrast in Matlab by percentage.

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

Where variables `a``b``c` 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:

Posted in computer vision, ｚｚ

### TomTom

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