testing region growing , tested on input3 ,seems worked