I am trying to get histogram of an image using this code Displaying a histogram of image data. Normally it works fine when input image given by url. But while I give image from local directory
private BufferedImage getImage() {
try {
return ImageIO.read(new URL(
"F:/test.jpg"));
} catch (IOException e) {
e.printStackTrace(System.err);
}
return null;
}
it gives exception,
java.net.MalformedURLException: unknown protocol: f
How to resolve this exception and get Histogram of an image