It is currently Sat Dec 16, 2017 7:48 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 778 posts ]  Go to page Previous  1 ... 48, 49, 50, 51, 52  Next
Author Message
 Post subject: Re: PureBasic Interface to OpenCV
PostPosted: Thu Sep 07, 2017 2:46 am 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1369
HI AAT,

Thank you for your new example, I've updated all the main packages to include it.

I am not sure if you noticed, but OpenCV has come out with a new update. I think I will procrastinate a little longer before updating to the latest version; rebuilding the binaries/libraries in all three OS is such a tedious process.

I hope this post finds you well :!:

_________________
ImageMy PureBasic Stuff


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic Interface to OpenCV
PostPosted: Fri Sep 08, 2017 12:55 am 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1369
Compiled and tested the new OpenCV 3.3 binaries without error, confirming compatibility with the existing interface; opted to keep a World build over separate files.
- OpenCV 2.4.13.3 will be compiled as separate binaries

NB*: This was not a straight build, various source files were modified to work with the C interface.

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

Updated the World packages:
- 32 & 64 bit Windows
-- binaries from v3.2 to v3.3

NB*: Reference files have also been updated.

_________________
ImageMy PureBasic Stuff


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic Interface to OpenCV
PostPosted: Fri Sep 08, 2017 4:58 am 
Offline
Enthusiast
Enthusiast

Joined: Fri Apr 20, 2012 8:09 pm
Posts: 248
Thank you JHP!
I don't even pretend to know, how you get the energy to come up with all these updates.

also, great work on your website http://jhpjhp.x10host.com


Norm.

_________________
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic Interface to OpenCV
PostPosted: Fri Sep 08, 2017 6:06 am 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1369
Hi normeus,

Thank you sincerely for your post.

Lately I have found my motivation waning, but it's comments like yours that make continuing a little easier; I definitely need to put some additional time into finishing my website.

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

Updated the Main & Demo Windows packages:
- 32 & 64 binaries from v2.4.13 to v2.4.13.3

NB*: Reference files have also been updated.

_________________
ImageMy PureBasic Stuff


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic Interface to OpenCV
PostPosted: Fri Sep 08, 2017 7:52 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1684
Location: Pas-de-Calais, France
JHPJHP wrote:
Lately I have found my motivation waning, but it's comments like yours that make continuing a little easier; I definitely need to put some additional time into finishing my website.

Hello JHPJHP !
Don't be fooled, I'm one among several people keeping an eye on your work. Maybe you've seen that I've tried to help chris319 on his webcam problem, bugging around with several C sources, and you know how it can be a nightmare. Your implementation is great, code is easy to use and read, and a must have for future applications. PureBasic with such capabilities is far easier than ANY language, including Python. Thank you again for all what you do !

_________________
Prehistoric games - Bobble Puzzle, Purebreaker 3 ~> http://djes.free.fr


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic Interface to OpenCV
PostPosted: Sat Sep 09, 2017 12:14 am 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1369
Hi djes,

Thank you for your post.

I did noticed the good work you and AAT have been doing. It was nice to read that you figured out the Visual Studio problem, definitely a skillset worth having.

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

Updated the Main & Demo OSX packages:
- 64 bit libraries from v2.4.13 to v2.4.13.3

NB*: Reference files have also been updated.

_________________
ImageMy PureBasic Stuff


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic Interface to OpenCV
PostPosted: Sat Sep 09, 2017 10:15 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1684
Location: Pas-de-Calais, France
Yes, sure. In fact, I dislike C and Unix style, way too anarchic for me. It's working, ok, and it could be fun. But it's often ugly, and over complicated.

I was wondering if you're using sort of make tool to compile your projects, and if pb could not benefit from such a tool for larger projects. :?:

_________________
Prehistoric games - Bobble Puzzle, Purebreaker 3 ~> http://djes.free.fr


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic Interface to OpenCV
PostPosted: Sat Sep 09, 2017 11:34 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1369
Hi djes,

