数字图像处理课程大作业报告李锐彬、余胜鑫
数字图像处理实验报告——图像分割实验

实验报告课程名称数字图像处理导论专业班级_______________姓名 _______________学号_______________电气与信息学院与谐勤奋求就是创新一.实验目得1.理解图像分割得基本概念;2.理解图像边缘提取得基本概念;3.掌握进行边缘提取得基本方法;4.掌握用阈值法进行图像分割得基本方法.二。
实验内容1.分别用Roberts,Sobel与拉普拉斯高斯算子对图像进行边缘检测。
比较三种算子处理得不同之处;2.设计一个检测图1中边缘得程序,要求结果类似图2,并附原理说明。
3.任选一种阈值法进行图像分割、图1 图2三.实验具体实现1.分别用Roberts,Sobel与拉普拉斯高斯算子对图像进行边缘检测。
比较三种算子处理得不同之处;I=imread(’mri、tif');imshow(I)BW1=edge(I,’roberts’);figure ,imshow(BW1),title(’用Roberts算子’)BW2=edge(I,’sobel’);figure,imshow(BW2),title(’用Sobel算子 ')BW3=edge(I,’log’);figure,imshow(BW3),title(’用拉普拉斯高斯算子’)比较提取边缘得效果可以瞧出,sober算子就是一种微分算子,对边缘得定位较精确,但就是会漏去一些边缘细节.而Laplacian—Gaussian算子就是一种二阶边缘检测方法,它通过寻找图象灰度值中二阶过零点来检测边缘并将边缘提取出来,边缘得细节比较丰富。
通过比较可以瞧出Laplacian-Gaussian算子比sober算子边缘更完整,效果更好。
2.设计一个检测图1中边缘得程序,要求结果类似图2,并附原理说明.i=imread('m83、tif’);subplot(1,2,1);imhist(i);title('原始图像直方图');thread=130/255;subplot(1,2,2);i3=im2bw(i,thread);imshow(i3);title('分割结果’);3.任选一种阈值法进行图像分割、i=imread('trees、tif’);subplot(1,2,1);imhist(i);title('原始图像直方图’);thread=100/255;subplot(1,2,2);i3=im2bw(i,thread);imshow(i3);title('分割结果’)1、分别用Roberts,Sobel与拉普拉斯高斯算子对图像进行边缘检测。
《数字图像处理》期末大作业

《数字图像处理》期末大作业大作业题目及要求:一、题目:本门课程的考核以作品形式进行。
作品必须用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。
数字图像处理大作业报告

数字图像处理实验报告实验选题:选题二组员:学号:班级:指导老师:实验日期: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类的构成等。
数字图像处理大作业

2
项目背景:
图像作为人类感知世界的视觉基础,是人类获取信息、表达信息和传递信息 的重要手段。数字图像处理,即用计算机对图像进行分析,以达到所需结果的技 术。首先数字图像处理技术可以帮助人们更客观、准确地认识世界,人的视觉系 统可以帮助人类从外界获取 3/4 以上的信息,而图像、图形又是所有视觉信息的 载体,尽管人眼的鉴别力很高,可以识别上千种颜色,但很多情况下,图像对于 人眼来说是模糊的甚至是不可见的,通过图象增强技术,可以使模糊甚至不可见 的图像变得清晰明亮。 介于本次软件开发的可重用性和可移植性,本次开发摒弃常用的 MFC 框架, 使用 Qt 跨平台应用程序框架。 Qt 是 1991 年奇趣科技开发的一个跨平台的 C++图形用户界面应用程序框架。 它提供给应用程序开发者建立艺术级的图形用户界面所需的所有功能。Qt 很容 易扩展,并且允许真正地组件编程。基本上,Qt 同 X Window 上的 Motif, Openwin,GTK 等图形界面库和 Windows 平台上的 MFC,OWL,VCL,ATL 是同 类型的东西。但 Qt 最主要区别于以上平台的特性便是跨平台,使用同一套代码 可以很容易的在另一个系统平台上编译生成一个可用的应用程序。
知识背景:
BMP(全称 Bitmap)是 Windows 操作系统中的标准图像文件格式,可以分成 两类:设备相关位图(DDB)和设备无关位图(DIB) 。DDB 位图在早期的 Windows 系统(Windows 3.0 以前)中是很普遍的,事实上它也是唯一的。然而,随着显 示器制造技术的进步,以及显示设备的多样化,DDB 位图的一些固有的问题开始 浮现出来了。比如,它不能够存储(或者说获取)创建这张图片的原始设备的分 辨率, 这样, 应用程序就不能快速的判断客户机的显示设备是否适合显示这张图 片。为了解决这一难题,微软创建了 DIB 位图格式。当下我们使用的 BMP 位图几 乎都是设备无关位图, 本软件也只是对 DIB 位图进行处理。下文中所述 BMP 位图 或者位图都是指设备无关位图。 BMP 文件总体上由 4 部分组成,分别是位图文件头、位图信息头、调色板和 图像数据,如表 1 所示。 表 1 BMP 文件的组成结构 位图文件头(bitmap-file header) பைடு நூலகம்图信息头 (bitmap-information header) 彩色表/调色板(color table)
数字图像处理实验报告

数字图像处理实验报告⼆○⼀⼋~⼆○⼀九学年第⼀学期信息科学与⼯程学院课程设计报告书课程名称:数字图像处理班级:学号:姓名:指导教师:⼆○⼀⼋年⼗⼆⽉⼀、课程设计⽬的:1. 掌握读、写、显⽰图像的基本⽅法。
2. 掌握图像直⽅图的概念、计算⽅法以及直⽅图归⼀化、均衡化⽅法。
3. 掌握图像灰度变换的基本⽅法,理解灰度变换对图像外观的改善效果。
⼆、课程设计内容及要求:1. 读⼊⼀幅图像,判断其是否为灰度图像,如果不是灰度图像,将其转化为灰度图像。
2. 完成灰度图像的直⽅图计算、直⽅图归⼀化、直⽅图均衡化等操作。
3. 完成灰度图像的灰度变换操作,如线性变换、伽马变换、阈值变换(⼆值化)等,分别使⽤不同参数观察灰度变换效果(对灰度直⽅图的影响)。
三、详细设计步骤:1、所使⽤的图像⽂件都保存在Matlab 安装⽬\toolbox\images\imdemos⼦⽬录下。
2、图像的读、写、显⽰操作。
运⽤Matlab 图像处理⼯具箱中的imread函数分别读⼊灰度图像pout.tif、⼆值图像blobs.png 和RGB 图像peppers.png,观察相应的图像矩阵,并运⽤imshow 函数显⽰相应图像。
3、对⼀个RGB 彩⾊图像peppers.png,分别抽取其R、G、B 三个分量层,并显⽰各层图像。
1、以灰度图像pout.tif 为例,运⽤灰度变换法实现图像增强。
2、运⽤Matlab 编程实现灰度直⽅图的统计以及直⽅图均衡化处理过程:(1)计算并绘制原始图像的灰度直⽅图;(2)根据离散累计分布函数,对原始灰度直⽅图进⾏均衡化处理,绘制均衡化后的灰度直⽅图;(3)⽣成均衡化处理后的新图像,显⽰并保存。
(4)⽐较原始图像和新图像的对⽐度。
(1)利⽤Matlab 函数IMNOISE(),在原图上分别叠加⾼斯噪声和椒盐噪声(2)实现均值滤波和中值滤波的功能,去除噪声;(3)调整窗⼝⼤⼩,采⽤对⽐均值滤波中值滤波的性能;1、以灰度图像rice.png 为例,实现Roberts 算⼦、Sobel 算⼦、Prewitt算⼦对其进⾏边缘检测,并实现根据梯度⽣成 5 种不同的增强图像。
数字图像处理-实验报告

数字图像处理-实验报告(理工类)课程名称:数字图像处理专业班级:电子信息工程学生学号:学生姓名:所属院部:电子信息工程指导教师:周洪成20 16 ——20 17 学年第 1 学期金陵科技学院教务处制实验报告书写要求实验报告原则上要求学生手写,要求书写工整。
若因课程特点需打印的,要遵照以下字体、字号、间距等的具体要求。
纸张一律采用A4的纸张。
实验报告书写说明实验报告中一至四项内容为必填项,包括实验目的和要求;实验仪器和设备;实验内容与过程;实验结果与分析。
各院部可根据学科特点和实验具体要求增加项目。
填写注意事项(1)细致观察,及时、准确、如实记录。
(2)准确说明,层次清晰。
(3)尽量采用专用术语来说明事物。
(4)外文、符号、公式要准确,应使用统一规定的名词和符号。
(5)应独立完成实验报告的书写,严禁抄袭、复印,一经发现,以零分论处。
实验报告批改说明实验报告的批改要及时、认真、仔细,一律用红色笔批改。
实验报告的批改成绩采用百分制,具体评分标准由各院部自行制定。
实验报告装订要求实验批改完毕后,任课老师将每门课程的每个实验项目的实验报告以自然班为单位、按学号升序排列,装订成册,并附上一份该门课程的实验大纲。
实验项目名称: 2、图像增强实验学时: 2 同组学生姓名:实验地点: A205 实验日期: 2016年11月08日实验成绩:批改教师:周洪成批改时间:一、实验目的和要求1掌握灰度直方图的概念及其计算方法;2熟练掌握直力图均衡化和直方图规定化的计算过程;3熟练掌握空域滤波中常用的平滑和锐化滤波器;4掌握色彩直方图的概念和计算方法;5利用MATLAB程序进行图像增强;6了解频域高频和低频滤波器对图象处理的效果。
7平滑:平滑的目的是模糊和消除噪声。
平滑是用低通滤波器来完成,在空域中全是正值;8锐化:锐化的目的是增强被模糊的细节。
锐化是用高通滤波器来完成,在空域中,接近原点处为正,在远离原点处为负。
二、实验仪器和设备1计算机;2 MATLAB程序;3移动式存储器(软盘、U盘等)。
(完整版)数字图像处理大作业
数字图像处理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函数,实现在医学图像中数字减影血管造影。
数字图像处理大作业要点
数字图像处理实验报告学院:信息学院专业:电科1004班姓名:学号:辅导老师:完成日期: 2013年6月29日空域图像增强实验要求:(1)选择若干图像(两幅以上),完成直方图均衡化。
(2)选择若干图像(两幅以上),对图像文件分别进行均值滤波、中值滤波和拉普拉斯锐化滤波操作。
(3)添加噪声,重复上述过程观察处理结果。
实验原理:(1)图像增强是图像处理的基本内容之一,图像增强是指按特定的需要突出一幅图像中的某些信息,同时削弱或去除某些不需要信息的处理方法,其目的是使得处理后的图像对某种特定的应用,比原始图像更合适。
处理的结果使图像更适应于人的视觉特性或机器的识别系统。
图像增强主要可分为三类:频域图像增强方法、小波域图像增强方法、空域图像增强方法。
(2)空域图像增强主要包括:直方图均衡化、平滑滤波和锐化滤波等方法。
(3)直方图均衡化是图像处理领域中利用图像直方图对对比度进行调整的方法。
这种方法通常用来增加许多图像的局部对比度,尤其是当图像的有用数据的对比度相当接近的时候。
通过这种方法,亮度可以更好地在直方图上分布。
这样就可以用于增强局部的对比度而不影响整体的对比度,直方图均衡化通过有效地扩展常用的亮度来实现这种功能。
直方图均衡化的基本思想是把原始图的直方图变换为均匀分布的形式,这样就增加了象素灰度值的动态范围从而可达到增强图像整体对比度的效果。
(4)平滑滤波是低频增强的空间域滤波技术。
它的目的有两类:一类是模糊;另一类是消除噪音。
空间域的平滑滤波一般采用简单平均法进行,就是求邻近像元点的平均亮度值。
(5)均值滤波是典型的线性滤波算法,它是指在图像上对目标像素给一个模板,该模板包括了其周围的临近像素(以目标象素为中心的周围8个象素,构成一个滤波模板,即去掉目标象素本身)。
再用模板中的全体像素的平均值来代替原来像素值。
均值滤波也称为线性滤波,其采用的主要方法为邻域平均法。
线性滤波的基本原理是用均值代替原图像中的各个像素值,即对待处理的当前像素点(x,y),选择一个模板,该模板由其近邻的若干像素组成,求模板中所有像素的均值,再把该均值赋予当前像素点(x,y),作为处理后图像在该点上的灰度个g(x,y),即个g(x,y)=1/m ∑f(x,y) m为该模板中包含当前像素在内的像素总个数。
数字图像处理实验报告——图像增强实验
实验报告课程名称数字图像处理导论专业班级_______________姓名_______________学号_______________电气与信息学院和谐勤奋求是创新2.编写函数w = genlap lacia n(n),自动产生任一奇数尺寸n的拉普拉斯算子,如5×5的拉普拉斯算子w = [ 1 1 1 1 11 1 1 1 11 1 -24 1 11 1 1 1 14.采用不同的梯度算子对b lurry_moon.tif进行锐化滤波,并比较其效果。
[I,m ap]=im read('trees.tif');I=double(I);subplo t(2,3,1)imshow(I,m ap);title(' Original Im age');[Gx,Gy]=gradie nt(I); % gradie n t calcul ationG=sqrt(Gx.*Gx+Gy.*Gy); % matrixJ1=G; % gradie nt1subplo t(2,3,2)imshow(J1,m ap);title(' Operator1 Im age');J2=I; % gradie nt2 K=find(G>=7);J2(K)=G(K);subplo t(2,3,3)im show(J2,m ap);title(' Operator2 Im age');J3=I; % gradie n t3 K=find(G>=7);J3(K)=255;subplo t(2,3,4)im show(J3,m ap);title(' Operator3 Im age');J4=I; % gradie n t4 K=find(G<=7);J4(K)=255;subplo t(2,3,5)im show(J4,m ap);title(' Operator4 Im age');J5=I; % gradie nt5 K=find(G<=7);J5(K)=0;Q=find(G>=7);J5(Q)=255;subplo t(2,3,6)im show(J5,m ap);title(' Operator5 Im age');5.自己设计锐化空间滤波器,并将其对噪声图像进行处理,显示处理后的图像;附录:可能用到的函数和参考结果**************报告里不能用参考结果中的图像1)采用3×3的拉普拉斯算子w = [ 1, 1, 1; 1 – 8 1; 1, 1, 1]滤波I=im read('moon.tif');T=double(I);subplo t(1,2,1),im show(T,[]);title('Origin al Im age');w =[1,1,1;1,-8,1;1,1,1];K=conv2(T,w,'sam e');subplo t(1,2,2)im show(K);title('Laplacian Transf orm ation');图2.9 初始图像与拉普拉斯算子锐化图像2)编写函数w = genlap lacia n(n),自动产生任一奇数尺寸n的拉普拉斯算子,如5×5的拉普拉斯算子:w = [ 1 1 1 1 11 1 1 1 11 1 -24 1 11 1 1 1 11 1 1 1 1]functi on w = genlap lacia n(5)%Com put es the Laplac ian operat orw = ones(n);x = ceil(n/2);w(x, x) = -1 * (n * n - 1);3)分别采用5×5,9×9,15×15和25×25大小的拉普拉斯算子对blurry_mo on.tif进行锐化滤波,并利用式完成图像的锐化增强,观察其有何不同,要求在同一窗口中显示。
数字图像处理实验报告
数字图像处理实验报告实验报告课程名称:图像技术实验名称:数字图像处理综合实验院(系):专业班级:姓名:学号:指导教师:⼀、实验⽬的:(1)、实验类型:综合性实验;(2)、了解图像技术软件如matlab,ERDAS的软硬件环境、数据采集;(3)、初步掌握图像技术软件的基本操作技能;(4)、能够熟练的操作matlab,ERDAS软件,并能应⽤该软件进⾏简单的图像处理和;(5)、掌握产品的输出设计。
⼆、实验主要仪器设备,器材,药品,软件等(1)软件准备:matlab7.0,ERDASIMAGINE9.2(2)硬件准备:PC机512M内存,32M显卡(最低)(3)资料准备:天津地区1999年,2005年的TM和分辨率为10⽶的SPOT 影像图三、实验原理和内容:(1)实验题⽬:数字图像图像处理综合实验(2)具体要求:应⽤matlab软件或erdas软件对lena图像和1999,2005年天津地区遥感影像做增强处理;对增强后的地图进⾏岸线提取;对1999,2005年天津地区TM图像进⾏信息提取。
(3)功能描述:窗⼝命令及功能介绍,数据的输⼊/输出,数据预处理,图像增强,监督分类(⾮监督分类),分类后处理,⽬视解译等功能。
(4)实验原理:如图所⽰影像处理技术路线及原理四、实验步骤:试验⼀,对lena图像进⾏平滑处理(1)平滑算⼦均值滤波算⼦是⼀个矩阵,各个元素均为相等的值,计算时将矩阵内对以应的象元值累加求平均以达到对图像平滑的作⽤;中值滤波是将矩阵模板中的象元值进⾏排序,然后对每个象元赋予象元中间值,达到对图像的平滑作⽤。
(2)处理结果1.均值滤波将lene.png放⼊matlaB默认路径,在编辑框中输⼊下⾯的代码对图像进⾏均值滤波,并输出滤波后的图像。
clcclear allI=imread('lena.png');J=imnoise(I,'salt & pepper',0.02); subplot(231);imshow(I);title('原图')subplot(232);imshow(J);title('添加椒盐噪声')J1=J(:,:,1);K1=filter2(fspecial('average',3),J1); K2=filter2(fspecial('average',5),J1); K3=filter2(fspecial('average',7),J1); K4=filter2(fspecial('average',9),J1); subplot(233);imshow(uint8(K1)); title('3*3模板平滑')subplot(234);imshow(uint8(K2)); title('5*5模板平滑') subplot(235);imshow(uint8(K3)); title('7*7模板平滑') subplot(236);imshow(uint8(K4)); title('9*9模板平滑')2.中值滤波clcclear allI=imread('lena.png');J=imnoise(I,'salt & pepper',0.02); subplot(131);imshow(I); title('原图')subplot(132);imshow(J);title('添加椒盐噪声')J1=J(:,:,1);K2=medfilt2(J1);subplot(133);imshow(K2,[]);title('中值滤波图像');3.理想低通滤波clear all;x=imread('lena-n.png');j=x(:,:,1);subplot(331);imshow(j);j=double(j);f=fft2(j);subplot(332);imshow(log(abs(g)),[]); color(jet(64)); [m,n]=size(f);n1=floor(m/2);n2=floor(n/2);d0=5;for i=1:mfor j=1:nd=sqrt((i-n1)^2+(j-n2)^2);if d<=d0h=1;elseh=0;endg(i,j)=h*g(i,j);endendg=ifftshift(g);g=uint8(real(ifft2(g)));subplot(333);imshow(g);g=fftshift(f);d1=15for i=1:mfor j=1:nd=sqrt((i-n1)^2+(j-n2)^2);if d<=d1h=1;elseh=0;endg(i,j)=h*g(i,j);endendg=ifftshift(g);g=uint8(real(ifft2(g)));subplot(334);imshow(g);xlabel('(d)被滤掉3.6%⾼频能量');g=fftshift(f);d2=45;for i=1:mfor j=1:nd=sqrt((i-n1)^2+(j-n2)^2);if d<=d2h=1;elseh=0;endg(i,j)=h*g(i,j);endendg=ifftshift(g);g=uint8(real(ifft2(g)));subplot(335);imshow(g);xlabel('(e)被滤掉1%⾼频能量');d3=65;for i=1:mfor j=1:nd=sqrt((i-n1)^2+(j-n2)^2);if d<=d3h=1;elseh=0;endg(i,j)=h*g(i,j);endendg=ifftshift(g);g=uint8(real(ifft2(g)));subplot(336);imshow(g);xlabel('(f)被滤掉0.6%⾼频能量');结果如下图:(3)评价结果从均值滤波得到的图像可以看出,⽤5*5模板进⾏平滑滤波效果最好,3*3的模板去除噪声的效果不是特别明显,7*7模板和9*9模板虽然去噪的效果好,但容易使原图像变模糊;中值滤波是相对较好的⼀种⽅法,不但算法简单,效果也很明显;⽤低通滤波虽然能很好的去除噪声,但算法较为复杂。