Process an area by trapezoid shape in image processing

10 views (last 30 days)
Hi everybody
I'm trying to extract cracks from asphalt image. camera angle makes me to process an area by trapezoid shape as road surface. but as i said, i need to extract crack which is a linear object. Then when i use an algorithm for extracting linear objects, the border of trapezoid would be recognized as crack too. when i use grayscale properties of pixels such as thresholding, because of color of asphalt, detecting crack wouldn't go well.
I need your help for doing process on trapzoid area or any other guidness for detecting this crack.
Thanks.
  6 Comments
David Goodmanson
David Goodmanson on 9 Oct 2020
Hi mohammadreza,
flags are intended for inappropriate comments, duplicated questions and so forth, which is not what is happening here. It would be prefererable if you were to delete the flags from the comments.
mohammadreza pourebrahimi
mohammadreza pourebrahimi on 10 Oct 2020
I'm amature here. Thank you for explaining about flag. I will use it in appropriate way.

Sign in to comment.

Answers (1)

Matt J
Matt J on 9 Oct 2020
Edited: Matt J on 9 Oct 2020
It is a simple morphological operation to generate a binary mask for the trapezoid's interior. You can use that to eliminate false positives at the road edges.
load theRoad
A=rgb2gray(A);
roadMask=imerode(bwconvhull(imbinarize(A)),strel("disk",3));
imshowpair(edge(A), edge(A).*roadMask, "montage");

Community Treasure Hunt

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

Start Hunting!