I have following code to convert an image, I want to use this code for multiple ".raw" files.
My files has name
m-001-1.raw,
m-001-2.raw
m-002-1.raw
m-002-2.raw
Here is the code
% Read file
fid = fopen('m-001-1.raw', 'r');
data = fread(fid, '*uint8');
% Create image
image = reshape(data, 768, 576, 3);
image = imrotate(image, -90);
% Save image
imwrite(image, 'm-001-1.bmp');
End of code
This code work fine when I use if for single file... but when I use for loop it gives errors. Can please someone tell me how to apply for loop in this code

댓글 수: 1

Image Analyst
Image Analyst 2014년 2월 20일
What's the purpose of reshape? Are you sure you don't mean imresize()?

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기

질문:

2014년 2월 19일

댓글:

2014년 2월 20일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by