Like you, for Windows I used CMake and Visual Studio, for Linux and OSX I used CMake and the built-in Make utility.

The only exception was for OSX; while working with wilbert I wrote a dylib patch tool, needed after the build process.

Other then that, and as you know, any text editor can be used to modify the C++ source files.

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

Updated the Main & Demo Linux packages:
- 64 bit libraries from v2.4.13 to v2.4.13.3

NB*: Reference files have also been updated.

_________________
ImageMy PureBasic Stuff


Last edited by JHPJHP on Sat Sep 09, 2017 11:44 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic Interface to OpenCV
PostPosted: Sat Sep 09, 2017 11:44 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1684
Location: Pas-de-Calais, France
Oh, I was not talking about C compilation (thank you anyway), but purebasic projects. For opencv, you have a lot of examples and I was wondering if you're just using standard tools...

_________________
Prehistoric games - Bobble Puzzle, Purebreaker 3 ~> http://djes.free.fr


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic Interface to OpenCV
PostPosted: Sat Sep 09, 2017 11:59 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1369
Hi djes,

Whatever language I am coding in, I usually prefer the built-in editor; for PureBasic, nothing outside of the IDE, and I don't use the form designer.

All my include files are manually created, unless I am dealing with images, etc.

For most batch updates, I use TextCrawler Pro, otherwise I will write my own.

For anything web related my editor of choice is UltraEdit.

_________________
ImageMy PureBasic Stuff


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic Interface to OpenCV
PostPosted: Sun Sep 10, 2017 9:06 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1684
Location: Pas-de-Calais, France
Ok, thank you ! I'm working the same way, with total commander for file and directory comparison.

_________________
Prehistoric games - Bobble Puzzle, Purebreaker 3 ~> http://djes.free.fr


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic Interface to OpenCV
PostPosted: Mon Oct 02, 2017 11:06 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Apr 20, 2012 8:09 pm
Posts: 248
Had some extra time so I created this example: ( of course there might already be an example of this )
It loads a JPG image, selects a section then it zooms back out to display the whole JPG on an AVI.
On video editing it is usually called the "Ken Burnes effect" and it is used to add "motion" to still photos.

save it as CV_Zoom_JHP.pb along with all the open cv examples and in compiler options set directories
to "binaries\" , the program will use \binaries\images\weight3.jpg as JPG and output /Videos/zoom.avi
it needs DIVX codec so if it does not run get the DIVX codec or change the codec to MSVC
[edit]
I downloaded the latest "OpenCV_Win32" JHP has at his site (Sept,29,2017). (OpenCV v2.4.13.3)
Code:
IncludeFile "includes/cv_functions.pbi"
;CV_Zoom_JHP.pb
Global *original.IplImage,*show.IplImage,*save.IplImage


Global zo_x=170,zo_y=80,zo_w=360,zo_h=300 ; section of picture to zoom from currently an e=mc2 eye
Global outputw=960,outputh=780,fps=30 ; final output dimentions of AVI file

#CV_WINDOW_NAME = "PureBasic Interface to OpenCV"
#CV_DESCRIPTION = "zooms on a jpg picture, Ken burns effect; saving it as an AVI movie"
#img = "images/weight3.jpg"

