数字图像处理matlab大作业
数字图像处理MATLAB作业(3)

3.1I=imread('bmp.bmp'); %把一个BMP灰度图像读入到变量I中I1=im2double(I); %图像灰度值的双精度化figure,imhist(I1); %打开一个新图形窗口来显示直方图I2=imadjust(I1,[0 0.3],[0 1]); %把图像的灰度范围从[0,0.3]拉伸到[0,1] figure,imshow(I2); %打开一个新图形窗口显示增强后的图像figure,imhist(I2); %打开一个新图形窗口显示增强后的直方图3.2I=imread('lf.bmp'); imshow(I);%读入并显示一幅BMP频谱图像I1=double(I);%双精度化I2=log(I1+1);%对数变换I3=mat2gray(I2);%把图像的灰度范围变换为[0 1]范围figure,imshow(I3); %打开一个新的图形窗口显示减少动态范围后的频谱图像3.4I=imread('fj.bmp'); I=rgb2gray(I);imshow(I);title('原始图像');%读入并显示一幅灰度图像figure,imhist(I);title('原始直方图');%打开一个新的图形窗口显示原始图像的直方图[I1,T]=histeq(I);%直方图均衡化figure,imshow(I1);title('均衡化后'); %打开一个新的图形窗口显示均衡化后的图像figure,imhist(I1);title('均衡化后直方图');%打开一个新的图形窗口显示均衡化后的直方图figure,plot((0:255)/255,T);title('变换曲线');%打开一个新的图形窗口画出变换曲线3.6I=imread('fj.bmp'); I=rgb2gray(I);imshow(I);title('原始图像');%读入并显示一幅灰度图像figure,imhist(I);title('原始直方图');%打开一个新的图形窗口显示原始图像的直方图[I1,T]=histeq(I);%直方图均衡化figure,imshow(I1);title('均衡化后'); %打开一个新的图形窗口显示均衡化后的图像figure,imhist(I1);title('均衡化后直方图');%打开一个新的图形窗口显示均衡化后的直方图figure,plot((0:255)/255,T);title('变换曲线');%打开一个新的图形窗口画出变换曲线3.7clc;clear all;I=imread('hua.bmp');imshow(I),title('hua.bmp'); %把一个图形窗口划分为1×2矩形显示区域,在图形窗口的左侧区域显示图像II1=double(I);%数据类型转换,不支持无符号整型计算[M,N]=size(I1);%计算图像的高和宽%产生高斯型高通滤波器m=round(M/2);n=round(N/2);%四舍五入取整hh=1.035;hl=0.7;c=3;for i=1:Mfor j=1:Nd(i,j)=sqrt((i-m)^2+(j-n)^2);endendd0=median(median(d));for i=1:Mfor j=1:Nh(i,j)=(hh-hl)*(1-exp(-c*(d(i,j)/d0)))+hl;%高通滤波器endend[i,j]=meshgrid(1:M,1:N);figure,mesh(h); title('highpass filter');%同态滤波h=h';I2=log(I1+1);%对数变换I3=fft2(I2);%傅立叶变换I3=fftshift(I3);%频谱中心化I3=reshape(I3,384,1152);I4=I3.*(h);%滤波I4=reshape(I4,384,384,3);I4=ifftshift(I4); %频谱反中心化I4=ifft2(I4);%傅立叶反变换I5=exp(I4-1);%指数变换I6=real(I5);%取幅值I7=mat2gray(I6);%恢复变换后的数值范围figure,imshow(I7);title('adjusted image intensity value');%在图形窗口的右侧区域显示结果图像3.8I=imread('lf.bmp');I=rgb2gray(I);imshow(I);%读入和显示一幅原始图像title('original image') %给图像加标题X=grayslice(I,16);%将灰度范围分成16层% X=grayslice (I,n)用阈值1/n, 2/n, ..., (n-1)/n 阈值化灰度图像I ,并返回索引图像X。
数字图像处理大作业

1、下图是一用于干涉原理进行测试的干涉场图像,要求判读条纹的间距,请给出图像处理的方案并说明每一步的作用及其对其它处理步骤可能产生的影响。
解:步骤与思路:○1.进行模糊处理,消除噪声○2.边缘检测,进行图像增强处理○3.二值化图像,再进行边缘检测,能够得到很清晰的边界。
○4.采用横向标号法,根据值为1像素在标号中的相邻位置可以确定间距I=imread('xz mjt.bmp');I1=medfilt2(I); %对图像中值滤波imshow(I1);[m,n]=size(I1);for i=1:mfor j=1:nif(I1(i,j)<100) %阈值为100I1(i,j)=255;elseI1(i,j)=0; %进行二值化endendendfigure;imshow(I1);Y1=zeros(1,25);y2=y1;c=y2;i=100;for j=1:1200if (I1(i,j)==255&&I1(i,j+1)==0)Y1=j+1;endif (I1(i,j)==0&&I1(i,j+1)==255)Y2=j;endendfor i=1:25c=Y2(i)-Y1(i)endc %找出每两个条纹之间的距离2. 现有8个待编码的符号m0,……,m7,它们的概率分别为0.11,0.02,0.08,0.04,0.39,0.05,0.06,0.25,利用哈夫曼编码求出这一组符号的编码并画出哈夫曼树。
3. 请以图像分割方法为主题,结合具体处理实例,采用期刊论文格式,撰写一篇小论文。
各种算子对图像进行边缘检测效果的研究图像分割是根据需要将图像划分为有意义的若干区域或部分的图像处理技术。
通过边缘检测在Matlab中实现方法,及用四叉数分解函数进行区域分割的方法,掌握了Matlab区域操作函数的使用和图像分析和理解的基本方法,并学到了'roberts','sobel','prewitt','canny','log'算子对图像进行边缘检测的不同效果。
数字图像处理MATLAB程序【完整版】

第一部分数字图像处理实验一图像的点运算实验1.1直方图一.实验目的1.熟悉matlab图像处理工具箱及直方图函数的使用;2.理解和掌握直方图原理和方法;二.实验设备1.PC机一台;2.软件matlab。
三.程序设计在matlab环境中,程序首先读取图像,然后调用直方图函数,设置相关参数,再输出处理后的图像。
I=imread('cameraman.tif’);%读取图像subplot(1,2,1),imshow(I) %输出图像title(’原始图像') %在原始图像中加标题subplot(1,2,2),imhist(I) %输出原图直方图title('原始图像直方图') %在原图直方图上加标题四.实验步骤1。
启动matlab双击桌面matlab图标启动matlab环境;2。
在matlab命令窗口中输入相应程序。
书写程序时,首先读取图像,一般调用matlab自带的图像,如:cameraman图像;再调用相应的直方图函数,设置参数;最后输出处理后的图像;3.浏览源程序并理解含义;4.运行,观察显示结果;5.结束运行,退出;五.实验结果观察图像matlab环境下的直方图分布.(a)原始图像(b)原始图像直方图六.实验报告要求1、给出实验原理过程及实现代码;2、输入一幅灰度图像,给出其灰度直方图结果,并进行灰度直方图分布原理分析。
实验1.2 灰度均衡一.实验目的1.熟悉matlab图像处理工具箱中灰度均衡函数的使用;2.理解和掌握灰度均衡原理和实现方法;二.实验设备1.PC机一台;2.软件matlab;三.程序设计在matlab环境中,程序首先读取图像,然后调用灰度均衡函数,设置相关参数,再输出处理后的图像.I=imread('cameraman.tif’);%读取图像subplot(2,2,1),imshow(I) %输出图像title(’原始图像’) %在原始图像中加标题subplot(2,2,3),imhist(I) %输出原图直方图title(’原始图像直方图’) %在原图直方图上加标题a=histeq(I,256); %直方图均衡化,灰度级为256subplot(2,2,2),imshow(a) %输出均衡化后图像title(’均衡化后图像’) %在均衡化后图像中加标题subplot(2,2,4),imhist(a) %输出均衡化后直方图title('均衡化后图像直方图’)%在均衡化后直方图上加标题四.实验步骤1。
《数字图像处理》期末大作业(1)

