JustPaste
HomeCategoriesAboutDonateContactTerms of UsePrivacy Policy
JustPaste

Free online notepad — write and share instantly

Navigate

  • Home
  • Timeline
  • Categories

Info

  • About
  • Donate
  • Contact

Legal

  • Terms of Use
  • Privacy Policy

© 2026 JustPaste.app. All rights reserved.

Made with ♥ by JustPaste

Untitled Page | JustPaste.app
11 days ago13 views
👨‍💻Programming

Untitled Page

Program: 1.Image Enhancement Technique
clc;
clear;
close all;
% Read the input image
img = imread('peppers.png');
% Enhance the image using histogram equalization
gray = rgb2gray(img);
enhanced = histeq(gray);
% Display original and enhanced images
subplot(1,2,1);
imshow(gray);
title('Original Image');
subplot(1,2,2);
imshow(enhanced);
title('Enhanced Image');
==========================================================================================================================================================
Program: 2.Histogram Equalization
clc;
clear;
close all;
img = imread('peppers.png');
gray = rgb2gray(img);
enhanced = histeq(gray);
subplot(1,2,1);
imshow(gray);
title('Original Image');
subplot(1,2,2);
imshow(enhanced);
title('Histogram Equalized Image');
=========================================================================================================================================================
program: 3.Image Restoration
clc;
clear;
close all;
img = imread('peppers.png');
% Add noise to the image
noisy = imnoise(img, 'salt & pepper', 0.05);
% Restore the image using median filter
restored = medfilt2(rgb2gray(noisy));
subplot(1,3,1);
imshow(img);
title('Original Image');
subplot(1,3,2);
imshow(noisy);
title('Noisy Image');
subplot(1,3,3);
imshow(restored);
title('Restored Image');
============================================================================================================================================================
Program: 4.Implement ImageFiltering
clc;
clear;
close all;
img = imread('peppers.png');
gray = rgb2gray(img);
% Apply average filter
filtered = imfilter(gray, fspecial('average', [3 3]));
subplot(1,2,1);
imshow(gray);
title('Original Image');
subplot(1,2,2);
imshow(filtered);
title('Filtered Image');
============================================================================================================================================================Program : 5.Edge Detection Using Roberts, Prewitt and Sobel Operators
clc;
clear;
close all;
img = imread('peppers.png');
gray = rgb2gray(img);
roberts = edge(gray, 'roberts');
prewitt = edge(gray, 'prewitt');
sobel = edge(gray, 'sobel');
subplot(2,2,1);
imshow(gray);
title('Original Image');
subplot(2,2,2);
imshow(roberts);
title('Roberts Operator');
subplot(2,2,3);
imshow(prewitt);
title('Prewitt Operator');
subplot(2,2,4);
imshow(sobel);
title('Sobel Operator');
============================================================================================================================================================
Program : 6. Implement image compression.
clc;
clear;
close all;
img = imread('peppers.png');
% Compress image using JPEG
imwrite(img, 'compressed.jpg', 'Quality', 25);
compressed = imread('compressed.jpg');
subplot(1,2,1);
imshow(img);
title('Original Image');
subplot(1,2,2);
imshow(compressed);
title('Compressed Image');
disp('Image compression completed.');
============================================================================================================================================================
Program : 7. Image Subtraction
clc;
clear;
close all;
img1 = imread('peppers.png');
img2 = imread('peppers.png');
img1 = imresize(img1, [256 256]);
img2 = imresize(img2, [256 256]);
result = imabsdiff(img1, img2);
subplot(1,3,1);
imshow(img1);
title('Image 1');
subplot(1,3,2);
imshow(img2);
title('Image 2');
subplot(1,3,3);
imshow(result);
title('Subtracted Image');
============================================================================================================================================================
Program : 8.Boundary Extraction Using Morphology
clc;
clear;
close all;
img = imread('peppers.png');
gray = rgb2gray(img);
bw = imbinarize(gray);
se = strel('disk', 1);
boundary = bw & ~imerode(bw, se);
subplot(1,2,1);
imshow(bw);
title('Binary Image');
subplot(1,2,2);
imshow(boundary);
title('Boundary Extraction');
============================================================================================================================================================
program :9.image segmentation
clc;
clear;
close all;
img = imread('peppers.png');
gray = rgb2gray(img);
% Image segmentation using thresholding
bw = imbinarize(gray);
subplot(1,2,1);
imshow(img);
title('Original Image');
subplot(1,2,2);
imshow(bw);
title('Segmented Image');
============================================================================================================================================================

⚠️Content was pasted as plain text and auto-formatted as a code block. Use the Code Block button in the editor for proper formatting.

← Back to timeline