Author Topic: Help in image processing:-))  (Read 5139 times)

0 Members and 1 Guest are viewing this topic.

Offline evilknight007Topic starter

  • Jr. Member
  • **
  • Posts: 42
  • Helpful? 0
Help in image processing:-))
« on: November 07, 2007, 08:20:46 PM »
Hi ppl .
I'm doing an autonomous robot for a competetion which must use image processing techniques.
the problem statement is to catch a RC controlled Thief bot ;) with our autonomous one . i have planned to use an overhead camera instead of a on board one .

As for the software i tried using matlab .but is takes too much time to analyse a  single image say (10-15 secs to find a centre of a red ball  :() I tried Roborealm(Thanks to u guys) but didn't really understand how to interface with the program.

Hope u get my point :D. . Can u guys point me in the right direction as which software would be better.

Offline sdk32285

  • Supreme Robot
  • *****
  • Posts: 418
  • Helpful? 0
Re: Help in image processing:-))
« Reply #1 on: November 07, 2007, 08:24:34 PM »
Hi
How are you doing it in matlab? If you vectorize your code, smooth the image (convolve with a gaussian), etc..
You can make your code quicker and more efficiently.
Robots for Roboticists Blog - http://robotsforroboticists.com/

Offline evilknight007Topic starter

  • Jr. Member
  • **
  • Posts: 42
  • Helpful? 0
Re: Help in image processing:-))
« Reply #2 on: November 07, 2007, 08:38:40 PM »
HI.
I have just started using Matlab and don;t have the slightest idea what you are talking about. ;D

But when i saw that a pic of 640*480 took 40 secs( !!!!)..i just resized the image to 320*240 and and made some modifications in the code to bring this down to 5-6 secs .

Offline sdk32285

  • Supreme Robot
  • *****
  • Posts: 418
  • Helpful? 0
Re: Help in image processing:-))
« Reply #3 on: November 07, 2007, 09:20:23 PM »
The first and easiest change is to get rid of any for loops. for example if you want to multiply each element of [3,2,4] by its corresponding number in [5;2;4] you can say [3,2,4] .* [5;2;4] instead of using a for loop.

Also make sure to put a ; at the end of each line of code so that it does not need to print things to the screen, this can also greatly speed your code up.

Also what function are you using to read the image in with? imread() is usually the quickest.
« Last Edit: November 08, 2007, 06:10:55 AM by sdk32285 »
Robots for Roboticists Blog - http://robotsforroboticists.com/

Offline fr4ncium

  • Jr. Member
  • **
  • Posts: 36
  • Helpful? 0
Re: Help in image processing:-))
« Reply #4 on: November 08, 2007, 02:06:20 AM »
I'm actually writing my own roborealm-esque Java applet right now.  Currently all it does is stream video from webcams and displays the pre-processed and post-processed video stream in separate windows.  Now I'm working on actual image algorithms (the only thing it can do at the moment is convert the stream to grayscale).  If you are familiar with Java and would like to mess around with it I can send you a copy of the code once I clean it up.

Offline JonHylands

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 562
  • Helpful? 3
  • Robot Builder/ Software Developer
Re: Help in image processing:-))
« Reply #5 on: November 08, 2007, 07:44:43 AM »
RoboRealm is trivially easy to interface to - it starts up as a web server, and you just connect to it via socket and send XML-formatted commands, and get XML-formatted responses back.

- Jon

Offline Steve Joblin

  • Supreme Robot
  • *****
  • Posts: 405
  • Helpful? 2
Re: Help in image processing:-))
« Reply #6 on: November 08, 2007, 09:31:11 AM »
RoboRealm also offer very easy to use Serial in and out capabilities... I would most definately give it another look!

Offline evilknight007Topic starter

  • Jr. Member
  • **
  • Posts: 42
  • Helpful? 0
Re: Help in image processing:-))
« Reply #7 on: November 08, 2007, 11:04:16 AM »
@sdk32285
Hey !! Tat really helped .But about avoiding for loops, how can i detect a centre of a circle or any object with using a loop .
So far i have been scanning every picture pixel by pixel and and have used two ;D for loops to find the centre of an object  :( But still don;t u think 5-6 seconds is slow in itself .
Looks like i have a lotta homework to do . :P

Offline evilknight007Topic starter

  • Jr. Member
  • **
  • Posts: 42
  • Helpful? 0
Re: Help in image processing:-))
« Reply #8 on: November 08, 2007, 11:12:31 AM »
@fr4ncium
Hi .. Thanks man. Aprreciate that. i just know the basics of java coding. But i'll still give it a try .Take your own time and perfect it before u send to me.  :P
@JonHylands & Steve Joblin
I read about the features in robotrealm and i think with a bit more reading and homework i can manage to do that.
But still as i said i'm not using a on board camera. Can the instructions(8 bits for four motors) be tranferred through RF from a serail port ? ?
Again, thanks a lot .  :)

Offline JonHylands

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 562
  • Helpful? 3
  • Robot Builder/ Software Developer
Re: Help in image processing:-))
« Reply #9 on: November 08, 2007, 11:50:21 AM »
RoboRealm runs on a PC. Whatever you write that talks to RoboRealm has to talk to it via socket, either locally on the same PC, or from a different one.

You might be able to use RoboRealm to control the vehicle directly, but personally I would use a decent high level language and just use RoboRealm for feature detection.

- Jon

Offline evilknight007Topic starter

  • Jr. Member
  • **
  • Posts: 42
  • Helpful? 0
Re: Help in image processing:-))
« Reply #10 on: November 12, 2007, 08:43:22 AM »
Thanks to you guys ..
Think i would be working on roborealm then.
Looks like it will be a lot easier than Matlab .
Have any of u worked with OpenCV before ??

 


Get Your Ad Here

data_list