Alternatives for HornetsEye - Ruby - ruby

I installed HornetsEye, that "real-time computer vision library" for some experiments with my webcam. I want to know if are there other alternatives in ruby?

RMagick comes to mind, but it is not very very performant ...
I have not tested it yet personally, but since OpenCV is definitely the way to go from C++, the ruby-opencv gem could be interesting. I could only find this one actively developped, though.
http://github.com/ruby-opencv/ruby-opencv

Perhaps Camellia Image Processing Library interests you because.
It has been written in C but has a native wrapper for RUBY and its performance is very good.

Related

Ruby Equivalent of the GD Library usage in PHP

I am looking to write an app that overlays images and copy on top of another image. I know in PHP you can use the GD library but for Ruby does anyone have a specific suggestion of a gem that would help with this?
I have seen 2 gems already but not sure which is the one most people use.
https://github.com/Spakman/ruby-gd
http://rubygems.org/gems/gd2
gd is a bit dated as a library for image manipulation/processing. The gems you listed are old, quite old in fact and likely will have issues with newer versions of Ruby.
Based on my own experience, I would look into a gem like minimagick which provides a nice interface to ImageMagick which is a more common library for the tasks you're trying to do.
The modern version of gem for working with GD library is https://github.com/dark-panda/gd2-ffij ... obviously, ImageMagick bindings are more powerful, but ImageMagick library have much more dependences and is generally heavyweight.

Ruby 1.9 compatible plotting / graphic library?

I feel like I have a simple desire that no one can satisfy: I want to be able to graph a set of points, and I am using Ruby 1.9.2.
I would like to use Gruff or Scruffy, since these seem to be the easiest to use. However, they both rely on rmagick, and it seems that many other libraries do to. Rmagick isn't compatible with Ruby 1.9 though. (not to mention, I've read that you should just stay away from it anyways...I would enjoy hearing reasons)
I am using wxRuby for a project, but in the future I will be needing simple graphs in other places, such as online and just command line scripts. Therefore, if someone has a solution for wxRuby, that is great, but an all-encompassing solution would be even better.
Thank you!
P.S.
I've seen gnuplot, but it would be a bit overkill. If that's my best option, I can live with that. I've also seen RGL, but I didn't look too long at it.
EDIT: Just to add, neither Gruff or Scruffy have been updated since August 2009, and I would like to find something that is at least semi-maintained. SVG::Graph looks very powerful, but hasn't been updated since Sept. '09. There is a fork of it on rubygems though which says it is 1.9 compatible, maybe I will try that if I can't get Scruffy or Gruff to play nice.
There may be some wx lib you could use.
Barring that I use rmagick with 1.9 (what's your platform?)
and it appears there have been some updates to those gems, though not new releases in awhile.
http://ruby-toolbox.com/categories/graphing.html

Ruby library/gem for game graphics?

I am creating a simple Blackjack game in Ruby, and I have finished all the game logic stuff (finally!) and currently have it running through the command line. It is all working, so now I need a library or gem that will make the whole graphics side of things easier.
Any ideas?
Thanks.
As well as Gosu, mentioned elsewhere, there's Rubygame which also appears to be regularly updated.
No opinion on either, suggested as an alternative for comparison.
UPDATE: New(-ish?) kid on the block: Ray. Fairly graphically-oriented, it would appear.
Maybe you could try to use Gosu which is a 2D game development library for the Ruby and C++ programming languages, available for Mac OS X, Windows and Linux.
Available as a gem. More information here
You can also watch a fun presentation I saw in Barcelona during Euruko (ruby conference).
Available Here
Shoes would be a good candidate, it's very lightweight, cross platform & fun to use.
It has a nice ruby API which you can use to draw shapes and use native GUI widgets.

Is it possible to use jruby to write an applet or is it better to use iron ruby for silverlight?

If I wanted to dabble with ruby, would it be easier to write an applet in Jruby or a Silverlight XAP with iron ruby?
So far all I have is a vague idea that it might be possible.
Firstly, if you want to dabble with Ruby the language i'd just download the windows installer, plenty of resources in that.
If it's specifically applets you want to look at check out the recently released Gestalt, allows you to run Ruby in the browser (needs Silverlight) http://visitmix.com/labs/gestalt/getstarted/
I'd suggest this is one of those happy "it depends" things. Some questions to consider that may help you clarify your thinking:
Which environment do you know better?
What are your target environment(s)?
Are you happy to run a not-yet-1.0 version (IronRuby?)
Can you get both (either) to run in your development environment?
How much (any?) support/prior art available?
I have a nagging feeling this may need to go beyond "dabbling" ;-)
I'd go with jruby because:
Jruby is more mature than IronRuby
Applets are more mature than Silverlight
I like open source and hate MS (hate silverlight not IronRuby, respect for IR devs)
Java libs galore
But if u already know a lot about .NET mabe IronRuby
Not everyone can use Silverlight, Java seems to be available (and preinstalled) on more platforms at the moment, so I would go with JRuby.

Can Ruby be used for UI based Windows apps?

I'm sorry if this question is noob-ish but I'm not having much luck with Google. Can Ruby be used for UI based Windows apps? I'm not looking for a Rails app, just Ruby.
Thanks
You have couple of options.
Use Gtk Ruby which works on Windows as well (http://ruby-gnome2.sourceforge.jp/).
You can use WxRuby or Tk.
You can use JRuby and Swing.In fact there are high level libraries which can help you there, such as (http://monkeybars.rubyforge.org/)
Yes, but the experience will vary depending on how you hook up the UI. TK or gtk, wxRuby, ruby shoes (not sure how alive that one is right now), Qt (which is cool) and fox (aka fxRuby) are some of the options. If you like to hurt yourself, you can hook directly to Win32 libraries, but I doubt you'll want to.
Additionally, if you target the nascent IronRuby, you can use WinForms or WPF.
I also prefer wxRuby. It looks great, uses native components, yet is cross-platform. On the Ruby On Windows blog there is a great write-up of how to get started. It helped me a lot.
You bet. wxRuby is what I use, but others use GTK. wxRuby also works on Linux which is where I am writing a program, but it should suit your needs. You can install it using
gem install wxruby
You could check out wxRuby..
Depends what kind of Window app are you going to implement. If this is your own pet project, then definitely you can try WxRuby or GTK. There is no risk here.
However if this is going to be serious, commercial windows app then you have to think twice. It is really worth using Ruby? It is great language. I use it on daily basis. But for a Windows app, C# integration with the whole environment is hard to beat.
check out Shoooes!

Resources