PureBasic Interface to OpenCV

Developed or developing a new product in PureBasic? Tell the world about it.
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!

I think it will be more compact code using OpenCV (but more dlls).

P.S. I deleted my message so that it no interferes with your news. :)
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to OpenCV

Post by JHPJHP »

Hi AAT,
AAT wrote:I think it will be more compact code using OpenCV (but more dlls).
I was more referring to automation; instead or in addition to the user adding points to create Vector Curves, the process could be automated.

See animated GIF below (created using Video Snipping Tool):
1. Downloaded a detailed image to be used as a template for our Vector Curves.
2. Opened the existing OpenCV example making a single change to the code.
3. Opened the previously downloaded image; all points were ready to be processed or turned into Bezier Curves.

Image
Last edited by JHPJHP on Wed Jul 15, 2020 8:35 pm, edited 2 times in total.
AAT
Enthusiast
Enthusiast
Posts: 256
Joined: Sun Jun 15, 2008 3:13 am
Location: Russia

Re: PureBasic Interface to OpenCV

Post by AAT »

JHPJHP, you are wizard!
Оne motion of a magic wand and voila... :D
marc_256
Enthusiast
Enthusiast
Posts: 742
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: PureBasic Interface to OpenCV

Post by marc_256 »

Hello JHPJHP,

Nice to have you back here ...

For my new robot, I did something totaly out of my budget,
I just brought a LattePanda alpha with Win 10 pro installed.
So, now (at last) I have the best/fast processor card to run PB and my robot ...

Finely I like to start and install all the needed software on this board.

Q1)
What is the minimum software I need to install to run your Open_CV with PB 5.72 LST x64,
I want to use 2 camera's for obstacles detection (red soda cans).

Q2)
Do you have any experience for what camera to use ?

greetings,
marc
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PureBasic Interface to OpenCV

Post by IdeasVacuum »

Hi Marc

Are you familiar with DF Robot?

https://www.dfrobot.com
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to OpenCV

Post by JHPJHP »

Hi AAT,
AAT wrote:JHPJHP, you are wizard!
Thank you... if/when I find the time, I'll craft :) together something to better showcase what I am envisioning.

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

Hi marc_256,

Thank you. I was hoping to hear that you were able to merge your robotics with PureBasic. Congratulations :!:

Deciding on which algorithms you require will determine which DLL's you need; no installation required.

The basic requirements for the webcam are:
- opencv_core2413.dll, opencv_core2413.lib
- opencv_highgui2413.dll, opencv_highgui2413.lib
- opencv_imgproc2413.dll, opencv_imgproc2413.lib

Any relatively new webcams will work. It's more about how well you write your code that will determine the accuracy and speed for identifying objects.

Good luck, and if you need any help with the code or just deciding the best algorithms, drop me a post.
marc_256
Enthusiast
Enthusiast
Posts: 742
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: PureBasic Interface to OpenCV

Post by marc_256 »

Hi IdeasVacuum,
Well, this is my first attempt to do something with the LATTEPANDA Alpha ...
I ordered the LATTE and the 10" IPS SCREEN (1280*800 px) on a local shop.
I sended a mail some weeks ago to DFROBOT, and I'm still waiting for an answer ???

Hello JHPJHP,
Thanks for your info,
and yes I gone need a lot of help here :( :?
I just started today so, ...

thanks
marc,
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
derschutzhund
New User
New User
Posts: 5
Joined: Mon Jul 01, 2013 11:24 pm

Re: PureBasic Interface to OpenCV

Post by derschutzhund »

Hi,
i just found this interesting topic and that might be interesting.
I would like to save images from a webcam and then analyze them in order to implement a kind of target tracking.
Is that possible with it?

Unfortunately I have not been able to test the program so far because the download does not work!

greetings

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

Re: PureBasic Interface to OpenCV

Post by AAT »

derschutzhund wrote:I would like to save images from a webcam and then analyze them in order to implement a kind of target tracking.
Is that possible with it?
Hi derschutzhund.
Yes, it's possible to save image from webcam. Moreover, you can analyze every frame from webcam in realtime if your analysis does not take too much time. There was many examples in the "PureBasic Interface to OpenCV" pack.
Ziltch
User
User
Posts: 52
Joined: Sun Aug 03, 2003 12:05 am
Location: Australia

Re: PureBasic Interface to OpenCV

Post by Ziltch »

Thanks again for the great interface.

I had been having problems with image quality with cvSave and found changing the CvSaveData struct fixed the problem.

Code: Select all

Structure CvSaveData
  paramId.l
  paramValue.l
  paramValue2.l <--- Added this line.
EndStructure
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to OpenCV

Post by JHPJHP »

Hi Ziltch,

Thank you for reporting your findings.

While I cannot reproduce the issue, I did find supporting documentation.
- https://stackoverflow.com/questions/801 ... ion-factor

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

Updated:
- all the main packages have been updated with the change provided by Ziltch

NOTES:
All downloads require an access key.
Access key is emailed after a one time $20 CAD donation.
Good for all current and future scripts, programs, and updates.

* If AAT or wilbert would like any or all of the OpenCV downloads (no access key required), post here or email your request from My PureBasic Stuff. *
Last edited by JHPJHP on Tue Aug 31, 2021 6:06 pm, edited 1 time in total.
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 and Ziltch.
JHPJHP wrote:While I cannot reproduce the issue...

I'm too. Thanks for the invitation! :)

Ziltch, paramValue2 is always 0? Could you provide an example of an image you are having problems with?
Ziltch
User
User
Posts: 52
Joined: Sun Aug 03, 2003 12:05 am
Location: Australia

Re: PureBasic Interface to OpenCV

Post by Ziltch »

My prog saved this before the struct change. jpg quality should be 95 but it is only 7.
Image

after the change image looks fine and image quality is 95
Image

It is strange as the extra param is always 0 . So why it would make a difference in my prog and not any of the code examples that I tried is confusing.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to OpenCV

Post by JHPJHP »

Animated GIF of 5 examples from the OpenCV package (250+ examples); created using Video Snipping Tool.
1. cv_convertscale.pb: Modify the brightness and contrast levels using a scaling factor.
2. cv_gamma.pb: Gamma Correction: The relationship between a pixels numerical value and its actual luminance.
3. cv_sharpen_1.pb: Unsharp masking (USM): Combining a blurred mask with the original image for a sharpen effect.
4. cv_sharpen_2.pb: Add various edge filters to an image giving it different sharpened effects (sharpen / excessive / realistic).
5. cv_enhance_detail.pb: Enhance the details of an image.

NB*: This post was to demonstrate certain features; see request here.

Image
JGarcia
New User
New User
Posts: 1
Joined: Thu Oct 08, 2020 10:19 am

Re: PureBasic Interface to OpenCV

Post by JGarcia »

Hi JHPJHP,


I have a version of openCV for purebasic from 2013.

Now I have a project for an AOI (Automated Optical Inspection) for my company and I would like to use the latest version if possible.
I can't download the software, I made a couple of donations but I don't receive the access code, can you please help me? , thanks.

I do not know if this message is appropriate here, I do not see private email to contact.
Locked