
Implementation of Distance Transformation using Processing By Rama Prasada Reddy Peddireddy A project report submitted to the Graduate Faculty of the University of Colorado at Colorado Springs in the partial fulfillment of the requirements for the degree of Master of Science in Computer Science Engineering Department of Computer Science 2017 1 | P a g e This report for the Master of Science degree by Rama Prasada Reddy Peddireddy has been approved for the Department of Computer Science by ______________________________________________________________________________ Advisor: Dr. Sudhanshu Semwal ______________________________________________________________________________ Committee member: Dr. Edward Chow ______________________________________________________________________________ Committee member: Dr. T.S. Kalkur _____________________________ Date 2 | P a g e Acknowledgements First and foremost, I thank my academic advisor, Professor Sudhanshu Semwal, for accepting me into his group, for continuous support of my Master’s study and related research. My sincere gratitude to him for his patience, motivation, and immense knowledge. His guidance helped me in all the time of this project work. I could not have imagined having a better advisor and mentor for my Master’s study. Additionally, I would like to thank my committee members Professor Edward Chow and Professor T.S. Kalkur for their interest in my work. My sincere gratitude for their insightful suggestions and encouragement. Beside my committee, I would like to thank my parents, my sister and brother-in-law for their continuous support and encouragement throughout my Master’s. I would like to thank all the people who contributed in some way to the work described in this project. 3 | P a g e Abstract In this project, we describe three different approaches for determining or finding a distance map for a binary image. The algorithms that solve such problems are known as Distance Transforms. These algorithms that solve such problems are known as Distance Transformations. These algorithms operate on binary images but can be extended to receive any type of digital image if a conversion algorithm that converts a digital image into a binary digital image is executed prior to executing the Distance Transform algorithm. Therefore, we also examine how to transform any regular digital image into a binary image, that is, into a black and white image. A Distance Transformation algorithm operates on a binary image consisting of featured pixels and non- featured pixels. It outputs a distance map or distance matrix where each cell matches a pixel of the input image and contains a value indicating the distance to the nearest featured pixel. Distance Transforms represent a natural way to blur feature locations geometrically and they allow other image effects like skeletonizing, image matching, object recognition, path planning and navigation. They can be applied on 2D data grids, in this case we are dealing with pixels. In this project, we implemented sequential algorithm for three different distance transformation techniques and compared them with execution time as a benchmark. With this I found that Chess board and City block distance transformations are faster than Euclidean distance transformation. 4 | P a g e Contents 1.1 Introduction ................................................................................................................................... 9 1.2 Fundamentals ................................................................................................................................ 9 1.2.1 Binary image ............................................................................................................................... 9 1.2.2 Grayscale image .......................................................................................................................... 9 1.2.3 Pixel ............................................................................................................................................ 9 1.2.4 Pixel value ................................................................................................................................. 10 1.2.5 Pixel connectivity ...................................................................................................................... 10 1.2.5.1 4-connected pixel connectivity ............................................................................................... 10 1.2.5.2 Diagonal pixel connectivity ..................................................................................................... 10 1.2.5.3 8-connected pixel connectivity ............................................................................................... 10 2.1 Processing.................................................................................................................................... 12 3.1 Distance Transformation .............................................................................................................. 13 4.1 Distance transformation types ..................................................................................................... 17 4.2 Chessboard distance transformation ............................................................................................ 17 4.3 City-block distance transformation .............................................................................................. 18 4.4 Euclidean distance transformation ............................................................................................... 20 5.1 Implementation ........................................................................................................................... 22 5.2 A function that converts a digital image into a binary image ........................................................ 22 5.3 Minimum distance calculation ..................................................................................................... 24 5.4 Main Transformation Process ...................................................................................................... 26 5.6 Platform for the Implementation ................................................................................................. 28 6.1 Results and comparison ............................................................................................................... 29 6.1 Test 1 ........................................................................................................................................... 29 6.2 Test 2 ........................................................................................................................................... 32 6.3 Test3............................................................................................................................................ 34 6.5 Test5............................................................................................................................................ 39 6.6 Execution Time Comparison Between Three Distance Transformation Techniques....................... 43 7.1 Conclusion ................................................................................................................................... 44 7.2 Lessons Learned........................................................................................................................... 44 7.3 Future Work ................................................................................................................................ 44 References ........................................................................................................................................ 45 Appendix: A ....................................................................................................................................... 47 5 | P a g e Appendix: B ....................................................................................................................................... 48 6 | P a g e List of figures Fig. 1. Forward mask propagation………………………………………………………15 Fig. 2. Backward mask propagation…………………………………………………….16 Fig. 3. Example of Chess board distance transformation…………………………….....17 Fig. 4. Result of Chess board distance transform input and output……………………..18 Fig. 5. Example of City block distance transformation…………………………………19 Fig. 6. Result of City Block Distance transform Input and output……………………...19 Fig. 7. Example of the Euclidean distance transformation……………………………...20 Fig. 8. Result of the Euclidean distance transformation………………………………...20 Fig. 9. Digital color image to binary digital conversion………………………………..24 Fig. 10. Input Image for Test1…………………………………………………………..29 Fig. 11. Result of the Chess board distance transformation for Test1…………………...30 Fig. 12. Result of the City block distance transformation for Test1……………………..31 Fig. 13. Result of the Euclidean distance transformation for Test1……………………...31 Fig. 14. Input Image for Test2……………………………………………………………32 Fig. 15. Result of the Chess board distance transformation for Test2……………………33 Fig. 16. Result of the City block distance transformation for Test2……………………...33 Fig. 17. Result of the Euclidean distance transformation for Test2………………………34 Fig. 18. Input Image for Test3…………………………………………………………….34 Fig. 19. Result of the Chess board distance transformation for Test3…………………….35 Fig. 20. Result of the City block distance transformation for Test3………………………36 Fig. 21. Result of the Euclidean distance transformation
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages50 Page
-
File Size-