PureBasic Interface to OpenCV

Developed or developing a new product in PureBasic? Tell the world about it.
AAT
Enthusiast
Enthusiast
Posts: 253
Joined: Sun Jun 15, 2008 3:13 am
Location: Russia

Re: PureBasic Interface to OpenCV

Post by AAT »

Many thanks, JHPJHP!
And my congratulation to you: more than 2^18 views :)
User avatar
JHPJHP
Addict
Addict
Posts: 1788
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to OpenCV

Post by JHPJHP »

Hi AAT,

It was good to hear from you again, I hope you are doing well.

---------------------------------------------------

Updated: ( OpenCV 3.3 to OpenCV 3.4.1 )
- World Download: PureBasic Interface to OpenCV :: 32 bit
- World Download: PureBasic Interface to OpenCV :: 64 bit

Other Changes:
- replaced reference files
- removed 3 examples (might be temporary)
- removed MS Runtime DLLs (users with an older version of Windows may need to provide their own)

NB*: The Function cvSaveImage is not working in the World packages; currently I am debugging the C / C++ source scripts.
Last edited by JHPJHP on Mon Apr 23, 2018 10:31 pm, edited 8 times in total.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; access key required.
_________________
acreis
Enthusiast
Enthusiast
Posts: 140
Joined: Fri Jun 01, 2012 12:20 am

Re: PureBasic Interface to OpenCV

Post by acreis »

Congratulations!

Very usefull work.

May I suggest you link statically c runtimes libraries? This should improve portability.

Thanks
User avatar
JHPJHP
Addict
Addict
Posts: 1788
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to OpenCV

Post by JHPJHP »

Hi acreis,

Thank you for your post.
acreis wrote:May I suggest you link statically c runtimes libraries? This should improve portability.
I removed the runtimes libraries from the Interface because in the latest versions of Windows they're already included.

----------------------------------------------------------

Updated:
- fixed World downloads
- removed Linux and OSX downloads

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; access key required.
_________________
acreis
Enthusiast
Enthusiast
Posts: 140
Joined: Fri Jun 01, 2012 12:20 am

Re: PureBasic Interface to OpenCV

Post by acreis »

Thanks for clearing up and the fantastic work.

Cheers
User avatar
bbanelli
Enthusiast
Enthusiast
Posts: 540
Joined: Tue May 28, 2013 10:51 pm
Location: Europe
Contact:

Re: PureBasic Interface to OpenCV

Post by bbanelli »

Greetings to all,

regarding Tesseract OCR Engine, has anyone managed:

a) implement new language file? It crashes when I edit

Code: Select all

hAPI = TesseractInit(#PSM_AUTO, #OEM_TESSERACT_ONLY, #PB_Compiler_FilePath + "binaries/tesseract/tessdata", "eng", #Null$)
with new language file

b) read anything except perfect demo picture JHPJHP included?

I get whole mess even with PDF->JPEG of english files, text only, let alone something more "mushy".

Which parameters should I play with?

B
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/
User avatar
JHPJHP
Addict
Addict
Posts: 1788
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to OpenCV

Post by JHPJHP »

Hi bbanelli,

a. See the following post: http://www.purebasic.fr/english/viewtop ... 27#p518127
b. Please post a link to a test JPG / PDF that produces the inaccurate results

NB*: At some point I will probably update the packages with the latest version of the Tesseract binaries.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; access key required.
_________________
User avatar
bbanelli
Enthusiast
Enthusiast
Posts: 540
Joined: Tue May 28, 2013 10:51 pm
Location: Europe
Contact:

Re: PureBasic Interface to OpenCV

Post by bbanelli »

JHPJHP wrote:Hi bbanelli,

a. See the following post: http://www.purebasic.fr/english/viewtop ... 27#p518127
Thanks. This version, however, for my language (Croatian) is almost 4 times (~4MB) smaller than latest (~18MB).

Obviously there has been tremendous advancement in Tesseract during time...
b. Please post a link to a test JPG / PDF that produces the inaccurate results
Can I send it on your PM?
NB*: At some point I will probably update the packages with the latest version of the Tesseract binaries.
It seems that Tesseract is quite mature now; I will make sure to post my own code if relevant so I can add to community since I plan to embed this engine to larger scale software of mine...

Thank you for all your hard work so far!

With my best,

Bruno
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/
User avatar
JHPJHP
Addict
Addict
Posts: 1788
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to OpenCV

Post by JHPJHP »

Hi bbanelli,

If the following does not help, send me a PM with a test file.

See the following post by Lunasole (newer binaries), the Tesseract include file was based on his original work.
- http://www.purebasic.fr/english/viewtop ... =tesseract
- http://geocities.ws/lunasole/data/_sources/tesseract/l

Which OpenCV example did you test your file against?
- cv_OCR_confidence.pb should provide the best results

