西安交通大学大学数字图像处理大作业

合集下载

数字图像处理大作业

数字图像处理大作业

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)

《数字图像处理》期末大作业(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。

数字图像处理大作业

数字图像处理大作业

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

西安交大数字图像处理第一次作业

西安交大数字图像处理第一次作业

数字图像处理第一次作业姓名:班级:学号:提交日期:2015年3月13日摘要本次报告首先简单阐述了BMP图像格式及其相关数据结构,随后主要完成了作业要求中关于图像处理与计算的各项任务。

本次作业以Matlab 2014为平台,通过对lena.bmp,elain.bmp图像文件的编程处理,分别得到了lena.bmp图像的8到1级灰度逐级递减显示,lena.bmp图像的均值和方差,通过近邻、双线性和双三次插值法对lena.bmp进行4倍放大后得到的2048×2048尺寸图像,和对lena.bmp、elain.bmp图像分别进行水平偏移变换和旋转变换后的图像及其4倍插值放大图像。

以上任务完成后均得到了预期的结果。

1.Bmp图像格式简介。

1.1 BMP格式概述BMP(全称Bitmap)是Windows操作系统中的标准图像文件格式,可以分成两类:设备相关位图(DDB)和设备无关位图(DIB),使用非常广。

它采用位映射存储格式,除了图像深度可选以外,不采用其他任何压缩,因此,BMP文件所占用的空间很大。

BMP文件的图像深度可选lbit、4bit、8bit及24bit。

BMP文件存储数据时,图像的扫描方式是按从左到右、从下到上的顺序。

1.2 BMP格式组成典型的BMP图像文件由四部分组成:(1)位图头文件数据结构,它包含BMP图像文件的类型、显示内容等信息;(2)位图信息数据结构,它包含有BMP图像的宽、高、压缩方法,以及定义颜色等信息;(3)调色板,这个部分是可选的,有些位图需要调色板,有些位图,比如真彩色图(24位的BMP)就不需要调色板;(4)位图数据,这部分的内容根据BMP位图使用的位数不同而不同,在24位图中直接使用RGB,而其他的小于24位的使用调色板中颜色索引值。

1.3 BMP格式对应数据结构BMP文件由文件头、位图信息头、颜色信息和图形数据四部分组成。

1.3.1 BMP文件头(14字节)BMP文件头数据结构含有BMP文件的类型、文件大小和位图起始位置等信息。

西安交大数字图像处理第二次实验报告

西安交大数字图像处理第二次实验报告

数字图像处理第二次作业摘要本次报告主要记录第二次作业中的各项任务完成情况。

本次作业以Matlab 2013为平台,结合matlab函数编程实现对lena.bmp,elain1.bmp图像文件的相关处理:1.分别得到了lena.bmp 512*512图像灰度级逐级递减8-1显示,2.计算得到lena.bmp图像的均值和方差,3.通过近邻、双线性和双三次插值法将lena.bmp zoom到2048*2048,4. 把lena和elain 图像分别进行水平shear(参数可设置为1.5,或者自行选择)和旋转30度,并采用用近邻、双线性和双三次插值法zoom到2048*2048。

以上任务完成后均得到了预期的结果。

1.把lena 512*512图像灰度级逐级递减8-1显示(1)实验原理:给定的lena.bmp是一幅8位灰阶的图像,即有256个灰度色。

则K位灰阶图像中某像素的灰度值k(x,y)(以阶色为基准)与原图同像素的灰度值v(x,y)(以256阶色为基准)的对应关系为:式中floor函数为向下取整操作。

取一确定k值,对原图进行上式运算即得降阶后的k位灰阶图像矩阵。

(2)实验方法首先通过imread()函数读入lena.bmp得到图像的灰度矩阵I,上式对I矩阵进行灰度降阶运算,最后利用imshow()函数输出显示图像。

对应源程序为img1.m。

(3)处理结果8灰度级7灰度级6灰度级5灰度级4灰度级3灰度级2灰度级1灰度级(4)结果讨论:由上图可以看出,在灰度级下降到5之前,肉眼几乎感觉不出降阶后图像发生的变化。

但从灰度级4开始,肉眼明显能感觉到图像有稍许的不连续,在灰度缓变区常会出现一些几乎看不出来的非常细的山脊状结构。

随着灰度阶数的继续下降,图像开始出现大片的伪轮廓,灰度级数越低,越不能将图像的细节刻画出来,最终的极端情况是退化为只有黑白两色的二值化图像。

由此可以得出,图像采样的灰度阶数越高,灰度围越大,细节越丰富,肉眼看去更接近实际情况。

西安交通大学数字图像处理第二次作业知识分享

西安交通大学数字图像处理第二次作业知识分享

数字图像处理的基本数学工具的使用摘要本报告主要介绍了运用编程软件MATLAB对图像灰度级进行变换、求取图像均值与方差、采用不同的内插方法对图像进行缩放及利用仿射变换对图像进行空间变换处理的方法。

同时,对最近邻内插法、双线性内插法、双三次内插法进行图像处理的效果进行了详细的对比,并对出现差异的原因做出了简要分析。

姓名: X X X班级:学号:提交日期:年月日2_1. 把lena 512*512图像灰度级逐级递减8-1显示;(1)问题分析:所要实现的功能是:在不改变图像大小的前提下,使得整幅图像的灰度级逐级递减并将图像显示出来;即对所有像素点的灰度依次进行除2操作;(2)实验过程:工具:MATLAB软件;利用imread()函数将图像读入MATLAB,利用imshow()对原图像进行显示,再利用循环体对整幅图像的灰度级逐级递减并一一进行显示。

源代码附于本报告最后一部分。

(3)实验结果:备注:在大小为512X512的途中观察更为方便,但此处为了便于排版以及将结果进行对比对所有图像做了一定的缩小。

a bc de fg h图2_1 (a)大小为512X512的256灰度级图像;(b)~(h)保持图像大小不变的同时以灰度级128,62,32,16,8,4,2显示的图像。

(4)结果分析:对图2_1中的(a)~(h)图像进行对比可知,256级、128级、64级以及32级灰度的图像几乎没有太大的区别;然而在灰度级为16的图(e)中出现了较为明显的伪轮廓,这种效果是由数字图像的平滑区域中的灰度级数不足引起的。

(说明:此分析为本人肉眼的观察结果,对细节的观察难免存在疏漏之处,还请批评指正。

)2_2. 计算lena图像的均值方差;(1)问题分析:所要实现的功能是:计算图像‘lena.bmp’的均值与方差;(2)实验过程:工具:MATLAB软件;利用imread()函数将图像读入MATLAB,由于二维数字图像使用二维阵列表示的,因而可以直接利用MATLAB中的mean2()及std2()分别求整幅图像的均值于方差;源代码附于本报告最后一部分。

数字图像处理大作业报告

数字图像处理大作业报告

数字图像处理实验报告实验选题:选题二组员:学号:班级:指导老师:实验日期:2019年5月22日一、实验目的及原理1.识别出芯片的引脚2.熟悉并掌握opencv的某些函数的功能和使用方法原理:通过滤波、形态学操作得到二值图,再在二值图中设置条件识别引脚部分。

二、实现方案对图片滤波、调节阈值做边缘检测过滤掉一部分图片中干扰元素;然后通过膨胀、腐蚀操作来减少引脚的空心部分;再通过findContours()函数找到引脚的边缘并得到轮廓的点集,设置特定的长宽比和矩形面积识别引脚部分。

三、实验结果四、源码#include<iostream>#include<cmath>#include"opencv2/highgui/highgui.hpp"#include"opencv2/imgproc/imgproc.hpp"using namespace std;using namespace cv;int main(int argv, char **argc){//载入图片Mat srtImag = imread("2.jpg");Mat G_blur = srtImag.clone();//降噪blur(G_blur, G_blur, Size(5, 5));//imshow("降噪", G_blur);//Canny边缘检测Mat Canny_Imag = G_blur;Canny_Imag = Canny_Imag > 176;Canny(G_blur, Canny_Imag, 300, 50, 3);//imshow("边缘检测", Canny_Imag);//膨胀Mat element = getStructuringElement(MORPH_RECT, Size(10, 10));dilate(Canny_Imag, Canny_Imag, element);//imshow("膨胀", Canny_Imag);//腐蚀Mat element_1 = getStructuringElement(MORPH_RECT, Size(11, 11));erode(Canny_Imag, Canny_Imag, element_1);//imshow("腐蚀", Canny_Imag);//查找轮廓vector<vector<Point>>contours;vector<Vec4i>hierarchy;findContours(Canny_Imag, contours, hierarchy, RETR_CCOMP, CHAIN_APPROX_SIMPLE);vector<vector<Point>> contour_s(contours.size());//该数组共有contours.size()个轮廓的点集vector<Rect> Rec_s(contours.size());//逼近多边形的点集数组//获得每个轮廓点集的逼近多边形的点集for (size_t i = 0; i < contours.size(); i++) {approxPolyDP(Mat(contours[i]), contour_s[i], 3,false);//contour_s存储逼近多边形的点集Rec_s[i]= boundingRect(contour_s[i]); //Rec_s存储最小包围矩形的点集}//筛选合适长宽比的矩形并将其画出来Mat result_Imag = srtImag.clone();for (size_t j = 0; j < contours.size(); j++) {double as_ra;//长宽比as_ra = Rec_s[j].height / Rec_s[j].width;if (as_ra > 3.3 && as_ra < 9.3 && Rec_s[j].area() > 20) { rectangle(result_Imag, Rec_s[j], Scalar(0, 255, 255), 2, 7);}}imshow("result", result_Imag);waitKey(0);return 0;}五、总结经过这次实验,我熟悉了对blur()、Canny()、dilate()、erode()、findContours()、approxPolyDP()等函数的使用,了解了Rect类的构成等。

西交大数字图像处理第三次作业

西交大数字图像处理第三次作业

数字图像处理第三次作业姓名:班级:学号:提交日期: 2015 年 3 月 31 日1、把附件图像的直方图画出; ( 1)问题分析:强度直方图图形化显示不同的像素值在不同的强度值上的出现频率,对于灰度图像来说强度范围为 [0~255] 之间,对于 RGB 的彩色图像可以独立显示三种颜色的强度直方图。

强度 直方图是用来寻找灰度图像二值化阈值常用而且是有效的手段之一, 如果一幅灰度图像的直方图显示为两个波峰, 则二值化阈值应该是这两个波峰之间的某个灰度值。

同时强度直方图是调整图像对比度的重要依据。

直方图实现方法: 对一幅灰度图像从上到下, 从左到右扫描每个像素值, 在每个灰度值上计算像素数目,以这些数据为基础完成图像直方图的绘制。

( 2)处理结果:citywall.bmpcitywall1 直 方 图( 调 用 imhist 函 数 )citywall1 直 方 图 ( 自 己 编 写 )100000.0290000.0188000 0.016 70000.0146000度 0.012密5000率 0.01概4000的 0.008素3000像0.006200010000.0040.00250 100 150 200 2500 50 100150 200 250灰 度 值10000citywall2 直 方 图 ( 调 用 imhist 函 数 )0.1citywall2 直 方 图 ( 自 己 编 写 )90000.0980000.0870000.076000度 0.065000密率 0.05概4000的 0.043000素像20000.0310000.020.010 50 100 150 200 2500 50 100150 200 250灰 度 值elain.bmp5000 4500 4000 3500 30002500elain1 直 方 图 ( 调 用 imhist 函 数 ) elain1 直 方 图 ( 自 己编 写 )0.05 0.045 0.04 0.035度 0.03密率概0.0252000的 0.02 1500素像10000.0155000.010.00550 100 150 200 2500 50 100150 200 250灰 度 值5000elain2 直 方 图 ( 调 用 imhist 函 数 )0.05elain2 直 方 图 ( 自 己 编 写 )4500 0.045 4000 0.04 35000.0353000度 0.03密2500率2000概 0.025的 0.021500素像10000.0155000.010.00550 100 150 200 2500 50 100150 200 250灰 度 值5000elain3 直 方图 ( 调 用 imhist 函 数 )0.1elain3 直 方 图 (自 己 编 写 )45000.094000 0.08 35000.073000度 0.062500密率2000概 0.05的1500素 0.04像10000.035000.020.010 50 100 150 200 2500 50 100150 200 250灰 度 值lena.bmp5000lena1 直 方 图 ( 调 用 imhist 函 数 )0.1lena1 直 方 图 ( 自 己 编 写 )45000.09 4000 0.08 35000.073000度 0.062500密率2000概 0.05的1500 素 0.04像10000.035000.020.0150 100 150 200 2500 50 100150 200 250灰 度 值5000lena2 直 方 图 ( 调 用 imhist 函 数 )0.1lena2 直 方 图 ( 自 己 编 写 )45000.094000 0.08 35000.073000度 0.062500 密率 0.05概2000的 0.041500素像10000.035000.020.0150 100 150 200 2500 50 100150 200 250灰 度 值5000lena3 直 方 图 ( 调 用 imhist 函 数 )lena3 直 方图 ( 自 己 编 写 )0.0245000.01840000.01635000.0143000度 0.0122500密率0.012000概的1500素 0.008像10000.0065000.0040.0020 50 100 150 200 2500 50 100150 200 250灰 度 值woman.bmpx 10 5 21.81.61.41.210.80.60.40.25x 10 21.81.6woman1 直方图(调用 imhist 函数)woman1直方图(自己编写)0.020.0180.0160.014度0.012密率概 0.01的素 0.008像0.0060.0040.0025010015020025050100150200250灰度值woman2 直方图(调用 imhist 函数)woman2直方图(自己编写)0.040.0351.40.03 1.2度 0.0251密率0.02概0.8的0.6素0.015像0.40.01 0.20.005 0050100150200250050100150200250 0灰度值( 3)结果分析及总结:本文分别采用imhist 函数和自己编写的程序求取图像的直方图。

(完整版)数字图像处理大作业

(完整版)数字图像处理大作业

数字图像处理1.图像工程的三个层次是指哪三个层次?各个层次对应的输入、输出对象分别是什么?①图像处理特点:输入是图像,输出也是图像,即图像之间进行的变换。

②图像分割特点:输入是图像,输出是数据。

③图像识别特点:以客观世界为中心,借助知识、经验等来把握整个客观世界。

“输入是数据,输出是理解。

2.常用的颜色模型有哪些(列举三种以上)?并分别说明颜色模型各分量代表的意义。

①RGB(红、绿、蓝)模型②CMY(青、品红、黄)模型③HSI(色调、饱和度、亮度)模型3.什么是图像的采样?什么是图像的量化?1.采样采样的实质就是要用多少点来描述一幅图像,采样结果质量的高低就是用前面所说的图像分辨率来衡量。

简单来讲,对二维空间上连续的图像在水平和垂直方向上等间距地分割成矩形网状结构,所形成的微小方格称为像素点。

一副图像就被采样成有限个像素点构成的集合。

例如:一副640*480分辨率的图像,表示这幅图像是由640*480=307200个像素点组成。

2.量化量化是指要使用多大范围的数值来表示图像采样之后的每一个点。

量化的结果是图像能够容纳的颜色总数,它反映了采样的质量。

针对数字图像而言:采样决定了图像的空间分辨率,换句话说,空间分辨率是图像中可分辨的最小细节。

量化决定了图像的灰度级,即指在灰度级别中可分辨的最小变化。

数字图像处理(第三次课)调用图像格式转换函数实现彩色图像、灰度图像、二值图像、索引图像之间的转换。

图像的类型转换:对于索引图像进行滤波时,必须把它转换为RGB图像,否则对图像的下标进行滤波,得到的结果是毫无意义的;2.用MATLAB完成灰度图像直方图统计代码设计。

6789101112131415161718192021222324252627282930title('lady-lenna');if isrgb(a);b=rgb2gray(a);%RGB转换为灰度图像endsubplot(2,2,2);imshow(b);%显示图像title('ladygaga-lenna');[m,n]=size(a);%返回图像大小e=zeros(1,256);for k=0:255for i=1:mfor j=1:nif a(i,j)==ke(k+1)=e(k+1)+1;%灰度值相同的进行累加endendendendsubplot(2,2,4);bar(e);%画图像的灰度直方图title('灰度直方图');c=imrotate(a,20);%图像的旋转subplot(2,2,3);imshow(c);数字图像处理(第四次课)编写matlab函数,实现在医学图像中数字减影血管造影。

西交大数字图像处理第五次作业

西交大数字图像处理第五次作业

数字图像处理第五次作业姓名:班级:学号:提交日期:2015年4月13日1、频域低通滤波器:设计低通滤波器包括 butterworth and Gaussian (选择合适的半径,计算功率谱比),平滑测试图像test1和test2; (1)问题分析:1)频率域滤波步骤:①给定一幅大小为M ×N 的输入图像f (x ,y ),确定填充参数,典型的选取P=2M 和Q=2N ; ②对f (x ,y )添加必要数量的0,形成大小为P ×Q 的填充后的图像fp (x ,y ); ③用(-1)^(x+y)乘以fp (x ,y )移到其变换中心; ④计算来自步骤3的图像的DFT ,得到F(u,v);⑤生成一个实的、对称的滤波函数H(u,v),其大小为P ×Q ,中心在(P/2,Q/2)处,用阵 列相乘形成乘积G(u,v)=H(u,v)F(u,v);即G(i,k)=H(i,k)F(i,k); ⑥得到处理后的图像:1g (x,y){real[[G(u,v)]]}(1)x yp -+=ℑ-其中,为忽略由于计算不准确导致的寄生复分量,选择了实部,下标p 指出我们处理的 是填充后的阵列。

