Verbatim large column https://www.dazhuanlan.com/2019/08/27/5d64bdd9c65fe/
Previous article introduces the concept of digital image processing, digital image processing tools and said, this article, we went on to introduce the type of digital image.
First, the image type
Toolbox supports four types of images:
灰度级图像
二值图像
索引图像
RGB图像
Most monochrome image processing are used is 二值图像
or 灰度级图像
, we first introduce the two images come to explain the rest after two kinds.
Second, the gray scale image
In fact, a gray scale image data is a matrix, the matrix values represent gray shades. When the element is a grayscale image or unit8 unit16 class, each having [0,255] and [0,65535] integer value, if the image is a single or double-based type, which is floating, and the value of an image usually normalized to the range [0,1].
Here we introduce the class of image processing mentioned above:
name | description |
---|---|
double | Double precision floating point, in the range of 10 ± 308 (. 8 bytes / element) |
single | Single-precision floating-point number, in the range of 10 ± 38 is (. 4 bytes / element) |
unit8 | 8bit unsigned integer in the range [0,255] (range of 1 byte / element) |
unit16 | 16bit unsigned integer in the range [0,65535] (range of 2 bytes / element) |
unit32 | 32bit unsigned integer in the range [0,4294967295] (range of 4 bytes / element) |
int8 | 8bit signed integers in the range [-128,127] (range of 1 byte / element) |
int16 | 16bit signed integer in the range [-32768, 32767] (range of 2 bytes / element) |
int32 | 32bit signed integer in the range [-2147483648,2147483647] (range of 4 bytes / element) |
char | Character (2 bytes / element) |
logical | 0 or 1 (1 byte / element) |
Third, the binary image
A binary image is an array of logic values 0 and 1 only, using the function logical
to convert a binary image array value.
For example:B = logical(A)
A may be an array of values 0 and 1 only, but may be other elements comprising an array of values, but if it is the second, the use of logical
the function of all non-zero amount will be converted to a logic 1 value.
We also can use the islogical
function to determine whether the array is a logical type, if yes, returns 1, if this is not 0, return to use islogical(C)
.
Of course, we can also logic array into an array of values, can be B=im2unit8(A)
, B=im2unit16(A)
, B=im2double(A)
, B=im2single(A)
, B=mat2gray(A)
and the like to convert the logical value of the array is an array of other types. Wherein mat2gray
the calibration image is converted to a to [0,1] double wide array of class, calling syntax is
g=mat2gray(A,[Amin,Amax])
Wherein the image g has a value ranging from 0-1 meaning, Amin and Amax in that, if A is smaller than Amin, then g is 0 becomes, if greater than Amax, then becomes 1 in the g.