SlideShare a Scribd company logo
Detection and Tracking of Red
Color
Project report
2014
Name: ABHIRAJ BOHRA
SEC: EC-A
Roll no.: 110103005
[Type the document title]
Detection and Tracking of RED color by
Using MATLAB
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.
% Capture the videoframesusingthe videoinputfunction
% replace the resolution&yourinstalledadaptorname.
% Setthe propertiesof the videoobject
%start the videoaquisition
%detectRED colourand Track
Function CODE:
function [camera_name, camera_id, resolution] = getCameraInfo(a)
camera_name = char(a.InstalledAdaptors(end));
camera_info = imaqhwinfo(camera_name);
camera_id = camera_info.DeviceInfo.DeviceID(end);
resolution = char(camera_info.DeviceInfo.SupportedFormats(end));
Main CODE:
a = imaqhwinfo;
[camera_name, camera_id, format] = getCameraInfo(a);
vid = videoinput(camera_name, camera_id, format);
set(vid, 'FramesPerTrigger', Inf);
set(vid, 'ReturnedColorspace', 'rgb')
vid.FrameGrabInterval = 5;
start(vid)
while(vid.FramesAcquired<=200)
data = getsnapshot(vid);
diff_im = imsubtract(data(:,:,1), rgb2gray(data));
diff_im = medfilt2(diff_im, [3 3]);
diff_im = im2bw(diff_im,0.18);
diff_im = bwareaopen(diff_im,300);
bw = bwlabel(diff_im, 8);
stats = regionprops(bw, 'BoundingBox', 'Centroid');
imshow(data)
hold on
for object = 1:length(stats)
bb = stats(object).BoundingBox;
bc = stats(object).Centroid;
rectangle('Position',bb,'EdgeColor','r','LineWidth',2)
plot(bc(1),bc(2), '-m+')
a=text(bc(1)+15,bc(2), strcat('X: ', num2str(round(bc(1))), ' Y: ',
num2str(round(bc(2)))));
set(a, 'FontName', 'Arial', 'FontWeight', 'bold', 'FontSize', 12, 'Color',
'yellow');
end
hold off
end
stop(vid);
flushdata(vid);
clear all

More Related Content

PDF
RGB colour detection and tracking on MATLAB
PDF
Color based image processing , tracking and automation using matlab
PPTX
Sobel Edge Detection Using FPGA
PPTX
color detection using open cv
PDF
HARDWARE SOFTWARE CO-SIMULATION FOR TRAFFIC LOAD COMPUTATION USING MATLAB SIM...
PPT
Presentation Object Recognition And Tracking Project
PDF
Digital image processing using matlab
PDF
Hardware software co simulation of edge detection for image processing system...
RGB colour detection and tracking on MATLAB
Color based image processing , tracking and automation using matlab
Sobel Edge Detection Using FPGA
color detection using open cv
HARDWARE SOFTWARE CO-SIMULATION FOR TRAFFIC LOAD COMPUTATION USING MATLAB SIM...
Presentation Object Recognition And Tracking Project
Digital image processing using matlab
Hardware software co simulation of edge detection for image processing system...

What's hot (18)

