PureBasic Interface to OpenCV

Developed or developing a new product in PureBasic? Tell the world about it.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: PureBasic Interface to OpenCV

Post by wilbert »

You're fast at converting those examples.
JHPJHP wrote:cv_mov_houghcircles.pb: finds circles in grayscale image frames using the Hough transform on a movie file
Quite impressive again that it can detect this circular object while it is moving around. :)
Windows (x64)
Raspberry Pi OS (Arm64)
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to OpenCV

Post by JHPJHP »

Hi wilbert,

Here are the last of the Windows examples modified to work in OSX. Thank you very much for your invaluable support throughout this process :!:
- most of the following legacy examples have been demonstrated in previously posted examples using newer OpenCV functions

Updated the OSX interface:
- converted 8 examples
-- le_cam_extractSURF.pb: detects keypoints and computes SURF (Speeded-Up Robust Features) descriptors on the webcam interface
-- le_extractSURF.pb: detects keypoints and computes SURF (Speeded-Up Robust Features) descriptors
-- le_fitellipse_1.pb: creates a sequence of points, bounding them in an ellipse of the minimal area
-- le_mov_bgcodebookmodel.pb: using an average difference learning method, foreground moving objects of a certain size are tracked
-- le_mov_bgstatmodel_1.pb: using a background/foreground detection algorithm, foreground objects are highlighted/removed
-- le_mov_bgstatmodel_2.pb: using a Gaussian mixture-based background/foreground detection algorithm, foreground objects are highlighted
-- le_mov_gaussianbgmodel.pb: using a Gaussian background model, foreground moving objects of a certain size are tracked
-- le_pyrsegmentation.pb: implementing image segmentation by pyramids, a cartoon effect is achieved

NB*: Fixed an OSX OpenCV Function declaration that improved performance from the stitching examples.
Last edited by JHPJHP on Mon Aug 08, 2016 6:57 pm, edited 1 time in total.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: PureBasic Interface to OpenCV

Post by wilbert »

JHPJHP wrote:Here are the last of the Windows examples modified to work in OSX.
Thanks for all you did JHPJHP. :)
It's nice to have this lib available on OSX.
JHPJHP wrote:-- le_pyrsegmentation.pb: implementing image segmentation by pyramids, a cartoon effect is achieved
Great effect 8)
Windows (x64)
Raspberry Pi OS (Arm64)
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to OpenCV

Post by JHPJHP »

Hi wilbert,

You're most welcome.

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

Updated the OSX interfaces:
- rebuilt all libraries (modified 1 dylib)
-- libopencv_imgproc.2.4.13.dylib
- fixed 1 example
-- cv_minarea_2.pb: finds the minimal area of a point set wrapping it in a triangle and a circle

libopencv_imgproc.2.4.13.dylib / cv_minarea_2.pb
- copied the legacy C++ source file from a previous OpenCV build, into the current source folder
- modified the C++ source file to include a C-Interface to the C++ function
- added various header references pointing to the C-Interface function
- fixed reported version problems when trying to compile

Image
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: PureBasic Interface to OpenCV

Post by wilbert »

JHPJHP wrote:libopencv_imgproc.2.4.13.dylib / cv_minarea_2.pb
- copied the legacy C++ source file from a previous OpenCV build, into the current source folder
- modified the C++ source file to include a C-Interface to the C++ function
- added various header references pointing to the C-Interface function
- fixed reported version problems when trying to compile
Thanks for keeping it up to date :)
Windows (x64)
Raspberry Pi OS (Arm64)
AAT
Enthusiast
Enthusiast
Posts: 256
Joined: Sun Jun 15, 2008 3:13 am
Location: Russia

Re: PureBasic Interface to OpenCV

Post by AAT »

Hi, JHPJHP!

One more time about OpenCV+Tesseract OCR.
The example how to get confidence level in the Tesseract OCR: http://rgho.st/8yCH8cCjL (90 days)

Symbol level:
Image

Word level:
Image

---------------------
Update: liblept168.lib http://rgho.st/8ZPfh2cBK
Thanks, JHPJHP!

