Ask Your Question
-1

Good foreground segmentation methods apart from Canny

asked 2019-12-16 10:59:02 -0600

updated 2020-12-09 08:04:15 -0600

I have a grey scale image (single channel data) and want to perform something like the Canny edge detection operation on it for foreground segmentation. But, the output has a lot of noise. I also tried bilateral filtering along with it but it didn't help the output.

Can someone please help point me in the correct direction on how to go about this?

Thank you.

Code snippet:

 v = np.median(vis)

 sigma = 0.33

 lower = int(max(0, (1.0 - sigma) * v))

upper = int(min(255, (1.0 + sigma) * v))

edges = cv2.Canny(vis,lower,upper)
edges = cv2.Canny(depth_vis,lower,upper)

Below is a sample picture of current Canny detector output. C:\fakepath\canny.png

edit retag flag offensive close merge delete

Comments

1

Canny edge detection operation on it for foreground segmentation.

what ? all it does is edge highlighting, not segmentation at all.

please explain, what you are really trying to achieve here. what is the goal of your program ?

berak gravatar imageberak ( 2019-12-16 11:02:50 -0600 )edit
1

Hello, thank you for the reply. Yes, I'm sorry about the wrong usage of terms. But, I'm doing edge detection first and will later go for segmentation of a part of the body part from image. But currently, I'm not able to achieve good edge detection from the data. (getting a lot of unnecessary contours). Please advise. Thank you.

opencv_great gravatar imageopencv_great ( 2019-12-16 11:29:15 -0600 )edit
1

edge detection first and will later go for segmentation of a part of the body part from image

this might be a bad idea. never throw away color and gradients too early

segmentation of a part of the body part from image

it's 2019, and we have proper cnn's for this

berak gravatar imageberak ( 2019-12-16 11:43:30 -0600 )edit

Thanks for the suggestion about CNN. But, I'm trying to achieve edge detection without using CNN (they need more resources). Hence I would like to resort to classical image processing techniques. Please let me know if you have another suggestion.

Thank you.

opencv_great gravatar imageopencv_great ( 2019-12-16 12:00:47 -0600 )edit

suggestion for what ? you never told us, what problem youÄre trying to solve.

berak gravatar imageberak ( 2019-12-16 12:15:46 -0600 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2019-12-16 13:20:02 -0600

Hello berak, I'm trying to get a more smooth edge highlighted image. As mentioned in the post, the output is not great and it has some unnecessary contours. And, I don't want to use any deep learning model because of hardware constraints. If you know of a way to solve the current problem, please suggest.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-12-16 10:59:02 -0600

Seen: 306 times

Last updated: Dec 19 '19