文档详情

图像处理三四五实验报告.doc

发布:2017-04-28约1.74万字共25页下载文档
文本预览下载声明
实验三 图像的几何变换 一.实验目的及要求 掌握图像几何变换的基本原理,熟练掌握数字图像的缩放、旋转、平移、镜像和转置的基本原理及其MATLAB编程实现方法。 二、实验内容 (一)研究以下程序,分析程序功能;输入执行各命令行,认真观察命令执行的结果。熟悉程序中所使用函数的调用方法,改变有关参数,观察试验结果。 1. 图像缩放 clear all, close all I = imread(cameraman.tif); Scale = 1.35; % 将图像放大1.35倍 J1 = imresize(I, Scale, nearest); % using the nearest neighbor interpolation J2 = imresize(I, Scale, bilinear); % using the bilinear interpolation imshow(I), title(Original Image); figure, imshow(J1), title(Resized Image-- using the nearest neighbor interpolation ); figure, imshow(J2), title(Resized Image-- using the bilinear interpolation ); % 查看imresize使用帮助 help imresize Command窗口显示如下: IMRESIZE Resize image. B = IMRESIZE(A, SCALE) returns an image that is SCALE times the size of A, which is a grayscale, RGB, or binary image. B = IMRESIZE(A, [NUMROWS NUMCOLS]) resizes the image so that it has the specified number of rows and columns. Either NUMROWS or NUMCOLS may be NaN, in which case IMRESIZE computes the number of rows or columns automatically in order to preserve the image aspect ratio. [Y, NEWMAP] = IMRESIZE(X, MAP, SCALE) resizes an indexed image. [Y, NEWMAP] = IMRESIZE(X, MAP, [NUMROWS NUMCOLS]) resizes an indexed image. To control the interpolation method used by IMRESIZE, add a METHOD argument to any of the syntaxes above, like this: IMRESIZE(A, SCALE, METHOD) IMRESIZE(A, [NUMROWS NUMCOLS], METHOD), IMRESIZE(X, MAP, M, METHOD) IMRESIZE(X, MAP, [NUMROWS NUMCOLS], METHOD) METHOD can be a string naming a general interpolation method: nearest - nearest-neighbor interpolation bilinear - bilinear interpolation bicubic - cubic interpolation; the default method METHOD can also be a string naming an interpolation kernel: box - interpolation with a box-shaped kernel triangle - interpolation with a triangular ke
显示全部
相似文档