Ilmari Heikkinen
12/29/2005 12:12:00 AM
On 12/29/05, John Koschwanez <ishkaprog@gmail.com> wrote:> I'm a Ruby newbie - "Programming Ruby" was great Xmas break reading!> I write image analysis and processing code to analyze single cells under> a microscope in real-time and to automate lab equipment. I now write> solely in C++ for PC, but I would love to use Ruby to quickly try new> ideas without plowing through C++ code. I have read through the forums> and I see Ara Howard is using C extensions to process images - I'll try> the same thing. I have some questions for the group:> - I capture images from a camera, process and analyze them, and display> them at ~10 fps. Ruby-v4l (capture) is for Linux only. Tk is probably> too slow, and someone recommended using OpenGL for display. Has anyone> had success with image capture or display using Ruby? What worked? Any> advice?I wrote a small slideshow program with Ruby, imlib2, and OpenGL. Withimages around 800x600 in size, it achieves ~20 images per second on myAthlon XP 1733MHz (read jpeg, decode jpeg into gl texture format, sendthe texture to the vidcard, draw quad with texture on screen, swapframe.) If you have a ready stream of decoded image data coming, I'dguess the main limiting factor would be RAM->vidcard bus speed.Don't know about Tk, but would find it sort of strange if it couldn'tdisplay 10fps video. Anyone tried?> - Is anyone using pure Ruby to process images real-time? RMagick is too> limited for my applications. I doubt Ruby would match the speed of C,> but it might be fun to try.Correct me if I'm wrong, but image processing is one of those thingsthat plays directly into the weaknesses of the current Rubyimplementation. Lots of iteration, lots of method calls -> very slowin pure Ruby. It's okay for prototyping algorithms on small images,though. Now, if there was something like Regexps, but for imageediting...> Thanks, John>Hope this helps,Ilmari