1 Basics

  • Read image
    • Imread function using the format: f = imread (filename ")
    • [M, N] = size (f) shows the number of rows and columns of the image;
    • whos f shows an array of additional information
  • Display image
    • Use imshow function,
      • imshow(f,G)
        • f is an array of image
        • G grayscale image for the series, if the default is omitted, 256
      • imshow(f,[low high])
        • All values ​​less than or equal low displayed in black
        • Is greater than or equal to a high value of white display
        • The default value in the range between the low and high stages of the display
      • imshow(f,[])
        • Low variable set to the minimum of the array f
        • The variable is set to the maximum high of the array f
    • When using imshow To display another image g, matlab will replace the old image with the new image on the screen. Is displayed simultaneously, a function should be added to figure
      • figure,imshow(g)
  • Data categories: conventional and is double uint8
  • Image type: commonly used for the luminance image and the binary image
    • Luminance image: a data matrix, if the classes are uint8, an integer in the range of [0255]
    • Binary image: logic values ​​0 and 1, only arrays
      • The function uses the logical array into a binary value array: B = logical (A)
        • If A contains elements in addition to other than 0 and 1, logical function is used for all non-zero amount may be changed to a logic 1
      • To test whether the array is a array logic, using the function islogical, islogical (c)
        • If c is a logic array, the function returns 1; otherwise, 0 is returned.
  • Some important standard array
    • zeros (M, N) generates a size of an M × N matrix of double type, which elements are all 0
    • ones (M, N) generates a size of an M × N matrix of double type, which elements are all 1
    • true (M, N) generates a size of an M × N matrix of logical categories, which elements are 1
    • false (M, N) generates a size of an M × N matrix of double type, whose elements are 0
    • magic (M) generating a M × M size of the magic square. In this matrix, each row and the elements, the elements of each column and the main diagonal elements of the well and are equal in
    • The random number rand (M, N) generates a size of an M × N matrix, the matrix elements are in the interval [0,1] is uniformly distributed
    • randn (M, N) generates a size of an M × N matrix, the matrix elements are normally distributed random number, the random number is the mean 0 and variance 1

Guess you like

Origin www.cnblogs.com/binglingtime/p/12594813.html