图像处理与分析作业汇总

合集下载

《数字图像处理》期末大作业

《数字图像处理》期末大作业

《数字图像处理》期末大作业大作业题目及要求:一、题目:本门课程的考核以作品形式进行。

作品必须用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。

图像处理作业

图像处理作业

《机器视觉与图像分析》考查题(2010 年秋工程学院相关专业硕士生)学历硕士学号 2010265001 姓名陈汉鸣成绩----------------------------------------------------------------------------------------------------------------------一、简答题(每小题5 分,共20 分)1. 试分析说明图像形态学运算中开运算和闭运算分别在图像处理中的作用。

答:先腐蚀再膨胀简称开运算,在图像中的作用是消除一些孤立点。

先膨胀再腐蚀简称闭运算,在图像中的作用是填充小块,平滑区域的作用。

两者经常结合起来一起使用,在去噪,特征提取方面还是应用得比较广。

开运算常用于去除较小的亮点(相对结构元素而言),同时保留所有的灰度和较大的亮区特征不变,即能够有效地消除细小物体、毛刺,能在纤细连接点处分离物体,能平滑较大物体的边界但不明显改变物体的形状、面积和位置。

闭运算常用于去除图像中较小的暗点(较结构元素而言),同时保留原来较大的亮度特征,即能够有效地填充物体内部细小的空洞,连接临近物体,能在不明显改变物体面积的情况下平滑物体的边界。

2. 简述区域生长算法的一般步骤。

答:区域生长法又叫区域扩张法:把图像分割成特征相似的若干小区域,比较相邻小区域的特征,若相似则合并为同一区域,如此进行到不能合并为止,最后生成特征不同的各区域。

根据所用邻域方式和相似性准则的不同,该法可分为简单生长(像素+像素),质心生长(区域+像素),混合生长(区域+区域)。

其步骤是:a.首先需要选定一些代表不同区域的起始像素,即生长点。

b.然后从这些生长点出发,按照一定的规则,一般是检查它与周围像素(或区域)的一致性(可以使灰度级、彩色、组织、梯度或其他特性),把那些通过一致性测试的像素(或区域)合并进来,形成新的“生长点”,反复操作,直到当前区域不能再合并为止。

数字图像处理大作业

数字图像处理大作业

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'算子对图像进行边缘检测的不同效果。

数字图像处理-作业汇总

数字图像处理-作业汇总

1. 一幅8灰度级图像具有如下所示的直方图,求直方图均衡后的灰度级和对应概率,并画出均衡后的直方图的示意图。