NB*: All OCR examples were created by AAT, with only small modifications by me.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; access key required.
_________________
User avatar
JHPJHP
Addict
Addict
Posts: 1788
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to OpenCV

Post by JHPJHP »

Updated:
- renamed 1 example
-- pb_GL_photo_cube.pb to pb_GL_photo_cube_triangle.pb
- modified 2 examples:
-- cv_pixel_spread.pb
-- pb_GL_photo_cube_triangle.pb
- added 1 example
-- cv_webcam_pixel_spread.pb

NB*: Added DPI awareness for all relevant Windows examples: SetProcessDpiAwarenessContext.

---------------------------------------------------------------

Updated:
- Linux & OSX downloads available again from the first post
-- upgraded libraries from v2.4.13.3 to v2.4.13.6

NB*: Currently there is an OpenCV Interface conflict in Linux with UseJPEGImageDecoder() and UseJPEGImageEncoder() Functions.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; access key required.
_________________
AAT
Enthusiast
Enthusiast
Posts: 253
Joined: Sun Jun 15, 2008 3:13 am
Location: Russia

Re: PureBasic Interface to OpenCV

Post by AAT »

Hi, JHPJHP!
I'm grateful to you for continuing to work on the package!

I upgraded the package of Tesseract OCR libraries to version 3.5.1. It works but I did not see better results compared to version 3.0.2. Libraries became larger, and they became larger in size.
I checked the work with all the examples from the package.

Download: http://rgho.st/7zcgMxVHm will be available for 90 days.
User avatar
JHPJHP
Addict
Addict
Posts: 1788
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to OpenCV

Post by JHPJHP »

Hi AAT,
AAT wrote:I upgraded the package of Tesseract OCR libraries to version 3.5.1.
That's great, there has been some interest in the past few months concerning the OCR examples in conjunction with newer binaries.

Because of the additional dependencies, I am reluctant to replace the current binaries, at least for now.

NB*: If you still have the sources available, can you please compile and post a link to a 64 bit package of Tesseract OCR binaries and dependencies.

------------------------------------------------

Updated:
- Linux packages have been updated with some minor improvements; see the first post for download links.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; access key required.
_________________
AAT
Enthusiast
Enthusiast
Posts: 253
Joined: Sun Jun 15, 2008 3:13 am
Location: Russia

Re: PureBasic Interface to OpenCV

Post by AAT »

Hi. JHPJHP!

Sorry, I did not compile the tesseract, I took the compiled dlls and for them I got the lib files using polib
I took dlls here: https://digi.bib.uni-mannheim.de/tesseract/

bat file:

Code: Select all

polib libtesseract-3.dll /machine:ix86 /out:libtesseract-3.lib
polib liblept-5.dll /machine:ix86 /out:liblept-5.lib
polib libgif-4.dll /machine:ix86 /out:libgif-4.lib
polib libpng16-16.dll /machine:ix86 /out:libpng16-16.lib
polib libjpeg-8.dll /machine:ix86 /out:libjpeg-8.lib
polib libopenjp2.dll /machine:ix86 /out:libopenjp2.lib
polib zlib1.dll /machine:ix86 /out:zlib1.lib
polib libtiff-5.dll /machine:ix86 /out:libtiff-5.lib
polib libjbig-2.dll /machine:ix86 /out:libjbig-2.lib
polib liblzma-5.dll /machine:ix86 /out:liblzma-5.lib
polib libwebp-5.dll /machine:ix86 /out:libwebp-5.lib
polib libstdc++-6.dll /machine:ix86 /out:libstdc++-6.lib
User avatar
JHPJHP
Addict
Addict
Posts: 1788
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to OpenCV

Post by JHPJHP »

Updated:
- some minor changes to various examples
- added Constants to the Main and World packages

Walking the binaries from the latest OpenCV release revealed additional Functions...

Windows (world):
- added 4 Functions

Code: Select all

cvCreateFileCaptureWithPreference(filename.p-ascii, apiPreference)
cvGetWindowImageRect(name.p-ascii)
cvSetTrackbarMin(trackbar_name.p-ascii, window_name.p-ascii, minval)
cvWriteRawDataBase64(*fs, *src, len, dt.p-ascii)
Windows / Linux / OSX (main):
- 155 Legacy Functions (not added)

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; access key required.
_________________
User avatar
JHPJHP
Addict
Addict
Posts: 1788
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to OpenCV

Post by JHPJHP »

Updated:
- some minor changes to various examples
- replaced all the Windows binaries (versions have not changed) *

* Rebuilt the binaries after upgrading to Visual Studio 2017 from 2013. In addition, CMake was upgraded to the latest release.

NB*: No sooner after moving to 2017, Visual Studio 2019 Preview comes available.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; access key required.
_________________
Post Reply