《数字图像处理》期末大作业大作业题目及要求:一、题目:本门课程的考核以作品形式进行。
作品必须用Matlab完成。
并提交相关文档。
二、作品要求:1、用Matlab设计实现图形化界面,调用后台函数完成设计,函数可以调用Matlab工具箱中的函数,也可以自己编写函数。
设计完成后,点击GUI图形界面上的菜单或者按钮,进行必要的交互式操作后,最终能显示运行结果。
2、要求实现以下功能:每个功能的演示窗口标题必须体现完成该功能的小组成员的学号和姓名。
1)对于打开的图像可以显示其灰度直方图,实现直方图均衡化。
2)实现灰度图像的对比度增强,要求实现线性变换和非线性变换(包括对数变换和指数变换)。
3)实现图像的缩放变换、旋转变换等。
4)图像加噪(用输入参数控制不同噪声),然后使用空域和频域进行滤波处理。
5)采用robert算子,prewitt算子,sobel算子,拉普拉斯算子对图像进行边缘提取。
6)读入两幅图像,一幅为背景图像,一幅为含有目标的图像,应用所学的知识提取出目标。
3、认真完成期末大作业报告的撰写,对各个算法的原理和实验结果务必进行仔细分析讨论。
报告采用A4纸打印并装订成册。
附录:报告模板《数字图像处理》期末大作业班级:计算机小组编号:第9组组长:王迪小组成员:吴佳达浙江万里学院计算机与信息学院2014年12月目录(自动生成)1 绘制灰度直方图,实现直方图均衡化 (5)1.1 算法原理 (5)1.2 算法设计 (5)1.3 实验结果及对比分析 (5)2 灰度图像的对比度增强 (5)2.1 算法原理 (5)2.2 算法设计 (5)2.3 实验结果及分析 (5)3 图像的几何变换 (5)3.1 算法原理 (5)3.2 算法设计 (5)3.3 实验结果及分析 (5)4 图像加噪(用输入参数控制不同噪声),然后使用空域和频域进行滤波处理 (5)4.1 算法原理 (5)4.2 算法设计 (6)4.3 实验结果及分析 (6)5 采用robert,prewitt,sobel,拉普拉斯算子对图像进行边缘提取 (6)5.1 算法原理 (6)5.2 算法设计 (6)5.3 实验结果及分析 (6)6 读入两幅图像,一幅为背景图像,一幅为含有目标的图像,应用所学的知识提取出目标 (6)6.1 算法原理 (6)6.2 算法设计 (6)6.3 实验结果及分析 (6)7 小结(感受和体会) (6)1 绘制灰度直方图,实现直方图均衡化1.1 算法原理图像增强是指按特定的需要突出一幅图像中的某些信息,同时,消弱或去除某些不需要的信息的处理方法。
《数字图像处理》期末大作业

