Skip to content

Yulia-Didun/MATLAB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

General information

Some basic image processing examples with MATLAB.

Content

histeq()

Enhance contrast using histogram equalization. Input: grayscale image. Output: adjusted image.

histeq()

imadjust()

Adjust image intensity values.

imadjust()

Negative of an Image

Finding the negative of an image by changing the intensity levels of the pixels present in the image.

Checks if image is either grayscale or RGB, and depends on statement choose loop. Works good on grayscale images but slow on RGB.

Grayscale:

if size(image,3) == 1
    [n,m] = size(image);
    for i = 1:n
        for j = 1:m
            image_negative(i,j) = 255 - image(i,j);
        end
    end
    subplot(1,2,2);
    imshow(image_negative), title('Negative');

RGB:

elseif size(image,3) == 3
    [n,m,p] = size(image);
    for i = 1:n
        for j = 1:m
            for k = 1:p
                image_negative(i,j,k) = 255 - image(i,j,k);
            end
        end
    end
    subplot(1,2,2);
    imshow(image_negative), title('Negative');
end

We can also get the negative of an image using MATLAB's built-in function imcomplement(). It subtracts the pixel value from the maximum pixel value of the image class.

Binary Image

Converting grayscale image to binary (black and white) image.

Binary image

Converting RGB image to binary.

Binary image

Releases

No releases published

Packages

No packages published

Languages