Need help in edge detection, finding its coordinates and calibrating it with a scale for further measurements.

2 次查看(过去 30 天)
I have an image of a curved slit as in below image(left). I need to detect the edge of the slit and find its coordinates (a scale is provided in the image). I tried binarizing the image(right) using "imbinarize". What should be done to detect the edge, export it coordinates for further measurements/ processing? Any help is appreciated! PS: I am new to Matlab.

回答(2 个)

Yash Ubale
Yash Ubale 2018-11-12
Hello,
You can visit the link mentioned below for further information.
You can get the vertical and horizontal gradients as numerical arrays at every pixel of the image along with the output image which contains the edges.
  2 个评论
HARIKRISHNAN u
HARIKRISHNAN u 2018-11-13
Thanks yash! That was helpful.
now i am stuck up with a new problem. After the edge detection there are a few unwanted objects in the image which i need to remove. I am looking for a way to mask some part of edge detected alone and make the rest of the pixel values to black (0). can anyone help on this?

请先登录,再进行评论。


HARIKRISHNAN u
HARIKRISHNAN u 2018-11-13
sure !
Here it is ...
I want the data inside the marked area as it is and need to conver the rest of area to black pixels.
Untitled.jpg
  1 个评论
Yash Ubale
Yash Ubale 2018-11-13
I would recommend you to try different parameters in edge detection to get better results. Once you get better results, follow the link mentioned below.
Also, you can try different morphological operations on the image that you have obtained.
You must choose appropriate structuring element.
Clustering could be thought of as one of the means to achieve it.
Hole filling can be done which could fill holes in the components.
You need to come up with your own algorithm which could be a combination of all the above, since the shape that you want to obtain is not generic. I could only suggest you some techniques which can be useful in your case.
One example algorithm could be, first find the connected edges and then find connected components in the binary image and whichever connected component is the largest is your required object.

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by