Variable Thresholding using Image Partitioning | Digital Image Processing | MATLAB
Code : clc clear all close all warning off x=rgb2gray(imread('Capture.JPG')); imshow(x); title('Original Image'); figure; imhist(x); axis tight; title('Hist...

Knowledge Amplifier
2.2K views β’ Jul 27, 2020

About this video
Code :
clc
clear all
close all
warning off
x=rgb2gray(imread('Capture.JPG'));
imshow(x);
title('Original Image');
figure;
imhist(x);
axis tight;
title('Histogram of Original Image');
figure;
imshow(im2bw(x,graythresh(x)));
title('Global Thresholding');
figure;
[r c]=size(x);
output=zeros(r,c);
starts=floor(1:c/10:c);
ends=starts(2:length(starts));
ends=[ends c];
imshow(x);
hold on;
for i=1:10
plot([ends(i) ends(i)],[1 r],'w');
end
for i=1:10
temp=x(:,starts(i):ends(i));
out(:,starts(i):ends(i))=im2bw(temp,graythresh(temp));
end
figure;
imshow(out);
title('Output of Variable Thresholding');
Learn Image Processing using MATLAB:
https://www.youtube.com/watch?v=L9hku2og874&list=PLjfRmoYoxpNostbIaNSpzJr06mDb6qAJ0&index=2&t=37s
#DigitalImageProcessing #MATLAB #ComputerVision
clc
clear all
close all
warning off
x=rgb2gray(imread('Capture.JPG'));
imshow(x);
title('Original Image');
figure;
imhist(x);
axis tight;
title('Histogram of Original Image');
figure;
imshow(im2bw(x,graythresh(x)));
title('Global Thresholding');
figure;
[r c]=size(x);
output=zeros(r,c);
starts=floor(1:c/10:c);
ends=starts(2:length(starts));
ends=[ends c];
imshow(x);
hold on;
for i=1:10
plot([ends(i) ends(i)],[1 r],'w');
end
for i=1:10
temp=x(:,starts(i):ends(i));
out(:,starts(i):ends(i))=im2bw(temp,graythresh(temp));
end
figure;
imshow(out);
title('Output of Variable Thresholding');
Learn Image Processing using MATLAB:
https://www.youtube.com/watch?v=L9hku2og874&list=PLjfRmoYoxpNostbIaNSpzJr06mDb6qAJ0&index=2&t=37s
#DigitalImageProcessing #MATLAB #ComputerVision
Tags and Topics
Browse our collection to discover more content in these categories.
Video Information
Views
2.2K
Likes
19
Duration
7:29
Published
Jul 27, 2020
User Reviews
4.2
(2) Related Trending Topics
LIVE TRENDSRelated trending topics. Click any trend to explore more videos.
No specific trending topics match this video yet.
Explore All Trends