Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Determine a process where you can acquire an image and use Matlab commands to get that image into Matlab. Make sure you can read in

Determine a process where you can acquire an image and use Matlab commands to get that image into Matlab. Make sure you can read in gray-scale images.

See if you can use the command imread. You can always use the following for reading and writing .raw images, those without a header. Below is the code for reading in a 400H x 200V image in .raw format named image.raw. Note that a, .raw, .bin, or no extension may be used, but the extension must match the file. The variable a contains the image. Note that the last line transposes the image. If you created a file image using Matlab, the last line may be needed because of the way the data is stored.

fid=fopen('image.raw');

a=fread(fid,[400,200],'type');

fclose(fid); a=a';

Where type is a variable type such as:

schar - 8-bit signed character, uchar - 8-bit unsigned character, uint16 - 16-bit unsigned integer, int16 - 16-bit signed integer, float - 32-bit floating point.

You can write an image to a file in a format without a header. It is the same as the .raw format. (or .bin) The following code puts the contents of the variable result into a file named file. The data can be stored as different types.

fid=fopen('file','wb');

fwrite(fid,result,'type');

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Reliability Engineering Designing And Operating Resilient Database Systems

Authors: Laine Campbell, Charity Majors

1st Edition

978-1491925942

More Books

Students also viewed these Databases questions