Recent Changes - Search:

Main

Robotics I Fall 2007

Robotics II Spring 2007

Robotics I Fall 2006

Vision Servoing Laboratories

FPGA-Based Vision

VDSP

LabVIEW Embedded

Code

Site Admin

edit SideBar

Lab1

Vision.Lab1 History

Hide minor edits - Show changes to output

Changed lines 166-167 from:
happy to do not overcome skin pixels, it should be easy to eliminate them, just check [[http://www.cc.gatech.edu/~rehg/Papers/SkinDetect-IJCV-lowres.pdf#search=%22Statistical%20Color%20Models%20with%20Application%20to%20Skin%20Detection%22 |here]]
to:
happy with the prescence of skin-like pixels, it should be easy to eliminate them, just check [[http://www.cc.gatech.edu/~rehg/Papers/SkinDetect-IJCV-lowres.pdf#search=%22Statistical%20Color%20Models%20with%20Application%20to%20Skin%20Detection%22 |here]]
Changed line 136 from:
    if(temp_pixel<=80) {
to:
    if(temp_pixel<=80) { // put the color BLACK on those pixels where the difference is small
Changed line 148 from:
    (*outptr)= 0x86;
to:
    (*outptr)= 0x85;
Changed line 155 from:
  outptr+=2;
to:
  outptr+=2;
Added lines 122-123:

Deleted line 121:
Changed lines 135-137 from:
    outptr--;
    inptr--;
        (*outptr)= 0x00;
to:
    outptr-=2;
    inptr-=2;
        (*outptr)= 0x2A;
Changed line 140 from:
    (*outptr)= 0x00;
to:
    (*outptr)= 0x85;
Changed line 143 from:
    (*outptr)= 0x00;
to:
    (*outptr)= 0x2A;
Changed lines 146-149 from:
    (*outptr)= 0x00;
to:
    (*outptr)= 0x86;
    outptr++;
    inptr++;
   
Changed line 153 from:
       outptr+=2;
to:
  outptr+=2;
Changed lines 155-156 from:
                         index++;
to:
    index++;
Changed lines 161-162 from:
happy to not overcome skin pixels, it should be easy to eliminate them, just check [[http://www.cc.gatech.edu/~rehg/Papers/SkinDetect-IJCV-lowres.pdf#search=%22Statistical%20Color%20Models%20with%20Application%20to%20Skin%20Detection%22 |here]]
to:
happy to do not overcome skin pixels, it should be easy to eliminate them, just check [[http://www.cc.gatech.edu/~rehg/Papers/SkinDetect-IJCV-lowres.pdf#search=%22Statistical%20Color%20Models%20with%20Application%20to%20Skin%20Detection%22 |here]]
Changed lines 26-27 from:
// [[Attach:rgbtable.txt | Here]] you will find the table rgbtable
to:
// [[Attach:rgbtable.txt | Here]] you will find the table rgbtable ready to be used.
Changed lines 160-161 from:
Now, you have to localize those coloured areas and define an strategy to track only those.
to:
Now, you have to localize those coloured areas and define an strategy to track only those. If you are not very
happy to not overcome skin pixels, it should be easy to eliminate them, just check [[http://www.cc.gatech.edu/~rehg/Papers/SkinDetect-IJCV-lowres.pdf#search=%22Statistical%20Color%20Models%20with%20Application%20to%20Skin%20Detection%22 |here]]

Changed lines 151-160 from:
    outptr--;
    inptr--;
  outptr++;
    inptr++;        
        outptr++;
    inptr++;
  outptr++;
    inptr++;
    index++;
to:
       outptr+=2;
    inptr+=2;
                         index++;
Changed lines 115-116 from:
# Suppose you have a mobil robot equipped with a digital camera. An object is shown to your robot and the mission is to follow it. With the above code you can easily find a desired color at frame rate. What you have to do is answer the next question, which are the most prominent colors in an image ? and then, define an strategy to allow your robot to follow it!
to:
I) Suppose you have a robot equipped with a digital camera. An object is shown to your robot and the mission is to follow it. With the above code you can easily find a desired color at frame rate. What you have to do is answer the next question, which are the most prominent colors in an image ? and then, define an strategy to allow your robot to follow it!
Changed lines 167-169 from:
# Color filtering can be used to create color layers. Even if the computation of one-color-layer is not expensive - in computational terms - consider many colors at the same time can decline the performance of our program. [[http://citeseer.ist.psu.edu/bruce00fast.html | Here]] you can find a very nice strategy to overcome such a difficulty.

to:
Now, you have to localize those coloured areas and define an strategy to track only those.

II)
Color filtering can be used to create color layers. Even if the computation of one-color-layer is not expensive - in computational terms - consider many colors at the same time can decline the performance of our program. [[http://citeseer.ist.psu.edu/bruce00fast.html | Here]] you can find a very nice strategy to overcome such a difficulty.

Changed line 21 from:
[[Attach:project.proj| Here]] you can download a whole set of functions that compose a project for
to:
[[Attach:project.zip| Here]] you can download a whole set of functions that compose a project for
Changed lines 21-22 from:

to:
[[Attach:project.proj| Here]] you can download a whole set of functions that compose a project for
the next color image processing.

Changed lines 116-119 from:
On the next images you can apply an aritmentic substraction, pixel by pixel, to find what is moving.

Attach:orig.jpg Attach:orig3.jpg Attach:orig2.jpg
to:
On the next images you can apply an aritmetic substraction, pixel by pixel, to find what is moving.

Attach:orig.jpg  - Attach:orig3.jpg = Attach:orig2.jpg
Changed line 22 from:
->color = 196  ;
to:
Changed line 27 from:
to:
->color = 196  ;
Added lines 92-93:
                           // If you like to filter a sequence of colors just comment the line
                            // of the white color assignment
Deleted lines 96-97:
outptr++;
    (*outptr) = 0x00;
Added lines 100-101:
    (*outptr) = 0x00;
    outptr++;
Added lines 116-165:
On the next images you can apply an aritmentic substraction, pixel by pixel, to find what is moving.

Attach:orig.jpg Attach:orig3.jpg Attach:orig2.jpg

Check the function diff_image:

int diff_image(    u32 width,
                    u32 height,
                    u8 *inptr,
                    u8 *outptr) {
int w, h,index=0;
u8 temp_pixel;

for( h = 0; h < height; h++ ) {
for( w = 0; w < width; w++) {
    outptr+=2;
    inptr+=2;
    temp_pixel = abs((*outptr) - (*inptr));
    if(temp_pixel<=80) {
    outptr--;
    inptr--;
        (*outptr)= 0x00;
    outptr++;
    inptr++;
    (*outptr)= 0x00;
    outptr++;
    inptr++;
    (*outptr)= 0x00;
    outptr++;
    inptr++;
    (*outptr)= 0x00;
    }
    else
    {
    outptr--;
    inptr--;
  outptr++;
    inptr++;        
        outptr++;
    inptr++;
  outptr++;
    inptr++;
    index++;

      }
  }
}
return index;
}

Changed lines 24-26 from:
// Here you will find the table rgbtable

to:

// [[Attach:rgbtable.txt | Here]] you will find the table rgbtable

Changed lines 22-26 from:
->color = 196  ; // Check the table  on http://peeron.com/cgi-bin/invcgis/colorguide.cgi
to:
->color = 196  ;
// Check the table  on http://peeron.com/cgi-bin/invcgis/colorguide.cgi
// Here you will find the table rgbtable

Changed lines 107-108 from:
# Suppose you have a mobil robot equipped with a digital camera. An object is shown to your robot and the mission is to follow it. With the above code you can easily find a desired color at frame rate. What you have to do is answer the next question, which are the most prominent colors in an image ? and then, define an strategy to allow your robot not to loose it!!
to:
# Suppose you have a mobil robot equipped with a digital camera. An object is shown to your robot and the mission is to follow it. With the above code you can easily find a desired color at frame rate. What you have to do is answer the next question, which are the most prominent colors in an image ? and then, define an strategy to allow your robot to follow it!
Changed lines 4-5 from:
corresponds to desirable color.
to:
corresponds to an specific color.
Changed line 21 from:
*****************************************************
to:
Changed line 26 from:
***********************************************************************************************
to:
Changed lines 9-10 from:
%center%Attach:Frame-0032.jpg Attach:blue_0108-0032.jpg |
to:
%center%Attach:Frame-0032.jpg Attach:blue_0108-0032.jpg
Changed lines 107-110 from:
# Suppose you have a mobil robot equipped with a digital camera. An object is shown to your robot and the mission is to follow
it. With the above code you can easily find a desired color at frame rate. What you have to do is answer the next question,
Which
are the most prominent colors in an image ? and then, define an strategy to allow your robot not to loose it!!
to:
# Suppose you have a mobil robot equipped with a digital camera. An object is shown to your robot and the mission is to follow it. With the above code you can easily find a desired color at frame rate. What you have to do is answer the next question, which are the most prominent colors in an image ? and then, define an strategy to allow your robot not to loose it!!
Changed lines 107-108 from:
# Suppose you have a mobil robot equipped with a digital camera. An object is shown to your robot and the mission is to follow it. With the above code you can easily find a desired color at frame rate. What you have to do is answer the next question, Which are the most prominent colors in an image ? and then, define an strategy to allow your robot not to loose it!!
to:
# Suppose you have a mobil robot equipped with a digital camera. An object is shown to your robot and the mission is to follow
it. With the above code you can easily find a desired color at frame rate. What you have to do is answer the next question,
Which are the most prominent colors in an image ? and then, define an strategy to allow your robot not to loose it!!
Deleted line 8:
Changed lines 28-29 from:

int yvyu_to_colorblob(  u32 width,
to:
int yvyu_to_blob_color(  u32 width,
Changed lines 40-41 from:
to:
int hm_colors=0;
Changed lines 66-67 from:
for( h = 0; h < height; h+=jump_h ) {
for( w = 0; w < width; w+=jump_w) {
to:
for( h = 0; h <= height; h+=jump_h ) {
for( w = 0; w <= width; w+=jump_w) {
Changed line 75 from:
    (*outptr) = (int)yy;
to:
    (*outptr) = (int)yy ;
Changed line 79 from:
    (*outptr) = (int)yy;
to:
    (*outptr) = (int)yy ;
Added line 83:
    hm_colors++;
Changed line 88 from:
    (*outptr) = 0xFE;
to:
    (*outptr) = 0x00;
Changed line 90 from:
    (*outptr) = 0x7F;
to:
    (*outptr) = 0x00;
Changed line 92 from:
    (*outptr) = 0xFE;
to:
    (*outptr) = 0x00;
Changed line 94 from:
    (*outptr) = 0x7F;
to:
    (*outptr) = 0x00;
Added line 102:
Added lines 22-28:
*****************************************************
->color = 196  ; // Check the table  on http://peeron.com/cgi-bin/invcgis/colorguide.cgi
->yvyv_to_blob_color( PIXEL_PER_LINE, LINES_PER_FRAME, (u8*)Frame, (u8*)Color,
->rgbtable[color-1][1],rgbtable[color-1][2],rgbtable[color-1][3]);

***********************************************************************************************

Changed lines 99-100 from:
# Suppose you have a mobil robot equipped with a digital camera. An object is shown to your robot and the mission is to follow it. With the above code you can easily find a desired color at frame rate. What you have to do is answer the next question, Which are the most prominent colors in an image ? and define an strategy to allow your robot not to loose it!!
to:
# Suppose you have a mobil robot equipped with a digital camera. An object is shown to your robot and the mission is to follow it. With the above code you can easily find a desired color at frame rate. What you have to do is answer the next question, Which are the most prominent colors in an image ? and then, define an strategy to allow your robot not to loose it!!
Added lines 106-107:
[[http://citeseer.ist.psu.edu/343516.html | Colour and Reflectance]]
Changed lines 112-114 from:


to:
[[http://citeseer.ist.psu.edu/gevers97color.html | Color Based Object Recognition]]

[[ http://citeseer.ist.psu.edu/sharma97digital.html | Digital Color Imaging]]


Changed lines 108-113 from:





to:
[[http://en.wikipedia.org/wiki/Bayer_filter | Bayer filter]]



Added lines 107-113:






Added line 106:
[[http://www.developer.com/java/other/article.php/3512456#Discussion_and_Sample_Code | Processing Image Pixels, Color Intensity, Color Filtering, and Color Inversion]]
Changed lines 101-104 from:
# Color filtering can be used to create color layers. Even if the computation of one-color-layer is not expensive - in computational terms - consider many colors at the same time can decline the performance of our program. [[http://citeseer.ist.psu.edu/bruce00fast.html | Here]] you can find a
very nice strategy to overcome such a difficulty.

to:
# Color filtering can be used to create color layers. Even if the computation of one-color-layer is not expensive - in computational terms - consider many colors at the same time can decline the performance of our program. [[http://citeseer.ist.psu.edu/bruce00fast.html | Here]] you can find a very nice strategy to overcome such a difficulty.

Changed line 101 from:
## Color filtering can be used to create color layers. Even if the computation of one-color-layer is not expensive - in computational terms - consider many colors at the same time can decline the performance of our program. [[http://citeseer.ist.psu.edu/bruce00fast.html | Here]] you can find a
to:
# Color filtering can be used to create color layers. Even if the computation of one-color-layer is not expensive - in computational terms - consider many colors at the same time can decline the performance of our program. [[http://citeseer.ist.psu.edu/bruce00fast.html | Here]] you can find a
Added lines 100-106:

## Color filtering can be used to create color layers. Even if the computation of one-color-layer is not expensive - in computational terms - consider many colors at the same time can decline the performance of our program. [[http://citeseer.ist.psu.edu/bruce00fast.html | Here]] you can find a
very nice strategy to overcome such a difficulty.


''' References'''

Changed line 99 from:
# Which are the most prominent colors in an image ?
to:
# Suppose you have a mobil robot equipped with a digital camera. An object is shown to your robot and the mission is to follow it. With the above code you can easily find a desired color at frame rate. What you have to do is answer the next question, Which are the most prominent colors in an image ? and define an strategy to allow your robot not to loose it!!
Changed lines 22-23 from:

to:
int yvyu_to_colorblob(  u32 width,
                    u32 height,
                    u8 *inptr,
                    u8 *outptr,
                    int R, int G, int B)
{
int w, h;  // parameters for the main loop
int jump=1; // over sampling the image: 1 is to scan all the pixels
int jump_w=jump,jump_h=jump;
int Y_max,Y_min,U_max,U_min,V_min,V_max; // border of the color "window"
int cp = 20;  // cp= color proximity
float y,u,v,yy,uu,vv,Y,U,V,r,g,b;


r=(float)R/255;
g=(float)G/255;
b=(float)B/255;

    // RGB to YUV conversion

Y = 0.299*r + 0.587*g + 0.114*b ;
yy = 13 + (Y*222);
U = - 0.147*r - 0.289*g + 0.436*b ;
uu = 13 + (U + .436)/.872*227;
V = 0.615*r - 0.515*g - 0.100*b ;
vv = 13 + (V + .615)/1.23*227;
 
// creat the color proximity on YUV

U_max = (int)uu + cp;
U_min = (int)uu - cp;
Y_max = (int)yy + cp;
Y_min = (int)yy - cp;
V_max = (int)vv + cp;
V_min = (int)vv - cp;


for( h = 0; h < height; h+=jump_h ) {
for( w = 0; w < width; w+=jump_w) {
    outptr+=(4*(jump_w-1));
if ((inptr[0] >= Y_min) && (inptr[0] <= Y_max) &&
(inptr[3] >= U_min) && (inptr[3] <= U_max) &&
(inptr[2] >= Y_min) && (inptr[2] <= Y_max) &&
(inptr[1] >= V_min) && (inptr[1] <= V_max) )
{
    // OUPUT the desired color if it is close to
    (*outptr) = (int)yy;
      outptr++;
    (*outptr) = (int)vv;
outptr++;
    (*outptr) = (int)yy;
    outptr++;
    (*outptr) = (int)uu;
    outptr++;
}
else
{
    // OUTPUT white color if the pixel do not correspond
    (*outptr) = 0xFE;
      outptr++;
    (*outptr) = 0x7F;
outptr++;
    (*outptr) = 0xFE;
    outptr++;
    (*outptr) = 0x7F;
    outptr++;
  }
inptr += (4*jump_w);
}
outptr+=width*(jump_h-1);
inptr+=width*(jump_h-1);
}
  return 0;   
}

Added lines 20-23:
''' Starting Code'''


Changed lines 1-2 from:
* Color Filtering
to:
'''Color Filtering'''
Added lines 20-22:
'''Mission'''

# Which are the most prominent colors in an image ?
Changed lines 16-19 from:
format.
to:
format.

The corresponding colors for most of the LEGO bricks are available [[http://peeron.com/cgi-bin/invcgis/colorguide.cgi | here]]

Changed lines 1-2 from:
Color Filtering
to:
* Color Filtering
Changed lines 9-10 from:
[[http://en.wikipedia.org/wiki/YCbCr | YCbCr]]
to:
Added lines 15-16:
The image is captured in the [[http://en.wikipedia.org/wiki/YCbCr | YCbCr]]
format.
Changed lines 9-10 from:
http://en.wikipedia.org/wiki/YCbCr
to:
[[http://en.wikipedia.org/wiki/YCbCr | YCbCr]]
Changed lines 9-10 from:
to:
http://en.wikipedia.org/wiki/YCbCr
Changed lines 11-12 from:
INPUT OUTPUT
to:

The image on the left corresponds to the INPUT image.
The image on the right corresponds to the
OUTPUT image.
Changed lines 10-12 from:
Attach:Frame-0032.jpg Attach:blue_0108-0032.jpg

to:
%center%Attach:Frame-0032.jpg Attach:blue_0108-0032.jpg |
INPUT OUTPUT

Changed lines 10-12 from:
[[Attach:Frame-0032.jpg | INPUT]] [[Attach:blue_0108-0032.jpg | OUTPUT ]]

to:
Attach:Frame-0032.jpg Attach:blue_0108-0032.jpg

Changed lines 10-12 from:
Attach:Frame-0032.jpg Attach:blue_0108-0032.jpg

to:
[[Attach:Frame-0032.jpg | INPUT]] [[Attach:blue_0108-0032.jpg | OUTPUT ]]

Changed lines 10-14 from:
Attach:Frame-0032.jpg

Attach:blue_0108-0032.jpg

to:
Attach:Frame-0032.jpg Attach:blue_0108-0032.jpg

Added lines 11-14:

Attach:blue_0108-0032.jpg

Changed line 10 from:
Attach:Frame-0032.bmp
to:
Attach:Frame-0032.jpg
Changed line 10 from:
to:
Attach:Frame-0032.bmp
Added lines 9-10:

Added lines 1-8:
Color Filtering

The main idea of this lab is to extract those pixels that
corresponds to desirable color.

E.g. From the next image, we like to extract those areas
that corresponds to an specific Blue.

Edit - History - Print - Recent Changes - Search
Page last modified on August 21, 2006, at 06:56 PM