基于matlab的数字图像处理常用函数

合集下载

matlab的histeq函数

matlab的histeq函数

matlab的histeq函数MATLAB的histeq函数是一种用于图像处理的直方图均衡化函数。

该函数能够将图像的像素值进行均衡化,使得图像的整体亮度变化更加平滑、细腻。

在图像处理、计算机视觉、数字图像处理等领域中,histeq函数是非常重要的一种函数。

在使用histeq函数时,用户需要先将指定图像读取到MATLAB中。

可以通过imread函数将指定图片读取到MATLAB中,代码如下:img=imread('image.jpg');其中,’image.jpg‘指定了图片的路径和名称,使用时需要自定义。

读取图片后,用户可以对图像进行一系列操作,如灰度化处理、自适应对比度增强等。

这里介绍直方图均衡化的操作。

直方图均衡化的过程可以使图像中的灰度值分布呈现更加均匀的状态,因而可以增强图像的亮度和对比度。

直方图均衡化的原理非常简单,主要是通过将像素的灰度值进行均衡化处理,使像素的灰度值分布更加平衡。

在MATLAB中实现直方图均衡化的方法是使用histeq函数,该函数的基本语法如下:out=histeq(in)其中,in是待处理的输入图片,out是经过处理的输出图片。

histeq函数的使用方法非常简单,只需要输入待处理的图片即可。

不过,用户也可以通过一系列可选参数来对函数进行更细致的控制,使其具有更好的适用性。

histeq函数支持的可选参数主要包括以下几个方面:1、灰度级别的调整可以通过在函数中添加灰度级别参数,来调整输出图片的灰度级别。

在MATLAB中,默认的灰度级别是256,该参数可以通过在函数中添加histeq(in,n)来设置。

在该函数中,n是灰度级别的数量。

可以通过将n设为256来保持默认状态,或调整成更小的数字,使输出图片的色调更加细腻。

2、调整灰度分布在histeq函数中,可以通过调整灰度分布参数来控制输出图片的灰度值分布。

该参数可以使用一个由256个元素组成的向量表示。

该向量中的每一个元素对应一个灰度值,每个元素表示输出图片中该灰度值相应的像素数占比。

MATLAB图像处理函数大全

MATLAB图像处理函数大全

Matlab图像处理函数大全目录图像增强 (3)1. 直方图均衡化的Matlab 实现 (3)1.1 imhist 函数 (3)1.2 imcontour 函数 (3)1.3 imadjust 函数 (3)1.4 histeq 函数 (4)2. 噪声及其噪声的Matlab 实现 (4)3. 图像滤波的Matlab 实现 (4)3.1 conv2 函数 (4)3.2 conv 函数 (5)3.3 filter2函数 (5)3.4 fspecial 函数 (6)4. 彩色增强的Matlab 实现 (6)4.1 imfilter函数 (6)图像的变换 (6)1. 离散傅立叶变换的Matlab 实现 (6)2. 离散余弦变换的Matlab 实现 (7)2.1. dct2 函数 (7)2.2. dict2 函数 (8)2.3. dctmtx函数 (8)3. 图像小波变换的Matlab 实现 (8)3.1 一维小波变换的Matlab 实现 (8)3.2 二维小波变换的Matlab 实现 (9)图像处理工具箱 (11)1. 图像和图像数据 (11)2. 图像处理工具箱所支持的图像类型 (12)2.1 真彩色图像 (12)2.2 索引色图像 (13)2.3 灰度图像 (14)2.4 二值图像 (14)2.5 图像序列 (14)3. MATLAB图像类型转换 (14)4. 图像文件的读写和查询 (15)4.1 图形图像文件的读取 (15)4.2 图形图像文件的写入 (16)4.3 图形图像文件信息的查询imfinfo()函数 (16)5. 图像文件的显示 (16)5.1 索引图像及其显示 (16)5.2 灰度图像及其显示 (16)5.3 RGB 图像及其显示 (17)5.4 二进制图像及其显示 (17)5.5 直接从磁盘显示图像 (18)图像处理函数 (18)图像处理函数详解——strel (18)图像处理函数详解——roipoly (19)图像处理函数详解——roifilt2 (20)图像处理函数详解——roifill (20)图像处理函数详解——roicolor (21)matlab图像处理函数详解——rgb2gray (22)Matlab图像处理函数:regionprops (22)图像处理函数详解——padarray (26)图像处理函数详解——nlfilter (27)图像处理函数详解——montage (27)函数详解——mat2gray (28)图像处理函数详解——imclose (29)图像处理函数详解——imopen (29)图像处理函数详解——imerode (30)图像处理函数详解——imdilate (30)图像处理函数详解——imresize (31)图像处理函数详解——imnoise (32)图像处理函数详解——imhist (32)图像处理函数详解——imfinfo (33)图像处理函数详解——imcomplement (34)图像处理函数详解——imapprox (35)图像处理函数详解——imadjust (35)图像处理函数详解——imadd (36)图像处理函数详解——im2uint8 (36)图像处理函数详解——im2bw (37)图像处理函数详解——histeq (37)图像处理函数详解——dither (38)图像处理函数详解——conv2 (38)图像处理函数详解——colfilt (39)图像处理函数详解——bwperim (39)图像处理函数详解——bwlabel (40)图像处理函数详解——bwareaopen (41)图像增强1. 直方图均衡化的Matlab 实现1.1 imhist 函数功能:计算和显示图像的色彩直方图格式:imhist(I,n)imhist(X,map)说明:imhist(I,n) 其中,n 为指定的灰度级数目,缺省值为256;imhist(X,map) 就算和显示索引色图像 X 的直方图,map 为调色板。

matlab数字图像处理函数大全

matlab数字图像处理函数大全

