Shokedbrain

matlab imhist description

Nov 5th, 2021 (edited)
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 2.83 KB | None | 0 0
  1. %IMHIST Display histogram of N-D image data.
  2. %   IMHIST(I) displays a histogram for the intensity image I whose number
  3. %   of bins are specified by the image type.  If I is a grayscale image,
  4. %   IMHIST uses 256 bins as a default value. If I is a binary image, IMHIST
  5. %   uses only 2 bins. I can be 2-D, 3-D or N-D.
  6. %
  7. %   IMHIST(I,N) displays a histogram with N bins for the intensity image I
  8. %   above a grayscale colorbar of length N.  If I is a binary image, then N
  9. %   can only be 2.
  10. %
  11. %   IMHIST(X,MAP) displays a histogram for the indexed image X. This
  12. %   histogram shows the distribution of pixel values above a colorbar of
  13. %   the colormap MAP. The colormap must be at least as long as the largest
  14. %   index in X. The histogram has one bin for each entry in the colormap.
  15. %   X can be 2-D, 3-D or N-D.
  16. %
  17. %   [COUNTS,X] = imhist(...) returns the histogram counts in COUNTS and the
  18. %   bin locations in X so that stem(X,COUNTS) shows the histogram. For
  19. %   indexed images, it returns the histogram counts for each colormap
  20. %   entry; the length of COUNTS is the same as the length of the colormap.
  21. %
  22. %   Class Support
  23. %   -------------
  24. %   An input intensity image can be uint8, int8, uint16, int16, uint32,
  25. %   int32, single, double, or logical. An input indexed image can be uint8,
  26. %   uint16, single, double, or logical. Both I and X can have any number of
  27. %   dimensions.
  28. %
  29. %   Note
  30. %   ----
  31. %   For intensity images, the N bins of the histogram are each half-open
  32. %   intervals of width A/(N-1).
  33. %
  34. %   For uint8, uint16, and uint32 intensity images, the p-th bin is the
  35. %   half-open interval:
  36. %
  37. %        A*(p-1.5)/(N-1)  <= x  <  A*(p-0.5)/(N-1)
  38. %
  39. %   For int8, int16, and int32 intensity images, the p-th bin is the
  40. %   half-open interval:
  41. %
  42. %        A*(p-1.5)/(N-1) - B  <= x  <  A*(p-0.5)/(N-1) - B
  43. %
  44. %   The intensity value is represented by "x". Intensity images of class
  45. %   single and double are assumed to take values in [0 1]. The scale factor
  46. %   A depends on the image class.  A is 1 if the intensity image is double
  47. %   or single; A is 255 if the intensity image is uint8 or int8; A is 65535
  48. %   if the intensity image is uint16 or int16; A is 4294967295 if the
  49. %   intensity image is uint32 or int32. B is 128 if the image is int8; B is
  50. %   32768 if the intensity image is int16; B is 2147483648 if the intensity
  51. %   image is int32.
  52. %   If the intensity values are complex numbers,the function takes the real
  53. %   part and ignores the imaginary part.  
  54. %
  55. %   Example 1
  56. %   -------
  57. %   % Display the histogram of a grayscale image.
  58. %
  59. %   I = imread('pout.tif');
  60. %   imhist(I)
  61. %
  62. %   Example 2
  63. %   -------
  64. %   % Display the histogram of a 3-D intensity image.
  65. %
  66. %   load mristack
  67. %   imhist(mristack)
  68. %
  69. %   See also HISTEQ, HISTOGRAM, IMHISTMATCH, IMHISTMATCHN.
  70.  
  71. %   Copyright 1992-2020 The MathWorks, Inc.
  72.  
Add Comment
Please, Sign In to add comment