Page 56 of 60

Re: PureBasic Interface to OpenCV

Posted: Sun May 31, 2020 11:07 am
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. :)

Re: PureBasic Interface to OpenCV

Posted: Sun May 31, 2020 5:34 pm
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

Re: PureBasic Interface to OpenCV

Posted: Mon Jun 01, 2020 9:57 am
by AAT
JHPJHP, you are wizard!
Оne motion of a magic wand and voila... :D

Re: PureBasic Interface to OpenCV

Posted: Mon Jun 01, 2020 12:36 pm
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

Re: PureBasic Interface to OpenCV

Posted: Mon Jun 01, 2020 4:39 pm
by IdeasVacuum
Hi Marc

Are you familiar with DF Robot?

https://www.dfrobot.com

Re: PureBasic Interface to OpenCV

Posted: Mon Jun 01, 2020 9:10 pm
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.

Re: PureBasic Interface to OpenCV

Posted: Mon Jun 01, 2020 10:24 pm
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,

Re: PureBasic Interface to OpenCV

Posted: Thu Sep 10, 2020 10:11 pm
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

Re: PureBasic Interface to OpenCV

Posted: Fri Sep 11, 2020 3:58 am
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.

Re: PureBasic Interface to OpenCV

Posted: Thu Oct 29, 2020 4:16 am
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

Re: PureBasic Interface to OpenCV

Posted: Thu Oct 29, 2020 2:08 pm
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. *

Re: PureBasic Interface to OpenCV

Posted: Fri Oct 30, 2020 2:23 am
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?

Re: PureBasic Interface to OpenCV

Posted: Sat Oct 31, 2020 4:10 pm
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.

Re: PureBasic Interface to OpenCV

Posted: Fri Nov 06, 2020 6:17 pm
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

Re: PureBasic Interface to OpenCV

Posted: Thu Nov 12, 2020 7:44 pm
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.