(图中的8个不同灰度级对应的归一化直方图为[0.17 0.25 0.21 0.16 0.07 0.08 0.04 0.02])解:由s k =∑Pr (r i )k i=0,可以求得原图像直方图的累进概率为: *s +=*0.17,0.42,0.63,0.79,0.86,0.94,0.98,1+其量化结果即:*s q +={17,37,47,67,67,1,1,1}对相应的原灰度级进行映射,即*k ′+=*1,3,4,6,7+相应地有:*s k ′+=*0.17,0.25,0.21,0.23,0.14+因而均衡后的直方图为:2.由题,p r (r )=−2r +2 p z (z )=2z由PDF 灰度变换的关系T (r )=∫p r (w )dw r=s =∫p z (t )dt z=G (z )可得{T (r )=−r 2+2r G (z )=z2⟹z =±√−r 2+2r 要求z 应当是非负的,因而z =√−r 2+2r3. 请计算如下两个向量与矩阵的卷积计算结果。

1) [ 1 2 3 4 5 4 3 2 1] *[ 2 0 -2]=[2,4,4,4,4,0,-4,-4,-4,-4,-2]2) [−101−202−101]∗[1320410323041052321431042]=[−1−3−13−204−3−6−44−4211−3−7−63−6415−3−11−48−10317−7−1125−10615−8−56−4−698−3−13−3−242]4. 高斯型低通滤波器在频域中的传递函数是H (u,v )=Ae −(u2+v 2)2σ2⁄ 根据二维傅里叶性质,证明空间域的相应滤波器形式为h (x,y )=A2πσ2e −2π2σ2(x 2+y 2)(这些闭合形式只适用于连续变量情况。

中国科学院大学图像处理与分析作业题及答案汇总

中国科学院大学图像处理与分析作业题及答案汇总

【作业1】2、一幅8灰度级图像具有如下所示的直方图,求直方图均衡后的灰度级和对应概率,并画出均衡后的直方图的示意图。

(计算中采用向上取整方法,图中的8个不同灰度级对应的归一化直方图为[0.17 0.25 0.21 0.16 0.07 0.08 0.04 0.02])【解答】直方图均衡采用公式rS r=⌈G∑P r(w)−1⌉w=0式中,G为灰度级数,取8,p r(w)为灰度级w的概率,S r为变换后的灰度,计算过程如下表所示:则新灰度级的概率分别是:P s(0) = 0P s(1) = P r(0) = 0.17P s(2) = 0P s(3) = P r(1) = 0.25P s(4) = 0P s(5) = P r(2) = 0.21P s(6) = P r(3) + P r(4) = 0.23P s(7) = P r(5) = P r(6) = P r(7) = 0.14编写matlab程序并绘制直方图:s=0:1:7;p=[0 0.17 0 0.25 0 0.21 0.23 0.14];bar(s,p);axis([-1 8 0 0.3]);可以看出,此图较题目原图更加“均匀”。

【作业2】1、完成课本数字图像处理第二版114页,习题3.10。

【解答】由图可知p r(r)=−2r+2,(0≤r≤1)p z(z)=2z,(0≤z≤1)将两图做直方图均衡变换s1=T1(r)=∫p r(w)dwr0=∫(−2w+2)dwr=−r2+2rs2=T2(z)=∫p z(w)dwz0=∫(2w)dwz=z2令上面两式相等,则z2=−r2+2r 因为灰度级非负,所以z=√−r2+2r2、请计算如下两个向量与矩阵的卷积计算结果。

(1)[ 1 2 3 4 5 4 3 2 1 ] * [ 2 0 -2 ](2) [−101−202−101]∗[1320410323041052321431042]【解答】(1)设向量a=[ 1 2 3 4 5 4 3 2 1 ],下标从-4到4,即a(-4)=1,a(-3)=2……a(4)=1;设向量b=[ 2 0 -2 ],下标从-1到1,即b(-1)=2,b(0)=0,b(1)=-2;设向量c=a*b,下标从-5到5。

图像处理第一次作业

图像处理第一次作业

图像处理第一次作业图像处理第一次作业一、什么是一幅图像?一幅模拟彩色图像经平板扫描仪扫描后获得一幅彩色数字图像,其分辨率为1024*768像素。

若采用RGB彩色空间,红、绿、蓝三基色的灰度等级为8bit,在无压缩的情况下,在计算机中存储该图像数据将占用多少bit的存储空间?当去掉图像的彩色信息,只留下灰度信息,灰度等级为4bit,在无压缩的情况下,存储该图像数据将占用多少bit的存储空间?(10分)答:图像是由扫描仪、摄像机等输入设备捕捉实际的画面产生的数字图像。

图像用数字任意描述像素点、强度和颜色。

描述信息文件存储量较大,所描述对象在缩放过程中会损失细节或产生锯齿。

在显示方面它是将对象以一定的分辨率分辨以后将每个点的色彩信息以数字化方式呈现,可直接快速在屏幕上显示。

分辨率和灰度是影响显示的主要参数。

图像适用于表现含有大量细节(如明暗变化、场景复杂、轮廓色彩丰富)的对象,如:照片、绘图等,通过图像软件可进行复杂图像的处理以得到更清晰的图像或产生特殊效果。

计算机中的图像从处理方式上可以分为位图和矢量图。

1)采用RGB猜测空间,灰度等级为8bit,无压缩时占存储空间大小为:1024=⨯⨯768⨯818874368bit32)去掉彩色信息,灰度等级为4bit,无压缩时占存储空间大小为:⨯⨯1024=3145728768bit4二、什么是图像增强?什么是图像复原?它们之间的区别是什么?(10分)答:图像增强是指按特定的需要突出一幅图像中的某些信息,同时,削弱或去除某些不需要的信息的处理方法。

其主要目的是处理后的图像对某些特定的应用比原来的图像更加有效。

图像增强技术主要包含直方图修改处理、图像平滑化处理、图像尖锐化处理和彩色处理技术等。

图像复原试图利用退化现象的某种先验知识来重建或复原被退化的图像。

其中维纳滤波是一种常见的图像复原的方法,该方法的思想是使复原的图像与原图像的均方误差最小原则来复原图像,但是该法具有一定的限制性,且在复原过程中易产生振铃效应。

《数字图像处理》复习大作业及答案

《数字图像处理》复习大作业及答案

《数字图像处理》复习⼤作业及答案2014年上学期《数字图像处理》复习⼤作业及参考答案=====================================================⼀、选择题(共20题)1、采⽤幂次变换进⾏灰度变换时,当幂次取⼤于1时,该变换是针对如下哪⼀类图像进⾏增强。

(B)A 图像整体偏暗B 图像整体偏亮C图像细节淹没在暗背景中D图像同时存在过亮和过暗背景2、图像灰度⽅差说明了图像哪⼀个属性。

(B )A 平均灰度B 图像对⽐度C 图像整体亮度D图像细节3、计算机显⽰器主要采⽤哪⼀种彩⾊模型( A )A、RGBB、CMY或CMYKC、HSID、HSV4、采⽤模板[-1 1]T主要检测( A )⽅向的边缘。

A.⽔平B.45?C.垂直D.135?5、下列算法中属于图象锐化处理的是:( C )A.低通滤波B.加权平均法C.⾼通滤波D. 中值滤波6、维纳滤波器通常⽤于( C )A、去噪B、减⼩图像动态范围C、复原图像D、平滑图像7、彩⾊图像增强时, C 处理可以采⽤RGB彩⾊模型。

A. 直⽅图均衡化B. 同态滤波C. 加权均值滤波D. 中值滤波8、__B__滤波器在对图像复原过程中需要计算噪声功率谱和图像功率谱。

A. 逆滤波B. 维纳滤波C. 约束最⼩⼆乘滤波D. 同态滤波9、⾼通滤波后的图像通常较暗,为改善这种情况,将⾼通滤波器的转移函数加上⼀常数量以便引⼊⼀些低频分量。

