Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sat Jun 24, 2017 12:23 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Access to image processing algorithms?
PostPosted: Fri Feb 08, 2013 8:44 pm 
Offline
User avatar

Joined: Wed Jul 07, 2010 2:55 pm
Posts: 720
Location: University Of Calgary, Faculty Of Medicine
How would you do an FFT or a gaussian blur on an image in RB?
Would you use a C++ plugin to accomplish this?
What about quicktime on the mac, would it assist?
Image Magik? Is the MonkeyBread Plugin for that free?

_________________
If at first you don't succeed... Try REALBasic and if that doesn't work try Xojo.


Top
 Profile  
Reply with quote  
 Post subject: Re: Access to image processing algorithms?
PostPosted: Fri Feb 08, 2013 8:59 pm 
Offline
User avatar

Joined: Thu Sep 10, 2009 2:50 am
Posts: 418
Location: Santa Cruz, CA, USA
I have FFT in RB code. It's pretty fast but for serious processing or 2D FFT I use declares to the vDSP library (mac). Gaussian blurs might be in there too, it has convolution kernels but I never figured those functions out. I have rb code for simple 3x3 convolution kernels.

Calling external functions will greatly speed this up. Fullscreen spectrograms went from like 3 seconds per frame with rb only code to like 10fps. I'm guessing Windows and Linux have a comparable library of highly optimized FFT.

I can dig this stuff up if you want.


Top
 Profile  
Reply with quote  
 Post subject: Re: Access to image processing algorithms?
PostPosted: Sat Feb 09, 2013 3:48 am 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
You could check our MBS Plugins. We have lots of picture functions including blur, convolution and others.

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: Access to image processing algorithms?
PostPosted: Sat Feb 09, 2013 9:17 am 
Offline
User avatar

Joined: Wed Jul 07, 2010 2:55 pm
Posts: 720
Location: University Of Calgary, Faculty Of Medicine
MonkeybreadSoftware wrote:
You could check our MBS Plugins. We have lots of picture functions including blur, convolution and others.

Greetings
Christian


Is this a free plugin? does it need other software to be loaded for it to work on a mac?

_________________
If at first you don't succeed... Try REALBasic and if that doesn't work try Xojo.


Top
 Profile  
Reply with quote  
 Post subject: Re: Access to image processing algorithms?
PostPosted: Sat Feb 09, 2013 9:35 am 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
It's free for developing in the IDE; but not for deploying.

It contains itself a lot of code, so you don't need other files.
And it's for Mac, Windows and Linux.

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: Access to image processing algorithms?
PostPosted: Mon Feb 11, 2013 3:11 am 
Offline

Joined: Thu Oct 13, 2005 1:05 am
Posts: 101
SOme functions like blur may work very fast using CoreImage (OS X build in gpu computing on pictures since 10.6).
For my knowledge RB itself hasnt any API for that. MBS plugin has lot CI support.

Other way - even faster and much more flexible than CoreImage in code would be using OpenCL for example fft processing.

Apple has lots of OpenCL code examles here - but i dont know how to communicate with RB.
https://developer.apple.com/library/mac/navigation/#section=Frameworks&topic=OpenCL

Also CUDA (for Mac) would be usefull - also lots of FFT code examples on Nvidia CUDA dev site.


Top
 Profile  
Reply with quote  
 Post subject: Re: Access to image processing algorithms?
PostPosted: Mon Feb 11, 2013 1:29 pm 
Offline
User avatar

Joined: Wed Jul 07, 2010 2:55 pm
Posts: 720
Location: University Of Calgary, Faculty Of Medicine
mitch_stgt wrote:
SOme functions like blur may work very fast using CoreImage (OS X build in gpu computing on pictures since 10.6).
For my knowledge RB itself hasnt any API for that. MBS plugin has lot CI support.

Other way - even faster and much more flexible than CoreImage in code would be using OpenCL for example fft processing.

Apple has lots of OpenCL code examles here - but i dont know how to communicate with RB.
https://developer.apple.com/library/mac/navigation/#section=Frameworks&topic=OpenCL

Also CUDA (for Mac) would be usefull - also lots of FFT code examples on Nvidia CUDA dev site.


