Code covered by the BSD License  

Highlights from
Red and Green Pixel Separation

2.33333

2.3 | 3 ratings Rate this file 14 Downloads (last 30 days) File Size: 1.69 KB File ID: #28712

Red and Green Pixel Separation

by GAGAN

 

14 Sep 2010 (Updated 22 Apr 2011)

The following code can be used to separate red and green pixels from a colored image.

| Watch this File

File Information
Description

The following code can be used to separate red and green pixels from an image. It is based on color distance transform. Some Threshold has to be provided so that its color distance is within some range to determine whether the given pixel is red or green.

Required Products Image Processing Toolbox
MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (5)
14 Sep 2010 Sean de

There are a number of things wrong with this submission:
-It displays and imtool and two figures of the output arguments without the ability to turn them off.
-Uses double FOR loops for a two-line logical index expression
-Only does red and green; why not blue? why not the ability to select what colors we want?
-Takes a filename as input not a matrix and does no error checking
-Does two calculations that are never used (M-LINT!!!)

14 Sep 2010 GAGAN

I have used this one for robotic purposes for identifying red or green signal ligts. One can easily detect the blue color as well using the algorithm.

14 Sep 2010 GAGAN

I have removed wasteful calculations as well.

25 Sep 2010 Harsha Vardhan  
24 Apr 2011 Petter  
Please login to add a comment or rating.
Updates
14 Sep 2010

I have removed two redundant calculations.

16 Mar 2011

Applied new Tags.

22 Apr 2011

Added new Tags.

Tag Activity for this File
Tag Applied By Date/Time
image processing GAGAN 14 Sep 2010 11:08:08
red GAGAN 14 Sep 2010 11:08:08
green GAGAN 14 Sep 2010 11:08:08
red color GAGAN 14 Sep 2010 11:08:08
green color GAGAN 14 Sep 2010 11:08:08
color GAGAN 14 Sep 2010 11:08:08
color distance transform GAGAN 14 Sep 2010 11:08:08
green color detection GAGAN 14 Sep 2010 11:08:08
transform GAGAN 14 Sep 2010 11:08:08
red detection GAGAN 14 Sep 2010 11:08:08
green detection GAGAN 14 Sep 2010 11:08:08
red color detection GAGAN 14 Sep 2010 11:08:08
distance GAGAN 14 Sep 2010 11:08:08
blue GAGAN 22 Apr 2011 13:15:13

Contact us at files@mathworks.com