这样的滤波器叫B。

A. 巴特沃斯⾼通滤波器B. ⾼频提升滤波器C. ⾼频加强滤波器D. 理想⾼通滤波器10、图象与灰度直⽅图间的对应关系是 B __A.⼀⼀对应B.多对⼀C.⼀对多D.都不11、下列算法中属于图象锐化处理的是:CA.低通滤波B.加权平均法C.⾼通滤D. 中值滤波12、⼀幅256*256的图像,若灰度级数为16,则存储它所需的⽐特数是:( A )A、256KB、512KC、1M C、2M13、噪声有以下某⼀种特性( D )A、只含有⾼频分量B、其频率总覆盖整个频谱C、等宽的频率间隔内有相同的能量D、总有⼀定的随机性14. 利⽤直⽅图取单阈值⽅法进⾏图像分割时:(B)a.图像中应仅有⼀个⽬标b.图像直⽅图应有两个峰c.图像中⽬标和背景应⼀样⼤d. 图像中⽬标灰度应⽐背景⼤15. 在单变量变换增强中,最容易让⼈感到图像内容发⽣变化的是( C )A亮度增强觉B饱和度增强C⾊调增强D不⼀定哪种增强16、利⽤平滑滤波器可对图像进⾏低通滤波,消除噪声,但同时模糊了细节。

图像处理作业答案

图像处理作业答案

1. 写出至少3种图像平滑算法,说明每种方法的优、缺点和适用的情况。

1)均值滤波法:均值滤波是典型的线性滤波算法,它是指在图像上对目标像素给一个模板,该模板包括了其周围的临近像素(以目标象素为中心的周围8个像素,构成一个滤波模板,即去掉目标像素本身),再用模板中的全体像素的平均值来代替原来像素值。

优点:简单,易于操作。

缺点:它不能很好地保护图像细节,在图像去噪的同时也破坏了图像的细节部分,从而使图像变得模糊,不能很好地去除噪声点。

使用情况:适用于去除通过扫描得到的图像中的颗粒噪声。

2)中值滤波法:中值滤波法是一种非线性平滑技术,它将每一象素点的灰度值设置为该点某邻域窗口内的所有象素点灰度值的中值。

优点:可以清除孤立的噪声点,既能去除噪声,又能很好的保护边缘图像,得到比较满意的复原效果。

缺点:不适合处理细节多的图像。

使用情况:滤除图像的椒盐噪声。

3)加权平均滤波法::加权平均滤波是对移动平均滤波的改进,不同时刻采样的数据乘以不同的权,越接近现时刻的数据,权越大。

优点:即使图像中的噪声影响得到抑制,又不对图像的边界和细节有明显的影响。

缺点::对于纯滞后时间常数较小、采样周期较长、缓慢变化的信号,滤波效果差。

使用情况::该算法比较适用于有较大纯滞后时间常数的对象。

2. 说明直方图均衡化和直方图规定化的实现过程。

1)直方图均衡化实现步骤:(1)•列出原始图像的灰度级(fj)(2)统计各灰度级的像素数目(3)计算原始图像直方图各灰度级的频数(4)计算累积分布函数(5).应用以下公式计算映射后的输出图像的灰度级,P为输出图像灰度级的个数(gi)(6)统计映射后各灰度级的像素数目(7)计算输出直方图(8)用fj和gi的映射关系修改原始图像的灰度级,从而获得直方图近似为均匀分布的输出图像2)直方图规定化的实现步骤:令Pr(r)和Pz(z)分别为原始图像和期望图像的灰度概率密度函数,如果对原始图像和期望图像均作直方图均衡化处理,则有:£="2 [耿)dr(1)V = 二f E (z)dz z = (v)(2)(3)由于都是进行直方图均衡化处理,处理后的原图像概率密度函数 Ps (s )及期望图像的概率密度函数Pv (v )是相等的。

图形图像处理实训报告总结三篇

图形图像处理实训报告总结三篇

图形图像处理实训报告总结三篇图形图像处理实训报告总结一篇通过这次实训,我收获了很多,一方面学习到了许多以前没学过的专业知识与知识的应用,另一方面还提高了自己动手做项目的能力。

本次实训,是对我能力的进一步锻炼,也是一种考验。

从中获得的诸多收获,也是很可贵的,是非常有意义的。

在实训中我学到了许多新的知识。

是一个让我把书本上的理论知识运用于实践中的好机会,原来,学的时候感叹学的内容太难懂,现在想来,有些其实并不难,关键在于理解。

在这次实训中还锻炼了我其他方面的能力,提高了我的综合素质。

首先,它锻炼了我做项目的能力,提高了独立思考问题、自己动手操作的能力,在工作的过程中,复习了以前学习过的知识,并掌握了一些应用知识的技巧等。

其次,实训中的项目作业也使我更加有团队精神。

从那里,我学会了下面几点找工作的心态:一、继续学习,不断提升理论涵养。

在信息时代,学习是不断地汲取新信息,获得事业进步的动力。

作为一名青年学子更应该把学习作为保持工作积极性的重要途径。

走上工作岗位后,我会积极响应单位号召,结合工作实际,不断学习理论、业务知识和社会知识,用先进的理论武装头脑,用精良的业务知识提升能力,以广博的社会知识拓展视野。

