summaryrefslogtreecommitdiff
path: root/Digital_Image_Processing_by_S_Jayaraman/10-Binary_Image_Processing.ipynb
diff options
context:
space:
mode:
authorPrashant S2020-04-14 10:25:32 +0530
committerGitHub2020-04-14 10:25:32 +0530
commit06b09e7d29d252fb2f5a056eeb8bd1264ff6a333 (patch)
tree2b1df110e24ff0174830d7f825f43ff1c134d1af /Digital_Image_Processing_by_S_Jayaraman/10-Binary_Image_Processing.ipynb
parentabb52650288b08a680335531742a7126ad0fb846 (diff)
parent476705d693c7122d34f9b049fa79b935405c9b49 (diff)
downloadall-scilab-tbc-books-ipynb-master.tar.gz
all-scilab-tbc-books-ipynb-master.tar.bz2
all-scilab-tbc-books-ipynb-master.zip
Merge pull request #1 from prashantsinalkar/masterHEADmaster
Initial commit
Diffstat (limited to 'Digital_Image_Processing_by_S_Jayaraman/10-Binary_Image_Processing.ipynb')
-rw-r--r--Digital_Image_Processing_by_S_Jayaraman/10-Binary_Image_Processing.ipynb118
1 files changed, 118 insertions, 0 deletions
diff --git a/Digital_Image_Processing_by_S_Jayaraman/10-Binary_Image_Processing.ipynb b/Digital_Image_Processing_by_S_Jayaraman/10-Binary_Image_Processing.ipynb
new file mode 100644
index 0000000..24d9473
--- /dev/null
+++ b/Digital_Image_Processing_by_S_Jayaraman/10-Binary_Image_Processing.ipynb
@@ -0,0 +1,118 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 10: Binary Image Processing"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.17: Scilab_Code_for_dilation_and_erosion_process.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Caption: Scilab Code for dilation and erosion process\n",
+"//Fig.10.17\n",
+"//Page553\n",
+"close;\n",
+"clear;\n",
+"clc;\n",
+"a = imread('E:\DIP_JAYARAMAN\Chapter10\morph1.bmp'); //SIVP toolbox\n",
+"//b =[1,1,1;1,1,1;1,1,1];\n",
+"StructureElement = CreateStructureElement('square', 3) ;\n",
+"a1 = DilateImage(a,StructureElement);\n",
+"a2 = ErodeImage(a,StructureElement);\n",
+"//Displaying original Image\n",
+"//imshow(a)\n",
+"figure(1)\n",
+"ShowImage(a,'Original Image');\n",
+"//Displaying Dilated Image\n",
+"//imshow(a1)\n",
+"figure(2)\n",
+"ShowImage(a1,'Dilated Image');\n",
+"xtitle('Dilated Image')\n",
+"//Displaying Eroded Image\n",
+"//imshow(a2)\n",
+"figure(3)\n",
+"ShowImage(a2,'Eroded Image');\n",
+"xtitle('Eroded Image')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 10.19: Scilab_Code_to_perform_an_opening_and_closing_operation_on_the_image.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Caption: Scilab Code to perform an opening and closing operation on the image\n",
+"//Fig.10.19\n",
+"//Page555\n",
+"close;\n",
+"clear;\n",
+"clc;\n",
+"a = imread('E:\DIP_JAYARAMAN\Chapter10\morph2.bmp'); //SIVP toolbox\n",
+"//b =[1,1,1;1,1,1;1,1,1];\n",
+"StructureElement = CreateStructureElement('square', 3) ;\n",
+"//Opening is done by first applying erosion and then dilation operations on image\n",
+"b1 = ErodeImage(a,StructureElement);\n",
+"b2 = DilateImage(b1,StructureElement);\n",
+"//Closing is done by first applying dilation and then erosion operation on image\n",
+"a1 = DilateImage(a,StructureElement);\n",
+"a2 = ErodeImage(a1,StructureElement);\n",
+"//Displaying original Image\n",
+"figure(1)\n",
+"ShowImage(a,'Original Image');\n",
+"//Displaying Opened Image\n",
+"figure(2)\n",
+"ShowImage(b2, 'Opened Image');\n",
+"xtitle('Opened Image')\n",
+"//Displaying Closed Image\n",
+"figure(3)\n",
+"ShowImage(a2, 'Closed Image');\n",
+"xtitle('Closed Image')"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}