graph cut - java implementation -working