Import, Export, and ConversionDisplay and ExplorationGeometric Transformation, Spatial ReferencingImage EnhancementImage AnalysisRead image from graphics fileWrite image to graphics fileInformation about graphics fileRead metadata from National Imagery Transmission Format (NITF) file Read image from NITF fileRead metadata from DPX fileRead DPX imageRead metadata from header file of Analyze 7.5 data setRead image data from image file of Analyze 7.5 data setRead metadata from Interfile fileRead images in Interfile formatAnonymize DICOM fileGet or set active DICOM data dictionaryDisplay DICOM file structureRead metadata from DICOM messageFind attribute in DICOM data dictionaryRead DICOM imageGenerate DICOM unique identifierWrite images as DICOM filesRead high dynamic range (HDR) imageWrite Radiance high dynamic range (HDR) image fileCreate high dynamic range imageRender high dynamic range image for viewingInterface for image I/OCheck if file is R-SetOpen R-Set fileCreate reduced resolution data set from image fileConvert grayscale or binary image to indexed imageConvert indexed image to grayscale imageConvert matrix to grayscale imageConvert RGB image or colormap to grayscaleConvert indexed image to RGB imageConvert label matrix into RGB imageConvert Bayer pattern encoded image to truecolor imageBinarize image by thresholdingQuantize image using specified quantization levels and output values Multilevel image thresholds using Otsu's methodAdaptive image threshold using local first-order statisticsGlobal histogram threshold using Otsu's methodConvert image to binary image, based on thresholdGlobal image threshold using Otsu's methodConvert grayscale image to indexed image using multilevel thresholdingConvert image to double precisionConvert image to 16-bit signed integersConvert image to Java buffered imageConvert image to single precisionConvert image to 16-bit unsigned integersConvert image to 8-bit unsigned integersCreate checkerboard imageCreate head phantom imageAdd noise to imageDisplay imageDisplay multiple image frames as rectangular montage Display multiple images in single figureMake movie from multiframe imagePlay movies, videos, or image sequencesDisplay image as texture-mapped surfaceGet values of Image Processing Toolbox preferencesDisplay Image Processing Toolbox Preferences dialog boxSet Image Processing Toolbox preferences or display valid values Image Viewer appImage Information toolAdjust Contrast toolDisplay Range toolDistance toolPixel Information toolPixel Information tool without text labelPixel Region toolMagnification box for scroll panelOverview tool for image displayed in scroll panelGet values of Image Processing Toolbox preferencesDisplay Image Processing Toolbox Preferences dialog boxSet Image Processing Toolbox preferences or display valid values Image Information toolChoose Colormap toolAdjust Contrast toolCrop imageDisplay Range toolDistance toolPixel Information toolPixel Information tool without text labelPixel Region toolPixel Region tool panelMagnification box for scroll panelOverview tool for image displayed in scroll panelOverview tool panel for image displayed in scroll panelSave Image ToolScroll panel for interactive image navigationCreate draggable ellipseCreate draggable freehand regionCreate draggable, resizable lineCreate draggable pointCreate draggable, resizable polygonCreate draggable rectangleRegion-of-interest (ROI) base classSelect polyline with mouseSpecify points with mouseSpecify rectangle with mouseImage data from axesImage model object from image objectImage Model objectConvert axes coordinates to pixel coordinatesInformation about image attributesGet handle to current axes containing imageGet handle to current figure containing imageOpen Image dialog boxGet all image handlesAdd function handle to callback listCheck validity of handleGet Application Programmer Interface (API) for handleRetrieve pointer behavior from HG objectDirectories containing IPT and MATLAB iconsCreate pointer manager in figureDelete function handle from callback listStore pointer behavior structure in Handle Graphics object Align figure windowsCreate rectangularly bounded drag constraint functionAdjust display size of imagencing, and Image RegistrationCrop imageResize imageRotate imageTranslate imageImage pyramid reduction and expansionApply geometric transformation to imageFit geometric transformation to control point pairsApply 2-D spatial transformation to imageFind output bounds for spatial transformationFlip input and output roles of TFORM structureCreate resampling structureCreate spatial transformation structure (TFORM)Apply spatial transformation to N-D arrayApply forward spatial transformationApply inverse spatial transformationCreate checkerboard image2-D Affine Geometric Transformation3-D Affine Geometric Transformation2-D Projective Geometric Transformation2-D piecewise linear geometric transformation2-D Polynomial Geometric Transformation2-D Local Weighted Mean Geometric TransformationApply geometric transformation to imageIntensity-based image registrationEstimate geometric transformation that aligns two 2-D or 3-D images Display imageCompare differences between imagesComposite of two imagesReference 2-D image to world coordinatesReference 3-D image to world coordinatesIntensity-based image registrationConfigurations for intensity-based registrationEstimate geometric transformation that aligns two 2-D or 3-D images Estimates geometric transformation that aligns two 2-D images using phase Estimate displacement field that aligns two 2-D or 3-D images Composite of two imagesCompare differences between imagesMattes mutual information metric configuration objectMean square error metric configuration objectRegular step gradient descent optimizer configuration objectOne-plus-one evolutionary optimizer configuration objectControl Point Selection ToolFit geometric transformation to control point pairsTune control-point locations using cross correlationConvert CPSTRUCT to valid pairs of control pointsNormalized 2-D cross-correlationInfer spatial transformation from control point pairsAdjust image intensity values or colormapAdjust Contrast toolSharpen image using unsharp maskingEnhance contrast using histogram equalizationContrast-limited adaptive histogram equalization (CLAHE)Adjust histogram of image to match N-bin histogram of reference image Apply decorrelation stretch to multichannel imageFind limits to contrast stretch imageConvert integer values using lookup tableAdd noise to imageN-D filtering of multidimensional images2-D Gaussian filtering of images3-D Gaussian filtering of 3-D imagesCreate predefined 2-D filterGuided filtering of imagesNormalized 2-D cross-correlation2-D adaptive noise-removal filtering2-D median filtering2-D order-statistic filteringLocal standard deviation of imageLocal range of imageLocal entropy of grayscale imageGeneral sliding-neighborhood operationsCreate Gabor filter or Gabor filter bankApply Gabor filter or set of filters to 2-D image2-D box filtering of images3-D box filtering of 3-D imagesCalculate integral imageCalculate 3-D integral image2-D box filtering of integral images3-D box filtering of 3-D integral imagesExtract objects from binary image by sizeExtract objects from binary image using properties Pad array2-D frequency response2-D FIR filter using frequency sampling2-D FIR filter using frequency transformation2-D FIR filter using 1-D window method2-D FIR filter using 2-D window method2-D convolution matrixBinary hit-miss operationMorphological operations on binary images Ultimate erosionRemove small objects from binary imageBottom-hat filteringSuppress light structures connected to image border Morphologically close imageDilate imageErode imageExtended-maxima transformExtended-minima transformFill image regions and holesH-maxima transformH-minima transformImpose minimaMorphologically open imageMorphological reconstructionRegional maximaRegional minimaTop-hat filteringWatershed transformCreate connectivity arrayCheck validity of connectivity argumentNeighborhood operations on binary images using lookup tables Nonlinear filtering using lookup tablesCreate lookup table for use with bwlookupMorphological structuring elementMorphological offset structuring elementDeblur image using blind deconvolutionDeblur image using Lucy-Richardson methodDeblur image using regularized filterDeblur image using Wiener filterTaper discontinuities along image edgesConvert optical transfer function to point-spread function Convert point-spread function to optical transfer functionPad arraySpecify polygonal region of interest (ROI)Convert region of interest (ROI) polygon to region maskFill in specified regions in image using inward interpolation Select region of interest (ROI) based on colorFilter region of interest (ROI) in imageCreate draggable ellipseCreate draggable freehand regionCreate draggable, resizable polygonCreate draggable rectangleRegion-of-interest (ROI) base classInterface for image I/ODistinct block processing for imageDetermine optimal block size for block processingGeneral sliding-neighborhood operationsRearrange matrix columns into blocksColumnwise neighborhood operationsRearrange image blocks into columnsAbsolute difference of two imagesAdd two images or add constant to imageLinear combination of color channelsComplement imageDivide one image into another or divide image by constant Linear combination of imagesMultiply two images or multiply image by constantSubtract one image from another or subtract constant from image Trace region boundaries in binary imageTrace object in binary imagePlot region boundariesFind edges in intensity imageFind circles using circular Hough transformCreate circleGradient magnitude and direction of an imageDirectional gradients of an imageFind 3-D gradient magnitude and direction of imagesFind the directional gradients of a 3-D imageHough transformExtract line segments based on Hough transformIdentify peaks in Hough transformQuadtree decompositionBlock values in quadtree decompositionSet block values in quadtree decompositionMeasure properties of image regionsArea of objects in binary imageExtract objects from binary image by sizeFind connected components in binary imageGenerate convex hull image from binary imageDistance transform of binary imageGeodesic distance transform of binary imageEuler number of binary imageFind perimeter of objects in binary imageExtract objects from binary image using propertiesSelect objects in binary imageGray-weighted distance transform of grayscale imageCreate contour plot of image dataHistogram of image dataPixel color valuesPixel-value cross-sections along line segments2-D correlation coefficientAverage or mean of matrix elementsStandard deviation of matrix elementsLabel connected components in 2-D binary imageLabel connected components in binary imageCreate label matrix from bwconncomp structurePack binary imageUnpack binary imageEntropy of grayscale imageLocal entropy of grayscale imageLocal range of imageLocal standard deviation of imageCreate gray-level co-occurrence matrix from imageProperties of gray-level co-occurrence matrixMean-squared errorPeak Signal-to-Noise Ratio (PSNR)Structural Similarity Index (SSIM) for measuring image qualitySegment image into foreground and background using active contour Binary image segmentation using Fast Marching MethodSegment image into two or three regions using geodesic distance-based colorCalculate weights for image pixels based on image gradient Calculate weights for image pixels based on grayscale intensity difference Select contiguous image region with similar gray valuesGlobal image threshold using Otsu's methodMultilevel image thresholds using Otsu's methodGlobal histogram threshold using Otsu's methodAdaptive image threshold using local first-order statisticsFind region boundaries of segmentation2-D superpixel oversegmentation of imagesBurn binary mask into 2-D imageConvert label matrix to cell array of linear indicesDistance transform of binary imageGeodesic distance transform of binary imageGray-weighted distance transform of grayscale imageHough transform2-D discrete cosine transformDiscrete cosine transform matrixConvert fan-beam projections to parallel-beamFan-beam transform2-D inverse discrete cosine transformInverse fan-beam transformInverse Radon transformConvert parallel-beam projections to fan-beamRadon transform2-D fast Fourier transformShift zero-frequency component to center of spectrum2-D inverse fast Fourier transformInverse FFT shiftConvert RGB to CIE 1976 L*a*b*Convert RGB color values to NTSC color spaceConvert RGB to CIE 1931 XYZConvert RGB color values to YCbCr color spaceConvert CIE 1976 L*a*b* to RGBConvert CIE 1976 L*a*b* to CIE 1931 XYZConvert CIE 1931 XYZ to CIE 1976 L*a*b*Convert CIE 1931 XYZ to RGBConvert YCbCr color values to RGB color spaceConvert NTSC values to RGB color spaceConvert L*a*b* data to doubleConvert L*a*b* data to uint16Convert L*a*b* data to uint8Convert XYZ color values to doubleConvert XYZ color values to uint16Search for ICC profilesRead ICC profileFind system default ICC profile repositoryWrite ICC color profile to disk fileTrue for valid ICC color profileCreate color transformation structureApply device-independent color space transformation Approximate indexed image by reducing number of colors XYZ color values of standard illuminantsAdaptive image threshold using local first-order statistics Find region boundaries of segmentationRemove small objects from binary imageTrace region boundaries in binary imageFind connected components in binary imageDistance transform of binary imageEuler number of binary imageLabel connected components in 2-D binary image Nonlinear filtering using lookup tables Morphological operations on binary imagesPack binary imageFind perimeter of objects in binary imageSelect objects in binary imageTrace object in binary imageUnpack binary imageCreate connectivity arrayConvert Bayer pattern encoded image to truecolor image Find edges in intensity imageFit geometric transformation to control point pairs Create predefined 2-D filterDefault display range of image based on its classSelect contiguous image region with similar gray values Enhance contrast using histogram equalizationHough transformExtract line segments based on Hough transform Identify peaks in Hough transformConvert HSV colormap to RGB colormapConvert image to double precisionConvert image to 16-bit signed integersConvert image to single precisionConvert image to 16-bit unsigned integersConvert image to 8-bit unsigned integersAbsolute difference of two imagesAdjust image intensity values or colormapBinarize image by thresholdingBottom-hat filtering2-D box filtering of imagesSuppress light structures connected to image border Morphologically close imageComplement imageCrop imageDilate imageErode imageExtended-maxima transformExtended-minima transformFill image regions and holesN-D filtering of multidimensional imagesFind circles using circular Hough transformApply Gabor filter or set of filters to 2-D image2-D Gaussian filtering of imagesFind 3-D gradient magnitude and direction of imagesFind the directional gradients of a 3-D imageHistogram of image dataH-maxima transformH-minima transformLinear combination of imagesMean-squared errorMorphologically open imageBurn binary mask into 2-D imageImage pyramid reduction and expansionQuantize image using specified quantization levels and output values Read image from graphics fileMorphological reconstructionRegional maximaRegional minimaResize imageRotate imageTop-hat filteringTranslate imageApply geometric transformation to image2-D box filtering of integral imagesCalculate integral imageConvert integer values using lookup tableCheck validity of colormapCheck validity of connectivity argumentConvert CIE 1976 L*a*b* to RGBConvert label matrix into RGB imageConvert label matrix to cell array of linear indicesAverage or mean of matrix elements2-D median filteringMultilevel image thresholds using Otsu's method2-D order-statistic filteringGlobal histogram threshold using Otsu's methodPad arrayPeak Signal-to-Noise Ratio (PSNR)Measure properties of image regionsConvert RGB image or colormap to grayscaleConvert RGB colormap to HSV colormapConvert RGB to CIE 1976 L*a*b*Convert RGB color values to YCbCr color spaceFind limits to contrast stretch image2-D superpixel oversegmentation of imagesWatershed transformConvert YCbCr color values to RGB color spaceReference 2-D image to world coordinatesReference 3-D image to world coordinates2-D Affine Geometric Transformation2-D Projective Geometric TransformationMorphological structuring elementMorphological offset structuring elementDistance transform of binary imageLabel connected components in 2-D binary image Nonlinear filtering using lookup tablesMorphological operations on binary images2-D correlation coefficientFind edges in intensity imageEnhance contrast using histogram equalizationConvert image to double precisionConvert image to single precisionConvert image to 8-bit unsigned integersConvert image to 16-bit unsigned integersAbsolute difference of two imagesAdjust image intensity values or colormapBottom-hat filteringMorphologically close imageComplement imageDilate imageErode imageFill image regions and holesN-D filtering of multidimensional imagesGradient magnitude and direction of an image Directional gradients of an imageHistogram of image dataLinear combination of imagesAdd noise to imageConvert YCbCr color values to RGB color space Morphologically open imageMorphological reconstructionEstimate displacement field that aligns two 2-D or 3-D images Resize imageRotate imageDisplay imageTop-hat filteringInverse Radon transformConvert matrix to grayscale imageAverage or mean of matrix elements2-D median filteringNormalized 2-D cross-correlationPad arrayRadon transformMeasure properties of image regionsConvert RGB image or colormap to grayscaleConvert RGB color values to YCbCr color spaceStandard deviation of matrix elementsLocal standard deviation of imageFind limits to contrast stretch image从图形文件读取图像写入图像到图形文件关于图形文件的信息从国家图像传输格式的元数据(NITF)文件从NITF文件读取图像读取DPX文件元数据读取DPX图像从分析7.5数据集的头文件读取元数据从分析7.5数据集的图像文件中读取图像数据从归档文件元数据在内部文件格式读取图像匿名DICOM文件获取或设置活动DICOM数据字典显示DICOM文件结构读取DICOM消息元数据发现在DICOM数据字典属性读取DICOM图像生成DICOM的唯一标识符写图像的DICOM文件读高动态范围(HDR)图像写下光辉的高动态范围(HDR)图像文件创建高动态范围图像用于观看的高动态范围图像图像I / O接口检查文件是否存在与r-组开放与r-组文件从图像文件创建减少的分辨率数据集将灰度或二值图像转换为索引图像将索引图像转换为灰度图像转换矩阵到灰度图像将RGB图像的灰度或颜色表索引图像的RGB图像转换转换成RGB图像标签矩阵Bayer编码图像转换为彩色图像二值化图像的阈值分割量化图像使用指定的量化电平和输出值采用多级图像阈值Otsu方法采用局部一阶统计的自适应图像阈值使用全局直方图阈值Otsu方法基于阈值的图像转换成二值图像使用全局阈值Otsu方法采用多层阈值化方法将灰度图像转换为索引图像将图像转换为双精度将图像转换为16位有符号整数将图像转换成java缓冲图像将图像转换为单精度将图像转换为16位无符号整数将图像转换为8位无符号整数创建棋盘格图像创建头部影像添加噪声到图像显示图像显示多个图像帧矩形蒙太奇在单个图形中显示多个图像从多帧图像的电影播放电影、视频或图像序列显示图像作为纹理映射的表面获取图像处理工具箱的首选项显示图像处理工具箱首选项对话框设置图像处理工具箱的首选项或显示有效值图像查看器应用程序图像信息的工具对比度调整工具显示范围的工具距离工具像素信息的工具无文本标签的像素信息工具像素区域的工具用于滚动面板的放大盒在滚动面板中显示的图像的概述工具获取图像处理工具箱的首选项显示图像处理工具箱首选项对话框设置图像处理工具箱的首选项或显示有效值图像信息的工具选择映射工具对比度调整工具作物图像显示范围的工具距离工具像素信息的工具无文本标签的像素信息工具像素区域的工具像素区域工具面板用于滚动面板的放大盒在滚动面板中显示的图像的概述工具滚动面板中显示的图像的工具面板保存图像的工具用于交互式图像导航的滚动面板创建可拖动椭圆创建可拖动自由区域创建可拖动,可调整大小的线创建可拖动点创建可拖动,可调整大小的多边形创建可拖动矩形感兴趣区域(感兴趣区域)基类用鼠标选择多段线用鼠标指定点用鼠标指定矩形从轴的图像数据图像对象的图像模型对象图像模型对象将坐标轴转换为像素坐标关于图像属性的信息获取当前包含图像的轴的句柄获取当前图像包含图像的句柄打开图像对话框获取所有图像处理添加函数句柄到回调列表检查处理的有效性获取处理的应用程序程序员接口(接口)从汞对象检索指针行为目录包含了IPT和Matlab的图标创建图形中的指针管理器从回调列表中删除函数句柄句柄图形对象中的存储指针行为结构排列图的窗口创建矩形拖动约束函数有界调整图像的显示大小作物图像调整图像大小旋转图像转换图像图像金字塔的还原与扩展将几何变换应用于图像拟合控制点对的几何变换二维空间变换在图像中的应用查找空间变换的输出范围输入和输出翻转平台结构的作用创建重采样结构创造空间转换结构(平台)将空间变换N-D数组应用前向空间变换应用逆空间变换创建棋盘格图像二维仿射几何变换三维仿射几何变换二维射影几何变换二维分段线性几何变换二维多项式几何变换二维局部加权平均几何变换将几何变换应用于图像基于强度的图像配准估计对齐两个二维或三维图像的几何变换显示图像比较图像之间的差异两幅图像的复合参考二维图像到世界坐标参考三维图像到世界坐标基于强度的图像配准基于强度的注册的配置估计对齐两个二维或三维图像的几何变换使用相位相关的两个二维图像的几何变换估计估计对齐两个二维或三维图像的位移场两幅图像的复合比较图像之间的差异Mattes互信息度量的配置对象均方误差度量配置对象正规步长梯度下降优化配置对象一加一进化优化配置对象控制点选择工具拟合控制点对的几何变换使用交叉相关的调整控制点位置cpstruct转换控制点的有效对标准化二维互相关从控制点对的空间变换调整图像的灰度值或颜色表对比度调整工具利用反锐化掩模图像锐化采用直方图均衡化增强对比度对比度自适应直方图均衡化(CLAHE)调整直方图的图像与参考图像n-bin直方图申请去相关拉伸的多通道图像查找对比度拉伸图像的限制使用查找表转换整数值添加噪声到图像N维的多维图像滤波二维图像的二维高斯滤波三维图像的三维高斯滤波创建预定义的二维滤波器图像引导滤波标准化二维互相关二维自适应噪声滤除二维中值滤波二维阶统计滤波图像局部标准偏差局部图像范围灰度图像局部熵一般滑动邻域运算Gabor滤波器和Gabor滤波器组的创建应用Gabor滤波器或滤波器组二维图像二维图像的二维图像滤波三维图像的三维盒滤波计算积分图像计算三维积分图像积分图像的二维箱滤波三维整体图像的三维箱滤波通过大小从二值图像中提取对象使用属性从二值图像中提取对象焊盘阵列二维频率响应采用频率采样的二维滤波器采用频率变换的二维滤波器二维FIR滤波器采用一维窗口的方法采用二维窗法的二维二维滤波器二维卷积矩阵二进制命中错误操作二值图像的形态学运算终极侵蚀从二值图像中删除小对象帽子底部过滤抑制连接到图像边缘的光结构形态接近的图像放大图像腐蚀图像扩展极大值变换扩展最小变换填充图像区域和孔h-maxima变换利用H-minima变换强制最小形态上打开的图像形态重构区域极值局部极小顶帽滤波分水岭变换创建连接的阵列检查连通性参数的有效性使用查找表的二值图像的邻域运算使用查找表的非线性滤波创建bwlookup使用查找表形态学结构元素形态学偏移结构元素利用盲反卷积去模糊图像用露西理查德森的方法去模糊图像利用正则化滤波复原图像使用维纳滤波复原图像沿图像边缘的锥度不连续性将光学传递函数转换为点扩散函数转换点扩展函数到光传输函数焊盘阵列指定感兴趣区域(投资回报率)将感兴趣区域(感兴趣区域)的多边形转换为区域掩模用内插法填充图像中的指定区域基于颜色的选择感兴趣区域(感兴趣区域)图像中的感兴趣区域(感兴趣区域)创建可拖动椭圆创建可拖动自由区域创建可拖动,可调整大小的多边形创建可拖动矩形感兴趣区域(感兴趣区域)基类图像I / O接口图像的不同块处理确定块处理的最佳块大小一般滑动邻域运算将矩阵列重新排列成块纵列邻域操作将图像块重新排列成列两幅图像的绝对差添加两个图像或添加常量到图像彩色通道的线性组合补充图像用常数将一幅图像分割成另一幅图像图像的线性组合用常数相乘的两幅图像或多幅图像从另一个或减去一个图像减去一个图像二元图像中的迹区域边界二进制图像中的跟踪对象绘图区域的边界在强度图像中查找边缘发现使用Hough变换圆创建圈子图像的梯度幅值和方向图像的方向梯度查找图像的三维梯度幅值和方向查找三维图像的方向梯度Hough变换基于Hough变换提取直线段确定峰Hough变换四叉树分解在四叉树分解块值在四叉树分解模块设置的值图像区域的测量特性二值图像中的对象区域通过大小从二值图像中提取对象查找二进制图像中的连接组件从二值图像生成凸壳图像二值图像的距离变换二值图像的测地距离变换二值图像的欧拉数在二值图像中查找对象的周长使用属性从二值图像中提取对象在二值图像中选择对象灰度图像的灰度加权距离变换创建图像数据的等高线图图像数据直方图像素的颜色值沿线段的像素值的横截面二维相关系数矩阵元素的平均值或平均值矩阵元素的标准偏差二维二值图像中的标签连接部件二值图像中的标签连接组件从bwconncomp创建标签矩阵结构包的二进制图像打开二进制图像灰度图像熵灰度图像局部熵局部图像范围图像局部标准偏差从图像创建灰度共生矩阵灰度共生矩阵的性质均方误差峰值信噪比(PSNR)结构相似性指数(SSIM)测量图像质量用主动轮廓分割成前景和背景的图像采用快速行进法的二值图像分割用基于测地距离的彩色分割的两个或三个区域的分割图像基于图像梯度的图像像素权重计算基于灰度强度差的图像像素权重计算选择具有相似灰度值的连续图像区域使用全局阈值Otsu方法采用多级图像阈值Otsu方法使用全局直方图阈值Otsu方法采用局部一阶统计的自适应图像阈值查找区域边界的分割二维超像素oversegmentation的图像将二元掩模烧成二维图像将标签矩阵转换为线性指标的单元阵列图像变换二值图像的距离变换二值图像的测地距离变换灰度图像的灰度加权距离变换Hough变换二维离散余弦变换离散余弦变换矩阵将扇形束投影转换成平行光束扇束变换二维逆离散余弦变换逆扇形束变换逆Radon变换将平行光束投影转换成扇形光束Radon变换二维快速傅立叶变换将零频分量移到光谱中心二维逆快速傅立叶变换逆FFT转换颜色转换转换RGB与CIE 1976 L*a*b*将RGB颜色值的NTSC色彩空间转换RGB与CIE 1931 XYZ转换到YCbCr色彩空间RGB颜色值1976将CIE L*a*b*到RGB1976将CIE L*a*b*到CIE 1931 XYZ将CIE 1931 XYZ CIE 1976 L*a*b*CIE 1931 XYZ到RGB的转换YCbCr颜色值转换到RGB颜色空间转换成NTSC值RGB颜色空间将L * A * B *数据转换为双将L*a*b*数据uint16将L*a*b*数据卡片XYZ颜色值转换为双将XYZ颜色值uint16搜索国际商会简介读的ICC配置文件查找系统默认的国际刑事法院配置文件库将颜色配置文件写入磁盘文件真正的有效的国际刑事法院颜色配置文件创建颜色转换结构应用设备独立的颜色空间变换通过减少颜色数的近似索引图像标准照明体XYZ颜色值generation采用局部一阶统计的自适应图像阈值查找区域边界的分割从二值图像中删除小对象二元图像中的迹区域边界查找二进制图像中的连接组件二值图像的距离变换二值图像的欧拉数二维二值图像中的标签连接部件使用查找表的非线性滤波二值图像的形态学运算包的二进制图像在二值图像中查找对象的周长在二值图像中选择对象二进制图像中的跟踪对象打开二进制图像创建连接的阵列Bayer编码图像转换为彩色图像在强度图像中查找边缘拟合控制点对的几何变换创建预定义的二维滤波器基于它的类的图像的默认显示范围选择具有相似灰度值的连续图像区域采用直方图均衡化增强对比度Hough变换基于Hough变换提取直线段确定峰Hough变换转换到RGB的色度HSV颜色图将图像转换为双精度将图像转换为16位有符号整数将图像转换为单精度将图像转换为16位无符号整数将图像转换为8位无符号整数两幅图像的绝对差调整图像的灰度值或颜色表二值化图像的阈值分割帽子底部过滤二维图像的二维图像滤波抑制连接到图像边缘的光结构形态接近的图像补充图像作物图像放大图像腐蚀图像扩展极大值变换扩展最小变换填充图像区域和孔N维的多维图像滤波发现使用Hough变换圆应用Gabor滤波器或滤波器组二维图像二维图像的二维高斯滤波查找图像的三维梯度幅值和方向查找三维图像的方向梯度图像数据直方图h-maxima变换利用H-minima变换图像的线性组合均方误差形态上打开的图像将二元掩模烧成二维图像图像金字塔的还原与扩展量化图像使用指定的量化电平和输出值从图形文件读取图像形态重构区域极值局部极小调整图像大小旋转图像顶帽滤波转换图像将几何变换应用于图像积分图像的二维箱滤波计算积分图像使用查找表转换整数值检查的有效性信息检查连通性参数的有效性1976将CIE L*a*b*到RGB转换成RGB图像标签矩阵将标签矩阵转换为线性指标的单元阵列矩阵元素的平均值或平均值二维中值滤波采用多级图像阈值Otsu方法二维阶统计滤波使用全局直方图阈值Otsu方法焊盘阵列峰值信噪比(PSNR)图像区域的测量特性将RGB图像的灰度或颜色表将RGB颜色表HSV色图转换RGB与CIE 1976 L*a*b*转换到YCbCr色彩空间RGB颜色值查找对比度拉伸图像的限制二维超像素oversegmentation的图像分水岭变换YCbCr颜色值转换到RGB颜色空间参考二维图像到世界坐标参考三维图像到世界坐标二维仿射几何变换二维射影几何变换形态学结构元素形态学偏移结构元素GPU 计算二值图像的距离变换二维二值图像中的标签连接部件使用查找表的非线性滤波二值图像的形态学运算二维相关系数在强度图像中查找边缘采用直方图均衡化增强对比度将图像转换为双精度将图像转换为单精度将图像转换为8位无符号整数将图像转换为16位无符号整数两幅图像的绝对差调整图像的灰度值或颜色表帽子底部过滤形态接近的图像补充图像放大图像腐蚀图像填充图像区域和孔N维的多维图像滤波图像的梯度幅值和方向图像的方向梯度图像数据直方图图像的线性组合添加噪声到图像YCbCr颜色值转换到RGB颜色空间形态上打开的图像形态重构估计对齐两个二维或三维图像的位移场调整图像大小旋转图像显示图像顶帽滤波逆Radon变换转换矩阵到灰度图像矩阵元素的平均值或平均值二维中值滤波标准化二维互相关焊盘阵列Radon变换图像区域的测量特性将RGB图像的灰度或颜色表转换到YCbCr色彩空间RGB颜色值矩阵元素的标准偏差图像局部标准偏差查找对比度拉伸图像的限制。

