I loaded a binary image and I want to convert it to 2D array, in particular int[][]
:
public int[][] ImageToArray(String pathImage) throws IOException {
File file = new File(pathImage);
BufferedImage bufferedImage = ImageIO.read(file);
int width = bufferedImage.getWidth();
int height = bufferedImage.getHeight();
int[][] imageArray = new int[width][height];
return imageArray;}
But when I run my source code I get an exception:
Caused by: javax.imageio.IIOException: Can't read input file!
Can you help me?