Find Threshold on Canny edge image problem

조회 수: 4 (최근 30일)
Tony123
Tony123 2020년 5월 9일
댓글: Tony123 2020년 5월 11일
Dear all experts,
I met a question about how to find the threshold values by giving a fixed edge percentage on canny edge detection problem. I use two 5x5 gradient filters. The code is showns below:
% convolve filterX and filterY with Image to get magnitude gradient and angle
Ix = conv2(Image,filterX); % filterX is a 5x5 gradient filter
Iy = conv2(Image,filterY); % filterY is a 5x5 gradient filter
magnitude = sqrt(Ix.^2+Iy.^2);
angle = atan2(Iy,Ix);
% How to find threshold based on the %percentage? The edge_percentage is the
% proportion of pixels supposed to be treated as potential edge points
max = max(max(magnitude));
min = min(min(magnitude));
% threshold = some percentage work
  댓글 수: 8
Image Analyst
Image Analyst 2020년 5월 11일
Make it easy for us to help you. Give us code to create filterX and filterY.
Tony123
Tony123 2020년 5월 11일
Sorry for the unclear, I attached my code

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by