Matlab中常用的数学函数介绍与应用

Matlab中常用的数学函数介绍与应用

Matlab中常用的数学函数介绍与应用引言:Matlab是一种强大的数学计算工具,它提供了丰富的函数库,可以方便地进行各种数学运算和数据分析。

本文将介绍一些常用的Matlab数学函数,并讨论它们的具体应用场景和用法。

一、线性代数函数1.1 dot函数dot函数用于计算两个向量的点积。

在向量计算中,点积可以帮助我们判断两个向量之间的夹角以及它们的相似程度。

例如,我们可以使用dot函数来计算两个特征向量之间的相似性,从而实现图像分类或者特征匹配。

具体用法:C = dot(A,B),其中A和B是两个向量。

计算结果将存储在变量C 中。

1.2 inv函数inv函数用于计算一个矩阵的逆矩阵。

在线性代数中,逆矩阵对于求解线性方程组、求解最小二乘问题以及确定矩阵的特征值等具有重要作用。

通过使用inv函数,我们可以方便地求解这些问题。

具体用法:B = inv(A),其中A是输入的矩阵,B是其逆矩阵。

1.3 eig函数eig函数用于计算一个矩阵的特征值和特征向量。

在许多数学和物理问题中,特征值和特征向量都具有重要的意义。

例如,在图像压缩和图像处理中,特征值分解可以帮助我们找到最佳的基向量,从而实现更好的图像压缩效果。

