Lets say there is an image which is size of A4 sheet. I want to segment part of it when four coordinates of the corners is given. So far what i could is this.

Java Code:
BufferedImage bf = ProcessingImages.tmpSideA.getSubimage(xx, yy, 290, 366);
which is not useful with my problem. Please someone help me with this??????

Thank you in Advance