I have some measured success. I was able to get a C program to work at capturing a frame from a webcam in both Java and Ruby, the big problem is is memory.
So I went back to JFM (Java Media Framework) but I am having all kinds of inconsistent issues. Sometimes it works with Groovy, [...]
Continue to Struggle with Linux WebCam
Language Uses & Editor Struggles
I was struggling for a bit on languages, which one to use, there are so many, do I use PHP, Ruby, Groovy, Python, or Jython or JRuby. I have settled on them let me summarize:
PHP - All my web programming will be in this language and my own custom framework.
Java - All my AI & [...]
Java vs. Groovy vs. JRuby
I was doing some benchmark testing on my robotics programs for vision testing and I got some interesting results. For the most complicated program Java took 5312ms, Groovy took 5453ms, and JRuby took 5531ms.
I was amazed at how close they were given that all the computer shootouts say that Groovy is slow and JRuby is [...]
Viewing A Web Camera with Java
I used this to test Video For Windows and the Java Media Framework (JMF) for my robotics code. If you install the JMF this should work fine for displaying the image from your webcam.
public class WebCamViewer extends SimpleSwing {
private Timer timer = new Timer();
private GetFrame getFrame;
private ImagePanel [...]
Controlling The Command Line with Java
I wrote this to launch some batch files from within an Java program.
public class CmdExec {
// process invoking program will call
private Process p;
// empty constructor
public CmdExec() { }
// execute command
public [...]
Getting Text and Images from The Web with Java
I used this code to get images and text from the web. First an image:
public static BufferedImage getImage(String urlString)throws Exception {
// construct URL
URL url = new URL(urlString);
// [...]
Creating a Pause Method in Java
I use this often in my robotics code. The reason is simple, it takes the robots time to do things and I need to wait for a microcontroller to perform some action, like get a sensor reading, or move a certain distance, or change heading. It’s very simple, but I will add more robotics code [...]
Invoking Java From Ruby
I did this using the rubygem Java-Ruby-Bridge. I did this because I was having problems with JRuby and wanted to execute my class from within Ruby.
Here is a simple way to do it, as long as you remember the classpath.
require ‘rjb’
Rjb::load(classpath = ‘../../TestJava/bin’, jvmargs=[])
test = Rjb::import(’Test’)
c = test.new
c.foo3
This way I was able to invoke a [...]
Categories
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Oct | ||||||
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
Archives
-
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- August 2006
- July 2006
- June 2006
- May 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
- August 2005
- July 2005
- June 2005
- May 2005
- February 2005
- January 2005
- November 2004
- October 2004
- September 2004
- August 2004
- July 2004
- June 2004
- May 2004
- April 2004
- March 2004