具体用法:[V,D] = eig(A),其中A是输入的矩阵,V是特征向量矩阵,D是特征值对角矩阵。

二、微积分函数2.1 diff函数diff函数用于计算一个函数的导数。

在微积分中,导数表示函数在某一点的变化率,具有重要的应用价值。

通过使用diff函数,我们可以方便地计算函数的导数,从而求解一些最优化问题、优化算法以及信号处理等领域的相关问题。

具体用法:Y = diff(X),其中X是输入的函数,Y是其导数。

2.2 int函数int函数用于计算一个函数的不定积分。

在微积分中,不定积分表示函数在某一区间上的面积或体积,对于求解曲线下面积、计算变量间的相关性以及估计概率密度分布等问题非常有用。

通过使用int函数,我们可以轻松地计算函数的不定积分。

matlab数字图像处理intrans函数学习笔记

matlab数字图像处理intrans函数学习笔记

matlab数字图像处理intrans函数学习笔记intrans函数如下:function g = intrans(f,varargin)error (nargchk(2,4,nargin))%check inputclassin = class(f);%stroe the class of the input for use later.if strcmp(class(f),'double') & max(f(:))>1 & ~strcmp(varargin{1},'log')f = mat2gray(f);%if all the 3 conditions is filling the need .else% make sure the class(f) is in the class of double , f(:) means all the% elemnets in the martix F, and the max(f(:))>1 means if the max(f(:))>1 so% convert them into double , in this way they are all less then1.% strcmp(varargin[1],'log') is the string compare, and the varargin {1}% compares with log.f = im2double(f);endmethod = varargin{1};switch methodcase 'neg'g = imcomplement(f);case 'log'if length(varargin) == 1c = 1;elseif length(varargin) == 2c = varargin{2};elseif length(varargin) == 3c = varargin{2};classin = varargin{3};elseerror('Incorrect number of input for the log option.')endg = c*(log(1+double(f)));case 'gamma'if length(varargin) < 2error('not enough input for the gamma option')endgam = varargin{2};g = imadjust (f, [], [], gam);case 'stretch'if length(varargin) == 1%defaults vaulem = mean2(f);E = 4.0;elseif length(varargin) == 3m = varargin{2};E = varargin{3};else error('incorrect number of inputs for the srtetch option.')endg = 1./(1 + (m./(f+eps)).^E);otherwiseerror('unkown enhancement method.')end% g = changeclass(classin , g);说实话,对matlab的代码风格不是很习惯,后来看着看着感觉和才⾮常相似,也就看起来舒服多了这段代码刚开始没看懂,尤其是varargin{}的⼀直不明⽩,但加断点后,将整个程序跑了⼀遍,基本就明⽩了,这⾥不得不说,中⽂版书上将的不是很明⽩。

