Introduction
This lab will demonstrate how to use the RangeSlider widget in Matplotlib to control the thresholding of an image. The purpose of thresholding is to convert a grayscale image into a binary image, where the pixels are either black or white. This is useful for image segmentation, where we want to extract certain features from the image.
VM Tips
After the VM startup is done, click the top left corner to switch to the Notebook tab to access Jupyter Notebook for practice.
Sometimes, you may need to wait a few seconds for Jupyter Notebook to finish loading. The validation of operations cannot be automated because of limitations in Jupyter Notebook.
If you face issues during learning, feel free to ask Labby. Provide feedback after the session, and we will promptly resolve the problem for you.
Skills Graph
%%%%{init: {'theme':'neutral'}}%%%%
flowchart RL
python(("`Python`")) -.-> python/BasicConceptsGroup(["`Basic Concepts`"])
matplotlib(("`Matplotlib`")) -.-> matplotlib/PlottingDataGroup(["`Plotting Data`"])
matplotlib(("`Matplotlib`")) -.-> matplotlib/InteractiveFeaturesGroup(["`Interactive Features`"])
python(("`Python`")) -.-> python/DataStructuresGroup(["`Data Structures`"])
python(("`Python`")) -.-> python/FunctionsGroup(["`Functions`"])
python(("`Python`")) -.-> python/ModulesandPackagesGroup(["`Modules and Packages`"])
python(("`Python`")) -.-> python/PythonStandardLibraryGroup(["`Python Standard Library`"])
python/BasicConceptsGroup -.-> python/comments("`Comments`")
matplotlib/PlottingDataGroup -.-> matplotlib/histograms("`Histograms`")
matplotlib/PlottingDataGroup -.-> matplotlib/heatmaps("`Heatmaps`")
matplotlib/InteractiveFeaturesGroup -.-> matplotlib/widgets_sliders("`Widgets and Sliders`")
python/BasicConceptsGroup -.-> python/variables_data_types("`Variables and Data Types`")
python/DataStructuresGroup -.-> python/lists("`Lists`")
python/DataStructuresGroup -.-> python/tuples("`Tuples`")
python/FunctionsGroup -.-> python/function_definition("`Function Definition`")
python/ModulesandPackagesGroup -.-> python/standard_libraries("`Common Standard Libraries`")
python/PythonStandardLibraryGroup -.-> python/math_random("`Math and Random`")
python/PythonStandardLibraryGroup -.-> python/data_collections("`Data Collections`")
python/FunctionsGroup -.-> python/build_in_functions("`Build-in Functions`")
subgraph Lab Skills
python/comments -.-> lab-48902{{"`Thresholding an Image with RangeSlider`"}}
matplotlib/histograms -.-> lab-48902{{"`Thresholding an Image with RangeSlider`"}}
matplotlib/heatmaps -.-> lab-48902{{"`Thresholding an Image with RangeSlider`"}}
matplotlib/widgets_sliders -.-> lab-48902{{"`Thresholding an Image with RangeSlider`"}}
python/variables_data_types -.-> lab-48902{{"`Thresholding an Image with RangeSlider`"}}
python/lists -.-> lab-48902{{"`Thresholding an Image with RangeSlider`"}}
python/tuples -.-> lab-48902{{"`Thresholding an Image with RangeSlider`"}}
python/function_definition -.-> lab-48902{{"`Thresholding an Image with RangeSlider`"}}
python/standard_libraries -.-> lab-48902{{"`Thresholding an Image with RangeSlider`"}}
python/math_random -.-> lab-48902{{"`Thresholding an Image with RangeSlider`"}}
python/data_collections -.-> lab-48902{{"`Thresholding an Image with RangeSlider`"}}
python/build_in_functions -.-> lab-48902{{"`Thresholding an Image with RangeSlider`"}}
end