二、努力实践,自觉进行角色转化。

只有将理论付诸于实践才能实现理论自身的价值,也只有将理论付诸于实践才能使理论得以检验。

同样,一个人的价值也是通过实践活动来实现的,也只有通过实践才能锻炼人的品质,彰显人的意志。

必须在实际的工作和生活中潜心体会,并自觉的进行这种角色的转换三、提高工作积极性和主动性。

实习,是开端也是结束。

展现在自己面前的是一片任自己驰骋的沃土,也分明感受到了沉甸甸的责任。

在今后的工作和生活中,我将继续学习,深入实践,不断提升自我,努力创造业绩,继续创造更多的价值。

可以说这次实训不仅使我学到了知识,丰富了经验。

也帮助我缩小了实践和理论的差距。

这次实训将会有利于我更好的适应以后的工作。

我会把握和珍惜实训的机会,在未来的工作中我会把学到的理论知识和实践经验不断的应用到实际工作中,为实现理想而努力。

数字图像处理期末大作业

数字图像处理期末大作业

数字图像处理期末大作业一、问题描述实现第十章中采用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 变换的原理就是利用图像全局特征将边缘像素连接起来组成区域封闭边界,它将图像空间转换到参数空间,在参数空间对点进行描述,达到检测图像边缘的目的。

数字图像处理 作业题及部分答案

数字图像处理 作业题及部分答案

1.数字图像与连续图像相比具有哪些优点?连续图像f(x,y)与数字图像I(c,r)中各量的含义是什么?它们有何联系和区别? (To be compared with an analog image, what are the advantages of a digital image? Let f(x,y) be an analog image, I(r, c) be a digital image, please give explanation and comparison for defined variables: f/I, x/r, and y/c)2.图像处理可分为哪三个阶段? 它们是如何划分的?各有什么特点? (We can divide "imageprocessing" into 3 stages, what are they? how they are divided? What are their features?)答:低级处理---低层操作,强调图像之间的变换,是一个从图像到图像的过程;中级处理---中层操作,主要对图像中感兴趣的目标进行检测和测量,从而建立对图像的描述,是一个从图像到数值或符号的过程;高级处理---高层操作,研究图像中各目标的性质和相互联系,得出对图像内容含义的理解以及对原来客观场景的解释;3.试从结构和功能等角度分析人类视觉中最基本的几个要素是什么?什么是马赫带效应? 什么是同时对比度?它们反映了什么共同问题? (According to the structure and function of the eyes, what are the basic elements in human vision? What is the Mach Band Effect? What is Simultaneous Contrast? What common facts can we infer from both Mach Band Effect and Simultaneous Contrast?)答:人的视觉系统趋向于过高或过低估计不同亮度区域边界的现象称为“马赫带”效应;同时对比度指的是人的视觉系统对某个区域感觉到的亮度除了依赖于它本身的强度,还与背景有关.马赫带效应和同时对比度现象表明人所感觉到的亮度并不是强度的简单函数.4.比较说明像素邻域、连接、通路以及连通基本概念的联系与区别。

图像识别与处理期末大作业

图像识别与处理期末大作业

云南大学软件学院期末课程报告Final Course ReportSchool of Software, Yunnan University个人成绩学期: 2017秋季学期课程名称: 图像识别与处理任课教师:题目:姓名:学号:联系电话:电子邮件:目录1.概述 (2)2.需求分析 (3)2.1初期需求 (3)2.2最终的需求 (3)2.3性能要求分析 (3)2.4最终项目功能需求 (4)3.软件设计说明 (5)3.1项目概要设计 (5)3.2 项目体系结构 (7)3.3 操作界面设计 (8)3.4项目功能设计 (9)3.5项目功能介绍 (10)3.5.1图像查看 (10)3.5.2图像(RGB)直方图 (11)3.5.3图像颜色反转 (12)3.5.4图像旋转 (13)3.5.5图像灰度处理 (13)3.5.6图像缩小 (14)3.5.7图像平移 (14)3.5.8图像文件 (15)3.5.9图像用户手册 (15)3.5.10图像对数校正 (16)3.5.11图像的指数校正 (16)3.5.12图像扩展校正 (17)3.5.13元胞自动机 (18)3.5.14中值滤波 (19)3.5.15均值滤波 (19)3.5.16小波变换 (20)3.5.17算子边缘检测 (21)3.5.18高通滤波 (21)4.使用说明 (22)4.1运行环境要求 (22)4.2用户操作手册 (23)5.总结 (26)1.概述图像处理与识别技术是一门跨学科的前沿高科技。

随着计算机软硬件技术的不断提高,计算机图像处理与识别技术从20世纪80年代中期到90年代末得到了迅速的发展,已广泛地应用在工业、农业、交通、金融、地质、海洋、气象、生物医学、军事、公安、电子商务、卫星遥感、机器人视觉、目标跟踪、自主车导航、多媒体信息网络通信等领域,取得了显著的社会效益和经济效益。

现在人们已充分认识到计算机图像处理与识别技术是认识世界、改造世界的重要手段,是21世纪信息时代的一门重要的高新科学技术。

《数字图像处理》复习大作业及答案

《数字图像处理》复习大作业及答案

