0% found this document useful (0 votes)
6 views4 pages

22ec620 Image Processing

The document outlines a model examination for an image processing course, where the task involves capturing images and applying contrast enhancement. The provided code demonstrates the process of histogram equalization and edge detection using Sobel operators on a grayscale image. The results include visual comparisons of the original image, enhanced image, and edge detection outputs.

Uploaded by

rchandraaditya3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

22ec620 Image Processing

The document outlines a model examination for an image processing course, where the task involves capturing images and applying contrast enhancement. The provided code demonstrates the process of histogram equalization and edge detection using Sobel operators on a grayscale image. The results include visual comparisons of the original image, enhanced image, and edge detection outputs.

Uploaded by

rchandraaditya3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

22EC620 IMAGE PROCESSING

MODEL EXAMINATION

Name: Naren Ananth R

Section : ECE – B

REG.NO : 917722D063

QUESTION : To capture images of myself from K.S Auditorium and apply contrast
Enhancement .Detect edges before and after contrast enhancement.

Code:

clc;

clear all;

close all;

img = imread('naren2.jpg');

img = rgb2gray(img);

enhanced = histeq(img);

smoothed=double(enhanced);

sx = [-1 0 1; -2 0 2; -1 0 1];

sy = [-1 -2 -1; 0 0 0; 1 2 1];

im = padarray(smoothed, [1,1]);

res_x = zeros(size(img));

res_y = zeros(size(img));

for i = 2:size(im,1)-1

for j = 2:size(im,2)-1

c = im(i-1:i+1, j-1:j+1);

temp1 = c .* sx;

temp2 = c .* sy;

res_x(i-1,j-1) = sum(temp1(:));
res_y(i-1,j-1) = sum(temp2(:));

end

end

res = sqrt(res_x.^2 + res_y.^2);

res_norm = mat2gray(res);

subplot(2,2,1);

imshow(img);

title('Original Grayscale');

subplot(2,2,2);

imshow(enhanced);

title('Histogram Equalized');

subplot(2,2,4);

imshow(res_norm);

title('Enhanced Edge Detection');

smoothed=double(img);

sx = [-1 0 1; -2 0 2; -1 0 1];

sy = [-1 -2 -1; 0 0 0; 1 2 1];

im = padarray(smoothed, [1,1]);

res_x = zeros(size(img));

res_y = zeros(size(img));

for i = 2:size(im,1)-1

for j = 2:size(im,2)-1
c = im(i-1:i+1, j-1:j+1);

temp1 = c .* sx;

temp2 = c .* sy;

res_x(i-1,j-1) = sum(temp1(:));

res_y(i-1,j-1) = sum(temp2(:));

end

end

res = sqrt(res_x.^2 + res_y.^2);

res_norm = mat2gray(res);

subplot(2,2,3);

imshow(res_norm);

title('original Edge Detection');

output:

INPUT IMAGE 2 :
INPUT IMAGE 3

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy