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

EDGE DRAWING LIBRARY #2314

Open
sturkmen72 opened this issue Oct 26, 2019 · 4 comments
Open

EDGE DRAWING LIBRARY #2314

sturkmen72 opened this issue Oct 26, 2019 · 4 comments

Comments

@sturkmen72
Copy link
Contributor

sturkmen72 commented Oct 26, 2019

recently i found https://github.com/CihanTopal/ED_Lib and i see it contains useful algorithms valuable to be included in OpenCV

firstly i contacted with the author and take his permission.
i want to work on code adaptation and rewriting according to OpenCV code style

test PR : #2313

@sturkmen72
Copy link
Contributor Author

sturkmen72 commented Apr 2, 2021

Algorithms in the original repo and their estimated completion states after first merged commit #2313

  • ED (Edge Drawing) ...%100 - Tested Well - Same output with the original
  • EDLines .........................%100 - Tested Well - Same output with the original
  • EDCircles .....................%95 - Tests in progress ( Slightly different results )
  • EDPF ..............................%95 - Tests in progress ( As far as tested it appeared to be the same as the Original )
  • EDColor .......................%95 - - Tests in progress ( As far as tested it appeared to be the same as the Original )

i hope to continue working on the list below

  • Making the above list completed
  • Improving documentation
  • Speeding up the algorithms
  • Improving the algorithms to get better results if possible.

@geroldmeisinger
Copy link

@sturkmen72 Thank you so much for your integration of the Edge Drawing algorithms in OpenCV and subsequently for opencv-contrib-python!

I'm using Stable Diffusion, a generative artificial intelligence software, which can turn a simple text prompt into a full blown image. Together with the ControlNet extension it is possible to "guide" the generation process based on edge maps into a specific direction. At the moment I'm training a new ControlNet based on Edge Drawing and the parameter free version already helped me a lot to increase quality of the guidance process. The first version is available on Civitai - ControlNet MySee - Edge Drawing Parameter Free and a web-demo for Edge Drawing Parameter Free, thanks to your integration. This provides a lot of value to users because it doesn't require parameter tuning like canny.

This is what it looks like to most users using the Automatic1111 UI for Stable Diffusion. Left is the "ground truth" image, middle is the processed "edge map" and right is the new "generated image" based on the prompt "photo of a woman in the street, fashine, anime" and guided by the edge map to get a similar pose:
image

I was able to compile the EDLib EDColor cpp version to generate the edge maps and the detection quality seems even better, which could further increase the quality of the ControlNet. Unfortunately, without EDColor in opencv-contrib - and therefore in Python - I'm not able to provide a web-demo for users. The EDColor version, especially a parameter free version, would be so nice.

Thank you again for all your work!

@AbsurdePhoton
Copy link

@sturkmen72 : you asked me from the EDLib repo to add context here, I am happy to do so.

  • all the ED "modules" have been ported to OpenCV except EDColor
  • EDColor is a specific case, in which ALL the color channels of an image are taken in account at the same time, improving the results
  • The actual modules only treat channels separately
  • I could test with the original EDLib, there is a real gain, especially while using CIELAB values

@geroldmeisinger
Copy link

geroldmeisinger commented Jun 27, 2024

I'm planning to train a new Controlnet with EDPF Color soon for Stable Cascade and Stable Diffusion SDXL+3 (if my hardware allows it). The Canny Controlnet is considered one of the most important Controlnets in image generation AI and thus had multiple reinstatements even though it uses the inferior canny filter, see
https://huggingface.co/xinsir/controlnet-canny-sdxl-1.0 for the most recent one

Canny is one of the most important ControlNet series models and can be applied to many jobs associated with drawing and designing.

If edge drawing would also find it's way to the official opencv this would also allow further support in tools (my PR was denied because it is in contrib) which made me even go the javascript route just to get it into the popular ComfyUI app.

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

No branches or pull requests

4 participants