converting the region growing to C code, beginnings