;LOAD IMAGE
If FileSize(#img)
   Debug #img
Else
   MessageRequester("Image not found","please verify image location")
   End
EndIf

*writer = cvCreateVideoWriter("../Videos/zoom.avi", CV_FOURCC("D", "I", "V", "X"), fps,outputw,outputh, #True); create our 30 frames/s AVI container

*original = cvLoadImage(#img, #CV_LOAD_IMAGE_ANYDEPTH | #CV_LOAD_IMAGE_ANYCOLOR) ; Load image any size
*save = cvCreateImage(outputw, outputh, #IPL_DEPTH_8U, *original\nChannels) ; create image to our AVI dimentions
cvResize(*original, *save, #CV_INTER_AREA) ;resize original image to our AVI dimentions
cvSetImageROI(*save, zo_x, zo_y, zo_w, zo_h) ; select e=mc2 eye from now resized *save picture
*show = cvCreateImage(zo_w, zo_h, #IPL_DEPTH_8U, *original\nChannels) ;create a temp buffer to show a section of image

;CREATE first FRAME
cvcopy(*save, *show,#Null)
*nsave = cvCreateImage(outputw, outputh, #IPL_DEPTH_8U, *original\nChannels)
cvresize(*show,*nsave,#cv_INTER_AREA)
cvResetImageROI(*save)
cvReleaseImage(@*show)

;SAVE IMAGES TO AVI MOVIE
For i = 1 To 6*fps ; six seconds at 30 frames per second 
 ;  For j = 1 To 2       ; add this For Next loop to write 2 frames of the same picture to slow it down
      cvWriteFrame(*writer, *nsave)
 ;  Next
   If roix >0 :roix=zo_x-i :EndIf  ; decrease x until 0
   If roiy >0 :roiy=zo_y-i :EndIf  ; decrease y until 0
   roiw=zo_w+(i*4) ; increase width
   roih=zo_h+(i*4) ; increase height
   If roiw > outputw: roiw = outputw:EndIf ;dont get bigger than our output width
   If roih > outputh: roih = outputh:EndIf ; dont get bigger than our output height
   cvSetImageROI(*save, roiy, roix, roiw, roih)   ; set our ROI with new dimentions
   *show = cvCreateImage(roiw, roih, #IPL_DEPTH_8U, *original\nChannels) ; create an image to copy to
   cvcopy(*save, *show,#Null) ; copy ROI to new image
   cvResetImageROI(*save) ;reset ROI
   cvresize(*show,*nsave,#cv_INTER_AREA) ; copy this new section to full output
   cvReleaseImage(@*show)
Next

cvReleaseVideoWriter(@*writer)

_________________
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari


Last edited by normeus on Tue Oct 03, 2017 6:50 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic Interface to OpenCV
PostPosted: Tue Oct 03, 2017 1:25 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 2:46 pm
Posts: 1684
Location: Pas-de-Calais, France
normeus> Which version did you use ? I wonder because frame_size and size are now pointers.

JHPJHP> I wonder in the examples, like cv_video_writeframe.pb, line 63, where *frame_size memory is allocated ?

_________________
Prehistoric games - Bobble Puzzle, Purebreaker 3 ~> http://djes.free.fr


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic Interface to OpenCV
PostPosted: Tue Oct 03, 2017 6:49 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Apr 20, 2012 8:09 pm
Posts: 248
I downloaded the latest "OpenCV_Win32" JHP has at his site (Sept,29,2017). (OpenCV v2.4.13.3)
I am using PB5.60x86
I saw examples using a pointer on the web. from docs on web:
Quote:
C: CvVideoWriter* cvCreateVideoWriter(const char* filename, int fourcc, double fps, CvSize frame_size, int is_color=1 )

but, I looked at example "cv_video_writeframe.pb"
Quote:
*writer.CvVideoWriter = cvCreateVideoWriter(sVideo, CV_FOURCC("D", "I", "V", "X"), fps, FrameWidth, FrameHeight, #True)

I based my example on JHP's example. I haven't looked at 64 bit OpenCV

Norm.

_________________
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic Interface to OpenCV
PostPosted: Tue Oct 03, 2017 7:05 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1369
Hi normeus, djes,

normeus is correct that the 32 bit version does not use a *pointer while the 64 bit version does.
- I have not yet tried your example, but I am looking forward to viewing the results

djes, in the 64-bit version I found that it was not necessary to allocate memory for the cvCreateVideoWriter, cvCreateImage, etc. Functions.

_________________
ImageMy PureBasic Stuff


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 778 posts ]  Go to page Previous  1 ... 48, 49, 50, 51, 52  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye