Are you prepared to share any of your code, ideas or programming
knowledge? If so feel welcome to send me a personal email :-)
My practical foray into vision started with interfacing
the old monochrome quickcam ccd camera. I wrote the interface
for DOS in QBasic, Assembler and also C using the DJGPP
I have played with the LogicTech webcams using their SDK and
the old VC++5 by inserting C code functions in a a VC++ shell.
Also used the old VB5 using some video for windows functions
that were given to me.
Although I understand the basics of analog and digital
electronics and have done a lot of interfacing via the
parallel port it is, as I said, a time problem. When I
get time I think it is better spent on working on some
algorithm than reinventing the electronic wheel.
As for software I would rather write my own libraries
and know that I understand the algorithms fully and can
use them without any proprietory problems.
The trick might be to write it in a Java or HLA which can
be compiled to either OS? Java has robotics support including
Yea, the quickcams are really fun. I may an intruder alarm for mine. Doing a
pixel differential analysis, no edge detection or anything serious. I bet I
still have that code somewhere.
In the open source world, there is such a rich assortment of code to use
that it is the hardware that is more difficult to do.
"Proprietory problems?" Forget it. I work in the software world, you can't
know if you are infringing on anyone's patents. Its one of the reasons why
a lot of developers are trying to fight software patents.
There are thousands of software patents approved every year. The majority of
them are duplictive or trivial. In 1999 some guy patented the swing.
Microsoft is busy patenting things like XML. A mere human can not know them
all and still accomplish anything. Sure there is plenty of "prior
practices," but legal "prior art" is sometimes hard to come by.
You are actually in worse shape if you have a track record of researching
the patent databases for algorithms. That way it is more likely than not
that you knew you were infringing on a patent, and then you have treble
So forget about it. Code what you want and patents only come into play if
you want to sell to a large customer. At that point, refuse to indemnify
and provide as-is and let them fight the legal battles.
I can honestly say I would sooner jump off a cliff than code something in
Java or a high level language. C/C++ are what I enjoy.
The cool thing about C and C++ is that while they can be used as if they are
high level languages, there is a direct correlation between the statements
used and the machine code that is generated. This is not true with
Java, .NET, perl, etc.
C and C++, are "low level" in that they produce directly executable machine
code in a predictable fashion.
Assembler is good, and I used to love writing in it, but I find that 99% of
the time, a good optimizing C compiler can generate faster code than
hand-done assembler. This isn't to say that C is faster than assembler,
because, obviously, it can't be. The problem is readability and
maintainability. When you write assembler, you have to be able to read it
and maintain it. The C compiler doesn't need to. Because of this, spagetti
code that you would never write in a million years, gets generated
automatically. It takes short cuts you would never do, and makes
assumptions that cross function modules you never would. In short, it
generates fast unmaintainable poorly written code. The beauty is that it
doesn't need to be maintained, and its only poorly written if you have to
If you read the paragraph carefully, you'll see that I say that most of the
time C/C++ code is faster than assembler.
It is *always* possible (if you know how) to code something more efficiently
or at least as efficiently in assembler, the issue is whether or not it can
be done in a way that is maintainable.
As you wrote in another post, this is a computer
science debate and we are here on comp.robotics.
We are not all advanced computer programmers and
never will be. I have not used AVL trees or even
a hash table and haven't found myself handicapped
as a result. At this point issues such as cluster
computing, messaging APIs or MPIs are not on my
Unfortunately for people like me this great big
bureaucratic monolith called Windoze or Linux has
been placed between me and the hardware (camera,
i/o port, or graphics card). The only access I can
afford (as a non professional programmer) is Java.
In fact all the robotic projects I have done so
far, including vision, have worked fine using C
or even the QBasic interpreter (robotic arm).
If they ever had commercial value I could always
hire an expert to type up a Windoze/Linux interface :)
While robotics is not computer science, there is a great deal of computer
science in it.
Well, there is an interesting paradox in this statement. Robotics is by its
very nature a persuit that requires some very advanced conceptual thinking.
Knowledge of computer science is not nessisary to build kits or assemble
parts, but if you intend to do anything interesting once you do, you'll
find such knowledge very useful.
Windows does have a huge barrier to entry. The cost of tools, the complexity
of the APIs, etc.
With Linux (and FreeBSD and most other x86 unix), if you run the programs as
root, the layer between the OS and program goes away. I wouldn't suggest
this in a production environment, but for a hobby it works great. You get
the accessabiliy of old DOS and the multitasking, memory, networking, etc
of unix, what's not to love?
So you don't consider my programs interesting?
Nothing I have read as regards AI, robots, NNs
requires expertise in the Windoze or Linux OS
or the use of APIs or MPIs etc.
But I do understand the power of these systems
as an environment for multitasking and integrating
mulitiple programs, giving a standard user
friendly interface and so on...
I had thought of loading Linux onto a cheap old computer
to see how hard it would be to learn to use but just haven't
got around to it.
Never did I say they weren't interesting, but I don't think anyone could
disagree with the statement that a good foundation is some of the basics of
computer science would be helpful.
I remember in the early '80s, I was learning about opamps. Out of nowhere
came this idea about how to make a pseudo-ramp generator using the opamp
and an RC circuit. I was so excited as I thought this was a new idea. Later
on, after I had built and proved to myself that the circuit worked, I saw
it publised in a "Using opaps" cookbook.
Many of the things a beginner struggles with are covered quickly in some of
the first computer science books. Learning about trees, hash tables, lists,
recursion, and so on equip you with some really nifty concepts that make
figuring out how to do things much easier.
I was talking about computer science, not the trivia of OS and API.
Yes, a good OS is helpful.
Well, for starts, you could download "knoppix," which is a Linux that need
not even be installed. It boots off the CD. Get your feet wet and decide
what to do.
Also, you can install a second hard disk on your computer and install Linux
I followed that project a while back. DOS, like CP/M before it, were awesome
for thier time. These days, I find that I am less than enthusiastic about
DOS. Sure, for nostalgia purposes its great, but of little value outside of
a few virtical applications.
Most computer systems from the PC-104 to nano-ITX to full blown PCs are
conceptually HUGE computer systems compared to what DOS was designed to run
on. Gigabytes of memory, many more of virtual memory, memory protection,
32bit addressability (64bit becoming popular), process isolation,
instruction pipelining, more RAM than DOS 3.x could handle on a hard disk.
For my time and money, a open source unix is the way to go. Linux, FreeBSD,
NetBSD, etc. all have a cleaner simplicity. DOS started life as (more or
less) a port of CP/M (Z80/8080) to the Intel 8086 (8088) by the name of
QDOS by seattle computer (Microsoft bought the original DOS). Everything
added to it was shoe horned into it with the requirement it ran in 640K
(and could run programs). UNIX, the bastard child of Multics, inherited a
design that expected to run on hardware that handn't even been designed (or
even conceived). In short, the design was carefully done. CP/M and DOS were
designed to run on little microprocessors, Multics was designed to run on
large hardware with lots of memory and lots of disks and peripherals.
I know this sounds like a dis on DOS and CP/M, it isn't at all. The first
micro computer I ever built was based on an RCA 1802 ELF. An 8 bit computer
with 16 general purpose registers. It was real fun to work on. I miss
burning eproms, debugging with a scope, etc. Those times are, however,
How would I code ZZZ in basic?
I would think about it and type it in.
But I haven't yet found use for the
"avl tree" or "hash table" and I prototyped
occupancy grid, path planning in BASIC,
as well as line detect, "edge" detect,
shape detect, object detect, pattern
matching, robot arm controller, OCR.
When I get a good understanding of
the problem and the solution, and have
code that works in BASIC, I switch to
I think as far as this group goes (comp.robotics.misc),
most people are either very beginner,
or advanced and not sharing code or algorithms.
There are exceptions, but I think I am mostly
That is why I suggest BASIC or psuedocode.
Help those who are beginning in this hobby
to understand algorithms which seem complicated,
but are very easy if described correctly.
Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here.
All logos and trade names are the property of their respective owners.