public void show(Mat image,String windowName){ setSystemLookAndFeel(); JFrame frame = createJFrame(windowName); ImageProcessor imageProcessor = new ImageProcessor(); Image loadedImage = imageProcessor.toBufferedImage(image); imageView.setIcon(new ImageIcon(loadedImage)); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); }
public void show(Mat image,String windowName){ setSystemLookAndFeel(); JFrame frame = createJFrame(windowName); ImageProcessor imageProcessor = new ImageProcessor(); Image loadedImage = imageProcessor.toBufferedImage(image); imageView.setIcon(new ImageIcon(loadedImage)); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); }
public void show(Mat image,String windowName){ setSystemLookAndFeel(); JFrame frame = createJFrame(windowName); ImageProcessor imageProcessor = new ImageProcessor(); Image loadedImage = imageProcessor.toBufferedImage(image); imageView.setIcon(new ImageIcon(loadedImage)); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); }
public void show(Mat image,String windowName){ setSystemLookAndFeel(); JFrame frame = createJFrame(windowName); ImageProcessor imageProcessor = new ImageProcessor(); Image loadedImage = imageProcessor.toBufferedImage(image); imageView.setIcon(new ImageIcon(loadedImage)); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); }
public void show(Mat image,String windowName){ setSystemLookAndFeel(); JFrame frame = createJFrame(windowName); ImageProcessor imageProcessor = new ImageProcessor(); Image loadedImage = imageProcessor.toBufferedImage(image); imageView.setIcon(new ImageIcon(loadedImage)); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); }
public void show(Mat image,String windowName){ setSystemLookAndFeel(); JFrame frame = createJFrame(windowName); ImageProcessor imageProcessor = new ImageProcessor(); Image loadedImage = imageProcessor.toBufferedImage(image); imageView.setIcon(new ImageIcon(loadedImage)); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); }
public void show(Mat image,String windowName){ setSystemLookAndFeel(); JFrame frame = createJFrame(windowName); ImageProcessor imageProcessor = new ImageProcessor(); Image loadedImage = imageProcessor.toBufferedImage(image); imageView.setIcon(new ImageIcon(loadedImage)); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); }
public void show(Mat image,String windowName){ setSystemLookAndFeel(); JFrame frame = createJFrame(windowName); ImageProcessor imageProcessor = new ImageProcessor(); Image loadedImage = imageProcessor.toBufferedImage(image); imageView.setIcon(new ImageIcon(loadedImage)); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); }
public void show(Mat image,String windowName){ setSystemLookAndFeel(); JFrame frame = createJFrame(windowName); ImageProcessor imageProcessor = new ImageProcessor(); Image loadedImage = imageProcessor.toBufferedImage(image); imageView.setIcon(new ImageIcon(loadedImage)); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); }
public void show(Mat image,String windowName){ setSystemLookAndFeel(); JFrame frame = createJFrame(windowName); ImageProcessor imageProcessor = new ImageProcessor(); Image loadedImage = imageProcessor.toBufferedImage(image); imageView.setIcon(new ImageIcon(loadedImage)); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); }
private void runMainLoop(String[] args) throws InterruptedException { ImageProcessor imageProcessor = new ImageProcessor(); Mat webcamMatImage = new Mat(); Image tempImage; VideoCapture capture = new VideoCapture("src/main/resources/videos/Megamind.avi"); if( capture.isOpened()){ while (true){ capture.read(webcamMatImage); if( !webcamMatImage.empty() ){ tempImage= imageProcessor.toBufferedImage(webcamMatImage); ImageIcon imageIcon = new ImageIcon(tempImage, "Video playback"); imageLabel.setIcon(imageIcon); frame.pack(); //this will resize the window to fit the image Thread.sleep(50); } else{ System.out.println(" Frame not captured or video has finished"); break; } } } else{ System.out.println("Couldn't open video file."); } } }
private void runMainLoop(String[] args) throws InterruptedException { ImageProcessor imageProcessor = new ImageProcessor(); Image tempImage;
private void runMainLoop(String[] args) { ImageProcessor imageProcessor = new ImageProcessor(); Mat webcamMatImage = new Mat(); Image tempImage; VideoCapture capture = new VideoCapture(0); capture.set(Videoio.CAP_PROP_FRAME_WIDTH,320); capture.set(Videoio.CAP_PROP_FRAME_HEIGHT,240); if( capture.isOpened()){ while (true){ capture.read(webcamMatImage); if( !webcamMatImage.empty() ){ tempImage= imageProcessor.toBufferedImage(webcamMatImage); ImageIcon imageIcon = new ImageIcon(tempImage, "Captured video"); imageLabel.setIcon(imageIcon); frame.pack(); //this will resize the window to fit the image } else{ System.out.println(" -- Frame not captured -- Break!"); break; } } } else{ System.out.println("Couldn't open capture."); } } }
private void runMainLoop(String[] args) { ImageProcessor imageProcessor = new ImageProcessor(); Mat webcamMatImage = new Mat(); Image tempImage; VideoCapture capture = new VideoCapture(0); capture.set(Videoio.CV_CAP_PROP_FRAME_WIDTH,640); capture.set(Videoio.CV_CAP_PROP_FRAME_HEIGHT,480); if( capture.isOpened()){ while (true){ capture.read(webcamMatImage); if( !webcamMatImage.empty() ){ detectAndDrawFace(webcamMatImage); tempImage= imageProcessor.toBufferedImage(webcamMatImage); ImageIcon imageIcon = new ImageIcon(tempImage, "Captured video"); imageLabel.setIcon(imageIcon); frame.pack(); //this will resize the window to fit the image } else{ System.out.println(" -- Frame not captured -- Break!"); break; } } } else{ System.out.println("Couldn't open capture."); } }