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

Add Preprocessing #6

Open
WillNilges opened this issue Nov 17, 2021 · 5 comments
Open

Add Preprocessing #6

WillNilges opened this issue Nov 17, 2021 · 5 comments

Comments

@WillNilges
Copy link
Owner

WillNilges commented Nov 17, 2021

I'm seeing hugely better results if I apply preprocessing with OpenCV before passing images to Inkpath. It's definitely not out of scope to add some CV libs and see if we can't have that implemented directly in the plugin.

TODO: Test on my 9-year-old T430s 😂

@WillNilges
Copy link
Owner Author

I wonder if I can effectively straighten the image as well (or somehow ask the user to do it manually)

@WillNilges
Copy link
Owner Author

I wonder if we could make OpenCV auto-crop by singling out white rectangles in the image and removing the rest of the pixels. Maybe we can also make it auto-straighten by trying to straighten out the edges like we did with the pool table.

@WillNilges
Copy link
Owner Author

I'm going to be using some userdata bullshittery to get data from OpenCV to my Lua plugin. From there, I'll go stroke-by-stroke, pushing things onto the Lua stack and passing them to Xournalpp. A possible optimization to make down the line would be to skip the Lua stack altogether and just shunt contours directly to Xournalpp somehow.

@WillNilges
Copy link
Owner Author

TODO: build and install OpenCV in the Dockerfile :3

@WillNilges
Copy link
Owner Author

Seems like inkpath doesn't like plusses or T's. Hmm.

image

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