ImageVerifierCode 换一换
格式:DOCX , 页数:13 ,大小:222.72KB ,
资源ID:7542406      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/7542406.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(媒体特征提取.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

媒体特征提取.docx

1、媒体特征提取媒体计算方法课程实验总结报告实验名称: 媒体特征提取 学 号: 姓 名: 日 期: 2014-12-23 一、实验目的1、实验目标以图像媒体为例,对指定的图像数据进行颜色特征、形状特征、局部不变等特征提取处理,体会不同的图像特征提取方法的特点和适用范围。2、实验涉及到的学习内容颜色特征提取、形状特征提取、局部不变特征提取(SIFT)。二、实验具体完成情况1、总体实验方案利用matlab编程实现对图像的颜色特征提取、形状特征提取和局部不变特征提取(SIFT)。2、具体技术途径matlab图像处理函数。3、实验结果与分析(1)颜色特征提取编写图像的灰度直方图特征提取算法,实现与imHi

2、st函数类似的效果。算法思想:利用for循环对原始图像进行遍历,统计每个颜色值在图像中的像素个数,根据统计结果绘制直方图。实验结果图1 本算法绘制的原始图像的直方图图2 imhist函数绘制的原始图像直方图(2)形状特征提取通过边缘检测等方法提取简单图像的边界特征,并用链码的方式保存图像的形状特征。算法思想:对原始图像进行边缘提取,在得到的边缘特征矩阵中寻找一个非零点,即边缘像素点,从该点开始,沿顺时针方向遍历其相邻8个像素点,记录第一个非零点的相对位置。再遍历这个边缘像素点周围的像素点,寻找下一个边缘像素点,直到重新遍历到初始点停止。实验结果图3 原始图像图4 提取的图像边缘特征算法只提取了

3、图像的边缘特征,并直接调用matlab的fchcode函数对图像边缘特征链码表示。(3)局部不变特征提取对于选定的某幅图像,提取SIFT局部不变特征,体会该特征的旋转、尺度、光照等不变性。算法思想:构建原始图像高斯金字塔;再同尺度相邻相差构建差分高斯金字塔;寻找尺度空间极值点,并删除错误点,其余为关键点;计算关键点坐标和所处的尺度;以关键点邻域梯度的主方向作为该点的方向特征。这里是使用别人写好的SIFT特征提取类函数,自己对其进行调用来实现特征提取以及匹配。实验结果图5 原始图像图6 提取的原始图像的SIFT特征信息图7 相似图像的SIFT特征匹配三、存在的主要问题和建议三个小的实验算法思想并

4、不难,但是在实现过程中发现自己的编程水平还有欠缺,理解了算法的思想,但是由于技术所限不能够按照算法思想自己编写一套程序。只能调用别人写好的函数实现自己预想的功能。另外此次实验都是在matlab中实现的,但在以后的工程实践中可能更多的是使用opencv,所以接下来要学习一下opencv的使用,现已在自己电脑的vs2010上配置好了opencv2.4.2,自己会在学习使用opencv的过程中重新实现以上实验。附:程序核心源代码(1)颜色特征提取close all%imhist直方图特征提取f1 = imread(Fig1202(c)(WashingtonDC_Band3_512).tif);sub

5、plot(1,2,1), imshow(f1), title(WashingtonDC_Band);subplot(1,2,2), imhist(f1), title(imhist); %自己编写imhist提取函数m,n=size(f1);a=zeros(1,256);for i=1:m for j=1:n a(f1(i,j)+1)=a(f1(i,j)+1)+1; endendfigure();subplot(1,2,1), imshow(f1), title(WashingtonDC_Band);subplot(1,2,2),bar(a,b);axis(0 255 0 max(a)+100

6、0) ,title(myself-imhist);(2)形状特征提取f=imread( Fig1107(a)(mapleleaf).tif);g=edge(f,sobel);B=boundaries(g);b=B1,1;c=fchcode(b);(3)尺度不变特征提取(Demo见附件)%sift.m% image, descriptors, locs = sift(imageFile)% This function reads an image and returns its SIFT keypoints.% Input parameters:% imageFile: the file nam

7、e for the image.% Returned:% image: the image array in double format% descriptors: a K-by-128 matrix, where each row gives an invariant% descriptor for one of the K keypoints. The descriptor is a vector% of 128 values normalized to unit length.% locs: K-by-4 matrix, in which each row has the 4 value

8、s for a% keypoint location (row, column, scale, orientation). The % orientation is in the range -PI, PI radians.% Credits: Thanks for initial version of this program to D. Alvaro and % J.J. Guerrero, Universidad de Zaragoza (modified by D. Lowe) function image, descriptors, locs = sift(imageFile) %

9、Load imageimage = imread(imageFile); % If you have the Image Processing Toolbox, you can uncomment the following% lines to allow input of color images, which will be converted to grayscale.% if isrgb(image)% image = rgb2gray(image);% end rows, cols = size(image); % Convert into PGM imagefile, readab

10、le by keypoints executablef = fopen(tmp.pgm, w);if f = -1 error(Could not create file tmp.pgm.);endfprintf(f, P5n%dn%dn255n, cols, rows);fwrite(f, image, uint8);fclose(f); % Call keypoints executableif isunix command = !./sift ;else command = !siftWin32 ;endcommand = command tmp.key;eval(command); %

11、 Open tmp.key and check its headerg = fopen(tmp.key, r);if g = -1 error(Could not open file tmp.key.);endheader, count = fscanf(g, %d %d, 1 2);if count = 2 error(Invalid keypoint file beginning.);endnum = header(1);len = header(2);if len = 128 error(Keypoint descriptor length invalid (should be 128)

12、.);end % Creates the two output matrices (use known size for efficiency)locs = double(zeros(num, 4);descriptors = double(zeros(num, 128); % Parse tmp.keyfor i = 1:num vector, count = fscanf(g, %f %f %f %f, 1 4); %row col scale ori if count = 4 error(Invalid keypoint file format); end locs(i, :) = ve

13、ctor(1, :); descrip, count = fscanf(g, %d, 1 len); if (count = 128) error(Invalid keypoint file value.); end % Normalize each input vector to unit length descrip = descrip / sqrt(sum(descrip.2); descriptors(i, :) = descrip(1, :);endfclose(g); %showkeys.m% showkeys(image, locs)% This function display

14、s an image with SIFT keypoints overlayed.% Input parameters:% image: the file name for the image (grayscale)% locs: matrix in which each row gives a keypoint location (row,% column, scale, orientation) function showkeys(image, locs) disp(Drawing SIFT keypoints .); % Draw image with keypointsfigure(P

15、osition, 50 50 size(image,2) size(image,1);colormap(gray);imagesc(image);hold on;imsize = size(image);for i = 1: size(locs,1) % Draw an arrow, each line transformed according to keypoint parameters. TransformLine(imsize, locs(i,:), 0.0, 0.0, 1.0, 0.0); TransformLine(imsize, locs(i,:), 0.85, 0.1, 1.0

16、, 0.0); TransformLine(imsize, locs(i,:), 0.85, -0.1, 1.0, 0.0);endhold off; % - Subroutine: TransformLine -% Draw the given line in the image, but first translate, rotate, and% scale according to the keypoint parameters.% Parameters:% Arrays:% imsize = rows columns of image% keypoint = subpixel_row

17、subpixel_column scale orientation% Scalars:% x1, y1; begining of vector% x2, y2; ending of vectorfunction TransformLine(imsize, keypoint, x1, y1, x2, y2) % The scaling of the unit length arrow is set to approximately the radius% of the region used to compute the keypoint descriptor.len = 6 * keypoin

18、t(3); % Rotate the keypoints by ori = keypoint(4)s = sin(keypoint(4);c = cos(keypoint(4); % Apply transformr1 = keypoint(1) - len * (c * y1 + s * x1);c1 = keypoint(2) + len * (- s * y1 + c * x1);r2 = keypoint(1) - len * (c * y2 + s * x2);c2 = keypoint(2) + len * (- s * y2 + c * x2); line(c1 c2, r1 r

19、2, Color, c);%match.m% num = match(image1, image2)% This function reads two images, finds their SIFT features, and% displays lines connecting the matched keypoints. A match is accepted% only if its distance is less than distRatio times the distance to the% second closest match.% It returns the numbe

20、r of matches displayed.% Example: match(scene.pgm,book.pgm); function num = match(image1, image2) % Find SIFT keypoints for each imageim1, des1, loc1 = sift(image1);im2, des2, loc2 = sift(image2); % For efficiency in Matlab, it is cheaper to compute dot products between% unit vectors rather than Euc

21、lidean distances. Note that the ratio of % angles (acos of dot products of unit vectors) is a close approximation% to the ratio of Euclidean distances for small angles.% distRatio: Only keep matches in which the ratio of vector angles from the% nearest to second nearest neighbor is less than distRat

22、io.distRatio = 0.6; % For each descriptor in the first image, select its match to second image.des2t = des2; % Precompute matrix transposefor i = 1 : size(des1,1) dotprods = des1(i,:) * des2t; % Computes vector of dot products vals,indx = sort(acos(dotprods); % Take inverse cosine and sort results %

23、 Check if nearest neighbor has angle less than distRatio times 2nd. if (vals(1) 0) line(loc1(i,2) loc2(match(i),2)+cols1, . loc1(i,1) loc2(match(i),1), Color, c); endendhold off;num = sum(match 0);fprintf(Found %d matches.n, num);%appendimages.m% im = appendimages(image1, image2)% Return a new image

24、 that appends the two images side-by-side. function im = appendimages(image1, image2) % Select the image with the fewest rows and fill in enough empty rows% to make it the same height as the other image.rows1 = size(image1,1);rows2 = size(image2,1); if (rows1 rows2) image1(rows2,1) = 0;else image2(rows1,1) = 0;end % Now append both images side-by-side.im = image1 image2;

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1