⑦通过从gp(x,y)的左上象限提取M ×N 区域,得到最终的处理结果个g(x,y)。

2)布特沃斯低通滤波器:截止频率位于距原点D0处的n 阶布特沃斯低通滤波器(BLPF )的传递函数定义为201(u,v)1[D(u,v)/D ]n H =+其中221/2(u,v)[(u /2)(v Q/2)]D P =-+-BLPF 传递函数并没有在通过频率和滤除频率之间给出明显截止的尖锐的不连续性。

对 于具有平滑传递函数的滤波器,可在这样一点定义截止频率,即使得H(u,v)下降到其最大值的某个百分比点。

对于上式,截止频率点是当D(u,v)=D0时的点,即H(u,v)从其最大值1下降为50%。

3)高斯低通滤波器:22(u,v)/2D (u,v)eD H -=其中,D(u,v)是距离频率域矩形中心的距离。

西安交大数字图像处理第一次作业.

西安交大数字图像处理第一次作业.

数字图像处理第一次作业姓名:班级:学号:提交日期:2015年3月13日摘要本次报告首先简单阐述了BMP图像格式及其相关数据结构,随后主要完成了作业要求中关于图像处理与计算的各项任务。

本次作业以Matlab 2014为平台,通过对lena.bmp,elain.bmp图像文件的编程处理,分别得到了lena.bmp图像的8到1级灰度逐级递减显示,lena.bmp图像的均值和方差,通过近邻、双线性和双三次插值法对lena.bmp进行4倍放大后得到的2048×2048尺寸图像,和对lena.bmp、elain.bmp图像分别进行水平偏移变换和旋转变换后的图像及其4倍插值放大图像。