PDF
Canny Edge Detection Algorithm on FPGA
PDF
Real time-image-processing-applied-to-traffic-queue-detection-algorithm
PDF
Basic geometric shape and primary colour detection using image processing on ...
PDF
Open CV - 電腦怎麼看世界
PPTX
Image proceesing with matlab
PDF
使用人工智慧檢測三維錫球瑕疵_台大傅楸善
PDF
Digital Image Processing
PPTX
OpenCV presentation series- part 1
PDF
Flow Trajectory Approach for Human Action Recognition
PDF
Image processing with matlab
PDF
Ijetr011814
DOCX
image compression using matlab project report
PDF
Ijarcet vol-2-issue-3-891-896
PDF
Digital Image Processing: An Introduction
PDF
50620130101001
PDF
2018AOI論壇_深度學習於表面瑕疪檢測_元智大學蔡篤銘
PDF
Visual pattern recognition in robotics
PDF
Video and Image Processing for Finding Paint Defects using BeagleBone Black
Canny Edge Detection Algorithm on FPGA
Real time-image-processing-applied-to-traffic-queue-detection-algorithm
Basic geometric shape and primary colour detection using image processing on ...
Open CV - 電腦怎麼看世界
Image proceesing with matlab
使用人工智慧檢測三維錫球瑕疵_台大傅楸善
Digital Image Processing
OpenCV presentation series- part 1
Flow Trajectory Approach for Human Action Recognition
Image processing with matlab
Ijetr011814
image compression using matlab project report
Ijarcet vol-2-issue-3-891-896
Digital Image Processing: An Introduction
50620130101001
2018AOI論壇_深度學習於表面瑕疪檢測_元智大學蔡篤銘
Visual pattern recognition in robotics
Video and Image Processing for Finding Paint Defects using BeagleBone Black
Ad

Viewers also liked (20)

PPT
Color detection
PPTX
Object Detection & Tracking
PPTX
Real Time Object Tracking
PPT
Moving object detection
PPS
Ucda Barcode generation project
PDF
Digital image processing
PDF
PDF
My project work-Digital score board for shooting
DOCX
Color sensor
PDF
Using color sensor for user interaction
PDF
Process Redesign for Improving the Traceability of Medical Instruments: Case ...
PDF
2 track kinect@Bicocca - hardware e funzinamento
PDF
Manual controlador lógico zelio
PPTX
Instruksi timer dan counter plc omron
PDF
Cara kerja rangkaian up counter dan down counter
PPTX
Colour sensor vivek
PPT
Omron and InduSoft Web Studio Vision Systems
PDF
Timer dan counter
PPTX
Line follower robot
PPTX
Menggunakan cx programmer
Color detection
Object Detection & Tracking
Real Time Object Tracking
Moving object detection
Ucda Barcode generation project
Digital image processing
My project work-Digital score board for shooting
Color sensor
Using color sensor for user interaction
Process Redesign for Improving the Traceability of Medical Instruments: Case ...
2 track kinect@Bicocca - hardware e funzinamento
Manual controlador lógico zelio
Instruksi timer dan counter plc omron
Cara kerja rangkaian up counter dan down counter
Colour sensor vivek
Omron and InduSoft Web Studio Vision Systems
Timer dan counter
Line follower robot
Menggunakan cx programmer
Ad

Similar to Detection and tracking of red color by using matlab (20)

PDF
426 lecture 4: AR Developer Tools
PDF
COSC 426 Lect. 3 -AR Developer Tools
PDF
Droidcon NYC 2014: Building Custom Camera Applications
PDF
Droidcon NYC 2014: Building Custom Camera Applications
PPT
Build Your Own 3D Scanner: 3D Scanning with Structured Lighting
PPTX
Number plate recogition
PPT
virtualtouchscreen
PPTX
License Plate Recognition System
PDF
PPTX
car number plate detection using matlab image & video processing
PPT
Image processing for robotics
PDF
Mopcon2017 - AppDevKit x CameraKit
PPTX
project_final_seminar
PDF
Interfacing of MATLAB with Arduino for Object Detection Algorithm Implementat...
PDF
Machine vision Application
PDF
Machine Vision On Embedded Platform
PDF
“Efficiently Registering Depth and RGB Images,” a Presentation from eInfochips
KEY
FLAR Workflow
PDF
Smart Face Recognition System Analysis
PPTX
COSCUP 2017 FACE OFF
426 lecture 4: AR Developer Tools
COSC 426 Lect. 3 -AR Developer Tools
Droidcon NYC 2014: Building Custom Camera Applications
Droidcon NYC 2014: Building Custom Camera Applications
Build Your Own 3D Scanner: 3D Scanning with Structured Lighting
Number plate recogition
virtualtouchscreen
License Plate Recognition System
car number plate detection using matlab image & video processing
Image processing for robotics
Mopcon2017 - AppDevKit x CameraKit
project_final_seminar
Interfacing of MATLAB with Arduino for Object Detection Algorithm Implementat...
Machine vision Application
Machine Vision On Embedded Platform
“Efficiently Registering Depth and RGB Images,” a Presentation from eInfochips
FLAR Workflow
Smart Face Recognition System Analysis
COSCUP 2017 FACE OFF

