how can i run this program?
5 views (last 30 days)
Show older comments
actually i'm beginner in using matlab image processing, i have code for secret sharing image, when i run this code i got this error:
??? Error using ==> fread
Invalid file identifier. Use fopen to generate a valid
file identifier.
Error in ==> Rabin>ReadImage at 133
Im_data = fread(Im_fp,'uint8');
Error in ==> Rabin at 32
[Im_linear, Im_Square] =
ReadImage(Im_Name,Height,Width);
and also i do not know what the lena.bin
please help me.
how can i run this program?
0 Comments
Answers (3)
Walter Roberson
on 25 May 2013
The name you passed as Im_Name is not the name of a file anywhere on the MATLAB path.
You probably do not have any image with the name "lena": it is not supplied with MATLAB. See http://www.cs.cmu.edu/~chuck/lennapg/lenna.shtml
0 Comments
Image Analyst
on 26 May 2013
I don't know what you mean when you say lena.bin - usually the lena image is a bmp, or tif, or some normal image format, in which case you can use imread() to read it in instead of fread() like you tried to do. Do you know what the format is? Apparently not and it seems like you don't even know anything at all about it so I doubt you can answer our questions. Anyway, maybe try imread instead of fread - it's worth a shot. If you know it's a 2D grayscale or 3D color image, you might try passing in the size of the 2D array so that you get an image.
image2D = fread(fileHandle, [x_size y_size], '*uint8');
This will get you the gray scale image, or one of the color channels if it's a 3 channel RGB color image. The way you're doing it with fread(), you'd get a 1D vector.
2 Comments
Image Analyst
on 26 May 2013
Because it's not my File Exchange submission, I suggest you contact the author.
See Also
Categories
Find more on Image Processing Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!