以上任务完成后均得到了预期的结果。

1.Bmp图像格式简介。

1.1 BMP格式概述BMP(全称Bitmap)是Windows操作系统中的标准图像文件格式,可以分成两类:设备相关位图(DDB)和设备无关位图(DIB),使用非常广。

它采用位映射存储格式,除了图像深度可选以外,不采用其他任何压缩,因此,BMP文件所占用的空间很大。

BMP文件的图像深度可选lbit、4bit、8bit及24bit。

BMP文件存储数据时,图像的扫描方式是按从左到右、从下到上的顺序。

1.2 BMP格式组成典型的BMP图像文件由四部分组成:(1)位图头文件数据结构,它包含BMP图像文件的类型、显示内容等信息;(2)位图信息数据结构,它包含有BMP图像的宽、高、压缩方法,以及定义颜色等信息;(3)调色板,这个部分是可选的,有些位图需要调色板,有些位图,比如真彩色图(24位的BMP)就不需要调色板;(4)位图数据,这部分的内容根据BMP位图使用的位数不同而不同,在24位图中直接使用RGB,而其他的小于24位的使用调色板中颜色索引值。

1.3 BMP格式对应数据结构BMP文件由文件头、位图信息头、颜色信息和图形数据四部分组成。

1.3.1 BMP文件头(14字节)BMP文件头数据结构含有BMP文件的类型、文件大小和位图起始位置等信息。

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

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

