PureBasic Interface to OpenCV

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: PureBasic Interface to OpenCV

Post by Kwai chang caine »

Wooowww !!! again more impressive i imagine !!! :shock: :shock:

Perhaps it's again my fault :oops:
But i have found an error "incorrect number of parameter" in line 50 in cv_pbimage_1.pb and cv_pbimage_2.pb

Code: Select all

cvSave(xmlPath + xmlName + "_keypoints.xml", *keypoints, #NULL$, #NULL$, #Null)
Again thanks to your useful job 8)
Last edited by Kwai chang caine on Wed Jan 08, 2014 12:07 pm, edited 1 time in total.
ImageThe happiness is a road...
Not a destination
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
JHPJHP wrote:...Some new functions have been REM'd out - there in the documentation, but not included in the DLL?...
I have found these functions in "core_c.h": they are "inline" functions.

I'll think over your new examples and will try comparison of contours.

Thank you!
Good luck!
AAT
Enthusiast
Enthusiast
Posts: 256
Joined: Sun Jun 15, 2008 3:13 am
Location: Russia

Re: PureBasic Interface to OpenCV

Post by AAT »

Kwaï chang caïne wrote:
But i have found an error "incorrect number of parameter" in line 50 in cv_pbimage_1.pb and cv_pbimage_2.pb

Code: Select all

