MIDTERM REPORT DIGITAL IMAGE PROCESSING canny algorithm and code

61 3 0
MIDTERM REPORT DIGITAL IMAGE PROCESSING canny algorithm and code

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

VIETNAM GENERAL CONFEDERATION OF LABOR TON DUC THANG UNIVERSITY FACULTY OF INFORMATION TECHNOLOGY MIDTERM REPORT DIGITAL IMAGE PROCESSING Canny Algorithm and Code Instructor: PHD PHAM VAN HUY Authors: NGUYENMINHNHUT– 518H0545 TRAN NHAN TAI – 518H0560 Class: 18H50203 – 18H50204 Course: 22 HO CHI MINH CITY, 2021 0 VIETNAM GENERAL CONFEDERATION OF LABOUR TON DUC THANG UNIVERSITY FACULTY OF INFORMATION TECHNOLOGY MOBILE APP DEVELOPMENT DIGITAL IMAGE PROCESSING Canny Algorithm and Code Instructor: PHD PHAM VAN HUY Authors: NGUYENMINHNHUT– 518H0545 TRAN NHAN TAI – 518H0560 Class: 18H50203 – 18H50204 Course: 22 HO CHI MINH CITY, 2021 0 i Appreciation Letter Firstly, this should be an honor to send my regards to the Faculty of Information Technology, lecturers and staff f rom all departments of Ton Duc Thang University I would like to express my sincere thanks for the support and assistance during the implementation of the statistics and probability report I would like to express my gratitude to PHD Pham Van Huy - teacher who directly instructed and supervised me to complete this essay I sincerely thank my friends and classmates who are studying and working at Ton Duc Thang University and the family has encouraged, facilitated and helped me during the process Due to the fact that my actual ability is still weak, I ensure that I still have many shortcomings, so I hope my supervisor and the other professors will ignore it At the same time, I hope to receive many comments from many sources to help me accumulate more experience to complete the upcoming graduation report to achieve better results 0 MIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.RE PORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.code MIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeM IDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.code ii THIS REPORT HAS BEEN CONDUCTED IN TON DUC THANG UNIVERSITY I assure that this is my own product and has been guided by PhD Pham Van Huy The research contents, results in this topic are all about honesty The data in the tables for analysis, comments and evaluation are collected by the me from various sources in the reference section In addition, comments and assessments as well as data from other authors or organizations are also used in the essay but with references and annotations If there is any fraud is detected, I ensure my complete responsibility for the contents of my work Ton Duc Thang University is not related to violations of authority and copyright caused by me during my work process (if any) Ho Chi Minh City, Saturday, 5th December, 2021 Authors (Sign and provide full name) Nguyen Minh Nhut Tran Nhan Tai 0 MIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.RE PORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.code MIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeM IDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.code iii VERIFICATION AND EVALUATION FROM LECTURER Supervisor’s evaluation _ _ _ _ _ _ _ Ho Chi Minh city, date: (Sign and provide full name) Marking lecturer’s evaluation _ _ _ _ _ _ _ Ho Chi Minh city, date: (Sign and provide full name) 0 MIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.RE PORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.code MIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeM IDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.code iv ABSTRACT Today life is blessed with the presence of technology and valuable inventions, one of them is camera, this one gadget is thing that you cannot go out without Then, images are things that you are able to modify and have good time with When images become extremely popular, the analysis of images has been a growing field of science and application for several decades Therefore, the ability to analyze images has been increasing One of the most well-known, classical techniques is edge detection There are various solutions for this topic such as Prewitt, Robert, Sobel, Marr Hildrith and Canny but this report we will focus on Canny edge detector and this algorithm is reacted as an efficient detector for edge extraction To make it easier to view but not try to rebuild the rest of the algorithm since “please not re-invent the wheel when it is already there for you”, we will go through all these headers below: PART 1: CANNY ALGORITHM THEORY Chapter 1: What is Edge detection? Chapter 2: Canny edge and Canny edge detection algorithm PART 2: CANNY ALGORITHM SCRIPTING Chapter 3: Canny algorithm scripting 0 MIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.RE PORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.code MIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeM IDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.code 19 PART 2: CANNY ALGORITHM SCRIPTING CHAPTER 3: Canny algorithm scripting In OpenCV, there is a Canny function with structure as: void cv::Canny ( InputArray image, OutputArray edges, double threshold1, double threshold2, int apertureSize = 3, bool L2gradient = false ) With parameters:  image 8-bit input image  edges output edge map; single channels 8-bit image, which has the same size as image (binary image)  threshold1 first threshold for the hysteresis procedure  threshold2 second threshold for the hysteresis procedure  apertureSize aperture size for Sobel operator  L2gradient a flag, indicating weather a more accurate 𝐿2 = 𝑑𝐼 𝑑𝐼 √( ) + ( )should be used to calculate the image gradient magnitude 𝑑 𝑥 𝑑𝑦 (L2gradient = true), or whether the default 𝐿1 = |𝑑𝐼/𝑑𝑥 | + |𝑑𝐼/𝑑𝑦 | 𝑖𝑠 𝑒𝑛𝑜𝑢𝑔ℎ (L2gradient = false) In Canny function, we don’t have to attend where is the higher threshold parameters in procedure prepareThresh template inline void prepareThresh(f64 low_thresh, f64 high_thresh, s32 &low, s32 &high) { if (low_thresh > high_thresh) std::swap(low_thresh, high_thresh); #if defined GNUC low = (s32)low_thresh; high = (s32)high_thresh; low -= (low > low_thresh); high -= (high > high_thresh); #else low = internal::round(low_thresh); 0 MIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.RE PORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.code MIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeM IDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.code 20 high = internal::round(high_thresh); f32 ldiff = (f32)(low_thresh - low); f32 hdiff = (f32)(high_thresh - high); low -= (ldiff < 0); high -= (hdiff < 0); #endif } The source code shows the different when change the L2gradient = true or false:  When L2gradient = true: for (; j < colscn; j++) _norm[j] = s32(_dx[j])*_dx[j] + s32(_dy[j])*_dy[j];  When L2gradient = false: for (; j < colscn; j++) _norm[j] = std::abs(s32(_dx[j])) + std::abs(s32(_dy[j])); Two loops above is apply in NormCanny procedure which have pointer as parameters (_dx, _dy and _norm) In source code, they apply the BLOB technic (consider 8-connected neighborhood pixels) when using Hyteresis: // now track the edges (hysteresis thresholding) while (stack_top > stack_bottom) { u8* m; if ((size_t)(stack_top - stack_bottom) + 8u > maxsize) { ptrdiff_t sz = (ptrdiff_t)(stack_top - stack_bottom); maxsize = maxsize * 3/2; stack.resize(maxsize); stack_bottom = &stack[0]; stack_top = stack_bottom + sz; } CANNY_POP(m); if if if if (!m[-1]) (!m[1]) (!m[-mapstep-1]) (!m[-mapstep]) CANNY_PUSH(m CANNY_PUSH(m CANNY_PUSH(m CANNY_PUSH(m + - 1); 1); mapstep - 1); mapstep); MIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.RE PORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.code MIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeM IDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.code 21 if if if if (!m[-mapstep+1]) (!m[mapstep-1]) (!m[mapstep]) (!m[mapstep+1]) CANNY_PUSH(m CANNY_PUSH(m CANNY_PUSH(m CANNY_PUSH(m + + + mapstep + 1); mapstep - 1); mapstep); mapstep + 1); } An example for using canny in OpenCV: import cv2 image = cv2.imread('test2.jpeg', cv2.IMREAD_COLOR) blur = cv2.GaussianBlur(image, (5, 5), 0) canny = cv2.Canny(image = blur, threshold1 = 30, threshold2 = 100, apertureSize = 3, L2gradient = False) cv2.imshow('Result', image) cv2.imshow('Canny', canny) cv2.waitKey(0) cv2.destroyAllWindows() 0 MIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.RE PORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.code MIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeM IDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.code 22 Here is the result: We can consider different between equations (Manhattan distance and Euclidean distance) 0 MIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.RE PORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.code MIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeM IDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.code 23 0 MIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.RE PORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.code MIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeM IDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.code 24 Using Euclidean Using Manhattan MIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.RE PORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.code MIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeM IDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.code 25 Then, we can see the different between Canny and Sobel: (Sobel will record all the different include not an edges): Using Sobel Using Canny 0 MIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.RE PORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.code MIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeMIDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.codeM IDTERM.REPORT.DIGITAL.IMAGE.PROCESSING.canny.algorithm.and.code

Ngày đăng: 24/12/2023, 15:08

Tài liệu cùng người dùng

Tài liệu liên quan