Question: I'm having some trouble with reading in binary files into MatLab, then manipulating the code to do what I need with the images - please
I'm having some trouble with reading in binary files into MatLab, then manipulating the code to do what I need with the images - please help!!!
Our given binary data file has 4 images that each have a size of 480 x 360 pixels. The files are stored in sequence. The datatype of each pixel is unsigned 16-bit integers. We need to code according to these directions:
1) Open the file a binary data file, then read in and store the data for the first image (only read in the needed pixels though).
2) Reshape it into an array with the image dimensions given above
3) Transpose the image so it will be easier to look at it in figure, while using a colormap gray for grayscale to check if you've done the previous steps correctly. (Do the same for 2nd and 4th images, but skip the 3rd - knowing it's size, you already know how to do this.)
4)Make sure to close the file, and display all three images.
Ok - so all I've got so far are the fopen and fread commands, but I'm not sure iIve done even that correctly. I know you need to use the reshape command as well. I think you would open the given binary file with the fopen command, and then use the fread command with the int16 since they are unsigned 16-bit integers?? I feel like I've gotten started, I just don't know where to go from here. Can someone please help me figure out this code and what I'm missing???
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