I imagine that one must 'declare' the classes and methods in REALBasic,
like:
Soft Declare Sub center Lib "Cocoa" selector "center" (windowRef As Integer)
center(Self.handle)


Where would I find the declares?

_________________
If at first you don't succeed... Try REALBasic and if that doesn't work try Xojo.


Top
 Profile  
Reply with quote  
 Post subject: Re: Access to image processing algorithms?
PostPosted: Mon Feb 11, 2013 11:11 pm 
Offline
User avatar

Joined: Thu Feb 16, 2006 10:04 pm
Posts: 262
It's far more complicated than "just a few declares" - more like a couple of bucket loads and many classes - it would be a decent amount of work to do. You have to convert everything to Cocoa class pointers so that the final functions that accomplish the blur can operate on them and then you have to show your results using NS Objects or convert back to something RB understands. There are multiple framework API's to accomplish the blur. Or you could do the math yourself on the RGB surface utilizing code from the net - a bit slow but you can do it.

This one page discusses NSImage basics.

[url]https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaDrawingGuide/Images/Images.html#//apple_ref/doc/uid/TP40003290-CH208-BCIBBFGJ[/url]

You could also accomplish the blur with OpenGL, but again, not without a bit of work. :-)

_________________
Thomas C.
Real Studio Blog
http://bigdaddysurf.com/blog/

https://itunes.apple.com/us/app/maui-dragstrip-2013/id604516033?mt=8
https://itunes.apple.com/us/book/how-to-waterstart/id576214730?mt=11


Top
 Profile  
Reply with quote  
 Post subject: Re: Access to image processing algorithms?
PostPosted: Wed Feb 13, 2013 9:47 pm 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:00 am
Posts: 583
Location: Beautiful Taiwan
RS includes a couple of options for free, take a look at the RGBSurface class in the language reference. While it's possible to do a Gaussian Blur with this class, it would be a little slow.

The only other options I'm aware of, are either a lot of work or cost money.

Einhugur has the PictureEffects plugin, which contains some great processing and is cross platform.

If you're developing Mac only, the MBS plugin has classes for accessing Apple's Core Image (which is a bit awkward, but very powerful) or you can write a whole bunch of declares to access Core Image yourself.

Most of our graphics applications actually use a combination of both Einhugur and Core Image (via the MBS plugin and my own declares to get even more functionality).

Depending on what you're doing, buying plug-ins can save you a lot of time, or if time isn't important and money is, then I would encourage you to learn how to access Apple's APIs and use declares.

_________________
Sam Rowlands
rMBP 15" @ 10.8 & '08 MBA 13" @ 10.6 + 10.7, RB2012
http://www.ohanaware.com/
AppWrapper - Prepare Apps for Mac App Store & OS X 10.8 - http://www.ohanaware.com/appwrapper/


Top
 Profile  
Reply with quote  
 Post subject: Re: Access to image processing algorithms?
PostPosted: Thu Feb 14, 2013 5:23 am 
Offline

Joined: Mon Feb 14, 2011 10:24 am
Posts: 1
This looks pretty cool - http://www.dingostick.com/node.php?id=8

its a free RB wrapper for freeimage (http://freeimage.sourceforge.net/)

"FreeImage is an "easy to use, fast, multithreading safe, compatible ... and cross-platform" OSS library for image manipulation. This is a REALbasic wrapper classes for FreeImage that make many of its capabilities trivial."

I played around with this a year ago and it was pretty easy to use


Top
 Profile  
Reply with quote  
 Post subject: Re: Access to image processing algorithms?
PostPosted: Tue May 28, 2013 2:49 am 
Offline
User avatar

Joined: Thu Jul 27, 2006 6:31 pm
Posts: 1698
Location: Monterey, CA
My ImagePlay Effects Library has a bunch of image effects, written entirely in REALbasic.

http://imageplay.sourceforge.net

Blur is included.

Be aware that it hasn't been updated in while, so there's no telling how it will act under the latest Real Studio.

_________________
ImagePlay Effects Library (40+ image effects in one open source module. No plugins, no dependencies, no restrictions.)
http://imageplay.sourceforge.net/


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 5 hours


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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group