I am working on a project where my first step is to detect faces by webcam and the 2nd step is to save those images into some file .i am using opencv programs for face detection. imagetoshow contains the image of face detected by the webcam.the code line for this is as: Image imageToShow = grabFrame();
i did first step but i am getting problem in second step code snippet to read the image that i am using is below: try{ f = new File("imageToShow"); //image file path image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); image = ImageIO.read(f); System.out.println("Reading complete."); }catch(IOException e){ System.out.println("Error: "+e); } It seems that it is not reading anything from the file specified .Am i doing it in the right way?