4.85714

4.9 | 23 ratings Rate this file 260 Downloads (last 30 days) File Size: 2.27 KB File ID: #28757
image thumbnail

Tracking red color objects using matlab

by A. Bhargav Anand

 

18 Sep 2010 (Updated 17 Nov 2010)

This program just tracks all red color objects and draws a bounding box around them.

| Watch this File

File Information
Description

This program just tracks all red color objects and draws a bounding box around them. This works on the difference between frames concept. Every frame in the video is returned as an rgb image on which we can do image processing stuff.

MATLAB release MATLAB 7.7 (R2008b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (36)
01 Oct 2010 akash

wow!!really that was so simple.can u tell me where u learned this stuff.it will be really helpful

01 Oct 2010 A. Bhargav Anand

@akash Dude, download the code, I have documented the whole code. Just go through it, try reading the documentation of every function i have used. And yeah, where did I get this stuff, GOOGLE it man !!!

08 Oct 2010 hiren  
08 Oct 2010 hiren  
08 Oct 2010 hiren

hi dude can u tell me how i can detect other colour..
i mean where i can change the code so i can do that thing...
thanks...

31 Oct 2010 ika

can u tell me how to make tracking object if i want track motion object and give annotation from start point untilthe object stop moving,so i can track from fisrt position, for example tracking with line???

thanks before....

02 Nov 2010 A. Bhargav Anand

@hiren, ika- sorry guys, ive been little busy these dayz, neways ill definitly get back to you guys with an answer. As of now this program was written only to detect the standard colors i.e. Red, Green & Blue colors. I was thinking to extend the whole program by adding a graphical interface and generalizing the whole tracking process.

@akash- you get lotz of stuff on internet dude. juss google about object tracking or motion tracking. Look the documentation of the image processing & video processing toolbox in matlab. Use the matlab help and go through the documentation of important functions that will be helpful. Thas enough fr mastering fundas !!! :)

17 Nov 2010 A. Bhargav Anand

Updated the code guys. Also uploaded a video.

http://www.youtube.com/watch?v=ARJae5d3oLg

18 Nov 2010 chen po sen

very smart and good experimental , thks .

24 Nov 2010 Hoa Dang

you are wonderful !!!
Thank you alot

25 Nov 2010 A. Bhargav Anand

Thanks man :)

19 Dec 2010 Vladimir  
26 Dec 2010 Arun

The speed of your code can be greatly improved if u can keep preview open in background.Also try to replace getsnapshot with peekdata (dont know to what extent it is possible)to reduce execution time(this may require manual triggering)

22 Apr 2011 Winston Larson

I had this working like a dream on Windows (this is a wonderful piece of software), but it seems to have trouble on a Mac. The video doesn't move fluidly, but rather captures just a couple of frames. Does anyone have the same issues, or advice? I'm admittedly new to Mac... Thanks!

14 May 2011 Jorge Lewinnek

I think it would be better if you use the conversion rgb to hsi, and determine the red color with hue, but it is a nice algorithm, and you help me a lot to know how to use my laptop camera.

26 Jun 2011 Atif Anwer

Brilliant Job Done! Really helpful in using this as a start for my Vision project :)

09 Jul 2011 Muhammad usman khan

hey please tell me to initialize webcam in MATLAB... im new in MATLAB.. what i have to write in your code to run it...
i thnk its cam name n resolution etc.. please give me example of correct syntax and where to read the name of camera and resolution...

17 Oct 2011 Karlo Isaac Ibáñez Viruega

Dude, my ML tells me that an error occurred " Error: File: redObjectTrack.m Line: 2 Column: 2
An array for multiple LHS assignment cannot contain character string." i think its related to the format of my camera : YCbCr422_640x480 does your program run with this format

10 Nov 2011 Sujin Wanchat  
18 Nov 2011 alexander

i'm getting errors from the getcamerainfo function

Error in ==> getCameraInfo at 4
camera_id = camera_info.DeviceInfo.DeviceID(end);

Error in ==> redObjectTrack at 2
[camera_name, camera_id, format] = getCameraInfo(a);

running r2010a 64 bit in windows 7

how might i remedy these errors

08 Jan 2012 nishant

outstanding

16 Jan 2012 atiqah  
24 Jan 2012 dads PB

Hey Dude if you teach me create red light camera using M-file ? pleasee

31 Jan 2012 Boo  
20 Mar 2012 TEJASVI DANDONA

Hi..Cud u pl tell me how to-
1) track colours other than red.
2) set the threshold such that the object in the front is tracked and not any other object in the back.
Thnx...

20 Mar 2012 Mohamad Faiz

Hi dude, do you know how to track red color using IP camera?

03 Apr 2012 Mr Smart  
15 Apr 2012 Peter Russo

Awesome, thanks a lot! I've been trying to make my own that uses just the intensity of the grayscale image, which is giving me lots of problems. By just picking a color, like red, it should be a lot easier. Thanks

25 Apr 2012 Mahdy Jadaliha

Great job. Thank you for sharing.

08 May 2012 elias argaw

please help
i try your code but i got the below message how i can fix it

??? Undefined function or method 'getCameraInfo'
for input arguments of type 'struct'.

12 May 2012 Ajay Kumar  
14 May 2012 Madiake Wasubera

maybe it could benefit me ,if you were to tell me where did you leant that.

22 May 2012 Fuat Cogun  
23 May 2012 Madiake Wasubera

Thanks a lot mate,your prog has helped me a lot,keep doin your thing.

31 May 2012 abu sadat

good

31 May 2012 abu sadat  
Please login to add a comment or rating.
Updates
17 Nov 2010

Previously the program just tracked the red object. Now the program has been updated to display the centroid of the detected object dynamically.

Tag Activity for this File
Tag Applied By Date/Time
video processing A. Bhargav Anand 20 Sep 2010 10:44:07
image processing A. Bhargav Anand 20 Sep 2010 10:44:07
object tracking A. Bhargav Anand 20 Sep 2010 10:44:07
color object tracking A. Bhargav Anand 20 Sep 2010 10:44:08
image aquisition A. Bhargav Anand 20 Sep 2010 10:44:08
image aquisition Siro 06 Oct 2010 04:51:53
color object tracking ika 01 Nov 2010 00:18:58
real time ika 01 Nov 2010 00:20:09
frames ika 01 Nov 2010 00:21:51
color object tracking HTW Dresden Dillmann 10 Nov 2010 16:19:46
video processing Mohamed Ali 09 Jul 2011 14:54:11
color object tracking roman badere 14 Jul 2011 11:19:34
object tracking roman badere 14 Jul 2011 11:19:46
color object tracking suganya 11 Aug 2011 07:09:09
frames UTeM Malaysia 18 Nov 2011 11:00:40
color object tracking usman 15 Dec 2011 12:15:31
color object tracking shrynik jain 01 Feb 2012 14:55:23
color object tracking Mohamad Faiz 20 Mar 2012 20:34:42
image tracking jalal shajahan 25 Mar 2012 22:09:10
video processing ujjwal kotdiya 29 Mar 2012 09:31:34
video processing Dave 30 Mar 2012 00:34:18
image tracking Arthur Benemann 02 May 2012 10:18:58
hey guys i got message says undefined function or method getcame elias argaw 08 May 2012 21:24:41

Contact us at files@mathworks.com