20XX年上学期《数字图像处理》复习大作业及参考答案=====================================================一、选择题(共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、利用平滑滤波器可对图像进行低通滤波,消除噪声,但同时模糊了细节。

数字图像处理期末大作业

数字图像处理期末大作业

数字图像处理期末大作业一、问题描述实现第十章中采用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. 图像处理与计算机图形学的区别与联系是什么?答:数字图像处理,是指有计算机及其它有关的数字技术,对图像施加某种运算和处理,从而达到某种预期的目的,而计算机图形学是研究采用计算机生成,处理和显示图形的一门科学。

两者区别:(1)研究对象不同,计算机图形学研究的研究对象是能在人的视觉系统中产生视觉印象的事物,包括自然景物,拍摄的图片,用数学方法描述的图形等,而数字图像处理研究对象是图像;(2)研究内容不同,计算机图像学研究内容为图像生成,透视,消阴等,而数字图像处理研究内容为图像处理,图像分割,图像透析等;(3)研究过程不同,计算机图像学是由数学公式生成仿真图形或图像,而数字图像处理是由原始图像处理出分析结果,计算机图形与图像处理是逆过程。

两者的联系:图像处理需图形学的交互手段,图形学需要图像处理合成图像,两者有重叠。

2. 图像数字化过程中的失真有那些原因?就在减少图像失真和减少图像的数据量两者之间如何取得平衡,谈谈个人的看法。

答:图像数字化过程中失真的原因主要来自三个方面:一.采样频率太低,即未满足采样定理而造成的失真;二.外部和内部噪声的影响,例如外部的电磁波、机械运动等;三.用有限个灰度值表示自然界无限连续的灰度值必然造成失真,为了减小失真必然增加采样点,即增加图像数据量。

在减少图像失真和减少图像的数据量两者之间取得平衡,要根据图像需求保留有用信息,如军事图像只需保留反应地形地貌及目标的信息,普通照片只需满足视觉要求即可。

3. 一幅模拟彩色图像经平板扫描仪扫描后获得一幅彩色数字图像,其分辨率为1024×768像素。

若采用RGB彩色空间,红、绿、蓝三基色的灰度等级为8比特,在无压缩的情况下,在计算机中存储该图像将占用多少比特的存储空间?当用Photoshop图像处理软件去掉图像的彩色信息,只留下灰度信息,灰度等级为4比特,在无压缩的情况下,存储该图像将占用多少字节的存储空间?答:(1)采用RGB彩色空间,红、绿、蓝三基色的灰度等级为8比特,在无压缩的情况下,占存储空间大小为:1024×768×8×3=18874268bit=2.25MB(2)去掉彩色信息,只留下灰度信息,灰度等级为4比特,在无压缩的情况下,所占的存储空间大小为:1024×768×4 =3145728bit=0.375MB4. 试设计一个程序实现nn 的中值滤波器,当模板中心移过图像中每个位置时,设计一种简便的中值更新方法。

数字图像处理作业答案

数字图像处理作业答案

1 大作业题目1.问答题1.1连续图像f(x.y)和数字图像I(r,c)中各分量的含义是什么?他们有什么联系和区别?取值范围在什么范围?答:f(x,y)表示二维图像在空间XY中一个坐标点的位置(实际图像的尺寸是有限的,所以x和y的取值也是有限的),即f(x,y)中的x,y分别代表一个点连续图像中的x轴和y轴的坐标,而f则代表图像在点(x,y)的某种性质F的数值(实际图像中各个位置上所具有的性质F的取值也是有限的,所以F得取值也是有限的)。

F,x,y的值可以是任意实数。

图像在点(x,y)也可以有多重性质,此时可用矢量f来表示。

数字图像I(r,c)表示位于图像矩阵上第r行,第c列的元素幅值。

其中I,c,r的值都是整数。

I(r,c)是通过对f(x,y)抽样和量化得来的,f(x,y)各量是连续的,I(r,c)各量是离散的,这里的I代表离散化后的f,(r,c)代表离散化后的(x,y),r,c分别有连续图像中的x,y分别采样得到的;x,y可以取所有的非负数,r,c可以取所有的非负整数。

1.2 发光强度及亮度、照度各有什么不同?答:1)发光强度,单位坎德拉,即cd。

