Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

i want to read image captured by webcam videocapture and write that to some external file

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?

i want to read image captured by webcam videocapture and write that to some external file

>  I am working on a project where my
 > first step is to detect faces by
 > webcam and the 2nd step is to save
save`enter code here`
> 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?

> way?

i want to read image captured by webcam videocapture and write that to some external file

>  I am working on a project where my
> first step is to detect faces by
> webcam and the 2nd step is to save`enter code here`
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?

i want to read image captured by webcam videocapture and write that to some external file

 >  I am working on a project where my
> my first step is to detect faces by
> by webcam and the 2nd step is to save
> save those images  into some file  .i am
> am using opencv programs for face
> detection. facedetection. 
   imagetoshow contains the
> the image of face detected  by the
> webcam.the the webcam.The code line for this is as:
>          Image 


 >          `Image imageToShow = grabFrame();    grabFrame();` 


> 
> i did first step but i am getting
> getting problem in second step  code snippet
> 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
> file specified .Am i doing it in the  right
> right way?
click to hide/show revision 5
No.5 Revision

updated 2017-02-22 11:52:20 -0600

berak gravatar image

i want to read image captured by webcam videocapture and write that to some external file

    >  

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 facedetection.

imagetoshow contains the image of face detected by the webcam.The code line for this is as: > `Image as:

Image imageToShow = grabFrame();`
>
> 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:

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?

way?