Java code to align ground truth and images