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

implemented ocr tool using tesseract #1239

Closed
wants to merge 4 commits into from
Closed

Conversation

enoy19
Copy link

@enoy19 enoy19 commented Jan 15, 2021

No description provided.

@borgmanJeremy
Copy link
Contributor

@enoy19 Can you update the CI to include the proper dependencies?

@borgmanJeremy
Copy link
Contributor

Thanks, ill get the rpm's and deb's updated. Hopefully tesseract is available in homebrew for MacOs and easily available on windows or we will need to rethink how to package it.

@enoy19
Copy link
Author

enoy19 commented Jan 25, 2021

Thanks, ill get the rpm's and deb's updated. Hopefully tesseract is available in homebrew for MacOs and easily available on windows or we will need to rethink how to package it.

Thank you!

#include "tesseract_tool.h"
#include "src/utils/screenshotsaver.h"
#include <QPainter>
#include <tesseract/basetesseractApi.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does this header come from? Per the tesseract docs it should be baseapi.h: https://github.com/tesseract-ocr/tesseract/blob/master/include/tesseract/baseapi.h

Having an issue building this on arch which lead me down this trail.

Copy link

@smartlitchi smartlitchi Feb 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it work by replacing the header with baseapi.h ?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it work by replacing the header with baseapi.h ?

Yes this works

return;
}

Pix *image = TesseractTool::qImage2PIX(context.selectedScreenshotArea().toImage());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

building this on Manjaro fails with the following error:

./flameshot/src/tools/ocr/ocrtool.cpp:71:33: error: ‘qImage2PIX’ is not a member of ‘TesseractTool’
71 |     Pix *image = TesseractTool::qImage2PIX(context.selectedScreenshotArea().toImage());
|                                 ^~~~~~~~~~
make[2]: *** [src/CMakeFiles/flameshot.dir/build.make:1222: src/CMakeFiles/flameshot.dir/tools/ocr/ocrtool.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:404: src/CMakeFiles/flameshot.dir/all] Error 2
make: *** [Makefile:171: all] Error 2

qImage2PIX != qImagetoPIX :)
calling wrong function in tesseract_tool.h
@eregnier
Copy link

eregnier commented Dec 28, 2021

Hello all,

It seems this PR is blocked / not merged. What would be the next steps to make this PR released ?

If I understand, the current issue is to make this branch compile properly on Manjaro ?

@borgmanJeremy
Copy link
Contributor

It must pass all the CI checks. It did not build properly on most platforms

@xeaon
Copy link

xeaon commented Dec 28, 2021

I've spent time to adapt @enoy19's commit to the newer codebase, which was building fine on Linux and I've even had an idea, how to manage languages but accidentally rm -rf'ed my directory.

I'm gonna try it again but I have very little C++ and basically non existing Qt skills, e.g. it'll take time 😅

@eregnier
Copy link

@xeaon damit. I wait for this feature and it looks like you fixed it then lost it. I had this problem in one of my projects and this made me feel bad :/

Anyway. I cannot do a lot by myself without investing a lot in cpp and qt stack. I am a python / js dev with very few knowledge aroud this project's stack. I will continue to live without this "nice to have" feature at the moment I guess.

Thank you all for your reactivity and answers.

@materemias
Copy link

Would be great to have this in the release, I hope someone with the needed skills will finish it!

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

Successfully merging this pull request may close these issues.

6 participants