MATLAB图像处理函数大全

MATLAB图像处理函数大全

Matlab数字数字图像处理函数汇总:1、数字数字图像的变换①fft2:fft2函数用于数字数字图像的二维傅立叶变换,如:i=imread('104_8.tif'); j=fft2(i);②ifft2::ifft2函数用于数字数字图像的二维傅立叶反变换,如:i=imread('104_8.tif');j=fft2(i);k=ifft2(j);2、模拟噪声生成函数和预定义滤波器①imnoise:用于对数字数字图像生成模拟噪声,如:i=imread('104_8.tif');j=imnoise(i,'gaussian',0,0.02);%模拟高斯噪声②fspecial:用于产生预定义滤波器,如:h=fspecial('sobel');%sobel水平边缘增强滤波器h=fspecial('gaussian');%高斯低通滤波器h=fspecial('laplacian');%拉普拉斯滤波器h=fspecial('log');%高斯拉普拉斯(LoG)滤波器h=fspecial('average');%均值滤波器2、数字数字图像的增强①直方图:imhist函数用于数字数字图像的直方图显示,如:i=imread('104_8.tif');imhist(i);②直方图均化:histeq函数用于数字数字图像的直方图均化,如:i=imread('104_8.tif');j=histeq(i);③对比度调整:imadjust函数用于数字数字图像的对比度调整,如:i=imread('104_8.tif');j=imadjust(i,[0.3,0.7],[]);④对数变换:log函数用于数字数字图像的对数变换,如:i=imread('104_8.tif');j=double(i);k=log(j);⑤基于卷积的数字数字图像滤波函数:filter2函数用于数字数字图像滤波,如:i=imread('104_8.tif');h=[1,2,1;0,0,0;-1,-2,-1];j=filter2(h,i);⑥线性滤波:利用二维卷积conv2滤波, 如:i=imread('104_8.tif');h=[1,1,1;1,1,1;1,1,1];h=h/9;j=conv2(i,h);⑦中值滤波:medfilt2函数用于数字数字图像的中值滤波,如:i=imread('104_8.tif');j=medfilt2(i);⑧锐化(1)利用Sobel算子锐化数字数字图像, 如:i=imread('104_8.tif');h=[1,2,1;0,0,0;-1,-2,-1];%Sobel算子j=filter2(h,i);(2)利用拉氏算子锐化数字数字图像, 如:i=imread('104_8.tif');j=double(i);h=[0,1,0;1,-4,0;0,1,0];%拉氏算子k=conv2(j,h,'same');m=j-k;3、数字数字图像边缘检测①sobel算子如:i=imread('104_8.tif');如有帮助,欢迎支持。

