Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utilizing edges and contours #14

Open
PaulaScharf opened this issue Apr 8, 2021 · 5 comments
Open

utilizing edges and contours #14

PaulaScharf opened this issue Apr 8, 2021 · 5 comments

Comments

@PaulaScharf
Copy link
Collaborator

PaulaScharf commented Apr 8, 2021

opencv provides a function called Canny to detect edges. maybe this could be used to improve the contours of the hand

@PaulaScharf PaulaScharf changed the title use edge detection to improve hand segmentation foreground segmentation Apr 8, 2021
@PaulaScharf
Copy link
Collaborator Author

This is the result after calculating the edges and then getting the contours:
contours

I think it has some potential I just need to figure out a way to use it. Biggest problem is that the contours are not perfect (eg often they do not close completly).

@PaulaScharf PaulaScharf changed the title foreground segmentation utilizing edges and contours Apr 8, 2021
@PaulaScharf
Copy link
Collaborator Author

PaulaScharf commented Apr 8, 2021

There is a machine learning approach called graph-cut that does semantic segmentation using edge detection but I am not sure if it is fast enough.

@PaulaScharf
Copy link
Collaborator Author

Interesting aproach to filling the mask until edges here. It will probably be too slow though...

@PaulaScharf
Copy link
Collaborator Author

PaulaScharf commented Apr 16, 2021

I added a mode just now where only the edges of a hand are visualized:
edges

The procedure is: first calculate edges for the entire frame, then create the hand mask as usual but heavily dilate it and lastly use the mask to cut out the edges.

I think the contours of these edges are often better than the mask. The outline is more realistic. However quality of the result is still very dependent on the mask. For example if the mask is missing a finger this will also be cut out of the edges.

A big draw back is the low visibility of the edges. Maybe I can figure out an intelligent way to set the color of the edges.

@PaulaScharf
Copy link
Collaborator Author

PaulaScharf commented May 5, 2021

I tried filling the edges with the watershed function. The results are fine, but not better than what we currently have.
watershed

Edit:
I improved the watershed again today. I would say that the results look promising. I especially like how the fingers are segmented. The framerate is awful but the code is also really messy at the moment so there is probably room for improvements.
watershed2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant