title: Error using Java OpenCV library with size
body: <p>I am newly working with openCV in java on eclipse and am working on an eye tracking software, i am using a base code some one else has created and plan to tweek it but am having an error with a few lines of code and can not figure out why. here is the entire class</p>
  
  <pre><code>package have;
  
  import java.awt.*;  
  
  import java.awt.image.BufferedImage;  
  import java.io.ByteArrayInputStream;  
  import java.io.IOException;  
  import javax.imageio.ImageIO;  
  import javax.swing.*;  
  import org.opencv.core.Core;  
  import org.opencv.core.Mat;  
  import org.opencv.core.MatOfByte;  
  import org.opencv.core.MatOfRect;  
  import org.opencv.core.Point;  
  import org.opencv.core.Rect;  
  import org.opencv.core.Scalar;  
  import org.opencv.core.Size;  
  import org.opencv.highgui.Highgui;  
  import org.opencv.highgui.VideoCapture;  
  import org.opencv.imgproc.Imgproc;  
  import org.opencv.objdetect.CascadeClassifier;  
  
  class FacePanel extends JPanel{  
       private static final long serialVersionUID = 1L;  
       private BufferedImage image;  
       // Create a constructor method  
       public FacePanel(){  
            super();   
       }  
       /*  
        * Converts/writes a Mat into a BufferedImage.  
         *   
        * @param matrix Mat of type CV_8UC3 or CV_8UC1  
        * @return BufferedImage of type TYPE_3BYTE_BGR or TYPE_BYTE_GRAY  
        */       
       public boolean matToBufferedImage(Mat matrix) {  
            MatOfByte mb=new MatOfByte();  
            Highgui.imencode(".jpg", matrix, mb);  
            try {  
                 this.image = ImageIO.read(new      ByteArrayInputStream(mb.toArray()));  
             } catch (IOException e) {  
                 e.printStackTrace();  
                 return false; // Error  
            }  
         return true; // Successful  
       }  
       public void paintComponent(Graphics g){  
            super.paintComponent(g);   
            if (this.image==null) return;         
              g.drawImage(this.image,10,10,this.image.getWidth(),this.image.getHeight(),     null);
        }
  
  }  
  class FaceDetector {  
       private CascadeClassifier face_cascade;  
       // Create a constructor method  
       public FaceDetector(){  
           // face_cascade=new      CascadeClassifier("./cascades/lbpcascade_frontalface_alt.xml");  
           //..didn't have not much luck with the lbp
  
          face_cascade=new      CascadeClassifier("./cascades/haarcascade_frontalface_alt.xml"); 
            if(face_cascade.empty())  
            {  
                 System.out.println("--(!)Error loading A\n");  
                  return;  
            }  
            else  
            {  
                       System.out.println("Face classifier loooaaaaaded up");  
            }  
       }  
       public Mat detect(Mat inputframe){  
             Mat mRgba=new Mat();  
             Mat mGrey=new Mat();  
        MatOfRect faces = new MatOfRect();  
        inputframe.copyTo(mRgba);  
        inputframe.copyTo(mGrey);  
        Imgproc.cvtColor( mRgba, mGrey, Imgproc.COLOR_BGR2GRAY);  
        Imgproc.equalizeHist( mGrey, mGrey );  
        face_cascade.detectMultiScale(mGrey, faces);  
        System.out.println(String.format("Detected %s faces", faces.toArray().length));  
        for(Rect rect:faces.toArray())  
        {  
            Point center= new Point(rect.x + rect.width*0.5, rect.y + rect.height*0.5 );  
            //draw a blue eclipse around face
  </code></pre>
  
  <p>the error starts here with error code : "The constructor Size(double, double, int, int, int, Scalar) is undefined"</p>
  
  <pre><code>          Size s = new Size( rect.width*0.5, rect.height*0.5), 0, 0, 360, new Scalar( 0, 0, 255 )
  </code></pre>
  
  <p>then here at ellipse i get an error of : "The method ellipse(Mat, RotatedRect, Scalar, int, int) in the type Core is not applicable for the arguments (Mat, Point, Size, int, int, int)</p>
  
  <pre><code>           Core.ellipse( mRgba, center,s , 4, 8, 0 );  
        }  
        return mRgba;  
   }  
  </code></pre>
  
  <p>}<br>
      public class Eyes {  </p>
  
  <pre><code>public static void main(String arg[]) throws InterruptedException{  
    // Load the native library.  
    System.loadLibrary(Core.NATIVE_LIBRARY_NAME); 
    //or ...     System.loadLibrary("opencv_java244");       
  
    //make the JFrame
    JFrame frame = new JFrame("WebCam Capture - Face detection");  
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  
  
    FaceDetector faceDetector=new FaceDetector();  
    FacePanel facePanel = new FacePanel();  
    frame.setSize(400,400); //give the frame some arbitrary size 
    frame.setBackground(Color.BLUE);
    frame.add(facePanel,BorderLayout.CENTER);       
    frame.setVisible(true);       
  
    //Open and Read from the video stream  
     Mat webcam_image=new Mat();  
     VideoCapture webCam =new VideoCapture(0);   
  
      if( webCam.isOpened())  
        {  
         Thread.sleep(500); /// This one-time delay allows the Webcam to initialize itself  
         while( true )  
         {  
           webCam.read(webcam_image);  
           if( !webcam_image.empty() )  
            {   
                Thread.sleep(200); /// This delay eases the computational load .. with little performance leakage
                 frame.setSize(webcam_image.width()+40,webcam_image.height()+60);  
                 //Apply the classifier to the captured image  
                 webcam_image=faceDetector.detect(webcam_image);  
                //Display the image  
                 facePanel.matToBufferedImage(webcam_image);  
                 facePanel.repaint();   
            }  
            else  
            {   
                 System.out.println(" --(!) No captured frame from webcam !");   
                 break;   
            }  
           }  
          }
         webCam.release(); //release the webcam
  
    } //end main 
  
  }
  </code></pre>
  
  <p>any and all help would be greatly appreciated </p>