© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2021
T. LaversLearn to Program with Kotlinhttps://doi.org/10.1007/978-1-4842-6815-5_19

19. Finding Digits

Tim Lavers1  
(1)
Woonona, NSW, Australia
 

In this chapter, we will write a class that, given a Picture containing a speed sign, will extract a List of Pictures representing the individual digits in the sign. To get started, open https://github.com/Apress/learn-to-program-w-kotlin-ch19.git.

19.1 DigitFinder

In addition to Picture, the project contains a class called DigitFinder:
 1   package lpk.imaging
 2
 3   import java.awt.Color
 4
 5   class DigitFinder(val input : Picture) {
 6       fun digits() : List<Picture> {
 7           val result = mutableListOf<Picture>() ...

Get Learn to Program with Kotlin: From the Basics to Projects with Text and Image Processing now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.