cvSave(xmlPath + xmlName + "_keypoints.xml", *keypoints, #NULL$, #NULL$, #Null)
You have to comment (remove) these lines:

Code: Select all

            xmlPath.s = GetPathPart(FileName)
            xmlName.s = GetFilePart(FileName, #PB_FileSystem_NoExtension)
            cvSave(xmlPath + xmlName + "_keypoints.xml", *keypoints, #NULL$, #NULL$, #Null)
            cvSave(xmlPath + xmlName + "_descriptors.xml", *descriptors, #NULL$, #NULL$, #Null)
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: PureBasic Interface to OpenCV

Post by Kwai chang caine »

Thanks AAT 8)
Know you a simple way with OpenCV, for have the same result of this site using pHash lib, or it's too difficult ?
http://phash.org/demo/
ImageThe happiness is a road...
Not a destination
AAT
Enthusiast
Enthusiast
Posts: 256
Joined: Sun Jun 15, 2008 3:13 am
Location: Russia

Re: PureBasic Interface to OpenCV

Post by AAT »

Sorry, i'm not specialist in image processing.
I think there is no sense to try to achieve the results of phash.org with openCV, rather you have to write PB interface to this lib (if you want).
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: PureBasic Interface to OpenCV

Post by Kwai chang caine »

No no it's not my question :wink:
I just ask if it's possible, to do the same thing with OpenCV and the splendid work of JHPJHP, than what do the site of pHash..

So comparison of two picture, and say a percent of similarity, or a number of differences, etc..
In fact the same behaviour of the site, but with OpenCV :D

Perhaps begin with the "cv_contours_1.pb" ???
or perhaps "le_contours_6a"...

What is the better way ??
ImageThe happiness is a road...
Not a destination
AAT
Enthusiast
Enthusiast
Posts: 256
Joined: Sun Jun 15, 2008 3:13 am
Location: Russia

Re: PureBasic Interface to OpenCV

Post by AAT »

Look at \openCV\sources\samples the examples with keyword "features", or le_SURF.pb in JHPJHP examples.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to OpenCV

Post by JHPJHP »

Hi Kwaï chang caïne,

Thank you for pointing out the error in the two examples... they are now fixed.

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

Hi AAT,

Thank you for the information concerning the inline functions - I will look into it.

Cheers!
Last edited by JHPJHP on Wed Jan 08, 2014 11:22 pm, edited 1 time in total.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: PureBasic Interface to OpenCV

Post by Kwai chang caine »

Look at \openCV\sources\samples the examples with keyword "features", or le_SURF.pb in JHPJHP examples.
Thanks AAT i regards this way 8)
Thank you for pointing out the error in the two examples... they are fixed now.
No no, it's me i thanks for this great job 8)
ImageThe happiness is a road...
Not a destination
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to OpenCV

Post by JHPJHP »

Updated:
- added Constants, Structures, Macros, Inline Functions (converted to Procedures)
- added 1 example
-- cv_mov_text.pb: draws text to a movie file and saves it as an AVI (Audio Video Interleaved)

The new example was derived from the following post by normeus:
http://www.purebasic.fr/english/viewtop ... 13&t=57922
Philippe-felixer76-3
User
User
Posts: 45
Joined: Mon Dec 30, 2013 10:12 pm

Re: PureBasic Interface to OpenCV

Post by Philippe-felixer76-3 »

Philippe-felixer76-3 wrote:
AAT wrote:Hi, JHPJHP

For now I study an example "Number Plate Recognition" (written on C++) from https://github.com/MasteringOpenCV/code ... ecognition
and I can't initialize and to work with SVM in PB. Can you give me any advice or help, please?

Good luck!
I find this interesting also.
There is no progress with SVM and OCR. You can test code without recognition. Test pictures (from internet) on http://rghost.ru/51414957
Hi, i made a very plain OCR engine way back in 2008, and i picked it up again and it seems to be the perfect solution for this job.

Any interest?
AAT
Enthusiast
Enthusiast
Posts: 256
Joined: Sun Jun 15, 2008 3:13 am
Location: Russia

Re: PureBasic Interface to OpenCV

Post by AAT »

Philippe-felixer76-3 wrote: Hi, i made a very plain OCR engine way back in 2008, and i picked it up again and it seems to be the perfect solutionfor this job

Any interest?
Hi Philippe-felixer76-3. Yes, it is interesting. Is your OCR made with openCV and PureBasic?
Philippe-felixer76-3
User
User
Posts: 45
Joined: Mon Dec 30, 2013 10:12 pm

Re: PureBasic Interface to OpenCV

Post by Philippe-felixer76-3 »

AAT wrote:
Philippe-felixer76-3 wrote: Hi, i made a very plain OCR engine way back in 2008, and i picked it up again and it seems to be the perfect solutionfor this job

Any interest?
Hi Philippe-felixer76-3. Yes, it is interesting. Is your OCR made with openCV and PureBasic?
It's purebasic only, i thought i lost it but then i scanned my external HD and found it again.

Im working on it to integrate it into your code.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to OpenCV

Post by JHPJHP »

Hi Philippe-felixer76-3,

Very interesting, your efforts are appreciated.

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

Updated
- added Constants, Functions, 1 Inline Function (converted to a Procedure)
- added 1 example (jointly contributed by AAT)
-- cv_approxpoly.pb: approximates a polygonal curve(s) with the specified precision
- added 1 default image

The example attempts to count the number of sides for each shape, illustrating the difference by outlining them in various colors. It's worth noting that cvApproxPoly is very precise, my fist attempt was to use an image download from the net, but the slightest imperfection in a line would count as another point, sometimes returning hundreds. I decided to create the image using MSPaint, even so - the arrows having 7 sides return 9 because of a slight variance to the contour.

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

Hi AAT,

The new example may be of some help with your current project. I don't think any one solution would suffice, but a combination of cvMatchShapes, cvApproxPoly, etc. with the OCR script Philippe-felixer76-3 is working on, may be enough to exact results.

Like I previously mentioned - cvApproxPoly is very precise, and may be able to narrow similar results to something useful.

Cheers!
Last edited by JHPJHP on Sun Jan 12, 2014 8:41 pm, edited 1 time in total.
Ziltch
User
User
Posts: 52
Joined: Sun Aug 03, 2003 12:05 am
Location: Australia

Re: PureBasic Interface to OpenCV

Post by Ziltch »

I have been using OpenCV in BlitzMax and C++ for ages. Great to see your work here getting it working with purebasic.

I am getting POLINK errors using PB x64. I can see no x64 directory in the binaries directory.
Is this now only 32bit?
Locked