《数字图像处理》期末大作业大作业题目及要求:一、题目:本门课程的考核以作品形式进行。
作品必须用Matlab完成。
并提交相关文档。
二、作品要求:1、用Matlab设计实现图形化界面,调用后台函数完成设计,函数可以调用Matlab工具箱中的函数,也可以自己编写函数。
设计完成后,点击GUI 图形界面上的菜单或者按钮,进行必要的交互式操作后,最终能显示运行结果。
2、要求实现以下功能:每个功能的演示窗口标题必须体现完成该功能的小组成员的学号(后三位)。
1)对于打开的图像可以显示其灰度直方图,实现直方图均衡化和直方图匹配(规定化)。
2)实现灰度图像的对比度增强,要求实现线性变换和非线性变换(包括对数变换和指数变换)。
3)实现图像的缩放变换、旋转变换等。
4)图像加噪(用输入参数控制不同噪声),然后使用空域和频域进行滤波处理。
5)采用robert算子,prewitt算子,sobel算子,拉普拉斯算子对图像进行边缘提取。
6)读入两幅图像,一幅为背景图像,一幅为含有目标的图像,应用所学的知识提取出目标。
3、认真完成期末大作业报告的撰写,对各个算法的原理和实验结果务必进行仔细分析讨论。
报告采用A4纸打印并装订成册。
附录:报告模板《数字图像处理》期末大作业班级:小组编号:组长:小组成员:浙江万里学院计算机与信息学院2013年12月目录(自动生成)1 绘制灰度直方图,实现直方图均衡化和直方图匹配(规定化)1.1 算法原理1.2 算法设计1.3 实验结果及对比分析图1 ××××××图2 ××××××分析***********************************************2 灰度图像的对比度增强2.1 算法原理2.2 算法设计2.3 实验结果及分析3 图形的几何变换3.1 算法原理3.2 算法设计3.3 实验结果及分析4 图像加噪(用输入参数控制不同噪声),然后使用空域和频域进行滤波处理4.1 算法原理4.2 算法设计4.3 实验结果及分析5 采用robert,prewitt,sobel,拉普拉斯算子对图像进行边缘提取5.1 算法原理5.2 算法设计5.3 实验结果及分析6 读入两幅图像,一幅为背景图像,一幅为含有目标的图像,应用所学的知识提取出目标6.1 算法原理6.2 算法设计6.3 实验结果及分析7 小结(感受和体会)(英文版)Two regulations promulgated for implementation is in the party in power for a long time and the rule of law conditions, the implementation of comprehensive strictly strategic plan, implementation in accordance with the rules and discipline to manage the party, strengthen inner-party supervision of major initiatives. The two regulations supporting each other, the < code > adhere to a positive advocate, focusing on morality is of Party members and Party leading cadres can see, enough to get a high standard; < rule > around the party discipline, disciplinary ruler requirements, listed as "negative list, focusing on vertical gauge, draw the party organizations and Party members do not touch the" bottom line ". Here, the main from four square face two party rules of interpretation: the first part introduces two party Revised regulations the necessity and the revision process; the second part is the interpretation of the two fundamental principles of the revision of laws and regulations in the party; the third part introduces two party regulations modified the main changes and needs to grasp several key problems; the fourth part on how to grasp the implementation of the two regulations of the party. < code > and < Regulations > revised the necessity and revised history of the CPC Central Committee the amendment to the Chinese Communist Party members and leading cadres honest politics several guidelines > and < Chinese Communist Party discipline and Punishment Regulations > column 1 by 2015 to strengthenparty laws and regulations focus. Two party regulations revision work lasted a Y ears, pooling the wisdom of the whole party, ideological consensus, draw historical experience, respect for the wisdom of our predecessors, which reflects the unity of inheritance and innovation; follow the correct direction, grasp the limited goals, adhere to the party's leadership, to solve the masses of the people reflect a focus on the problem. The new revision of the < code > and < rule >, reflects the party's 18 and the eighth session of the third, the spirit of the fourth plenary session, reflecting the experience of studying and implementing the General Secretary Xi Jinping series of important speech, reflects the party's eighteen years comprehensive strictly practice. (a) revised two regulations of the party need of < the ICAC guidelines > in < in 1997 Leaders as members of the Communist Party of China clean politics certain criteria (Trial) > based on revised, the promulgation and implementation of January 2010, to strengthen the construction of the contingent of leading cadres play an important role. But with the party to manage the party strictly administering the deepening, has not been able to fully meet the actual needs. Content is too complicated, "eight prohibition, 52 are not allowed to" hard to remember, and also difficult to put into practice; the second is concisely positive advocated by the lack of prohibited provisions excessive, no autonomy requirements; the third is banned terms and discipline law, both with the party discipline, disciplinary regulationsrepeat and Criminal law and other laws and regulations repeat; the fourth is to "clean" the theme is not prominent, not for the existing problems, and is narrow, only needle of county-level leading cadres above. < rule > is in 1997 < Chinese Communist Party disciplinary cases (Trial) > based on revision, in December 2003 the promulgation and implementation, to strengthen the construction of the party play very important role. Along with the development of the situation, which many provisions have been unable to fully meet the comprehensive strictly administering the practice needs. One is Ji law, more than half of the provisions and criminal law and other countries laws and regulations Repetition; two is the political discipline regulations is not prominent, not specific, for violation of the party constitution, damage the authority of Party Constitution of misconduct lack necessary and serious responsibility to pursue; third is the main discipline for the leading cadres, does not cover all Party members. Based on the above situation, need to < the criterion of a clean and honest administration > and < rule > the two is likely to be more relevant regulations first amendment. By revising, really put the authority of Party discipline, the seriousness in the party tree and call up the majority of Party members and cadres of the party constitution of party compasses party consciousness. (II) two party regulations revision process the Central Committee of the Communist Party of China attaches great importance to two regulations revision . Xi Jinping, general books recorded in the FifthPlenary Session of the eighth session of the Central Commission for Discipline Inspection, on the revised regulations < > made clear instructions. According to the central deployment, the Central Commission for Discipline Inspection from 2014 under six months begin study two regulations revision. The Standing Committee of the Central Commission for Discipline Inspection 4 review revised. Comrade Wang Qishan 14 times held a special meeting to study two regulations revision, amendment clarifies the direction, major issues of principle, path and target, respectively held a forum will listen to part of the province (area) secretary of the Party committee, Secretary of the Discipline Inspection Commission, part of the central ministries and state organs DepartmentThe first party committee is mainly responsible for people, views of experts and scholars and grassroots party organizations and Party members. Approved by the Central Committee of the Communist Party of China, on 7 September 2015, the general office of the Central Committee of the Party issued a notice to solicit the provinces (autonomous regions, municipalities) Party, the central ministries and commissions, state ministries and commissions of the Party (party), the General Political Department of the military, every 3 people organization of Party of two regulations revision opinion. Central Commission for Discipline Inspection of extensive solicitation of opinions, careful study, attracting, formed a revised sent reviewers. In October 8 and October 12, Central Committee PoliticalBureau Standing Committee and the Political Bureau of the Central Committee After consideration of the two regulations revised draft. On October 18, the Central Committee of the Communist Party of China formally issued two regulations. Can say, two laws amendment concentrated the wisdom of the whole party, embodies the party. Second, < code > and < Regulations > revision of the basic principles of two party regulations revision work and implement the party's eighteen, ten eight plenary, the spirit of the Fourth Plenary Session of the Eleventh Central Committee and General Secretary Xi Jinping important instructions on the revised < low political criterion > and < Regulations >, highlighting the ruling party characteristics, serious discipline, the discipline quite in front of the law, based on the current, a long-term, advance as a whole, with Bu Xiuding independent < rule > and < rule >. Main principle is: first, adhere to the party constitution to follow. The constitution about discipline and self-discipline required specific, awaken the party constitution of party compasses party consciousness, maintaining the authority of the constitution. General Secretary Xi Jinping pointed out that "no rules, no side round. Party constitution is the fundamental law, the party must follow the general rules. In early 2015 held the eighth session of the Central Commission for Discipline Inspection Fifth Plenary Session of the 16th Central Committee, Xi Jinping again pointed out that constitution is the party must follow the general rules, but also the general rules." the revisionof the < code > and < rule > is Method in adhere to the regulations established for the purpose of combining rule of virtue is to adhere to the party constitution as a fundamental to follow, the constitution authority set up, wake up the party constitution and party rules the sense of discipline, the party constitution about discipline and self-discipline specific requirements. 4 second is to adhere to in accordance with the regulations governing the party and the party. The Party of rule of virtue "de", mainly refers to the party's ideals and beliefs, excellent traditional style. The revised the < code > closely linked to the "self-discipline", insisting on the positive initiative, for all members, highlight the "vital few", emphasized self-discipline, focusing on the morality, and the majority of Party members and the ideological and moral standards. The revised < > Ji method separately, Ji, Ji Y an to Method, as a "negative list", emphasizing the heteronomy, focusing on vertical gauge. Is this one high and one low, a positive reaction, the strict party discipline and practice results transformation for the integration of the whole party to observe moral and discipline requirements, for the majority of Party members and cadres provides benchmarking and ruler. Third, insist on to. In view of the problems existing in the party at the present stage, the main problems of Party members and cadres in the aspect of self-discipline and abide by the discipline to make clearly defined, especially the party's eighteen years strict political discipline and political rules, organization and discipline andto implement the central eight provisions of the spirit against the four winds and other requirements into Disciplinary provisions. Not one pace reachs the designated position, focusing on in line with reality, pragmatic and effective. After the revision of major changes, major changes in the < code > and < rule > modified and needs to grasp several key problems (a) < code > < code > adhere to according to regulations governing the party and party with morals in combination, for at the present stage, the leadership of the party members and cadres and Party members in existing main problems of self-discipline, put forward principles, requirements and specifications, showing Communists noble moral pursuit, reflected at all times and in all over the world ethics from high from low 5 common requirements. One is closely linked to the "self-discipline", removal and no direct relation to the provisions of . the second is adhere to a positive advocate, "eight prohibition" 52 are not allowed to "about the content of the" negative list moved into synchronization amendment < cases >. Three is for all the party members, will apply object from the leadership of the party members and cadres to expand to all Party members, fully embodies the comprehensive strictly required. The fourth is prominent key minority, seize the leadership of the party members and cadres is the key, and put forward higher requirements than the ordinary Party members. Five is to simplify, and strive to achieve concise, easy to understand, easy to remember. The revised < code > is the ruling Party since the first insists ona positive advocate forAll Party members and the self-discipline norms, moral declaration issued to all members of the party and the National People's solemn commitment. > < criterion of a clean and honest administration consists of 4 parts, 18, more than 3600 words. After the revision of the < code >, a total of eight, 281 words, including lead, specification and Party member cadre clean fingered self-discipline norms, etc. Part 3 members low-cost clean and self-discipline, the main contents can be summarized as "four must" "eight code". Lead part, reiterated on ideal and faith, fundamental purpose, the fine traditions and work style, noble sentiments, such as "four must" the principle of requirements, strong tone of self-discipline, The higher request for 6 and supervised tenet, the foothold in permanent Bao the party's advanced nature and purity, to reflect the revised standards requirements. Members of self-discipline norms around the party members how to correctly treat and deal with the "public and private", "cheap and rot" thrifty and extravagance "bitter music", put forward the "four norms". Party leader cadre clean fingered self-discipline norms for the leadership of the party members and cadres of the "vital few", around the "clean politics", from civil servant of the color, the exercise of power, moral integrity, a good family tradition and other aspects of the leadership of the party members and cadres of the "four norms" < > < norm norm. "The Party member's self-discipline norms" and "party members and leading cadre clean fingered self-discipline norms," atotal of eight, collectively referred to as the "eight". "Four must" and "eight" of the content from the party constitution and Party's several generation of leaders, especially Xi Jinping, general secretary of the important discussion, refer to the "three discipline and eight points for attention" statements, and reference some embody the Chinese nation excellent traditional culture essence of epigrams. (2) the revised regulations, the main changes in the revised Regulations > to fully adapt to the strictly requirements, reflects the according to the regulations governing the law of recognition of deepening, the realization of the discipline construction and Jin Ju. < rule > is party a ruler, members of the basic line and follow. And the majority of Party members and cadres of Party organizations at all levels should adhere to the bottom line of thinking, fear discipline, hold the bottom line, as a preventive measure, to keep the party's advanced nature and purity. 1, respect for the constitution, refinement and discipline. Revised < rule > from comprehensive comb physical constitution began, the party constitution and other regulations of the Party of Party organizations and Party discipline requirements refinement, clearly defined in violation of the party constitution will be in accordance with regulations to give the corresponding disciplinary action. The original 10 categories of misconduct, integration specification for political discipline, discipline, honesty and discipline masses Ji Law and discipline and discipline and other six categories, the content of < rule >real return to Party discipline, for the majority of Party members and listed a "negative list. 7 2, highlighting the political discipline and political rules. > < Regulations according to the stage of the discipline of outstanding performance, emphasizing political discipline and political rules, organization and discipline, in opposition to the party's leadership and the party's basic theory, basic line, basic program and basic experience, the basic requirement of behavior made prescribed punishment, increase the cliques, against the organization such as violation of the provisions, to ensure that the central government decrees and the Party of centralized and unified. 3, adhere to strict discipline in the law and discipline In front, Ji separated. Revised < Regulations > adhere to the problem oriented, do Ji separated. Any national law existing content, will not repeat the provisions, the total removal of 79 and criminal law, repeat the content of the public security management punishment law, and other laws and regulations. In the general reiterated that party organizations and Party members must conscientiously accept the party's discipline, die van comply with national laws and regulations; at the same time, to investigate violations of Party members and even criminal behavior of Party discipline and responsibility, > < Regulations distinguish five different conditions, with special provisions were made provisions, so as to realize the connection of Party discipline and state law. 4, reflect Wind building and anti-corruption struggle of the latest achievements. < rule > the party's eighteen yearsimplement the spirit of the central provisions of the eight, against the requirements of the "four winds" and transformation for disciplinary provisions, reflecting the style construction is always on the road, not a gust of wind. In the fight against corruption out of new problems, increase the trading rights, the use of authority relatives profit and other disciplinary terms. Prominent discipline of the masses, the new against the interests of the masses and ignore the demands of the masses and other disciplinary terms and make provisions of the disposition and the destruction of the party's close ties with the masses.Discipline to protect the party's purpose. 8 of these regulations, a total of three series, Chapter 15, 178, more than 24000 words, after the revision of the regulations a total of 3 series, Chapter 11, 133, 17000 words, divided into "general" and "special provisions" and "Supplementary Provisions" Part 3. Among them, add, delete, modify the provisions of the proportion of up to nearly 90%. 1, the general general is divided into five chapters. The first chapter to the regulations of the guiding ideology, principles and scope of application of the provisions, highlight the strengthening of the party constitution consciousness, maintenance the authority of Party Constitution, increase the party organizations and Party members must abide by the party constitution, Y an Centralized centralized, would examine at all levels of the amended provisions implementing and maintaining Party discipline, and consciously accept the party discipline,exemplary compliance with national laws and regulations. The second chapter of discipline concept, disciplinary action types and effects of the regulations, will be a serious warning from the original a year for a year and a half; increase the Party Congress representative, by leaving the party above (including leave probation) punishment, the party organization should be terminated its representative qualification provisions. The third chapter of the disciplinary rules of use prescribed in the discipline rectifying process, non convergence, not close hand classified as severely or heavier punishment. "Discipline straighten "At least eighteen years of five years, these five years is to pay close attention to the provisions of the central eight implementation and anti -" four winds ". The fourth chapter on suspicion of illegal party disciplinary distinguish five different conditions, with special provisions were made provisions, to achieve effective convergence of Party and country 9 method. < rule > the provisions of Article 27, Party organizations in the disciplinary review found that party members have committed embezzlement, bribery, dereliction of duty dereliction of duty and other criminal law act is suspected of committing a crime shall give cancel party posts, probation or expelled from the party. The second is < Regulations > Article 28 the provisions of Party organizations in the disciplinary review But found that party members are stipulated in the criminal law, although not involved in a crime shall be investigated for Party discipline and responsibility shouldbe depending on the specific circumstances shall be given a warning until expelled punishment. This situation and a difference is that the former regulation behavior has been suspected of a crime, the feeling is quite strict, and the latter for the behavior not involving crime, only the objective performance of the provisions of the criminal code of behavior, but the plot is a crime to slightly. < Regulations > the 29 provisions, Party organizations in the discipline review found that party members and other illegal behavior, affect the party's image, the damage to the party, the state and the people's interests, we should depend on the situation Seriousness given disciplinary action. The loss of Party members, seriously damaging the party's image of behavior, should be given expelled from the party. At this article is party member is in violation of the criminal law outside the other illegal acts, such as violates the public security administration punishment law, customs law, financial laws and regulations behavior. The fourth is < cases > Article 32 stipulates, minor party members and the circumstances of the crime, the people's Procuratorate shall make a decision not to initiate a prosecution, or the people's court shall make a conviction and exempted from criminal punishment shall be given within the party is removed from his post, probation or expelled from the party. Party members and crime, sheets were fined in accordance with For acts; the principal Ordinance amended the provisions of the preceding paragraph. This is the new content, in order to achieve Ji method effectiveconvergence. Five is < > the thirty third article 10 of the provisions, the Party member due to an intentional crime is sentenced to criminal law (including probation) sheets or additional deprivation of political rights; due to negligence crime and was sentenced to three years or more (excluding three years) a penalty, shall give expelled punishment. Due to negligence crime is convicted and sentenced to three years (including three years) in prison or be sentenced to public surveillance, detention, shall in general be expelled from the party. For the individual may not be expelled from the party, should control Approval. This is followed and retained the original > < Regulations the provisions of punishment party authorization rules and report to a level party organizations. For is "party members with criminal acts, and by the criminal punishment, generally should be expelled from the party". The fifth chapter of probationary Party member of the discipline and discipline after missing members of the treatment and punishment decisions, such as the implementation of the provisions, clear the related party discipline and punishment decision made after, for duties, wages and other relevant alteration formalities for the longest time. 2, sub sub section will the original regulations of10 categories of acts of violation of discipline integration revised into 6 categories, respectively, in violation of the punishments for acts of political discipline "in violation of discipline behavior of punishment" in violation of integrity of disciplinary action points "of violation punishments for actsof mass discipline" "the violation of work discipline, punishment" in violation of discipline of life behavior punishment "6 chapters. 3, annex" Supplementary Provisions "clear authority making supplementary provisions of, cases of interpretative organ, as well as regulations implementation time and retroactivity etc.. 11 (3) learning understanding > < regulations needs to grasp several key problems The first problem -- about the violation of political discipline behavior > < new ordinance chapter 6 the political discipline column for the six disciplines, that is the main opposition to Party leadership and the opposition of the basic theory, basic line, basic program and basic experience, basic requirements of misconduct made provisions of the disposition, especially the eighteen since the CPC Central Committee put forward the Yan Mingzheng treatment of discipline and political rules requirements and practical achievements transformation for Discipline article, increase the false debate central policies, cliques, against the organization review, make no discipline of the principle of harmony terms. These are the party's eighteen years in comprehensive strictly Process combined with the practice of rich content. (1) false debate the central policies and undermine the Party of centralized and unified the problem is made in accordance with the provisions of the party constitution. Constitution in general programme requirements adhere to democratic centralism is one of the requirements of the construction of the party must adhere to the four cardinal. Applicationof this principle is not only the party the basic organization principle and is also the mass line in party life, it requires that we must fully develop inner-party democracy, respect for the dominant position of Party members, safeguarding the Party member democratic rights, give full play to the enthusiasm and creativity of the party organizations at all levels and Party members, at the same time, also must implement the right concentration, ensure the party's mission < the chaos in unity and concerted action to ensure that the party's decision to get quickly and effectively implementing. The Party Central Committee formulated the major principles and policies, through different channels and ways, fully listen to the party organizations and Party members of the opinions and suggestions, but 12 is some people face to face not to say back blather "" will not say, after the meeting said, "" Taiwan does not say, and nonsense ", in fact, not only disrupt the people thought, some causing serious consequences, the damage to the Party of the centralized and unified, hinder the central policy implementation, but also a serious violation of the democratic system of principles. There is no doubt that shall, in accordance with the Regulations > 4 Specified in Article 6 to give the appropriate punishment. For did not cause serious consequences, to give criticism and education or the corresponding tissue processing. (2) about the destruction of the party's unity < New Regulations > the forty eighth to fifty second article, to damage Party's unity unified and violation of political discipline, punishment situationmade explicit provisions. Article 52 of the new "in the party get round group, gangs seek private gain, cliques, cultivate private forces or through the exchange of interests, for their own to create momentum and other activities to gain political capital, given a serious warning or withdraw from their party posts disposition; if the circumstances are serious, to give Leave a party to observation or expelled from the party. (3) on against the organization review of the provisions of the constitution, party loyalty honesty is party members must comply with the obligations. Members must obey the organization decision, shall not violate the organization decided encounters by asking questions to find organization, rely on the organization, shall not deceive the organization, against the organization. For example, after the investigation does not take the initiative to explain the situation, but to engage in offensive and defensive alliance, hiding the stolen money is against survey organization, is a violation of the behavior of political discipline. Article 24 of the original > < Regulations, although the provisions of the interference, hinder group review the behavior of the fabric can be severely or 13 Aggravated punishment, but did not put this kind of behavior alone as a discipline for qualitative amount of discipline. > < new regulations increase the Article 57, "anti organization review, one of the following acts, given a warning or serious warning; if the circumstances are relatively serious, giving removed from or placed on probation within the party post; if the circumstances are serious, give。
matlab图像处理(上)

