From 24b156175d3f2e5b07599f8b482dfafc098feca7 Mon Sep 17 00:00:00 2001 From: "Ragini.N" Date: Wed, 16 Jun 2021 11:18:32 +0000 Subject: [PATCH] Upload New File --- image processing and models/hsv.m | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 image processing and models/hsv.m diff --git a/image processing and models/hsv.m b/image processing and models/hsv.m new file mode 100644 index 0000000..04c1b20 --- /dev/null +++ b/image processing and models/hsv.m @@ -0,0 +1,35 @@ +clc; +close all ; +clear all ; + +%% reading the image +l=13; +jpgFilename = strcat('e_images_',num2str(l), '.jpg'); +rgb=imread(jpgFilename); +%% gray scaling +gray = rgb2gray(rgb); +figure(1); +imshow(gray); +title('gray scaled'); + +%% binary thresholding + +[size1,size2]=size(gray); +for i=1:size1 + for j=1:size2 + if gray(i,j)<60 + gray(i,j)=255; + end + end +end + +BW=im2bw(gray,graythresh(gray)); + +figure(2); +imshow(BW); + +%% hsv general +hsv = rgb2hsv(rgb); +figure(3); +imshow(hsv); +title('hsv')