Real Software Forums
http://forums.realsoftware.com/

Access to image processing algorithms?
http://forums.realsoftware.com/viewtopic.php?f=7&t=46881
Page 1 of 1

Author:  BrianOBrien [ Fri Feb 08, 2013 8:44 pm ]
Post subject:  Access to image processing algorithms?

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?

Author:  doofus [ Fri Feb 08, 2013 8:59 pm ]
Post subject:  Re: Access to image processing algorithms?

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.

Author:  MonkeybreadSoftware [ Sat Feb 09, 2013 3:48 am ]
Post subject:  Re: Access to image processing algorithms?

You could check our MBS Plugins. We have lots of picture functions including blur, convolution and others.

Greetings
Christian

Author:  BrianOBrien [ Sat Feb 09, 2013 9:17 am ]
Post subject:  Re: Access to image processing algorithms?

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?

Author:  MonkeybreadSoftware [ Sat Feb 09, 2013 9:35 am ]
Post subject:  Re: Access to image processing algorithms?

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

Author:  mitch_stgt [ Mon Feb 11, 2013 3:11 am ]
Post subject:  Re: Access to image processing algorithms?

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.

Author:  BrianOBrien [ Mon Feb 11, 2013 1:29 pm ]
Post subject:  Re: Access to image processing algorithms?

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?

Author:  mauitom [ Mon Feb 11, 2013 11:11 pm ]
Post subject:  Re: Access to image processing algorithms?

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. :-)

Author:  rowlands [ Wed Feb 13, 2013 9:47 pm ]
Post subject:  Re: Access to image processing algorithms?

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.

Author:  ndillane [ Thu Feb 14, 2013 5:23 am ]
Post subject:  Re: Access to image processing algorithms?

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

Author:  tomis [ Tue May 28, 2013 2:49 am ]
Post subject:  Re: Access to image processing algorithms?

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.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/