More from Abhiraj Bohra (6)

PPT
Digital Circuit Verification Hardware Descriptive Language Verilog
PDF
Verilog tutorial
PPT
Number system and codes
PPTX
Solar Cells
PPT
Introduction to oscillator circuits
PPTX
Precaution to reduce mobile radiation in human beings
Digital Circuit Verification Hardware Descriptive Language Verilog
Verilog tutorial
Number system and codes
Solar Cells
Introduction to oscillator circuits
Precaution to reduce mobile radiation in human beings

Recently uploaded (20)

PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
additive manufacturing of ss316l using mig welding
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
CH1 Production IntroductoryConcepts.pptx
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
Sustainable Sites - Green Building Construction
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
PPT on Performance Review to get promotions
DOCX
573137875-Attendance-Management-System-original
PPTX
UNIT 4 Total Quality Management .pptx
PDF
composite construction of structures.pdf
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
additive manufacturing of ss316l using mig welding
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
UNIT-1 - COAL BASED THERMAL POWER PLANTS
OOP with Java - Java Introduction (Basics)
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
CH1 Production IntroductoryConcepts.pptx
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Embodied AI: Ushering in the Next Era of Intelligent Systems
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Sustainable Sites - Green Building Construction
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPT on Performance Review to get promotions
573137875-Attendance-Management-System-original
UNIT 4 Total Quality Management .pptx
composite construction of structures.pdf
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Mitigating Risks through Effective Management for Enhancing Organizational Pe...

Detection and tracking of red color by using matlab

  • 1. Detection and Tracking of Red Color Project report 2014 Name: ABHIRAJ BOHRA SEC: EC-A Roll no.: 110103005
  • 2. [Type the document title] Detection and Tracking of RED color by Using MATLAB 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. % Capture the videoframesusingthe videoinputfunction % replace the resolution&yourinstalledadaptorname. % Setthe propertiesof the videoobject %start the videoaquisition %detectRED colourand Track Function CODE: function [camera_name, camera_id, resolution] = getCameraInfo(a) camera_name = char(a.InstalledAdaptors(end)); camera_info = imaqhwinfo(camera_name); camera_id = camera_info.DeviceInfo.DeviceID(end); resolution = char(camera_info.DeviceInfo.SupportedFormats(end));
  • 3. Main CODE: a = imaqhwinfo; [camera_name, camera_id, format] = getCameraInfo(a); vid = videoinput(camera_name, camera_id, format); set(vid, 'FramesPerTrigger', Inf); set(vid, 'ReturnedColorspace', 'rgb') vid.FrameGrabInterval = 5; start(vid) while(vid.FramesAcquired<=200) data = getsnapshot(vid); diff_im = imsubtract(data(:,:,1), rgb2gray(data)); diff_im = medfilt2(diff_im, [3 3]); diff_im = im2bw(diff_im,0.18); diff_im = bwareaopen(diff_im,300); bw = bwlabel(diff_im, 8); stats = regionprops(bw, 'BoundingBox', 'Centroid'); imshow(data) hold on for object = 1:length(stats) bb = stats(object).BoundingBox; bc = stats(object).Centroid; rectangle('Position',bb,'EdgeColor','r','LineWidth',2) plot(bc(1),bc(2), '-m+') a=text(bc(1)+15,bc(2), strcat('X: ', num2str(round(bc(1))), ' Y: ', num2str(round(bc(2))))); set(a, 'FontName', 'Arial', 'FontWeight', 'bold', 'FontSize', 12, 'Color', 'yellow'); end hold off end stop(vid); flushdata(vid); clear all