Reputation: 181
I Want to get 2 curve as in Desire result. I tried to use Edge detection technique to get these 2 curves, but the output was not as expected. First step, I convert the original image to grayscale image. In second step, I convert the grayscale image to binary image with threshold calculated by the formula below:
threshold = floor((sum(sum("grayscale image here")))/(2 *high *width));
And then use Sobel edge detection algorithm to find the edges:
im_edge = edge("binary image here", 'sobel');
I remove unwanted edges in left side and right side by just fill it with black. I got the result in Result but it was not as my expected. The result is also embedded edges found by:
im_edge = edge("grayscale image here", 'sobel');
Can anyone help me to get a better result
Upvotes: 1
Views: 54
Reputation: 410
Since I don't have 50 reputations to write a comment, I will write my comments here as answer.
The problem you have is that there is no visible edge in your input image. The image is pretty smooth as far as I can see. If you did not put two lines on the image, I won't be able to tell it.
To get better results, you need to get more features such as by applying some transformation on the input image. For example, you can try to find the edge on the gradient of the input image or absolute value of gradient, and see if you can find that two lines better(imgradient
).
Upvotes: 1