hi i have applied segmentation to my image.the segmented image has broken edges,i should link it before further processing.can anyone give me the code for edge linking.Thanks in advance...

답변 (1개)

Image Analyst
Image Analyst 2012년 4월 27일

0 개 추천

You could try imclose(), followed by bwmorph('skel') to skeletonize again, if necessary. Or take a look at this Peter's edge linking code: http://www.csse.uwa.edu.au/~pk/Research/MatlabFns/#edgelink

댓글 수: 6

Leah Stella
Leah Stella 2020년 9월 5일
This link isn't working, is there anywhere else this code can be viewed?
Image Analyst
Image Analyst 2020년 9월 6일
Try this:
I'm also attaching two of my edge linking demos.
Sumit
Sumit 2023년 12월 26일
if minDistance <= longestGapToClose
% Draw line from this endpoint to the other endpoint.
% line([thisColumn, nearestX], [thisRow, nearestY], 'Color', 'g', 'LineWidth', 2);
h = images.roi.Line(gca, 'Color', 'r', 'Position',[thisColumn, thisRow; nearestX, nearestY]);
% You can comment out the fprintf() to speed up the overall time the process takes.
fprintf('Drawing line #%d (which is %.1f pixels long) from (%d, %d) on segment #%d to (%d, %d) on segment #%d.\n', ...
lineCounter, minDistance, thisColumn, thisRow, theLabels(k), nearestX, nearestY, theLabels(k2));
drawnow;
mask = h.createMask(rowsInImage, columnsInImage);
finalMask(mask) = true; % Burn line into output image.
% Increment the line counter.
lineCounter = lineCounter + 1;
end
end
i have encountered this error in these lines of code , can you help me?
Invalid or deleted object.
Error in images.roi.Line/getLineData
Error in images.roi.internal.mixin.CreateMask/createOpenMask
Error in images.roi.Line/createMask
Image Analyst
Image Analyst 2023년 12월 26일
Which demo did you run and what images and parameters did you use?
Sumit
Sumit 2023년 12월 27일
i have used edgelinkingimage demo and images i used are from MSRA dataset
Image Analyst
Image Analyst 2023년 12월 27일
If you have any more questions, then attach your data and code to read it in with the paperclip icon, in a new question (not here), after you read this:

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

태그

질문:

2012년 4월 27일

댓글:

2023년 12월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by