Đang Thực Hiện

Load and store *.pnm image file

Write two functions to load and store binary (types P5 and P6) “*.pnm” image files in your favorite language/package out of C++, Java, Python or Matlab. Load function should generate an Image structure (or an object). The image structure should contain following.

Image

type : an integer value specifying the image type. Values Gray = 0 and RGB = 1

width : an integer value specifying the width of the image.

height : an integer value specifying the width of the image.

data : a byte array of image data (stored in row major order).

For simplicity you can assume second header line is always a comment. And max value is always 255 (i.e. 8 bit images).

For full pnm file format specification, refer

[url removed, login to view]

Following software can be used to view pnm images. Also it allows you to convert any image to pnm format (for testing purposes). [url removed, login to view]

In addition to ImageJ, the open source software GIMP also can open PNM format image files.

For example following C++ code shows the headers of required functions.

struct Image {

int type; // an integer value specifying the image type. Values // Gray = 0 and RGB = 1

int width; // an integer value specifying the width of the image.

int height; // an integer value specifying the height of the image.

char* data; // an 8-bit array of image data (row major).

};

Image loadImage(string fileName);

void storeImage(string fileName, Image img);

Kỹ năng: Lập trình C++, Ảnh hóa

Xem thêm: types of array in data structure, the c++ programming language wiki, struct c programming, string in data structure, string data structure, string cplusplus, python software testing, python programming wiki, python programming language wiki, python programming download, programming wiki, programming language types, programming and data structure, pnm, open source programming language, matlab programming language, matlab integer programming, java programming language download, java open source programming, java data struct, html programming file, favorite programming language, example of array data structure, data structure in array, data structure array

Về Bên Thuê:
( 14 nhận xét ) Indianapolis, United States

Mã Dự Án: #9413452

Đã trao cho:

vrcoder

As discussed. As discussed. As discussed. As discussed. As discussed. As discussed. As discussed. As discussed.

$50 USD trong 1 ngày
(51 Đánh Giá)
5.8

1 freelancer đang chào giá trung bình $50 cho công việc này

$50 USD trong 3 ngày
(1 Đánh Giá)
1.8