3. 分别将 DCT 系数矩阵右侧四列置零,左侧四列置零,观察图像变化。 4. 分别对 DCT 系数做转置, 旋转 90 度, 旋转 180 度操作, 逆变换图像有何变化。 两问代码如下(DLR.m): clear all; close all; clc; load hall.mat
row = length(hall_gray(:,1)); col = length(hall_gray(1,:)); row_k = row/8; col_k = col/8; im_left = zeros(row, col); im_right = zeros(row, col); im_zz = zeros(row, col); im_nine = zeros(row, col); im_eight = zeros(row, col); for count_w = 1: row_k for count_n = 1: col_k row_s = (count_w-1)*8+1; row_f = count_w*8; col_s = (count_n-1)*8+1; col_f = count_n*8; temp = hall_gray(row_s: row_f, col_s:col_f); temp = dct2(temp); temp(1, 1) = temp(1, 1)-1024; left = temp; left(:, 1:4)=0; right = temp; right(:, 5:8)=0; zz = temp'; rot_nine = rot90(temp); rot_eight = rot90(rot_nine); im_left(row_s: row_f, col_s: col_f) = idct2(left); im_right(row_s: row_f, col_s: col_f) = idct2(right); im_zz(row_s: row_f, col_s: col_f) = idct2(zz); im_nine(row_s: row_f, col_s: col_f) = idct2(rot_nine); im_eight(row_s: row_f, col_s: col_f) = idct2(rot_eight); end end im_left = uint8(double(im_left)+128*ones(row, col)); im_right = uint8(double(im_right)+128*ones(row, col));
(完整版)数字图像处理MATLAB程序【完整版】

