Is it doable/reasonable to add opencv?
Galunid opened this issue · comments
I was thinking about writing a module that would allow users to double tap a panel in manga to zoom to a selected panel(basically cut out part of the image and display it).
Base image:
Cut out panels:
To get this result I used opencv library and a short python script https://pastebin.com/hKKGgzNw. My question is whether it's reasonable to include OpenCV, and if so, how would I go around it?
OpenCV seems like it might be rather excessively large for our purposes, even setting aside some potential doubts about its usability on a poor little Kindle or Kobo.
But perhaps more important, Leptonica should do roughly the same things faster and we already have it. In fact I implicitly mentioned it in koreader/koreader#6408 (comment) although I didn't speak of some of the underlying technology. In fact the current zoom in page flipping mode already functions mostly the way you sketched. ;-)
Some examples:
koreader-base/ffi/koptcontext.lua
Lines 232 to 258 in 0e64066
koreader-base/ffi/koptcontext.lua
Lines 260 to 335 in 0e64066
Clearly the fact that it's hidden in page flipping mode means almost no one knows it exists. So there are multiple issues.
- The zoom to box feature is great as a starting point and it's neat most of the time but it doesn't always work out. You want much freer zoom.
Some details on things we might want in free zoom here: koreader/koreader#5524 - Ideally all this would somehow be available in the main reader mode easily without having to trigger a mostly hidden special mode.
I'm not sure page flipping mode still has much purpose with the greatly improved skim widget.
Basically what @Frenzie said ;).
(OpenCV is humongous, and I don't think it has any arm-specific codepaths).
Thanks. Just like I thought. I'll take a look at leptonica, but to be fair, there doesn't seem to be a lot of resources to learn from, so I'll probably give it up.