matlab灰度变换函数

matlab灰度变换函数

Matlab灰度变换函数简介灰度变换是一种常用的图像处理技术,在数字图像处理中具有广泛的应用。

灰度变换函数是实现灰度变换的一种方式,可以通过该函数将图像的灰度级进行变换,以达到图像增强、对比度调整等目的。

本文将详细介绍灰度变换函数在Matlab中的使用方法及其原理,以便读者能够了解并灵活运用该函数进行图像处理。

一、定义和原理灰度变换函数是指通过对图像的像素点灰度值进行线性或非线性变换,来实现对图像灰度级的调整。

其一般形式为:g(x,y)=T(f(x,y))其中,f(x,y)为原始图像的灰度像素值,g(x,y)为变换后的图像的灰度像素值,T 为灰度变换函数。

灰度变换函数可以通过如下两种方式来实现:1.线性灰度变换函数:g(x,y)=a⋅f(x,y)+b,其中,a和b为常数,通过调整a和b的值可以实现对图像灰度级的线性变换。

2.非线性灰度变换函数:g(x,y)=T(f(x,y)),其中,T(⋅)为非线性函数,通过调整函数T的形式和参数可以实现对图像灰度级的非线性变换。

二、Matlab中的灰度变换函数在Matlab中,可以使用以下两种函数来实现灰度变换:1.imadjust函数:该函数使用线性灰度变换函数对图像进行灰度级的调整。