2014年上学期《数字图像处理》复习大作业及参考答案=====================================================一、选择题(共20题)1、采用幂次变换进行灰度变换时,当幂次取大于1时,该变换是针对如下哪一类图像进行增强。

(B)降低灰度级,让图像变暗一些A 图像整体偏暗B 图像整体偏亮C图像细节淹没在暗背景中D图像同时存在过亮和过暗背景2、图像灰度方差说明了图像哪一个属性。

(B )A 平均灰度B 图像对比度C 图像整体亮度D图像细节3、计算机显示器主要采用哪一种彩色模型( A )A、RGBB、CMY或CMYKC、HSID、HSV4、采用模板[-1 1]T主要检测( A )方向的边缘。

A.水平B.45︒C.垂直D.135︒5、下列算法中属于图象锐化处理的是:( C )A.低通滤波B.加权平均法C.高通滤波D. 中值滤波6、维纳滤波器通常用于( C )A、去噪B、减小图像动态范围C、复原图像D、平滑图像7、彩色图像增强时, C 处理可以采用RGB彩色模型。

A. 直方图均衡化B. 同态滤波C. 加权均值滤波D. 中值滤波8、__B__滤波器在对图像复原过程中需要计算噪声功率谱和图像功率谱。

A. 逆滤波B. 维纳滤波C. 约束最小二乘滤波D. 同态滤波9、高通滤波后的图像通常较暗,为改善这种情况,将高通滤波器的转移函数加上一常数量以便引入一些低频分量。

这样的滤波器叫B。

A. 巴特沃斯高通滤波器B. 高频提升滤波器C. 高频加强滤波器D. 理想高通滤波器10、图象与灰度直方图间的对应关系是 B __A.一一对应B.多对一C.一对多D.都不11、下列算法中属于图象锐化处理的是:CA.低通滤波B.加权平均法C.高通滤D. 中值滤波12、一幅256*256的图像,若灰度级数为16,则存储它所需的比特数是:( A )A、256KB、512KC、1M C、2M13、噪声有以下某一种特性( D )A、只含有高频分量B、其频率总覆盖整个频谱C、等宽的频率间隔内有相同的能量D、总有一定的随机性14. 利用直方图取单阈值方法进行图像分割时:(B)a.图像中应仅有一个目标b.图像直方图应有两个峰c.图像中目标和背景应一样大d. 图像中目标灰度应比背景大15. 在单变量变换增强中,最容易让人感到图像内容发生变化的是( C )A亮度增强觉B饱和度增强C色调增强D不一定哪种增强16、利用平滑滤波器可对图像进行低通滤波,消除噪声,但同时模糊了细节。

《图像处理技术》大作业题

《图像处理技术》大作业题