第一部分数字图像处理实验一图像的点运算实验1.1 直方图一.实验目的1.熟悉matlab图像处理工具箱及直方图函数的使用;2.理解和掌握直方图原理和方法;二.实验设备1.PC机一台;2.软件matlab。
三.程序设计在matlab环境中,程序首先读取图像,然后调用直方图函数,设置相关参数,再输出处理后的图像。
I=imread('cameraman.tif');%读取图像subplot(1,2,1),imshow(I) %输出图像title('原始图像') %在原始图像中加标题subplot(1,2,2),imhist(I) %输出原图直方图title('原始图像直方图') %在原图直方图上加标题四.实验步骤1. 启动matlab双击桌面matlab图标启动matlab环境;2. 在matlab命令窗口中输入相应程序。
书写程序时,首先读取图像,一般调用matlab自带的图像,如:cameraman图像;再调用相应的直方图函数,设置参数;最后输出处理后的图像;3.浏览源程序并理解含义;4.运行,观察显示结果;5.结束运行,退出;五.实验结果观察图像matlab环境下的直方图分布。
(a)原始图像 (b)原始图像直方图六.实验报告要求1、给出实验原理过程及实现代码;2、输入一幅灰度图像,给出其灰度直方图结果,并进行灰度直方图分布原理分析。
实验1.2 灰度均衡一.实验目的1.熟悉matlab图像处理工具箱中灰度均衡函数的使用;2.理解和掌握灰度均衡原理和实现方法;二.实验设备1.PC机一台;2.软件matlab;三.程序设计在matlab环境中,程序首先读取图像,然后调用灰度均衡函数,设置相关参数,再输出处理后的图像。
I=imread('cameraman.tif');%读取图像subplot(2,2,1),imshow(I) %输出图像title('原始图像') %在原始图像中加标题subplot(2,2,3),imhist(I) %输出原图直方图title('原始图像直方图') %在原图直方图上加标题a=histeq(I,256); %直方图均衡化,灰度级为256subplot(2,2,2),imshow(a) %输出均衡化后图像title('均衡化后图像') %在均衡化后图像中加标题subplot(2,2,4),imhist(a) %输出均衡化后直方图title('均衡化后图像直方图') %在均衡化后直方图上加标题四.实验步骤1. 启动matlab双击桌面matlab图标启动matlab环境;2. 在matlab命令窗口中输入相应程序。
数字图像处理的matlab作业