定义:光源在给定方向的单位立体角中发射的光通量定义为光源在该方向的发光强度。

解释:发光强度是针对点光源而言的,或者发光体的大小与照射距离相比比较小的场合。

这个量是表明发光体在空间发射的会聚能力的。

可以说,发光强度就是描述了光源到底有多“亮”,因为它是光功率与会聚能力的一个共同的描述。

发光强度越大,光源看起来就越亮,同时在相同条件下被该光源照射后的物体也就越亮,因此,早些时候描述手电都用这个参数。

常见光源发光强度:太阳,2.8E27cd,高亮手电,10000cd,5mm超高亮LED,15cd。

2)亮度,单位尼特,即nt。

定义:单位光源面积在法线方向上,单位立体角内所发出的光流。

解释:这个是最容易被误解的概念了。

亮度是针对光源而言,而且不是对点光源,是对面光源而言的。

数字图像处理第四次作西安交大

数字图像处理第四次作西安交大

数字图像处理第四次作业姓名:班级:学号:提交日期:摘要本次作业学习了空域滤波器的使用,并且学习了如何产生高斯函数。

通过对实验结果的分析可以发现高斯函数对于细小的噪声优化效果较好,而中值滤波对于大噪声也有一定的优化效果。

而后面的边缘提取作业,很明显的可以看出使用Canny算子的图片处理效果要好很多,虽然仍旧存在边缘不连续的问题,但是整体的边缘已经提取了出来。