《图像处理技术》大作业学号:200808205135姓名:柯锦班级:B08082051学院:数计1 作业题目基于图像的动态景物的监测与跟踪2 作业数据短视频,背景相同,一个目标运动,及多目标运动3 基本方法(1)图像增强(2)图像基本运算(3)图像分割见代码注释:单目标主要代码如下function pushbutton4_Callback(hObject, eventdata, handles)% hObject handle to pushbutton4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global KeJin;%设置全局变量,用于记录目标单击的按钮axes(handles.axes1); %在axes1中处理,实现原动画的显示clear data %数据清理avi = aviread('samplevideo.avi');%读取一个avi动画,放到临时数组avi中video = {avi.cdata};for a = 1:length(video) %一帧一帧的读取video,并调用绘图函数imagesc显示每一帧的内容,以达到avi动画的播放imagesc(video{a});axis image offdrawnow;end;%handles.keJin=1;%guidata(hObject, handles);KeJin=1;% --- Executes on button press in pushbutton5.function pushbutton5_Callback(hObject, eventdata, handles)% hObject handle to pushbutton5 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDA TA)global KeJin;if KeJin==1axes(handles.axes2);%在axes2中处理,实现目标的跟踪的显示clear dataavi = aviread('samplevideo.avi');video = {avi.cdata};tracking(video);%调用tracking函数,实现动画跟踪(单目标)endif KeJin==2axes(handles.axes2);MovingDetect();%调用MovingDetect函数,实现动画跟踪(多目标)endfunction d = tracking(video) %跟踪处理函数,实现一个运动目标的跟踪if ischar(video)% Load the video from an avi file.avi = aviread(video);pixels = double(cat(4,avi(1:2:end).cdata))/255;%将数据缩小255倍,然后以第四维进行组合,图像的增强(像素点的值缩小)clear avielse% Compile the pixel data into a single arraypixels = double(cat(4,video{1:2:end}))/255; %将数据缩小255倍,然后以第四维进行组合,图像的增强(像素点的值缩小)clear videoend% Convert to RGB to GRAY SCALE image.nFrames = size(pixels,4);%pixels第四维的大小放在nFrames中(总帧数)for f = 1:nFrames %对于没一帧,都做如下工作pixel(:,:,f) = (rgb2gray(pixels(:,:,:,f))); %转换为灰度图像endrows=240;cols=320;nrames=f;for l = 2:nrames%从第二帧到最后一帧,都做如下工作%下句为图像的基本运算,减运算,也是该跟踪的根本算法之一d(:,:,l)=(abs(pixel(:,:,l)-pixel(:,:,l-1)));%前后图像相减,得到的矩阵放到d中,以实现图像跟踪,此为图像的基本运算k=d(:,:,l);bw(:,:,l) = im2bw(k, .2);%转化为二值图像bw1=bwlabel(bw(:,:,l));imshow(bw(:,:,l))%显示二值图像hold on%右方向为横坐标轴%下方向为纵坐标轴cou=1;for h=1:rowsfor w=1:colsif(bw(h,w,l)>0.5)%此处用到图像分割,全局阀值分割toplen = h; %每一帧,如果cou!=1的话,下边界纵坐标放在toplen中,if (cou == 1)tpln=toplen; %每一帧,上边界纵坐标放在tpln中endcou=cou+1;breakendendend%disp(toplen);coun=1;for w=1:colsfor h=1:rowsif(bw(h,w,l)>0.5)%此处用到图像分割,全局阀值分割leftsi = w; %每一帧,如果coun!=1的话,右边界横坐标放在leftsi中if (coun == 1)lftln=leftsi; %每一帧,左边界横坐标放在lftln中coun=coun+1;endbreakendendendwidh=leftsi-lftln;%矩形的长(宽度)heig=toplen-tpln;%矩形的宽(高度)widt=widh/2;heit=heig/2;with=lftln+widt;%中心横坐标heth=tpln+heit;%中心纵坐标rectangle('Position',[lftln tpln widh heig],'EdgeColor','r');%用红色矩形框住目标,以确定目标位置plot(with,heth, 'r^');%用Δ标出目标的中心drawnow;hold offend;多目标function x = MovingDetect()clear data%初始化背景所需要的帧数N=15;%背景更新参数p1 = 95;p2 = 100-p1;M_ = 1;%读取A VI视频文件mov = aviread('My.AVI');%获取视频帧数dimension = size(mov);frameQTY = dimension(2);M=mov;tmFr = rgb2gray(frame2im(mov(1)));s = size(tmFr);scrsz = get(0,'ScreenSize');%%%h1 = figure('position', [scrsz(4)/2,scrsz(4)/2,s(2)*2,s(1)*2]); cdataSum = int16(zeros(s));sedisk = strel('rectangle',[2,2]);sedisk2 = strel('rectangle',[3,2]);count = zeros(s);for c1 = 1:frameQTY;colorFrC = M(c1);%获取第i帧frC = rgb2gray(frame2im(colorFrC));frC = im2frame(frC, gray(256));f = int16(frC.cdata);if( c1<= N)%前N帧用于背景建模movie(frC, 1, 15, [0,s(1),0,0]);%播放第i帧%movie(h1, frC, 1, 15, [0,s(1),0,0]);%播放第i帧cdataSum = cdataSum + f;else%开始运动检测,首先计算出背景if(c1==N+1)cdB = cdataSum/N;else cdB = int16(cdB);endf2 = abs( f - cdB );f2 = uint8(f2);if( c1 == 25)disp('1');endbwf = f2;bw = find( f2 < 45 );bwf(bw) = 0;cdB(bw) = (f(bw)+9*(cdB(bw)) )/10;bw = find( f2 >= 45 );bwf(bw) = 255;%bwf=logical(bwf);cdB = uint8(cdB);f3 = imdilate(bwf, sedisk);f3 = imerode(f3, sedisk);noSmall = bwareaopen( f3, 150 );%标签矩阵L = bwlabel( noSmall, 4 );taggedCars( :,: ) = frC.cdata;if any( L(:) )stats = regionprops(L,'boundingbox','filledArea');for label = 1:length(stats)box = stats(label);if( box.FilledArea < 200 || box.FilledArea/(s(1)*s(2)) > 0.3 )continue;endbox = box.BoundingBox;left=round(box(1));top=round(box(2));right=round(box(1)+box(3)-1);bottom=round(box(2)+box(4)-1);if( abs(top - bottom)/abs(right - left) > 4 || abs(right - left)/abs(top - bottom) > 4 )continue;endtaggedCars(top,left:right)=1; %画矩形框%taggedCars(bottom,left:right)=1;taggedCars(top:bottom,left)=1;taggedCars(top:bottom,right)=1;endend%f5 = imdilate(imerode(f,tk1), tk);ff = [frC.cdata, cdB;f3, taggedCars];%noSmall, taggedCarsff = im2frame(ff,gray(256));movie(ff, 1, 15, [0,0,0,0]);%播放第i帧%movie(h1, ff, 1, 15, [0,0,0,0]);%播放第i帧end% end of if-elseend%--播放结束4 作业完成目标:动态目标的定位与跟踪,并用方框提示并给出运动轨迹截图如下:单目标:多目标:部分代码来源于:/search.php?searchid=475&orderby=lastpost&ascdesc=desc&searchsubmit=yes&page=1小结:此次大作业采用减法运算达到单个目标跟踪的目的,采用了图像增强,设定阀值使结果便于观察,分析。

图像处理作业

图像处理作业

