In order to change the class of image, you can use the following functions-
>> im = imread('a.jpg'); // To read the image >> imshow(im); // To display the image >> whos im; // To get info. about image size, type etc., class of im is uint8 here >> imd = im2double(im); // Type conversion >> imshow(imd); // To display second type image >> whos imd; // It will display class type double
Class of an image is changed. It looks exactly as the other one. When we see the type, it is double and pixel value are floating point numbers now. In th convention ‘0’ represents black and ‘1’ represents white. So, this is the another way to represent each pixel of an image i.e in double precision.