分析图像边缘检测原理,给出梯度算子、拉普拉斯算子和canny 算子原理分析过程。
选取两幅图像,编程对其进行边缘检测(要求使用 sobel 算子、laplace 算子和canny 算子),分析结果,比较三种算子的性能。
(一)图像边缘检测原理分析:边缘检测的实质是采用某种算法来提取出图像中对象与背景间的交界线。
我们将边缘定义为图像中灰度发生急剧变化的区域边界。
图像灰度的变化情况可以用图像灰度分布的梯度来反映,因此我们可以用局部图像微分技术来获得边缘检测算子。
经典的边缘检测方法,是对原始图像中像素的某小邻域来构造边缘检测算子。
以下是对几种经典的边缘检测算子进行理论分析,并对各自的性能特点作出了比较和评价不妨记:▽f (x,y)=i x f ∂∂+j yf ∂∂ 为图像的梯度,▽f (x,y)包含灰度变化信息记: e (x,y)=y x f f 22+为▽f (x,y)的梯度,e(x,y)可以用作边缘检测算子。
为了简化计算,也可以将e(x, y)定义为偏导数x f 与y f 的绝对值之和:),(y x e =|),(y x f x |+|),(y x f y |以这些理论为依据,提出了许多算法,常用的边缘检测方法有:Roberts 边缘检测算子、Sobel 边缘检测算子、Prewitt 边缘检测算子、Canny 边缘检测算子、Laplace 边缘检测算子等等。
图像边缘检测的基本步骤:( 1) 滤波。
边缘检测主要基于导数计算, 但受噪声影响。
但滤波器在降低噪声的同时也导致边缘强度的损失。
( 2) 增强。
增强算法将邻域中灰度有显著变化的点突出显示。
一般通过计算梯度幅值完成。
( 3) 检测。
但在有些图像中梯度幅值较大的并不是边缘点。
最简单的边缘检测是梯度幅值阈值判定。
( 4) 定位。
精确确定边缘的位置。
(1)Sobel 边缘检测算子原理分析:对数字图像{f (i,j)}的每个像素,考察它上、下、左、右邻点灰度的加权差,与之接近的邻点的权大。
数字图像处理作业(matlab)

第
2
页 共 13 页
图 3.3.1 原图效果
图 3.3.2 d0=5 时处理的效果
第
3
页 共 13 页
图 3.2.3
d0=15 的处理效果
图 3.2.4 d0=3.6 d0=150 的处理效果
第
4
页 共 13 页
图 2.3.7 d0=230 的处理效果
D(u, v) D0 轨迹为一个圆。
高斯低通滤波器的传递函数为:
H (u, v) e D
2
( u ,v ) / 2 2
第
1
页 共 13 页
其中 为标准偏差,通过令 Do 我们可以得到:
H (u, v) e D
2
( u ,v ) / 2 D02
当 D(u, v) D0 时,滤波器由最大值 1 降为 0.607. 3.2 程序 I1=imread('C:\Users\akhs\Desktop\美丽西电\1.jpeg'); %读取图像 figure; imshow(I1,[ ]); title('原图效果'); I=rgb2gray(I1); % 将图像变为灰度图象 %将灰度图像的二维不连续 Frourier 变换的零频率成分移到频谱的中心 s=fftshift(fft2(I)); [M,N]=size(s); % 分别返回 s 的行数到 M 中,列数到 N 中 n=2; % 对 n 赋初值 %GLPF 滤波,d0=5,15,30 ,80,150,230(程序中以 d0=5 为例) d0=5; % 初始化 d0 n1=floor(M/2); %对 M/2 进行取整 n2=floor(N/2); %对 N/2 进行取整 for i=1:M for j=1:N d=sqrt((i-n1)^2+(j-n2)^2); % 点(i,j)到傅立叶变换中心的距离 h=1*exp(-1/2*(d^2/d0^2)); %GLPF 滤波函数 s(i,j)=h*s(i,j); %GLPF 滤波后的频域表示 end end s=ifftshift(s); % 对 s 进行反 FFT 移动 %对 s 进行二维反离散的 Fourier 变换后,取复数的实部转化为无符号 8 位整数 s=uint8(real(ifft2(s))); figure; % 创建图形图像对象 imshow(s); % 显示 GLPF 滤波处理后的图像 title('GLPF 滤波(d0=5)'); % 为经 GLPF 滤波后的图像添加标题 3.3.运行结果 通过设置 do=5,15,30,80,150,230.针对不同图片可以得到如下效果:
数字图像处理 Matlab版 作业1

%A、B 是作为图片的变量
>> B1=imread('image2-10.jpg'); >> MSE=sum((A(:)-B1(:)).^2)/(M*N) MSE = 31.3642
>> B2=imread('image2-20.jpg'); MSE=sum((A(:)-B2(:)).^2)/(M*N) MSE = 20.3310
K20=imfinfo('image2-20.jpg'); >> image_byte_20=K20.Width*K20.Height*K20.BitDepth/8; >> CMP_bytes=K20.FileSize; >> CMP_R20=image_byte_20/CMP_bytes CMP_R20 = 16.9368
>>y1=[SNR0,SNR10,SNR20,SNR30,SNR40,SNR50]; y2=[MSE0,MSE1,MSE2,MSE3,MSE4,MSE5]; x=[0,10,20,30,40,50]; plot(x,y1,x,y2) >> y1=[SNR0,SNR10,SNR20,SNR30,SNR40,SNR50]; y2=[MSE0,MSE1,MSE2,MSE3,MSE4,MSE5]; x=[0,10,20,30,40,50]; plot(x,y1,x,y2)
>> K50=imfinfo('image2-50.jpg'); image_byte_50=K50.Width*K50.Height*K50.BitDepth/8; CMP_bytes=K50.FileSize; CMP_R50=image_byte_50/CMP_bytes CMP_R50 = 10.6149 %绘图 1
数字图像处理期末大作业

数字图像处理期末大作业一、问题描述实现第十章中采用Hough变换来检测图像中圆的过程。
,通过包括平滑(把细节去除),边缘检测(得到轮廓)以及Hough变换得到的圆,并把结果叠加到原来的灰度图像上。
给出具体的过程,中间结果,最后结果,实现的代码,并写出报告。
二、图片的获取以及预处理针对老师提供的一副硬币图片,要求检测出其中的hough圆,并叠加到原图像上以便增强图像。
在检测hough圆之前,首先要对图像进行平滑处理,进行拉普拉斯变换,然后检测垂直方向,水平方向,+45度和-45度方向的边缘,将四个方向的边缘叠加起来,得到总的边缘,对该图像进行二值化,然后对得到的图像检测其hough圆,得到圆形边缘,将该图像叠加到原图像上,就实现了图像边缘增强的目的。
三、图像处理算法的基本原理以及处理结果本实验流程图如下:1.读取图像图像处理的第一步就是对所采集的图像进行读入,本次实验的输入图像是一幅灰度图像,不需要将图像转换成为灰度图像,直接利用函数imread ()完成。
原图像如下所示:原图像2.图像预处理在图像预处理中,我们完成了两步工作,首先使用方差为1的高斯噪声对图像进行平滑,然后进行拉普拉斯变换,即)],(*)([2y x f r h ∇,222r 2e 21)(σσ-=πr h 为方差为2σ的高斯噪声,本实验中12=σ。
又),(*)]([)],(*)([22y x f r h y x f r h ∇=∇,其中2224222]2[)(σσσr er r h --=∇,将)(2r h ∇和),(y x f 分别进行傅里叶别换,将其逐点相乘,再进行傅里叶反变换,就得到了预处理后的图像。
3.边缘检测对水平,垂直,+45度,-45度方向进行边缘检测,本实验中我们采用了Prewitt 梯度算子,它用于检测水平方向,垂直方向,+45度方向和-45度方向的掩膜分别如下:水平掩膜 垂直掩膜 +45度掩膜 -45度掩膜使用这四个掩膜分别对上一步得到的图像逐点进行处理,就可以得到四个方向的边缘了(本实验中边缘的一个像素都不处理),再将它们加起来,就得到了总的边缘,实验结果如下:水平边缘垂直边缘-45度边缘总的边缘如下图所示:4.二值化对上图得到的图像进行二值化,这里我采用的是循环方式确定图像全局阈值,即首先以图像的平均值作为阈值,将图像分成两部分,分别求两部分的平均值,新的阈值为这两个平均值的均值,重复上述过程,直到两次阈值之差小于特定的值时停止,并以最后一次得到的阈值对图像进行二值化,本实验中我要求两次阈值之差小于0.5时停止,最后得到的全局阈值为 -102.1332,二值化后的图像如下所示:二值化后的图像5.Hough变换检测圆形边界Hough 变换的原理就是利用图像全局特征将边缘像素连接起来组成区域封闭边界,它将图像空间转换到参数空间,在参数空间对点进行描述,达到检测图像边缘的目的。
matlab数字图像处理图像运算+答案

matlab数字图像处理图像运算+答案实验⼆:图像运算⼀、实验⽬的掌握MATLAB语⾔中图像数据的读取、显⽰与保存⽅法;掌握统计图像灰度直⽅图的⽅法理解直⽅图均衡的原理和作⽤,掌握图像直⽅图均衡化的⽅法理解图像点运算、代数运算、⼏何运算的基本定义和常见⽅法进⼀步熟悉了解MATLAB语⾔的应⽤⼆、知识要点1.数据类型及图像类型间的基本转换函数数据类转换:B = data_class_name(A);2.imhist(H);%显⽰a的直⽅图histeq(H); %将图像a进⾏直⽅图均衡化adapthisteq(H); %将图像a进⾏直⽅图均衡化3.图像的点运算点运算是通过对图像中每个像素值进⾏计算,改善图像显⽰效果的操作,也称对⽐度增强或对⽐度拉伸或灰度变换。
可以表⽰为B(x,y)=f(A(x,y)).进⾏逐点运算,输⼊映射为输出,不改变图像像素的空间关系。
Y=aX+b %线性点运算Y=X+aX(max(X)-X) %⾮线性点运算4.代数运算代数运算是指对两幅输⼊图像进⾏点对点的加、减、乘或除运算⽽得到输出图像的运算。
四种图像代数运算的数学表达式如下:C(i,j)=A(i,j)+B(i,j) C=imadd(A,B)C(i,j)=A(i,j)-B(i,j) C=imsubtract(A,B);C(i,j)=A(i,j)*B(i,j) C=immultiply(A,B)C(i,j)=A(i,j)/B(i,j) C=imdivide(A,B)5.图像加噪函数imnoise(参阅matlab help)imnoise的语法格式为J = imnoise(I,type)J = imnoise(I,type,parameters)其中J=imnoise(I,type)返回对原始图像I添加典型噪声的有噪图像J。
参数type 和parameters⽤于确定噪声的类型和相应的参数。
J = imnoise(I,'gaussian',m,v) %加⼊均值m,⽅差为v的⾼斯噪声,m默认值0,v默认值0.01J = imnoise(I,'poisson') %加⼊泊松分布的噪声J = imnoise(I,'salt & pepper',d)%加⼊密度为d的椒盐噪声,d的默认值为0.05 J = imnoise(I,'speckle',v) %加⼊均值0,⽅差为v的乘性噪声三、实验内容1、将给定的Couple.bmp图像⽂件读出并显⽰,显⽰其灰度直⽅图,分别⽤histeq、adapthiateq函数将其直⽅图均衡化,观察均衡后的图像及其直⽅图。
华东政法大学计算机专业数字图像处理matlab作业

IFG=ifft2(G); imshow(IFG,[]); title(‘逆变换图像’); (2)h=imnoise(‘motion’,10,10); M=imfilter(f,h); M1=fft2(double(M))… 4、任意选择一幅图像,绘制图像的直方图。可以直接通过使用 imhist(I)来显示图像的直方图 I=imread(‘cameraman.tif’); imshow(I);title('原始图像'); b=size(I); %测量图像尺寸参数 a=zeros(1,256); %创建存放灰度出现概率的向量 for m=1:b(1) for n=1:b(2) a(I(m,n)+1)=a(I(m,n)+1)+1; %将灰度为 I(m,n) 的像素存储在 a (I(m,n)+1) 中, 因为 MATLAB 里没有 a(0); end end n=0:255; figure,bar(n,a); %绘制原始图像的直方图 title('原图像直方图');xlabel('灰度值');ylabel('出现概率 '); 6、读入图像将图像转化成二值图像。在一张图表上,显示原始图像、灰度图像,二值图像; [imm,map]=imread('trees.tif'); % imm 为 2 维矩阵、map 为 256*3 矩阵 figure, imshow(imm,map); % 显示原始图像(彩色) gmap = rgb2gray(map); figure, subplot(1,2,1),imshow(imm,gmap); % 显示灰度图像 subplot(1,2,2),imshow(im2bw(imm,map,0.4),[]); % 显示二值图像 注意:若输入图像是 3 维矩阵,则转化为灰度图像时为 gimm = rgb2gray(imm); 7、读入一幅图像(cameraman.tif) ,完成如下操作,并存储变换后的图像 (1)把图像翻转 90 及 180 度,并显示; (参考 imrotate 函数) (2)缩小图像 (3)切割图像(参考 incrop 函数) (4)镜像图像(如样图所示镜像效果) I=imread(‘cameraman.tif’); H=size(I); I2(1:H(1),1:H(2))=I(H(1):-1:1,1:H(2)); % 垂直翻转(垂直镜像) figure, imshow(I2); I3(1:H(1),1:H(2))=I(1:H(1),H(2):-1:1); % 水平翻转(水平镜像) figure,imshow(I3); I4(1:H(1),1:H(2))=I(H(1):-1:1,H(2):-1:1); % 对角镜像 figure,imshow(I4); 5、对同一场景但模糊程度不一样的三张数字图像绘制出其直方图,计算每一幅图像所有像素灰度的方差。 使用 imhist 求其直方图。计算像素灰度的方差: I=imread(); IG=rgb2gray(I); k=size(IG);
数字图像处理大作业

数字图像处理大作业学号:姓名:班级:数字图像处理作业用自己拍摄的图像,完成以下作业:1,用Matlab语言完成如下实验:1)打开一个BMP文件2)将其局部区域的灰度值进行改变3)另存为一个新的BMP文件2,Matlab编程实现图像傅立叶高通、低通滤波,给出算法原理及实验结果。
3,找一幅曝光不足的灰度(或彩色)图像,用Matlab按照直方图均衡化的方法进行处理。
4,用Matlab打开一幅图像,添加椒盐、高斯噪声,然后使用邻域平均法、中值滤波法进行平滑。
5,用Matlab打开一幅图像,利用Roberts梯度法、Sobel算子和拉普拉斯算子进行锐化,并比较结果。
以上作业,严禁抄袭。
作业请注明学号,姓名,班级,电话号码。
将纸质版于2012-06-06晚7:00交至B529房间。
1,用Matlab语言完成如下实验:1)打开一个BMP文件2)将其局部区域的灰度值进行改变3)另存为一个新的BMP文件%文件名为way01.bmp 源程序如下:clear all;f=imread('way.bmp');f1=rgb2gray(f); %ת»»Îª»Ò¶Èͼfigure(1);imshow(f1);imwrite(f1,'way01.bmp');f1(100:150,100:120)=256; %¾Ö²¿¸Ä±ä»Ò¶ÈÖµfigure(2);imshow(f1);运行结果为:注:源文件名为way.jpg2,Matlab编程实现图像傅立叶高通、低通滤波,给出算法原理及实验结果。
1)傅里叶高通滤波:源程序为:clear all;I=imread('way01.bmp');figure(1);imshow(I);I=double(I);f=fft2(I);g=fftshift(f);[M,N]=size(g);n1=floor(M/2);n2=floor(N/2);d0=5;for i=1:Mfor j=1:Nd=sqrt((i-n1)^2+(j-n2)^2);if d>=d0h1=1;elseh1=0;endg1(i,j)=(h1+0.5)*g(i,j);endendg2=ifftshift(g1);g3=uint8(real(ifft2(g2))); figure(2);imshow(g3);title('¸ßͨÂ˲¨½á运行结果为:2)傅里叶低通滤波:源程序为:clear all;I=imread('way01.bmp');figure(1);imshow(I);I=double(I);f=fft2(I); g=fftshift(f); [M,N]=size(g);n1=floor(M/2);n2=floor(N/2);d0=30;for i=1:Mfor j=1:Nd=sqrt((i-n1)^2+(j-n2)^2);if d<=d0h1=1;elseh1=0;endg1(i,j)=(h1+0)*g(i,j);endendg2=ifftshift(g1);g3=uint8(real(ifft2(g2))); figure(2);imshow(g3);title('µÍͨÂ˲¨½á¹û')运行结果为:3,找一幅曝光不足的灰度(或彩色)图像,用Matlab按照直方图均衡化的方法进行处理。
matlab大作业Matlab在数字信号处理及图像处理中的应用

<<Matlab在数字信号处理及图像处理中的应用>>(1)产生简单信号程序如下:close allclear allt1=-5:0.01:5;%定义t的取值范围y1=sinc(t1);%调用sinc函数subplot(221);plot(t1,y1);grid;title('sinc函数');y2=rectpuls(t1,2);%调用门函数subplot(222);plot(t1,y2);grid;title('门函数');axis([-5,5,-0.5,1.5]);%定义坐标轴的范围y3=tripuls(t1,3);%调用三角脉冲函数subplot(223);plot(t1,y3);grid;title('三角脉形冲');axis([-5,5,-0.5,1.5]);(2)求模型的零输入响应⎥⎥⎦⎤⎢⎢⎣⎡∙∙21x x =⎥⎦⎤⎢⎣⎡--7814.005572.07814.0⎦⎤⎢⎣⎡12x x +⎥⎦⎤⎢⎣⎡-0210⎥⎦⎤⎢⎣⎡12u u Y=[1.9691 6.4493]⎥⎦⎤⎢⎣⎡12x x ,初始条件为x(0)=⎥⎦⎤⎢⎣⎡01程序如下a=[-0.5572 -0.7814;0.7814 0];c=[1.969 6.4493];x0=[1 ; 0]%初始状态x0 =1sys=ss(a,[],c,[]);%状态方程initial(sys,x0)(3)滤波器设计1.设计一个butterworth 数字低通滤波器,抽样频率为1000HZ ,滤波器的3db 截至频率为40HZ ,阻带截止频率为150HZ ,阻带最小衰减为60db.绘制该滤波器的频率响应曲线。
程序如下:Wp=40/500;%通带截止频率Ws=150/500;%阻带截止频率[n,Wn]=buttord(Wp,Ws,3,60)%求butterworth滤波器的阶数和3db带宽的截止频率[b,a]=butter(n,Wn);%调用butter函数设计模拟滤波器freqz(b,a,512,1000);%画频率响应图title('巴特沃斯滤波器')2.设计一个chebysheI数字低通滤波器,抽样频率为1000HZ,滤波器的3db截至频率为40HZ,阻带截止频率为150HZ,阻带最小衰减为60db.绘制该滤波器的频率响应曲线。
matlab数字图像处理 课程设计论文 期中大作业

《数字图像处理》期中大作业姓名:钟涛学号:24102200147序号:23南湖学院机电系2013年4月第一部分:IPT函数的应用1、读取并显示一张彩色图像,然后将其灰度化,并将灰度化后的结果存入计算机中,最后再将其二值化;2、解答:(1)程序f=imread('pic.jpg') %读入图像meimshow(f) %显示图像mea=rgb2gray(f) %调用灰度处理函数对头像进行灰度处理figure,imshow(a) %显示灰度处理后的图像b=im2bw(a) %调用二值转换函数将图像转换成二值图像figure,imshow(b) %显示灰度处理后的二值图像imwrite(a,'pic-gai.jpg') %将灰度图像写入计算机imwrite(b,'pic-gai.jpg') %将二值图像写入计算(2)运行结果图1:原图pic.jpg 图2:灰度处理后的pic.jpg图3:灰度处理加二值处理后的pic-gai.jpg(3)结果分析调用灰度系统函数对图像进行灰度化,然后进行二值处理。
灰度处理后去掉了彩色,二值处理让深灰色变成黑色浅灰色变成了白色。
2、使用亮度变换函数完成一张灰度图片的亮度调整:解答:(1)程序:f2=rgb2gray(imread('pic.jpg')) %读入图像并进行灰度处理imshow(f2) %显示灰度处理后的图像F=fft2(f2) %对图像进行DFT计算S=abs(F) %得到频谱图figure,imshow(S,[]) %显示频谱图Fc=fftshift(F) %进行图像的平移figure,imshow(abs(Fc),[]) %显示平移后图像S2=log(1+abs(Fc)) %进行对数变换figure,imshow(S2,[]) %显示对数变换后的图像(3)运行结果图1 灰度图像图2 f4直方图图3 进行规定化之后的效果g4 图4 g4直方图(3)结果分析通过调用函数fft2进行DFT计算,然后利用fftshift将变换的原点平移到频率矩阵中心,可以明显看到图像中心点的变化(图3),然后利用对数变化增强视觉效果(图4),结果变化明显,一目了然。
数字图像处理MATLAB上机作业

数字图像处理实验报告指导老师:学号姓名班级1.产生右图所示图像f1(),其中图像大小为256×256,中间亮条为128×32,暗处=0,亮处=100。
对其进行:①同屏显示原图f1()和(f1)的幅度谱图;②若令f2()=(-1)()f1(),重复以上过程,比较二者幅度谱的异同,简述理由;③若将f2()顺时针旋转90度得到f3(),试显示(f3)的幅度谱,并与(f2)的幅度谱进行比较;④若将f1()顺时针旋转90度得到f4(),令f5()1()4(),试显示(f5)的幅度谱,并指出其与(f1)和(f4)的关系;⑤若令f6()2()3(),试显示(f6)的幅度谱,并指出其与(f2)和(f3)的关系,比较(f6)和(f5)的幅度谱。
f1(256,256);64:1:192122:1:144f1()=100;12(f1);1(1);1(1,1);1(1,1);1:2561:256<1()1();>1()1();;1:2561:2561()=255*(1());(1,2,1);(f1);('原图');(1,2,2);(1);('原图的幅度谱');1:2561:256f2()=(-1)^()*f1();22(f2);2(2);2(1,1);2(1,1);1:2561:256<2()2();>2()2();;1:2561:2562()=255*(2());(2,2,1);(f1);('原图');(2,2,2);(1);('原图的幅度谱');(2,2,3);(f2);('原图中心化');(2,2,4);(2);('原图中心化的幅度谱');f3(f290,'');32(f3);3(3);3(1,1);3(1,1);1:2561:256<3()3();>3()3();;1:2561:2563()=255*(3());(2,2,1);(f2);('原图中心化');(2,2,2);(2);('原图中心化的幅度谱');(2,2,3);(f3);('旋转后的图像');(2,2,4);(3);('旋转后的幅度谱');图像旋转90度后,幅度谱也旋转了90度。
数字图像处理处理大作业实验报告

数字图像处理处理大作业实验报告数字图像处理处理大作业实验报告PB11210***上上签MyZenith.N_3104_EVER实验一题目:线性插值改变图像大小实验目的:1、使用MATLAB编程实现对图片大小的改变操作,使所给图片达到所要求的效果。
2、通过对MATLAB的编程加强对图像处理的认识,初步学习MATLAB在图像处理中的基本应用实验内容:在这一项目中,同学们需要实现基于双线性插值的图像缩放算法。
作业中需实现如下功能:(a) 能够利用鼠标从实验图像中任意选取测试区域,并单独显示。
(b) 使用双线性插值算法对测试区域进行缩放处理,输出如下结果,放大到原始分辨率的2倍,放大到原始分辨率的4倍,缩小到原始分辨率的1/2倍。
实验原理:图像某点的值由最邻近的四个点联立方程决定。
实验代码:1、在主函数中,使用switch函数分别调用子函数,并且之前选择需要放大或者缩小的倍数。
代码如下:2、 choice=('Yes');3、4、5、6、7、8、while (minus(choice,('Yes'))==0) clear;close;F=imread('monarch.bmp'); I=imcrop(F); BR=I(:,:,1); BG=I(:,:,2); BB=I(:,:,3); [rows,cols]=size(BR);K = sqrt(str2double(inputdlg('·?±???', 'INPUT scalefactor', 1, {'2'})));9、 width = K * rows;10、 height = K * cols;11、12、13、14、 widthScale = rows/width;15、 heightScale = cols/height;16、17、 for x = 1:width-2for y = 1:height-218、 X = x * widthScale;Y = y * heightScale;19、20、 if (X/double(uint16(X)) == 1.0) && (Y/double(uint16(Y)) == 1.0) 21、 dstBR(x,y) = BR(int16(X),int16(Y));dstBG(x,y) = BG(int16(X),int16(Y));22、 dstBB(x,y) = BB(int16(X),int16(Y)); 23、 else24、 a = double(uint16(X));25、 b = double(uint16(Y));26、27、28、29、30、BRx11 = double(BR(a,b)); BRx12 = double(BR(a,b+1)); BRx21 = double(BR(a+1,b)); BRx22 = double(BR(a+1,b+1));31、32、 BGx11 = double(BG(a,b));33、 BGx12 = double(BG(a,b+1));34、 BGx21 = double(BG(a+1,b));35、 BGx22 = double(BG(a+1,b+1));36、37、38、39、40、BBx11 = double(BB(a,b)); BBx12 = double(BB(a,b+1)); BBx21 = double(BB(a+1,b)); BBx22 = double(BB(a+1,b+1));41、42、 w1 = (b+1-Y) * (a+1-X); 43、 w2 = (Y-b) * (a+1-X);w3 = (b+1-Y) * (X-a);44、 w4 = (Y-b) * (X-a); 45、 dstBR(x,y) = uint8( BRx11 * w1 + BRx12 * w2 + BRx21* w3 + BRx22 * w4 );46、 dstBG(x,y) = uint8( BGx11 * w1 + BGx12 * w2 + BGx21* w3 + BGx22 * w4 );47、 dstBB(x,y) = uint8( BBx11 * w1 + BBx12 * w2 + BBx21* w3 + BBx22 * w4 );48、 end49、 end50、 end51、52、53、54、55、56、57、OUT(:,:,1)=dstBR; OUT(:,:,2)=dstBG; OUT(:,:,3)=dstBB;imshow(I); figure; imshow(OUT);58、59、60、61、62、options.Interpreter = 'tex'; options.Default = 'Cancel'; choice = questdlg('??·','????','Yes','No',options); end实验结果:1、选择缩放倍数:2、所选择的图像源文件如下:3、用鼠标标定所需要进行缩放的区域:4、程序正常运行后缩放效果:4倍放大5、程序正常运行后缩放效果:2倍放大6、程序正常运行后的缩放效果:缩小一倍实验二题目:高斯滤波及中值滤波处理人为添加的椒盐噪声和高斯噪声实验目的:1、对所给定的图像使用MATLAB添加高斯噪声和椒盐噪声;2、再用MATLAB程序实现中值滤波和高斯滤波;3、计算所得到结果图像的PSNR,对它们进行分析与比较,从而理解各种滤波方法的优点与特性。
matlab数字图像处理 课程设计论文 期中大作业要点

《数字图像处理》期中大作业姓名:**学号:***********序号:23南湖学院机电系2013年4月第一部分:IPT函数的应用1、读取并显示一张彩色图像,然后将其灰度化,并将灰度化后的结果存入计算机中,最后再将其二值化;2、解答:(1)程序f=imread('pic.jpg') %读入图像meimshow(f) %显示图像mea=rgb2gray(f) %调用灰度处理函数对头像进行灰度处理figure,imshow(a) %显示灰度处理后的图像b=im2bw(a) %调用二值转换函数将图像转换成二值图像figure,imshow(b) %显示灰度处理后的二值图像imwrite(a,'pic-gai.jpg') %将灰度图像写入计算机imwrite(b,'pic-gai.jpg') %将二值图像写入计算(2)运行结果图1:原图pic.jpg 图2:灰度处理后的pic.jpg图3:灰度处理加二值处理后的pic-gai.jpg(3)结果分析调用灰度系统函数对图像进行灰度化,然后进行二值处理。
灰度处理后去掉了彩色,二值处理让深灰色变成黑色浅灰色变成了白色。
2、使用亮度变换函数完成一张灰度图片的亮度调整:解答:(1)程序:f2=rgb2gray(imread('pic.jpg')) %读入图像并进行灰度处理imshow(f2) %显示灰度处理后的图像F=fft2(f2) %对图像进行DFT计算S=abs(F) %得到频谱图figure,imshow(S,[]) %显示频谱图Fc=fftshift(F) %进行图像的平移figure,imshow(abs(Fc),[]) %显示平移后图像S2=log(1+abs(Fc)) %进行对数变换figure,imshow(S2,[]) %显示对数变换后的图像(3)运行结果图1 灰度图像图2 f4直方图图3 进行规定化之后的效果g4 图4 g4直方图(3)结果分析通过调用函数fft2进行DFT计算,然后利用fftshift将变换的原点平移到频率矩阵中心,可以明显看到图像中心点的变化(图3),然后利用对数变化增强视觉效果(图4),结果变化明显,一目了然。
MATALB图像数字处理大作业ppt文本

数字信号与图像处理姓名学号年级专业学院指导教师Matlab实现数值图像处理[摘要]图像增强是数字图像的预处理,对图像整体或局部特征能有效地改善。
我们讨论了基于直方图的均衡化和规定化处理的图像增强技术基本原理,给出了相关推导公式和算法;同时,以一个灰度图像为例,用 MATLAB语言实现了直方图均衡化和规定化增强处理,并给出了具体程序、实验结果图像及直方图。
结果表明,直方图均衡化和规定化处理能有效改善灰度图像的时比度差和灰度动态范围。
[关键词] 图像增强;直方图;均衡化;邻域滤波; 图像的锐化;MATLAB; MATLB语言被称为是一种“演草纸式的科学计算语言”,它在数值计算、数据处理、自动控制、信号处理、神经网络、优化计算、模糊逻辑、小波分析、图像处理、统计分析、金融分析等众多的领域有着广泛的用途。
特别是它所提供的各种工具箱,使得我们在科学计算、工程设计、数值分析、图像处理等领域的各种计算、演算、模拟等工作变得相当简单。
MATI AB不仅具有面向对象的计算机语言特征,也初具面向任务的计算机语言的思想。
我从应用所学的MATLAB的语言知识与正在学习的数像处理技术角度利用MATLAB课本中图像增强部分理论进行了验证。
一、 MATLAB语言的特点由于MATLAB是用c语言编写的,MATLAB提供了和c语言几乎一样多的运算符,灵活使用MATLAB的运算符将使程序变得极为简短。
MATI AB既具有结构化的控制语句,如for循环、while循环、break语句和if语句,又有面向对象编程的特性。
在MATLAB里,语法限制不严格,程序设计自由度大,程序的可移植性很好,基本上不做修改就可以在各种型号的计算机和操作系统上运行。
MATLAB的图形功能强大。
在FORTRAN和C语言里,绘图都程不容易,但在MATILAB里,数据的可视化非常简单。
MATLAB还有较强的编辑图形界面的能力。
MATLAB的缺点是,它与其它高级程序相比,程序的执行速度较慢。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
谢 谢!
几个图像处理实例
—— matlab & photoshop
姓名: 学号:
matlab & photoshop
Matlab: lab、 科学研究、 编程处理
Photoshop: shop、 艺术创作、 无须写代码
处理实例
1.羽化 2.均衡化 3.大家一起 Nhomakorabea找茬 4.背景图片制作过程
1.羽化
程序
1.羽化
程序
Matlab 处理效果
1.羽化
1.羽化
Photoshop 处理效果
2.均衡化
• 定义: 通过图像灰度直方图均衡化处理,使得图
像的灰度分布趋向均匀,图像所占有的像素 灰度间距拉开,加大了图像反差,改善视觉 效果,达到增强目的。
2.均衡化
程序
2.均衡化
程序
2.均衡化
程序
2.均衡化
程序
2.均衡化
程序
2.均衡化
Matlab 处理过程
2.均衡化
Matlab 处理效果
2.均衡化
Photoshop 处理效果
通过自定义滤镜处理
3.大家一起来找茬
程序
3.大家一起来找茬
Matlab 处理效果
3.大家一起来找茬
Matlab 处理效果
4.背景图片制作过程
程序
4.背景图片制作过程
程序
4.背景图片制作过程