chain codes




I would like to known if any one can describe to me how to read the
chain code of two circles side by side in a image and how do I would
know when one image has finished and another image has begun. using C+
+ code. I have tried the typical neighbourhood code and it does not
seem to work.


for(int h=1; h<ROWS-1;h++)
{
for(int w=1; w<COLS-1;w++)
{
int value=Array[h][w];

if (val<255)
cout<<h<<" " <<w<<endl;

getchar();

if(Array[h][w]<255)
{
Shape_Array[h][w] = value;
}
else
if (Array[h][w+1] < 255 && Shape_Array[h][w+1] == 255)
{
Shape_Array[h][w+1] = value;
w++;
}
else if (Array[h][w-1] < 255 && Shape_Array[h][w-1] == 255)
{
Shape_Array[h][w-1] = value;
w--;
}

else
if (Array[h+1][w-1] < 255 && Shape_Array[h+1][w-1] == 255)
{
Shape_Array[h+1][w-1] = value;
h++;
w--;
}
else if (Array[h+1][w] < 255 && Shape_Array[h+1][w] == 255)
{
Shape_Array[h+1][w] = value;
h++;
}
else if (Array[h+1][w+1] < 255 && Shape_Array[h+1][w+1] == 255)
{
Shape_Array[h+1][w+1] = value;
h++;
w++;
}
else if (Array[h-1][w-1] < 255 && Shape_Array[h-1][w-1] == 255)
{
Shape_Array[h-1][w-1] = value;
h--;
w--;
}
else if (Array[h-1][w] < 255 && Shape_Array[h-1][w] == 255)
{
Shape_Array[h-1][w] = value;
h--;
}
else if (Array[h-1][w+1] < 255 && Shape_Array[h-1][w+1] == 255)
{
Shape_Array[h-1][w+1] = value;
h--;
w++;
}




}
}

.



Relevant Pages

  • chain codes
    ... chain code of two circles side by side in a image and how do I would ... know when one image has finished and another image has begun. ... I have tried the typical neighbourhood code and it does not ...
    (sci.image.processing)
  • chain codes
    ... chain code of two circles side by side in a image and how do I would ... know when one image has finished and another image has begun. ... I have tried the typical neighbourhood code and it does not ...
    (sci.image.processing)