how can i run this program?

5 views (last 30 days)
high
high on 25 May 2013
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?

Answers (3)

Matt J
Matt J on 25 May 2013
lm_fp is not pointing to an open file. Use FOPEN to open it.

Walter Roberson
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

Image Analyst
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
high
high on 26 May 2013
thankyou so much for your replaying, actually you are right, i do not have good idea about matlab. as well, i have not written this program, i found it in: http://www.mathworks.com/matlabcentral/fileexchange/39660-secret-image-sharing-scheme/content/Secret%20Image%20Sharing%20Schemes/ImageSharing.m
but when i try to run it i got that error, however i apply your advise. pleas can you help me to run this code?
Image Analyst
Image Analyst on 26 May 2013
Because it's not my File Exchange submission, I suggest you contact the author.

Sign in to comment.

Categories

Find more on Image Processing Toolbox 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!