@Override
    public void actionPerformed(ActionEvent e) {
        if (e.getSource().equals(buttons[0])) {
            camera.openCamera(1);
        } else if (e.getSource().equals(buttons[1])) {
            if (camera.isOpen()) {
                if(camera.isVideo()){
                    camera.stopCameraVideo();
                }
                Mat frame = camera.getCapture();
                m4p.refreshNewMatFrame4Image(frame);
            } else {
                JOptionPane.showMessageDialog(null, "Encienda primero la camara");
            }
        } else if (e.getSource().equals(buttons[2])) {
            if (camera.isOpen()) {
                camera.startCameraVideo();
                isdisplayImage = false;
                MyBooleans.chargeImage = true;
            } else {
                JOptionPane.showMessageDialog(null, "Encienda primero la camara");
            }
        } else if (e.getSource().equals(buttons[3])) {
            //falta por definir
        } else if (e.getSource().equals(buttons[4])){
            camera.loadImage("img/"+textField.getText());
            System.out.println("img/"+textField.getText());
            m4p.refreshNewMatFrame4Image(MyMatImages.ImageOpenCVCharged);
            MyBooleans.chargeImage = true;
            isdisplayImage = true;
        }
    }