summaryrefslogtreecommitdiff
path: root/2993/CH2/EX2.6/Ex2_6.sce
diff options
context:
space:
mode:
Diffstat (limited to '2993/CH2/EX2.6/Ex2_6.sce')
-rw-r--r--2993/CH2/EX2.6/Ex2_6.sce22
1 files changed, 22 insertions, 0 deletions
diff --git a/2993/CH2/EX2.6/Ex2_6.sce b/2993/CH2/EX2.6/Ex2_6.sce
new file mode 100644
index 000000000..9eac35228
--- /dev/null
+++ b/2993/CH2/EX2.6/Ex2_6.sce
@@ -0,0 +1,22 @@
+
+clc;
+close;
+
+//Given image matrix is F
+F = [1 2; 5 4]
+
+//Threshold value(Thresh) = 3
+Thresh = [2 2; 2 1];
+
+//Thresholded Image after applying Threshold
+
+for i = 1:4
+ if (F(i)>=Thresh(i)) then //If the pixel value is >= Threshold , the output is 1
+ F(i) = 1;
+ else
+ F(i) = 0; //If the pixel value is not >= Threshold , the output is 0
+ end
+end
+
+disp(F,'F = ','The Output ')//The output after thresholding
+