How to create .pgm image from text file?
Show older comments
Hello
I have a .txt file in the following format(see attached file):
line 1: integer height
line 2: integer width
line 3: float ratio
line 4: int size
line 5: int start
line 6: int goal
The next lines from 7 to height must be stored in a matrix height*width
The matrix is matrix of integers ( 0s and 100s)
The 0s must be converted to white pixels(free spaces) while 100s must be converted to black pixels(obstacles), so the image is a map that can be used in robot navigations.
How can I read this file and convert the matrix into .pgm image file.
Thanks a lot in advance,
1 Comment
Eman Almoaili
on 18 Nov 2020
Edited: Eman Almoaili
on 18 Nov 2020
Answers (0)
Categories
Find more on Import, Export, and Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!