{"id":10629,"date":"2020-02-24T10:52:28","date_gmt":"2020-02-24T10:52:28","guid":{"rendered":"http:\/\/blog.bachi.net\/?p=10629"},"modified":"2020-06-29T14:45:36","modified_gmt":"2020-06-29T14:45:36","slug":"tsm_compvis","status":"publish","type":"post","link":"https:\/\/blog.bachi.net\/?p=10629","title":{"rendered":"TSM_CompVis"},"content":{"rendered":"<p><a href=\"http:\/\/neuralnetworksanddeeplearning.com\/\">Neural Networks and Deep Learning<\/a><br \/>\n<a href=\"https:\/\/www.deeplearningbook.org\/\">Deep Learning<\/a>, Ian Goodfellow and Yoshua Bengio and Aaron Courville<br \/>\n<a href=\"https:\/\/github.com\/mnielsen\/neural-networks-and-deep-learning\">Code samples for my book &#8220;Neural Networks and Deep Learning&#8221;<\/a><br \/>\n<a href=\"https:\/\/cs231n.github.io\/convolutional-networks\/\">CS231n Convolutional Neural Networks for Visual Recognition<\/a><br \/>\n<a href=\"https:\/\/d2l.ai\/chapter_convolutional-neural-networks\/padding-and-strides.html\">Padding and Stride<\/a><br \/>\n<a href=\"https:\/\/adeshpande3.github.io\/A-Beginner%27s-Guide-To-Understanding-Convolutional-Neural-Networks-Part-2\/\">A Beginner&#8217;s Guide To Understanding Convolutional Neural Networks Part 2<\/a><\/p>\n<p><!-- skimage =================================================================== --><\/p>\n<h2>skimage<\/h2>\n<p><a href=\"https:\/\/scikit-image.org\/docs\/dev\/auto_examples\/\">General examples<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/auto_examples\/filters\/plot_hysteresis.html\">Hysteresis thresholding<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/auto_examples\/filters\/plot_rank_mean.html\">Mean filters<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/auto_examples\/filters\/plot_denoise.html\">Denoising a picture<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/auto_examples\/filters\/plot_unsharp_mask.html\">Unsharp masking<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/auto_examples\/edges\/plot_canny.html\">Canny edge detector<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/auto_examples\/edges\/plot_line_hough_transform.html\">Straight line Hough transform<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/auto_examples\/edges\/plot_circular_elliptical_hough_transform.html\">Circular and Elliptical Hough Transforms<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/auto_examples\/transform\/plot_rescale.html\">Rescale, resize, and downscale<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/auto_examples\/transform\/plot_piecewise_affine.html\">Piecewise Affine Transformation<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/auto_examples\/color_exposure\/plot_equalize.html\">Histogram Equalization<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/auto_examples\/color_exposure\/plot_rgb_to_gray.html\">RGB to grayscale<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/auto_examples\/color_exposure\/plot_adapt_rgb.html\">Adapting gray-scale filters to RGB images<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/auto_examples\/segmentation\/plot_thresholding.html\">Thresholding<\/a>, Otsu&#8217;s method<br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/auto_examples\/applications\/plot_morphology.html\">Morphological Filtering<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/auto_examples\/applications\/plot_rank_filters.html\">Rank filters<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/user_guide\/tutorial_segmentation.html\">Image Segmentation<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/user_guide\/numpy_images.html\">A crash course on NumPy for images<\/a><\/p>\n<h4>API<\/h4>\n<p><a href=\"https:\/\/scikit-image.org\/docs\/dev\/api\/skimage.io.html\">Module: io<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/api\/skimage.filters.html\">Module: filters<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/api\/skimage.transform.html\">Module: transform<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/api\/skimage.morphology.html\">Module: morphology<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/api\/skimage.color.html\">Module: color<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/api\/skimage.exposure.html\">Module: exposure<\/a><\/p>\n<h4>Tutorial<\/h4>\n<p><a href=\"https:\/\/github.com\/scikit-image\/scikit-image\/issues\/2700\">Bright ridge detection not working as expected with Frangi<\/a>, Frangi-, Hessian-Filter<br \/>\n<a href=\"https:\/\/tonysyu.github.io\/ipython-jupyter-widgets-an-image-convolution-demo.html#.XoWnDIgzaPp\">IPython (Jupyter) widgets: An image convolution demo<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/35192550\/wiener-filter-for-image-deblur\">Wiener Filter for image deblur<\/a><br \/>\n<a href=\"https:\/\/github.com\/scikit-image\/skimage-demos\/blob\/master\/clock_deblur.py\">github.com\/scikit-image\/skimage-demos\/blob\/master\/clock_deblur.py<\/a><br \/>\n<a href=\"https:\/\/towardsdatascience.com\/histogram-equalization-5d1013626e64\">Histogram Equalization<\/a><\/p>\n<p><!-- scipy ====================================================================== --><\/p>\n<h2>scipy<\/h2>\n<p><a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/tutorial\/ndimage.html\">Multidimensional image processing (scipy.ndimage)<\/a><\/p>\n<h4>API<\/h4>\n<p><a href=\"https:\/\/docs.scipy.org\/doc\/scipy\/reference\/generated\/scipy.ndimage.binary_fill_holes.html\">scipy.ndimage.binary_fill_holes<\/a><\/p>\n<p><!-- Python ===================================================================== --><\/p>\n<h2>Python<\/h2>\n<h4>python-kurs.eu<\/h4>\n<p><a href=\"https:\/\/www.python-kurs.eu\/python3_generatoren.php\">Generatoren und Iteratoren<\/a><br \/>\n<a href=\"https:\/\/www.python-kurs.eu\/python3_lambda.php\">Lambda, filter, reduce und map<\/a><br \/>\n<a href=\"https:\/\/www.python-kurs.eu\/python3_list_comprehension.php\">Listen-Abstraktion (List Comprehension)<\/a><\/p>\n<h4>ORDIX blog<\/h4>\n<p><a href=\"https:\/\/blog.ordix.de\/technologien\/generatoren-in-python\">Python Generator-Funktionen und -Expressions: Ein alter Hut kann auch modern sein<\/a><br \/>\n<a href=\"https:\/\/blog.ordix.de\/technologien\/einstieg-in-neuronale-netze-mit-tensorflow-und-keras\">Einstieg in Neuronale Netze mit TensorFlow und Keras<\/a><br \/>\n<a href=\"https:\/\/blog.ordix.de\/unternehmen\/data-mining-in-der-praxis-teil-i-was-ist-data-mining-1\">Data Mining in der Praxis (Teil I): Was ist Data Mining?<\/a><br \/>\n<a href=\"https:\/\/blog.ordix.de\/technologien\/data-mining-in-der-praxis-teil-ii-klassifikation\">Data Mining in der Praxis (Teil II): Klassifikation<\/a><br \/>\n<a href=\"https:\/\/blog.ordix.de\/technologien\/data-mining-in-der-praxis-teil-iii-lineare-regression\">Data Mining in der Praxis (Teil III) Lineare Regression<\/a><\/p>\n<h4>Real Python<\/h4>\n<p><a href=\"https:\/\/realpython.com\/python-f-strings\/\">Python 3&#8217;s f-Strings: An Improved String Formatting Syntax (Guide)<\/a><\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nname = &quot;Eric&quot;\r\nage = 28\r\n\r\n### Option #1: %-formatting\r\nprint(&quot;Hello, %s. You are %d.&quot; % (name, age))\r\n\r\n### Option #2: str.format()\r\nprint(&quot;Hello, {}. You are {}.&quot;.format(name, age))\r\n\r\n### Option #3: f-Strings\r\nprint(f&quot;Hello, {name}. You are {age}.&quot;)\r\n<\/pre>\n<p><!-- Homework =================================================================== --><\/p>\n<h2>Homework<\/h2>\n<p><a href=\"https:\/\/www.inovex.de\/blog\/digitize-receipts-computer-vision\/\">Digitize your Receipts using Computer Vision<\/a><br \/>\n<a href=\"https:\/\/dzone.com\/articles\/using-ocr-for-receipt-recognition\">Deep Dive Into OCR for Receipt Recognition<\/a><br \/>\n<a href=\"https:\/\/hackernoon.com\/simple-ocr-implementation-on-android-with-googles-ml-kit-ceb4cdd8d70c\">Simple OCR implementation on Android with Google\u2019s ML Kit<\/a><\/p>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/46565975\/find-intersection-point-of-two-lines-drawn-using-houghlines-opencv\/49590801\">find intersection point of two lines drawn using houghlines opencv<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/383480\/intersection-of-two-lines-defined-in-rho-theta-parameterization\/383527\">Intersection of two lines defined in (rho\/theta ) parameterization<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/59318555\/reading-multiple-invoices-from-an-image-using-ocr-computer-vision\">Reading multiple invoices from an image using OCR\/computer vision<\/a><br \/>\n<a href=\"https:\/\/www.quora.com\/How-can-I-detect-an-object-from-static-image-and-crop-it-from-the-image-using-openCV\">How can I detect an object from static image and crop it from the image using openCV?<\/a><br \/>\n<a href=\"https:\/\/ocr.space\/receiptscanning\">Receipt Scanning &#8211; How to scan a receipt and extract data from it<\/a><\/p>\n<p><a href=\"https:\/\/answers.opencv.org\/question\/92164\/how-to-find-coordinates-of-intersection-of-lines-after-using-houghlines\/\">how to find coordinates of intersection of lines after using &#8220;houghlines&#8221;<\/a><\/p>\n<p><a href=\"https:\/\/www.chromeriver.com\/innovations\/mobile-receipt-handling\">Expense Reports in a Snap (or a Tap)<\/a><\/p>\n<h4>Homogene Koordinaten<\/h4>\n<p><a href=\"https:\/\/de.wikipedia.org\/wiki\/Homogene_Koordinaten\">Homogene Koordinaten<\/a><br \/>\n<a href=\"https:\/\/de.wikipedia.org\/wiki\/Ebenengleichung\">Ebenengleichung<\/a><br \/>\n<a href=\"https:\/\/de.wikipedia.org\/wiki\/Koordinatenform\">Koordinatenform<\/a><\/p>\n<p><a href=\"https:\/\/www.matheretter.de\/wiki\/homogene-koordinaten\">Homogene Koordinaten<\/a><br \/>\n<a href=\"http:\/\/www.maths.lth.se\/matematiklth\/personal\/calle\/datorseende13\/notes\/forelas2.pdf\">Lecture 2: Homogeneous Coordinates, Lines and Conics<\/a> (PDF)<\/p>\n<p><!-- Computer Vision (SBE404B) =================================================================== --><\/p>\n<h2>Computer Vision (SBE404B)<\/h4>\n<p><a href=\"https:\/\/a-alaa.github.io\/\">Asem Alaa<\/a><br \/>\n<a href=\"https:\/\/github.com\/EslamAdel\">EslamAdel<\/a><br \/>\n<a href=\"https:\/\/github.com\/A-M-Anwar\">Ayman Anwar<\/a><\/p>\n<p><a href=\"https:\/\/sbme-tutorials.github.io\/2020\/cv\/\">Computer Vision (SBE404B) &#8211; Spring 2020<\/a><br \/>\n<a href=\"https:\/\/sbme-tutorials.github.io\/2019\/cv\/cv.html\">Computer Vision (SBE404B) &#8211; Spring 2019<\/a><br \/>\n<a href=\"https:\/\/sbme-tutorials.github.io\/2018\/cv\/cv.html\">Computer Vision (SBE404B) &#8211; Spring 2018<\/a><\/p>\n<p><a href=\"https:\/\/sbme-tutorials.github.io\/2018\/cv\/notes\/1_week1.html\">Week 1: Warming up with Python Basics<\/a><br \/>\n<a href=\"https:\/\/sbme-tutorials.github.io\/2018\/cv\/notes\/2_week2.html\">Week 2: Image Processing 1<\/a><br \/>\n<a href=\"https:\/\/sbme-tutorials.github.io\/2018\/cv\/notes\/3_week3.html\">Week 3: Images in Frequency Domain<\/a><br \/>\n<a href=\"https:\/\/sbme-tutorials.github.io\/2018\/cv\/notes\/4_week4.html\">Week 4: Image Filtering and Edge Detection<\/a><br \/>\n<a href=\"https:\/\/sbme-tutorials.github.io\/2018\/cv\/notes\/5_week5.html\">Week 5: Hough Transform (Line and Circle Detection)<\/a><br \/>\n<a href=\"https:\/\/sbme-tutorials.github.io\/2018\/cv\/notes\/6_week6.html\">Week 6: Corner Detection<\/a><br \/>\n<a href=\"https:\/\/sbme-tutorials.github.io\/2018\/cv\/notes\/7_week7.html\">Week 7: Segmentation (Thresholding and Region growing)<\/a><br \/>\n<a href=\"https:\/\/sbme-tutorials.github.io\/2018\/cv\/notes\/8_week8.html\">Week 8: Segmentation (Clustering Segmentation)<\/a><br \/>\n<a href=\"https:\/\/sbme-tutorials.github.io\/2018\/cv\/notes\/9_week9.html\">Week 10: Image features, feature descriptors, and feature matching<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/sbme-tutorials\/cv-week1-demo\">github.com\/sbme-tutorials\/cv-week1-demo<\/a><br \/>\n<a href=\"https:\/\/github.com\/sbme-tutorials\/sbe401-week2-demo\">github.com\/sbme-tutorials\/sbe401-week2-demo<\/a><br \/>\n<a href=\"https:\/\/github.com\/sbme-tutorials\/cv_week3_demo\">github.com\/sbme-tutorials\/cv_week3_demo<\/a><br \/>\n<a href=\"https:\/\/github.com\/sbme-tutorials\/cv-week4-demo\">github.com\/sbme-tutorials\/cv-week4-demo<\/a><br \/>\n<a href=\"https:\/\/github.com\/sbme-tutorials\/cv-week8-demo\">github.com\/sbme-tutorials\/cv-week8-demo<\/a><\/p>\n<p><!-- Week 1 ===================================================================== --><\/p>\n<h2>Week 1<\/h2>\n<p><a href=\"https:\/\/web.media.mit.edu\/~tswedish\/blog\/2018\/03\/12\/opt-odom\">Deep Learning Alchemy to close the Perception Loop in Vision: Part 1 &#8211; Image Alignment with Pytorch<\/a><br \/>\n<a href=\"http:\/\/cs231n.github.io\/python-numpy-tutorial\/\">CS231n Convolutional Neural Networks for Visual Recognition &#8211; Python Numpy Tutorial<\/a><br \/>\n<a href=\"https:\/\/github.com\/kuleshov\/cs228-material\/blob\/master\/tutorials\/python\/cs228-python-tutorial.ipynb\">CS228 Python Tutorial<\/a> (Notebook)<br \/>\n<a href=\"https:\/\/blog.teamtreehouse.com\/python-single-line-loops\">Python Single Line For Loops<\/a><br \/>\n<a href=\"https:\/\/medium.com\/@melodyxu\/the-confusing-double-colon-in-numpy-850093adc36f\">The Confusing Double Colon (::) in NumPy<\/a><\/p>\n<h3>Flags<\/h3>\n<p><a href=\"https:\/\/pyx-project.org\/\">PyX \u2014 Python graphics package<\/a><br \/>\n<a href=\"https:\/\/progzoo.net\/wiki\/Python:Flags_Tutorial\">Python:Flags Tutorial<\/a><br \/>\n<a href=\"https:\/\/progzoo.net\/wiki\/Python:Flags_with_Lines_Tutorial\">Python:Flags with Lines Tutorial<\/a><\/p>\n<h3>Python Essentials<\/h3>\n<h4>Data Structure<\/h4>\n<p><a href=\"https:\/\/thomas-cokelaer.info\/tutorials\/python\/data_structures.html\">4. Data Structures (list, dict, tuples, sets, strings)<\/a><br \/>\n<a href=\"https:\/\/docs.python.org\/3\/tutorial\/datastructures.html\">5. Data Structures<\/a><\/p>\n<p><a href=\"https:\/\/www.tutorialsteacher.com\/python\/python-data-types\">Python Data Types<\/a><br \/>\n<a href=\"https:\/\/realpython.com\/python-data-types\/\">Basic Data Types in Python<\/a><br \/>\n<a href=\"https:\/\/www.geeksforgeeks.org\/python-data-types\/\">Python Data Types<\/a><br \/>\n<a href=\"http:\/\/Python Data Types\">Data Types in Python<\/a><\/p>\n<h4>Format String<\/h4>\n<p><a href=\"https:\/\/docs.python.org\/3.8\/library\/string.html#format-string-syntax\">Format String Syntax<\/a><br \/>\n<a href=\"https:\/\/docs.python.org\/3.8\/library\/string.html#formatstrings\">Format String Syntax<\/a><br \/>\n<a href=\"https:\/\/docs.python.org\/3.8\/library\/string.html#formatspec\">Format Specification Mini-Language<\/a><\/p>\n<h4>Slice<\/h4>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/509211\/understanding-slice-notation\">Understanding slice notation<\/a><\/p>\n<h4>Loop, Iteration<\/h4>\n<p><a href=\"https:\/\/opensource.com\/article\/18\/3\/loop-better-deeper-look-iteration-python\">Loop better: A deeper look at iteration in Python<\/a><br \/>\n<a href=\"https:\/\/towardsdatascience.com\/python-basics-iteration-and-looping-6ca63b30835c\">Python Basics: Iteration, Iterables, Iterators, and Looping<\/a><\/p>\n<h4>Exercise<\/h4>\n<p><a href=\"https:\/\/www.w3resource.com\/python-exercises\/numpy\/index.php\">W3Resources: NumPy Exercises, Practice, Solution<\/a><br \/>\n<a href=\"https:\/\/www.machinelearningplus.com\/python\/101-numpy-exercises-python\/\">Machine Learning Plus: 101 NumPy Exercises for Data Analysis (Python)<\/a><br \/>\n<a href=\"https:\/\/www.hackerrank.com\/domains\/python\/numpy\/page\/1\">HackerRank: Numpy Challenges<\/a><\/p>\n<p><!-- Week 2 ===================================================================== --><\/p>\n<h2>Week 2<\/h3>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/31638651\/how-can-i-draw-lines-into-numpy-arrays\/47381058\">How can I draw lines into numpy arrays?<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/35537453\/how-to-draw-thick-anti-aliased-lines-in-scipy\">How to draw thick anti-aliased lines in SciPy?<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/api\/skimage.draw.html\">scikit-image &#8211; Module: draw<\/a><br \/>\n<a href=\"https:\/\/scikit-image.org\/docs\/dev\/auto_examples\/edges\/plot_shapes.html\">scikit-image &#8211; Shapes<\/a><br \/>\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/Line_drawing_algorithm\">Wikipedia: Line drawing algorithm<\/a><br \/>\n<a href=\"https:\/\/de.wikipedia.org\/wiki\/Rasterung_von_Linien\">Rasterung von Linien<\/a><br \/>\n<a href=\"https:\/\/de.wikipedia.org\/wiki\/Rasterung\">Rasterung<\/a><\/p>\n<p><!-- Week 3 ===================================================================== --><\/p>\n<h2>Week 3<\/h3>\n<h4>Convert NumPy<\/h4>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/17506163\/how-to-convert-a-boolean-array-to-an-int-array\">How to convert a boolean array to an int array<\/a><\/p>\n<h4>Histogramm<\/h4>\n<p><a href=\"https:\/\/towardsdatascience.com\/histograms-in-image-processing-with-skimage-python-be5938962935\">Histograms in Image Processing with skimage-Python<\/a><\/p>\n<p><!-- Week 4 ===================================================================== --><\/p>\n<h2>Week 4<\/h4>\n<p><a href=\"https:\/\/datacarpentry.org\/image-processing\/\">Image Processing with Python<\/a><\/p>\n<p><a href=\"https:\/\/docs.python.org\/3\/library\/functions.html\">Python 3 &#8211; Built-in Functions<\/a><br \/>\n<a href=\"https:\/\/docs.python.org\/3\/library\/stdtypes.html#typesseq\">Python 3 &#8211; Built-in Types<\/a><\/p>\n<h4>scikit-image.org<\/h4>\n<p><a href=\"https:\/\/scikit-image.org\/docs\/dev\/api\/skimage.transform.html\">Module: transform<\/a><\/p>\n<h4>kite<\/h4>\n<p><a href=\"https:\/\/kite.com\/python\/docs\/skimage.transform.resize\">resize<\/a><br \/>\n<a href=\"https:\/\/kite.com\/python\/docs\/skimage.transform.rescale\">rescale<\/a><\/p>\n<h4>YouTube<\/h4>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=d1CIV9irQAY\">Image Analysis in Python with SciPy and Scikit Image | Scipy 2019 Tutorial | Nunez-Iglesias<\/a><br \/>\n<a href=\"https:\/\/www.youtube.com\/watch?v=pZATswy_IsQ\">Image Analysis in Python with SciPy and scikit-image | SciPy 2018 Tutorial | Stefan van der Walt<\/a><br \/>\n<a href=\"https:\/\/www.youtube.com\/watch?v=CTOURPZftuU\">20 &#8211; Introduction to image processing using scikit-image in Python<\/a><\/p>\n<h4>ABC<\/h4>\n<p><a href=\"https:\/\/docs.python.org\/3\/glossary.html#term-abstract-base-class\">Glossary: ABC<\/a><br \/>\n<a href=\"https:\/\/docs.python.org\/3\/library\/collections.abc.html#collections.abc.Sequence\">Abstract Base Classes for Containers<\/a><\/p>\n<h4>Iterable \/ Iterator<\/h4>\n<p>Iter-<strong>ables<\/strong> are able to be iterated over. Iter-<strong>ators<\/strong> are the agents that perform the iteration.<\/p>\n<p>Iterators are lazy single-use iterables (not precompiled, just-in-time calculation)<\/p>\n<ul>\n<li>They\u2019re \u201clazy\u201d because they have the ability to only compute items as you loop over them.<\/li>\n<li>And they\u2019re \u201csingle-use\u201d because once you\u2019ve \u201cconsumed\u201d an item from an iterator, it\u2019s gone forever.<\/li>\n<li>The term \u201cexhausted\u201d is often used for an iterator that has been fully consumed.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/treyhunner.com\/2016\/12\/python-iterator-protocol-how-for-loops-work\/\">The Iterator Protocol: How &#8220;For Loops&#8221; Work in Python<\/a><\/p>\n<p>Importantly, it should be noted that iterators are stateful. Meaning once you\u2019ve consumed an item from an iterator, it\u2019s gone. So after you\u2019ve looped over an iterator once, it\u2019ll be empty if you try to loop over it again.<\/p>\n<p>An iterator is like a stream of items. You can only look at the items in the stream one at a time and you only ever have access to the first element. To look at something in the stream, you need to remove it from the stream and once you take something from the top of the stream, it&#8217;s gone from the stream for good.<\/p>\n<h4>range<\/h4>\n<p><code>range<\/code> is an <code>iterable<\/code>, but not an <code>iterator<\/code><\/p>\n<p><a href=\"https:\/\/docs.python.org\/3\/library\/stdtypes.html#sequence-types-list-tuple-range\">Sequence Types \u2014 list, tuple, range<\/a><br \/>\n<a href=\"https:\/\/docs.python.org\/3\/library\/stdtypes.html#ranges\">Ranges<\/a><br \/>\n<a href=\"https:\/\/www.pythoncentral.io\/pythons-range-function-explained\/\">Python\u2019s range() Function Explained<\/a><br \/>\n<a href=\"https:\/\/treyhunner.com\/2018\/02\/python-range-is-not-an-iterator\/\">Python: range is not an iterator!<\/a><\/p>\n<ul>\n<li>immutable sequence type<\/li>\n<li>looping a specific number of times in for loops<\/li>\n<li>When you&#8217;re using an iterator, every loop of the for statement produces the next number on the fly.<\/li>\n<\/ul>\n<p>The advantage of the <code>range<\/code> type over a regular <code>list<\/code> or <code>tuple<\/code> is that a <code>range<\/code> object will always take the same (small) amount of memory, no matter the size of the <code>range<\/code> it represents (as it only stores the <code>start<\/code>, <code>stop<\/code> and <code>step<\/code> values, calculating individual <code>items<\/code> and <code>subranges<\/code> as needed).<\/p>\n<h4>zip<\/h4>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/38024554\/python-iterator-and-zip\">Python iterator and zip<\/a><br \/>\n<a href=\"https:\/\/realpython.com\/python-zip-function\/\">Using the Python zip() Function for Parallel Iteration<\/a><\/p>\n<h4>Packing \/ Unpacking<\/h4>\n<p><a href=\"https:\/\/docs.python.org\/2\/tutorial\/controlflow.html#unpacking-argument-lists\">4.7.4. Unpacking Argument Lists<\/a><\/p>\n<h4>Generator<\/h4>\n<p><code>Iterable -> Iterator -> Generator<\/code><\/p>\n<p><a href=\"https:\/\/www.programiz.com\/python-programming\/generator\">Python Generators<\/a><br \/>\n<a href=\"https:\/\/wiki.python.org\/moin\/Generators\">Generators<\/a><br \/>\n<a href=\"https:\/\/data-flair.training\/blogs\/python-generator-vs-iterator\/\">Python Generators vs Iterators \u2013 Comparison Between Python Iterators and Generators<\/a><br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/2776829\/difference-between-pythons-generators-and-iterators\">Difference between Python&#8217;s Generators and Iterators<\/a><\/p>\n<h4>Generator Expressions vs. List Comprehension<\/h4>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\n# Generator expression\r\n(x*2 for x in range(256))\r\n\r\n# List comprehension\r\n&#x5B;x*2 for x in range(256)]\r\n<\/pre>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nline_list = &#x5B;'  line 1\\n', 'line 2  \\n', ...]\r\n\r\n# Generator expression -- returns iterator\r\nstripped_iter = (line.strip() for line in line_list)\r\n\r\n# List comprehension -- returns list\r\nstripped_list = &#x5B;line.strip() for line in line_list]\r\n<\/pre>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/47789\/generator-expressions-vs-list-comprehension\">Generator Expressions vs. List Comprehension<\/a><br \/>\n<a href=\"https:\/\/docs.python.org\/3\/howto\/functional.html#generator-expressions-and-list-comprehensions\">Generator expressions and list comprehensions<\/a><br \/>\n<a href=\"https:\/\/www.geeksforgeeks.org\/python-list-comprehensions-vs-generator-expressions\/\">Python List Comprehensions vs Generator Expressions<\/a><\/p>\n<p><!-- Week 10 ===================================================================== --><\/p>\n<h2>Week 10<\/h3>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/53768922\/converting-image-from-rgb-to-luv-and-back-results-in-different-image\">Converting image from RGB to LUV and back results in different image<\/a><\/p>\n<p><a href=\"https:\/\/docs.opencv.org\/3.0-beta\/doc\/py_tutorials\/py_ml\/py_kmeans\/py_kmeans_opencv\/py_kmeans_opencv.html\">K-Means Clustering in OpenCV<\/a><br \/>\n<a href=\"https:\/\/de.wikipedia.org\/wiki\/Liste_der_Farbr%C3%A4ume\">Liste der Farbr\u00e4ume<\/a><br \/>\n<a href=\"https:\/\/de.wikipedia.org\/wiki\/CIELUV-Farbraumsystem\">CIELUV-Farbraumsystem<\/a><br \/>\n<a href=\"https:\/\/en.wikipedia.org\/wiki\/CIELUV\">CIELUV<\/a><\/p>\n<p><!-- Week 14 ===================================================================== --><\/p>\n<h2>Week 14<\/h3>\n<p><a href=\"https:\/\/hirotomusiker.github.io\/medium\/\">Hiroto Honda&#8217;s Medium Blog Posts<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Neural Networks and Deep Learning Deep Learning, Ian Goodfellow and Yoshua Bengio and Aaron Courville Code samples for my book &#8220;Neural Networks and Deep Learning&#8221; CS231n Convolutional Neural Networks for Visual Recognition Padding and Stride A Beginner&#8217;s Guide To Understanding Convolutional Neural Networks Part 2 skimage General examples Hysteresis thresholding Mean filters Denoising a picture [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-10629","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/10629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10629"}],"version-history":[{"count":60,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/10629\/revisions"}],"predecessor-version":[{"id":11237,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/10629\/revisions\/11237"}],"wp:attachment":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}