一、空域低通滤波器:分别用高斯滤波器和中值滤波器去平滑测试图像test1和2,模板大小分别是3x3 ,5x5 ,7x7;(利用固定方差sigma=1.5产生高斯滤波器)(一)中值滤波器:一个数值集合的中值n是这样的数值,即数值集合中有一半小于或等。

于n,还有一半大于或等于n。

为了对一幅图像上的某点进行中值滤波处理,首先将领域内的像素分类排序,确定其中值,并将中值赋予滤波后图像中的相应像素点。

这样,中值滤波器的主要公式是使拥有不同灰度的点看起来更接近于它的相邻点。

事实上,我们使用mxm中值滤波器来去除那些相对于其领域像素更亮或更暗并且其区域小于m^2/2(滤波区域的一半)的鼓励像素族。

在这种情况下,“去除”的意思是强制为领域的中值灰度。

较大的族所受到的影响明显较小。

程序运行结果:结果观察:通过运行结果可以看出从处理后的图像看,图像的平滑效果较为明显,且受窗口的影响,窗口越大,平滑效果越明显,图像细节越模糊,尤其是test2中人脸图像的眼睛部分,随着滤波器模板的增大,可以明显的感受到图像模糊的效果。

这三个模板中,感觉5x5的模板滤波效果最好。