数字图像处理作业 第一章 绪 论1. 连续图象f(x,y)与数字图象I(r,c)中各量的含义各是什么? 它们有什么联系和区别?它们的取值各在什么范围?2. 图象处理, 图象分析和图象理解各有什么特点?它们之间有哪些联系和区别?3. 图象工程主要与哪些学科相关?它们之间如何互相影响?4. 近年来有哪些新的数学工具在图象工程中得到应用?5. 简要叙述图象采集,图象显示,图象存储以及图象通信与图象处理和分析的联系.6. 近年来在图象采集,图象显示,图象存储各方面最突出的进展是什么?对图象处理和分析产生了哪些影响?7. 人类视觉中最基本的几个要素是什么?8. 马赫带效应和同时对比度反映了什么共同问题?9. 什么是图像逼真度和图像可懂度?采用归一化均方误差NMES 计算下面两幅图像的逼真度。

10. ⎥⎥⎥⎦⎤⎢⎢⎢⎣⎡=111111111),(y x f⎥⎥⎥⎦⎤⎢⎢⎢⎣⎡=111101111),(y x f11. 人眼观察如图5-1所示两幅形状相同的图像,但由于目标和背景灰度不同,图中所标为灰度值,判断一下哪幅图像中的目标人眼观察会感觉得更亮?(白色灰度值为255,黑色灰度值为0)(a) (b) 图112. 求下列图像的二维付立叶变换(a) 长方形图像如图5-2(a)。

⎩⎨⎧≤≤=其它,0),(b y a x Ey x f(b)旋转45°的正方形图像如图5-2(b)。

13. 如),(y x f 是圆对称的,即⎩⎨⎧≤+其它=0),(222a y x Ey x f证明其付立叶变换也是圆对称的,并由下式给出dr r rJ E F u F ⎰∞=00)2(2)(),(ρππρυ=式中:22y x r += ⎪⎭⎫ ⎝⎛=-x y tg 1θ22υρ+=u⎪⎭⎫⎝⎛=-u tg υϕ114. []θϕθππd jz z J ⎰--=200)cos(exp 21)(为零阶第一类贝塞尔函数。

15. 2-D 傅立叶变换的分离性有什么实际意义?16. 试举例说明2-D 傅立叶变换的周期性和共轭对称性的用途. 17. 设x,y 都是连续变量,计算下列各式的傅立叶变换:(1) df(x)/dx; (2) (,)/(,)/f x y x f x y y ∂∂+∂∂; (3) 2222(,)/(,)/f x y x f x y y ∂∂+∂∂.18. 证明f(x)的自相关函数的傅立叶变换就是f(x)的功率谱2|F(u)|.图 219. 图像增强的目的是什么? 20. 什么是直方图?21. 直方图修改的技术基础是什么?22. 在直方图修改技术中采用的变换函数的基本要求是什么? 23. 直方图均衡化处理采用何种变换函数? 24. 直方图均衡化处理的结果是什么?25.假定有64×64大小的图像,灰度为16级,概率分布如下表,试用直方图均衡化方法处理之,并画出处理前后的直方图。

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

)
]

F
(u

u0
,
v

v0
)
频域向右平移
(u0
,
v0
)
对应空域乘以
e
j
2
(
u0 x M
,
v0 y N
)
特别地, F[ f (x, y)(1)xy ] F (u M ,v N ) 表示空域乘以 (1)xy 可以将频域中 22
的图像移动到中间位置,即频域图像中心化。
2)平均性和对称性
0 0
6000 5000 4000 3000 2000 1000
0 0
原始直方图
50
100
150
200
250
第一次均衡化的直方图
50
100
150
200
250
6000
第二次均衡化的直方图
5000
4000
3000
2000
1000
0
0
50
100
150
200
250
由结果可以看出,第二次均衡化后的直方图与第一次的相同。
目标:
2
2
根据傅里叶变换的频域平移的性质
[f (x,y)e j2 (u0x/M ] v0y/N ) F(u u0,v v0)
u0

M 2
,
v0
N 2 代入性质中,得到空域的函数为:
1[F(u M ,v N )] f (x,y)e j (x y) f (x,y)( 1)x y
2
2
3、 观察如下所示图像。右边的图像这样得到:(a)在原始图像左边乘以(−1)x+y;(b) 计算
[f (x x0,y y0)] F(u,v)e j2 (u0x/M v0y/N )
答案:
证明:
M1 N1
[f (x x0,y y0)]
f (x
x0,y
y )e j2 (ux/M vy/N ) 0
x x0 0 y y0 0
M 1N 1
f (x ', y ')e j2 (u(x ' x0 )/M v(y ' y0)/N )
4.请围绕本周课堂讲授的内容编写至少一道习题,并给出自己的分析解答。题目 形式可以是填空题、选择题、判断对错题、计算题、证明题。发挥你的创造力吧。
(判断题)直方图均衡化一定能够将原始图像的直方图分布映射为整个灰度区 间上较为平坦的直方图分布。
答案:错。直方图均衡化具体增强效果不容易控制,可能出现直方图从一个极 端变为另一个极端,直观上来看图像由过暗变为过亮或者由过亮变为过暗。同 时,映射出的直方图也并非一定十分平坦。
第一次作业 1、完成课本习题 3.2(a)(b), 课本中文版《处理》第二版的 113 页。可以通过 matlab 帮助你 分析理解。
(a)
s

T
(r
)

1