P.S. JHPJHP, I think you've already added this library in your package :)
Last edited by AAT on Mon Sep 05, 2016 1:18 pm, edited 1 time in total.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to OpenCV

Post by JHPJHP »

Hi AAT,

Thank you for another great addition to the OCR Tesseract examples.
AAT wrote:P.S. JHPJHP, I think you've already added this library in your package
I replaced the binaries with files from an older prebuilt download that contained both 32 and 64 bit versions.

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

Updated the Windows interfaces:
- added 1 example (contributed by AAT)
-- cv_OCR_confidence.pb: using Tesseract OCR (Optical Character Recognition) an image is translated to text displaying its confidence-level in stages

NB*: The 64bit Windows interface has been updated to support all 5 Tesseract examples.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to OpenCV

Post by JHPJHP »

Updated (Windows and OSX interfaces):
- added 1 example
-- cv_stippling.pb: stippling is the creation of a pattern simulating varying degrees of shading by using small dots
--- based on script found here

This was one of those examples that took longer then expected due to the conversion between Processing, PureBasic, and OpenCV :: Enjoy :!:

NB*: Images may show varying degrees of detail based on size, color, and settings.

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

Updated the example cv_stippling.pb: added the option to toggle between color and black dots.
Last edited by JHPJHP on Thu Sep 29, 2016 5:47 am, edited 1 time in total.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: PureBasic Interface to OpenCV

Post by wilbert »

That looks very nice :)
Windows (x64)
Raspberry Pi OS (Arm64)
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to OpenCV

Post by JHPJHP »

Hi wilbert,

Thank you for the comment. I knew if I was hear from anyone it would be you :)

Updated: cv_stippling.pb
- optimized various parts of the code, modified settings to better illustrate stippling and the repulsion field algorithm
Last edited by JHPJHP on Sat Oct 01, 2016 2:27 am, edited 2 times in total.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: PureBasic Interface to OpenCV

Post by wilbert »

JHPJHP wrote:optimized various parts of the code, modified settings, to better illustrate stippling and the repulsion field algorithm
It works fine on OSX :)
Windows (x64)
Raspberry Pi OS (Arm64)
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to OpenCV

Post by JHPJHP »

Updated (all interfaces):
- replaced 1 file
-- references/highgui.mht with references/highgui.pdf
- updated 1 example
-- cv_stippling.pb: optimized performance, added an option to reset stippling
- added 1 example
-- cv_cam_stippling.pb: stippling is the creation of a pattern simulating varying degrees of shading by using small dots

cv_stippling.pb
- to best demonstrate the repulsion field algorithm, press the [ C KEY ] switching to black dots, then press [ ENTER ] to reset stippling

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

Updated:
- updated 2 examples
-- cv_stippling.pb: optimized the repulsion field algorithm
-- cv_cam_stippling.pb: optimized the repulsion field algorithm, added the option to toggle between stippling and webcam
Last edited by JHPJHP on Sun Oct 02, 2016 3:55 am, edited 1 time in total.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: PureBasic Interface to OpenCV

Post by wilbert »

Thanks for all your hard work :)
Windows (x64)
Raspberry Pi OS (Arm64)
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to OpenCV

Post by JHPJHP »

Hi wilbert,

You're most welcome :!:

An alternate Stippling technique popular for its attention to detail is the Weighted Voronoi Stippling method, incorporating varying dot sizes to enhance results...

Updated
- updated 2 examples
-- cv_cam_stippling.pb: applied a couple small code improvements
-- cv_stippling.pb: switched from a static dot size to varying dot sizes based on color
- added 1 example
-- cv_repulsion_field.pb: each particle tries to find an optimum placement by pushing itself away from its neighbors

Image
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: PureBasic Interface to OpenCV

Post by wilbert »

JHPJHP wrote:-- cv_stippling.pb: switched from a static dot size to varying dot sizes based on color
- added 1 example
-- cv_repulsion_field.pb: each particle tries to find an optimum placement by pushing itself away from its neighbors
I like the varying dot sizes better :)
The repulsion field example also looks nice.
Windows (x64)
Raspberry Pi OS (Arm64)
Locked