(二)高斯滤波器:(1)二维高斯函数具有旋转对称性,即滤波器在各个方向上的平滑程度是相同的。

一般来说,一幅图像的边缘方向是事先不知道的,因此,在滤波前是无法确定一个方向上比另一方向上需要更多的平滑.旋转对称性意味着高斯平滑滤波器在后续边缘检测中不会偏向任一方向。

(2)高斯函数是单值函数。

这表明,高斯滤波器用像素邻域的加权均值来代替该点的像素值,而每一邻域像素点权值是随该点与中心点的距离单调增减的。

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

数字图像处理目录作业一 (1)一作业要求 (1)二源代码 (1)三运行结果 (3)作业二 (5)一作业要求 (5)二算法描述 (5)三源代码 (7)四运行结果 (10)作业一一作业要求在图像的空间域滤波操作中,会出现有部分掩膜矩阵在图像外面的情况,所以需要给图像先加入一个边界,执行完操作之后,再去掉这个边界,保证图像中所有的像素都参与矩阵运算。

二源代码byte[,] filter(byte[,]f,float[,]mask){int w = f.GetLength(0);int h = f.GetLength(1);byte[,] g = new byte[w,h];int M = mask.GetLength(0)/2;int N = mask.GetLength(1)/2;for (int y=N;y<h-N;y++)for (int x=M;x<w-M;x++){float s = 0;for (int m=-M;m<=M;m++)for (int n=-N;n<=N;n++)s+=f[x+m,y+n]*mask[M+m,N+n];g[x,y] = SByte(s);}return g;}byte SByte(double v){if (v>255) return 255;if (v<0) return 0;return (byte)v;}float[,] averagingMask(int M,int N){float[,] mask = new float[2*M+1,2*N+1];for (int m=-M;m<=M;m++)for (int n=-N;n<=N;n++)mask[M+m,N+n] = 1.0f/((2*M+1)*(2*N+1));return mask;}byte[,] addboard(byte[,] f,int M,int N){int w=f.GetLength(0);int h=f.GetLength(1);int gw=w+2*M;int gh=h+2*N;byte[,] g=new byte[gw,gh];//add top board and bottom boardfor(int i=0;i<N;i++)for(int j=0;j<w;j++)g[M+j,i]=f[j,0];for(int i=0;i<N;i++)for(int j=0;j<w;j++)g[M+j,i+h+N]=f[j,h-1];//copy the imagefor(int i=0;i<w;i++)for (int j=0;j<h;j++)g[i+M,j+N]=f[i,j];//add left and right boardfor(int i=0;i<M;i++)for (int j=0;j<gh;j++)g[i,j]=g[M,j];for(int i=0;i<M;i++)for (int j=0;j<gh;j++)g[w+M+i,j]=g[gw-1-M,j];return g;}byte[,] removeboard(byte[,]f,int M,int N){int w=f.GetLength(0);int h=f.GetLength(1);int gw=w-2*M;int gh=h-2*N;byte[,] g=new byte[gw,gh];for(int i=0;i<gw;i++)for(int j=0;j<gh;j++)g[i,j]=f[i+M,j+N];return g;}void main(){byte[,] f = LoadImg();ShowImg("f",f);int w=f.GetLength(0);int h=f.GetLength(1);int M=10,N=20;int gw=w-2*M;int gh=h-2*N;byte[,] boardimage=new byte[gw,gh];byte[,] filterimage=new byte[gw,gh];boardimage=addboard(f,M,N);ShowImg("boardimage",boardimage);filterimage=filter(boardimage,averagingMask(M,N));ShowImg("result",removeboard(filterimage,M,N)); }三运行结果原图像:加边界之后的图像:均值滤波并且去除边界的图像:作业二一作业要求给定图像与处理结果,如图一所示,思考算法并编程实现。

图一左边为原图,右边为处理结果二算法描述Compare the result and the original image, we can see that the program change thecontrast of image and enhance the edge of Lena. Consider using intensity transform and Sobel edge detection to achieve the goal. After many experiments, I choose following intensity transform function.y0.25110x=+The graph of this function is Fig 1.Fig 1 Graph of intensity transform functionUse Sobel to detect the edge of the original image.Sobel in x direction can be written as the following transform matrix:SobleX=101 202 101 -⎡⎤⎢⎥-⎢⎥⎢⎥-⎣⎦Similar, Sobel in y direction can be written as the following transform matrix:SobleY=121 000 121 ---⎡⎤⎢⎥⎢⎥⎢⎥⎣⎦We can use SobelX and SobelY to compute the gradient image.f=f is the value of pixels in the gradient image,xg is the value of pixels in imageprocessed by SobelX, andyg is the value of pixels in image processed by SobelY. In order to decrease noise, I use the following function to process gradient image:70after before f f =-After processing, I use 0 to replace these negative values.Because the gradient image has a very high contrast, so I use intensity transform again.0.22after before f f =After that, the final result can be calculated:result y f =-All the function is chosen through experiment, maybe the result isn’t the same with the teacher’s result, but it’s very similar.三 源代码byte[,] filter(byte[,]f,float[,]mask){int w = f.GetLength(0);int h = f.GetLength(1);int M = mask.GetLength(0)/2;int N = mask.GetLength(1)/2;byte[,] g = new byte[w,h];for (int y=N;y<h-N;y++)for (int x=M;x<w-M;x++){float r = 0;for (int m=-M;m<=M;m++)for (int n=-N;n<=N;n++){r+=f[x+m,y+n]*mask[M+m,N+n];}g[x,y]=S(r);}return g;}byte[,] SobelX(byte[,]f){float[,] mask = new float[3,3];mask[0,0]=-1; mask[1,0] = 0; mask[2,0] = 1;mask[0,1]=-2; mask[1,1] = 0; mask[2,1] = 2;mask[0,2]=-1; mask[1,2] = 0; mask[2,2] = 1;return filter(f,mask);}byte[,] SobelY(byte[,]f){float[,] mask = new float[3,3];mask[0,0]=-1; mask[1,0] = -2; mask[2,0] =-1;mask[0,1]= 0; mask[1,1] = 0; mask[2,1] = 0;mask[0,2]= 1; mask[1,2] = 2; mask[2,2] = 1;return filter(f,mask);}byte S(double f){if(f>255) return 255;if(f<0) return 0;return (byte)f;}byte[,] Scale(byte[,]f,double a){int w = f.GetLength(0);int h = f.GetLength(1);for(int i=0;i<w;i++)for(int j=0;j<h;j++)f[i,j]=(byte)(f[i,j]*a);return f;}byte[,] Subnum(byte[,]f,int a){int w = f.GetLength(0);int h = f.GetLength(1);for(int i=0;i<w;i++)for(int j=0;j<h;j++)f[i,j]=S((f[i,j]-a));return f;}byte[,] Sub(byte[,]f,byte[,]g){int w = f.GetLength(0);int h = f.GetLength(1);byte[,] p = new byte[w,h];for(int x=0;x<w;x++)for(int y=0;y<h;y++)p[x,y]=S(f[x,y]-g[x,y]);return p;}byte[,] Mix(byte[,]fx,byte[,]fy){int w = fx.GetLength(0);int h = fx.GetLength(1);byte[,] g = new byte[w,h];for (int y=0;y<h;y++)for (int x=0;x<w;x++){float px =(fx[x,y]);float py =(fy[x,y]);g[x,y] = S(Sqrt(px*px+py*py));}return g;}byte[,] IntensityTransform(byte[,]f){int w = f.GetLength(0);int h = f.GetLength(1);byte[,] g = new byte[w,h];for(int i=0;i<w;i++)for(int j=0;j<h;j++)g[i,j] = S(0.25*f[i,j]+110);return g;}void main(){byte [,] I = LoadImg();ShowImg("Original",I);byte [,] I1 = IntensityTransform(I);ShowImg("IntensityTransform",I1);byte [,] I2 = SobelX(I);byte [,] I3 = SobelY(I);byte [,] I4 = Mix(I2,I3);ShowImg("Gradient",I4);byte [,] I5=Subnum(I4,70);ShowImg("DecreaseNoise",I5);byte [,] I6=Scale(I5,0.22);ShowImg("Scale",I6);byte [,] I7 = Sub(I1,I6);ShowImg("FinalResult",I7);}四运行结果原图像:灰度变换之后的图像:Sobel算子提取到的边缘图像:降低噪声之后的边缘图像:改变提取到的边缘的亮度之后得到的图像:最终结果:。

相关文档
最新文档