Converting binary to image file
10 views (last 30 days)
I have a binary text file and i want to convert it to image file. It can be png, jpeg or whatever.
I have used the following code but i did not understand the error. Please help me
reconstructed = reshape(typecast(uint8(bin2dec(char(reshape('sobel', 8, )+'0').')), 'uint8'), 100);
Constantino Carlos Reyes-Aldasoro on 2 Aug 2022
You are mixing many things.
If you use 'sobel' between single quotes you are using a string with the characters s o b e l.
If you have a file called 'sobel.txt' you should first read that file and store the values in a variable, which you will later use to create your image.
If you want to save an image file, you first need to have it in matlab, ideally you can then display it to check it makes sense and then you can print it to a png or whatever you want.