Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
27
Добавлен:
09.02.2015
Размер:
673.28 Кб
Скачать

In addition to these png parameters, you can use any

parameter name that satisfies the PNG specification for

keywords: only printable characters, 80 characters or

fewer, and no leading or trailing spaces. The value

corresponding to these user-specified parameters must be a

string that contains no control characters except for

linefeed.

RAS-specific parameters

-----------------------

'Type' One of these strings: 'standard'

(uncompressed, b-g-r color order with

truecolor images), 'rgb' (like 'standard',

but uses r-g-b color order for truecolor

Images), 'rle' (run-length encoding of 1-bit

and 8-bit images)

'Alpha' A matrix specifying the transparency of each

pixel individually; the row and column

dimensions must be the same as the data

array; may be uint8, uint16, or double. May

only be used with truecolor images.

PBM, PGM, and PPM-specific parameters

------------------------

'Encoding' One of these strings: 'ASCII' for plain encoding

or 'rawbits' for binary encoding. Default is 'rawbits'.

'MaxValue' A scalar indicating the maximum gray or color

value. Available only for PGM and PPM files.

For PBM files, this value is always 1. Default

is 65535 if image array is 'uint16' and 255 otherwise.

Table: summary of supported image types

---------------------------------------

BMP 1-bit, 8-bit and 24-bit uncompressed images

GIF 8-bit images

HDF 8-bit raster image datasets, with or without associated

colormap; 24-bit raster image datasets; uncompressed or

with RLE or JPEG compression

JPEG 8-bit, 12-bit, and 16-bit Baseline JPEG images

JPEG2000 1-bit, 8-bit, and 16-bit JPEG2000 images

PBM Any 1-bit PBM image, ASCII (plain) or raw (binary) encoding.

PCX 8-bit images

PGM Any standard PGM image. ASCII (plain) encoded with

arbitrary color depth. Raw (binary) encoded with up

to 16 bits per gray value.

PNG 1-bit, 2-bit, 4-bit, 8-bit, and 16-bit grayscale

images; 8-bit and 16-bit grayscale images with alpha

channels; 1-bit, 2-bit, 4-bit, and 8-bit indexed

images; 24-bit and 48-bit truecolor images; 24-bit

and 48-bit truecolor images with alpha channels

PNM Any of PPM/PGM/PBM (see above) chosen automatically.

PPM Any standard PPM image. ASCII (plain) encoded with

arbitrary color depth. Raw (binary) encoded with up

to 16 bits per color component.

RAS Any RAS image, including 1-bit bitmap, 8-bit indexed,

24-bit truecolor and 32-bit truecolor with alpha.

TIFF Baseline TIFF images, including 1-bit, 8-bit, 16-bit,

and 24-bit uncompressed images, images with packbits

compression, images with LZW compression, and images

with Deflate compression; 8-bit and 24-bit images with

JPEG compression; 1-bit images with CCITT 1D, Group 3,

and Group 4 compression; CIELAB, ICCLAB, and CMYK images.

XWD 8-bit ZPixmaps

Please read the file libtiffcopyright.txt for more information.

See also imfinfo, imread, imformats, fwrite, getframe.

Reference page in Help browser

doc imwrite

<im2java> - Convert image to Java image.

IM2JAVA Convert image to Java image.

JIMAGE = IM2JAVA(I) converts the intensity image I to an instance of

the Java image class, java.awt.Image.

JIMAGE = IM2JAVA(X,MAP) converts the indexed image X with colormap

MAP to an instance of the Java image class, java.awt.Image.

JIMAGE = IM2JAVA(RGB) converts the RGB image RGB to an instance of

the Java image class, java.awt.Image.

Class Support

-------------

The input image can be of class uint8, uint16, or double.

Note

----

Java requires uint8 data to create an instance of java.awt.Image. If the

input image is of class uint8, JIMAGE contains the same uint8 data. If the

input image is of class double or uint16, im2java makes an equivalent

image of class uint8, rescaling or offsetting the data as necessary, and

then converts this uint8 representation to an instance of java.awt.Image.

Example

-------

This example reads an image into the MATLAB workspace and then uses

im2java to convert it into an instance of the Java image class.

I = imread('moon.tif');

javaImage = im2java(I);

icon = javax.swing.ImageIcon(javaImage);

label = javax.swing.JLabel(icon);

pSize = label.getPreferredSize;

f = figure('visible','off');

fPos = get(f,'Position');

fPos(3:4) = [pSize.width, pSize.height];

set(f,'Position',fPos);

hLabel= javacomponent(label,[0 0 fPos(3:4)], f);

figure(f)

Reference page in Help browser

doc im2java

<multibandread> - Read band-interleaved data from a binary file.

MULTIBANDREAD Read band interleaved data from a binary file

X = MULTIBANDREAD(FILENAME,SIZE,PRECISION,

OFFSET,INTERLEAVE,BYTEORDER)

reads band-sequential (BSQ), band-interleaved-by-line (BIL), or

band-interleaved-by-pixel (BIP) data from a binary file, FILENAME. X is

a 2-D array if only one band is read, otherwise it is 3-D. X is returned

as an array of data type double by default. Use the PRECISION argument

to map the data to a different data type.

X = MULTIBANDREAD(FILENAME,SIZE,PRECISION,OFFSET,INTERLEAVE,

BYTEORDER,SUBSET,SUBSET,SUBSET)

reads a subset of the data in the file. Up to 3 SUBSET parameters may be

used to subset independently along the Row, Column, and Band dimensions.

In addition to BSQ, BIL, and BIP files, multiband imagery may be stored

using the TIFF file format. In that case, the data should be imported

with IMREAD.

Parameters:

FILENAME: A string containing the name of the file to be read.

DIMS: A 3 element vector of integers consisting of

[HEIGHT, WIDTH, N]. HEIGHT is the total number of rows, WIDTH is

the total number of elements in each row, and N is the total number

of bands. This will be the dimensions of the data if it read in its

entirety.

PRECISION: A string to specify the format of the data to be read. For

example, 'uint8', 'double', 'integer*4'. By default X is returned as

an array of class double. Use the PRECISION parameter to format the

data to a different class. For example, a precision of

'uint8=>uint8' (or '*uint8') will return the data as a UINT8 array.

'uint8=>single' will read each 8 bit pixel and store it in MATLAB in

single precision. MULTIBANDREAD will attempt to use the efficient

MEMMAPFILE function if the precision string corresponds to a native

MATLAB type. See the help for FREAD for a more complete description

of PRECISION.

OFFSET: The zero-based location of the first data element in the file.

This value represents number of bytes from the beginning of the file

to where the data begins.

Соседние файлы в папке Библиотеки Matlab