1 (m
/
r
)
E
其中,r 为输入图像的亮度,s 为输出图像的亮度,E 控制函数坡度。 (b)假设图像为二值灰度图像,则 m 的值固定为 0.5 设计变换程序如下:
的傅立叶变换为
证明: 已知:
[e ] (x2 y2 )
e (u2 v2 )
证明:
[Ae ] A2 e 1
(u2 v2 )/2 2
2 2 2 2 (x2 y2 )
令G(u, v)
e
(u2
v2 )
,
g(x,y)
e (x2 y2 )
则根据傅里叶变换的相似性性质
[f (ax,by)]
|
1 ab
|
F(au
,
v b
0.2
0.15
0.1
0.05
0
0
1
2
3
4
5
6
7
3. (选做题)课本习题 3.6。对于离散的情况,用 matlab 进行一下实验。
假设 r 被归一化到[0,1]区间上,第一次直方图均衡化,有:
r
s T (r) pr ()d, 0 r 1
0
ps (s)

pr (r) |
dr ds
j0
j0
向上取整得到 s0 1, s1 3, s2 5, s3 6, s4 6, s5 7, s6 7, s7 7 计算后的灰度级和其对应概率为
灰度级 0
1
2
3
4
5
6
7
概率
0
0.17
0
0.25
0
0.21 0.23 0.14
均衡后的直方图示意图如下图所示:
0.25
[平均性]:
f (x, y)F(0, 0)
1
M 1 N 1
f (x, y)
MN x0 y0
频域中的零频率对应空域中像素点灰度值的平均值
[共轭对称性]: F(u, v) F*(u, v)
频域中的所有点都是共轭对称的,成对出现的。
[对称性]: | F(u,v) || F*(u. v) |
f ( x, y)e2j (x y)
f ( x, y)
因此,产生的新图像关于原始图像的上下左右镜像对称(中心对称)。
4.请围绕本周课堂讲授的内容编写至少一道习题,并给出自己的分析解答。题目 形式可以是填空题、选择题、判断对错题、计算题、证明题。发挥你的创造力吧。
题目:(证明题)请证明二维离散傅里叶变换的时移性成立
0.1
0
0
0.2
0.4
0.6
0.8
1
1
0.8
0.6
0.4
0.2
0
0
0.2
0.4
0.6
0.8
1
1
0.8
0.6
0.4
0.2
0
0
0.2
0.4
0.6
0.8
1
1
0.8
0.6
0.4
0.2
0
0
0.2
0.4
0.6
0.8
1
1
0.8
0.6
0.4
0.2
0
0
0.2
0.4
0.6
0.8
1
1
0.8
0.6
0.4
0.2
0
0
0.2
0.4
(2)
1 3 1 3 2 0 4
1 2 1
0 0 0
1
1 2 1
*
1
0 2
3
3 0 4 3 1
2 3 1 2 0
0 2 0 1 4
4
3
5 4
2

3
3 3
7 8
6 7 11 11 5
4 6 4 2 6
clc;clear;
x=0:0.01:1;
m=0.5;
E=1;
g=1./(1+(m./(double(x)+eps)).^E);
figure;plot(x,g);
通过改变E的值分别为1,5,10,20,50,100.有如下图像(顺序为从左向右、
从上到下依次对应)。
0.7
0.6
0.5
0.4
0.3
0.2
离散傅里叶变换(DFT); (c) 对变换取复共轭; (d) 计算傅里叶反变换; (d) 结果的实部再乘以 (−1)x+y。(用数学方法解释为什么会产生右图的效果。)
解:
由题意,设原始图像函数为 f (x,y)
则经过步骤(a) 得到 f (x,y)( 1)x y
经过步骤(b) 得到 质)
[f (x,y)( 1)x y ]
4 3 8 5 4
9
11
15 17
15
8
3 1 3 3 2 4 2
3.请围绕本周课堂讲授的内容编写至少一道习题,并给出自己的分析解答。题目 形式可以是填空题、选择题、判断对错题、计算题、证明题。发挥你的创造力吧。
(选择题)以下哪种滤波方式去除椒盐噪声的效果最好?() A 中值滤波 B 均值滤波 C 拉普拉斯滤波 D 高斯滤波
F(u
M ,v 2
N 2
)
(频域平移的性
经过步骤(c) 得到 F *(u
M ,v 2
N) 2
F( (u
M ), (v 2
N )) 2
(共轭
对称性)
经过步骤(d) 得到
1[F( (u
M ), (v 2
N ))] 2
f ( x, y)e j (x y)(相
似性和频域平移性质)
经过步骤(f) 得到
f ( x, y)ej (x y)( 1)x y
sk


k
G
Pr
(rj
)
1

j 1
其中 G=8。
1
s0 T (r0 ) 8 Pr (rj ) 1 0.36 s1 T (r1) 8 Pr (rj ) 1 2.36
j0
j0
2
3
s2 T (r2 ) 8 Pr (rj ) 1 4.04 s3 T (r3) 8 Pr (rj ) 1 5.32
第二次作业
1、 完成课本数字图像处理第二版 114 页,习题 3.10。 解:
由图可知:
原图像的概率密度函数为 pr (r) 2r 2
灰度变换后的图像的概率密度函数为 pz (z) 2z
思路:将原图像和目标图像进行直方图匹配,从而找到变换函数。
对原图像直方图均衡化得到
s T (r)
相关文档
最新文档