How to create .pgm image from text file?
古いコメントを表示
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 件のコメント
Eman Almoaili
2020 年 11 月 18 日
編集済み: Eman Almoaili
2020 年 11 月 18 日
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Import, Export, and Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!