J = imadjust(I,[low_in high_in],[low_out high_out])其中,I为输入图像,low_in和high_in为输入图像的灰度级范围,low_out 和high_out为输出图像的灰度级范围。

函数将图像的灰度级从[low i n,ℎigℎi n]映射到[low o ut,ℎigℎo ut]范围内。

2.stretchlim函数和imadjust函数:这种方式是通过非线性灰度变换函数来实现对图像的灰度级调整。

J = imadjust(I,stretchlim(I),[])函数内部使用stretchlim函数计算输入图像的灰度级范围,然后再使用imadjust函数对图像进行灰度级调整。

Matlab中图像处理常用函数的用法

Matlab中图像处理常用函数的用法

Matlab中常见函数的用法1 size()函数1)s=size(A),当只有一个输出参数时,返回一个行向量,该行向量的第一个元素时矩阵的行数,第二个元素是矩阵的列数。

2)[r,c]=size(A),当有两个输出参数时,size函数将矩阵的行数返回到第一个输出变量r,将矩阵的列数返回到第二个输出变量c。

3)size(A,n)如果在size函数的输入参数中再添加一项n,并用1、2或者3为n赋值,则 size将返回矩阵的行数或列数。

其中r=size(A,1)该语句返回的时矩阵A的行数, c=size(A,2) 该语句返回的时矩阵A的列数。

如果A为一个二维数组,则可以将其看成一个第三维为1的数组,即size(A,3)的返回值为1。

2 padarray()函数B = padarray(A,padsize,padval,direction)A为输入图像,B为填充后的图像,padsize给出了给出了填充的行数和列数,通常用[r c]来表示。

padval和direction分别表示填充方法和方向。

它们的具体值和描述如下:Padval选项:'symmetric'表示图像大小通过围绕边界进行镜像反射来扩展;'replicate'表示图像大小通过复制外边界中的值来扩展;'circular'图像大小通过将图像看成是一个二维周期函数的一个周期来进行扩展。

Direction选项:'pre'表示在每一维的第一个元素前填充;'post'表示在每一维的最后一个元素后填充;'both'表示在每一维的第一个元素前和最后一个元素后填充,此项为默认值。

若参量中不包括direction,则默认值为'both';若参量中不包含padval,则默认用0来填充。

若参量中不包括任何参数,则默认填充为零且方向为'both'。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

基本界面
1-1、基本运算与函数
在MATLAB下进行基本数学运算,只需将运算式直接打入提示号(>>)之後,并按入Enter键即可。

例如:
>> (5*2+1.3-0.8)*10/25
ans =4.2000
MATLAB会将运算结果直接存入一变数ans,代表MATLAB运算後的答案(Answer)并显示其数值於萤幕上。

小提示:">>"是MATLAB的提示符号(Prompt),但在PC中文视窗系统下,由於编码方式不同,此提示符号常会消失不见,但这并不会影响到MATLAB的运算结果。

我们也可将上述运算式的结果设定给另一个变数x:
x = (5*2+1.3-0.8)*10^2/25
x = 42
若要输入矩阵,则必须在每一列结尾加上分号(;),如下例:
A = [1 2 3 4; 5 6 7 8; 9 1011 12];
A =
1 2 3 4
5 6 7 8
9 10 11 12
同样地,我们可以对矩阵进行各种处理:
A(2,3) = 5 % 改变位於第二列,第三行的元素值
A =
1 2 3 4
5 6 5 8
9 10 11 12
B = A(2,1:3) % 取出部份矩阵B
B = 5 6 5
A = [A B'] % 将B转置後以列向量并入A
A =
1 2 3 4 5
5 6 5 8 6
9 10 11 12 5
A(:, 2) = [] % 删除第二行(:代表所有列)
A =
1 3 4 5
5 5 8 6
9 11 12 5
A = [A; 4 3 2 1] % 加入第四列
A =
1 3 4 5
5 5 8 6
9 11 12 5
4 3 2 1
A([1 4], :) = [] % 删除第一和第四列(:代表所有行)
A =
5 5 8 6
9 11 12 5
这几种矩阵处理的方式可以相互叠代运用,产生各种意想不到的效果,就看各位的巧思和创意。

小提示:在MATLAB的内部资料结构中,每一个矩阵都是一个以行为主(Column-oriented )的阵列(Array)因此对於矩阵元素的存取,我们可用一维或二维的索引(Index)来定址。

举例来说,在上述矩阵A中,位於第二列、第三行的元素可写为A(2,3) (二维索引)或A(6)(一维索引,即将所有直行进行堆叠後的第六个元素)。

此外,若要重新安排矩阵的形状,可用reshape命令:
B = reshape(A, 4, 2) % 4是新矩阵的行数,2是新矩阵的列数
B =
5 8
9 12
5 6
11 5
小提示:A(:)就是将矩阵A每一行堆叠起来,成为一个列向量,而这也是MATLAB变数的内部储存方式。

以前例而言,reshape(A, 8, 1)和A(:)同样都会产生一个8x1的矩阵。

1,图像的读入和显示:
(1)图像读入:A=imread('文件名',文件格式)
[X,map]=imread('文件名') %X代表索引图像矩阵,map为颜色映射表
(2)图像显示:image(A);
2. 图像写回
A=imwrite('文件名',文件格式)
[X,map]=imwrite('文件名')%注意,当只写文件名时,它应带有扩展名
3.获取图像信息
info=imfinfo('文件名') 4.标准图像显示技术
(1)imshow(I,n)%显示灰度图像,n为灰度级数
(2)imshow(I,[low,high])%[low,high]为图像数据的值域(可为空[ ])
(3)imshow(BW)%显示二值图像
(4)imshow(X,map)%显示索引色图像
5.图像的运算
(1)Z=imadd(X,Y)%图像的加运算,X,Y是输入的两幅图像,其中一个可以是常数
(2)Z=imsubtract(X,Y)%图像的减运算,Y可以是常数
(3)Z=immiltiply(X,y)%图像的乘运算,Y也可以是常数
(4)Z=imdivide(X,y)%图像的除运算,Y也可以是常数
6.图像的类型转换
(1)RGB=ind2rgb(X,map)%索引图转换为真彩色图
(2)I=mat2gray(A)%将一个数据矩阵转换为灰度图
(3)I=rgb2gray(RGB)%将一副灰度图转换为真彩色图
(4)[X,map]=rgb2ind(RGB,n)%将RGB图转换为索引色图
(5)BW=im2bw(I,level)%将真彩色图或灰度图转换为二值图,level为阈值
BW=im2bw(X,map,level)%将索引色图转换为二值图
(6)I=ind2gray(X,map)%将索引色图转换为灰度图
7.傅里叶变换
(1)Y=fft2(x,m,n)%二维离散傅里叶快速变换,x为要进行傅里叶变换的矩阵,m、n是返回的变换矩阵Y的行数和列数。

(2)Y=ifft2(x,m,n)%二维离散傅里叶反变换
(3)Y1=fftshift(Y)%把傅里叶变换操作得到的结果中零频率成分移到矩阵中心,这样利于观察频谱。

8.离散余弦变换
(1)D=dct2(A,m,n)%二维离散余弦变换,A是输入图像,B是返回的DCT变换系数,m、n为D的行数和列数(2)D=idct(A,m,n)%e二维离散余弦逆变换。

(3)D=dctmtx(n)%返回DCT变换矩阵
9.Radon变换
[R,xp]=radon(I,theta)%I为图像矩阵,theta为角度
I=iradon(R,thrta)%逆Radon变换
10.图像的增强(1)
(1)imhist(I)%显示一副图像的直方图
(2)J=histeq(I)%直方图均衡化
(3)J=imadjust(I,[low_in;high_in],[low_out;high_out],gamma)%调整图像灰度值
(4)J=adapthisteq(I)%有限对比自适应直方图均衡化
(5)S=decorrestretch(I)%去相关色度拉伸
11.图像的增强(2)
B=imfilter(A,H,option1,option2,...)
A是输入图像,H是卷积核或相关核,option是一些可选参数。

注:权重矩阵称为卷积核,也称为滤波器。

卷积核是相关核旋转180度得到的,可选参数参看help
其中H也用H=fspecial(type,parameters)可自定义
12.中值滤波器
B=medfilt2(A,[m,n])%A是输入的图像,[m,n]是邻域的大小
13.自适应滤波器
B=wiener2(A,[m,n])
14.图像的分析
P=impixel(I)%交互式获取图像像素值
P=impixel(I,c,r)%指定点坐标像素值,c、r为行坐标和列坐标
C=improfile(I,xi,yi,n,method)%创建图像强度曲线,n规定了计算图像强度点的个数,xi、yi规定了空间直线端点坐标,method是插值方法(nearest,bilinrar,bicubic)
imcontour(I,n,linespec)%显示图像数据的等值线图
15.图像的统计信息
B=mean(A)%计算A的均值
b=std2(A)%计算A的标准差
r=corr2(A,B)%A,B为输入二维矩阵,r是返回的协方差系数
a=rgb2gray()。

相关文档
最新文档