2

In windows i have a java swing application with a jymyron library for cature frames using web camera.but jmyron library is not supporting in fedora.( dll files not supported in fedora).then what library i can used in my application.how to install that.plz give suggestions.actually i tried with jmf.but i cant install it properly.because frame grabber i used in the code is not supporting in linux platform.the code is like.

package imagepanel;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.util.Timer;
import java.util.TimerTask;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class TestWebCam extends JFrame {
  private FrameGrabber vision;
  private BufferedImage image;
  private VideoPanel videoPanel = new VideoPanel();
  private JButton jbtCapture = new JButton("Show Video");
  private Timer timer = new Timer();
  public TestWebCam() {
    JPanel jpButton = new JPanel();
    jpButton.setLayout(new FlowLayout());
    jpButton.add(jbtCapture);
    setLayout(new BorderLayout());
    add(videoPanel, BorderLayout.CENTER);
    add(jpButton, BorderLayout.SOUTH);
    setVisible(true);
    jbtCapture.addActionListener(
      new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          timer.schedule(new ImageTimerTask(), 1000, 33);
       }
    }
   );
}

class ImageTimerTask extends TimerTask {
  public void run() {  
    videoPanel.showImage();
 }
}
class VideoPanel extends JPanel {
  public VideoPanel() {
    try {
      vision = new FrameGrabber();
      vision.start();
    } catch (FrameGrabberException fge) {
  }
}

protected void paintComponent(Graphics g) {
  super.paintComponent(g);
  if (image != null)
    g.drawImage(image, 10, 10, 160, 120, null);
  }

  public void showImage() {
    image = vision.getBufferedImage();
    repaint();   
  }
}

  public static void main(String[] args) {
    TestWebCam frame = new TestWebCam();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(190, 210);
    frame.setVisible(true);
  }
}

1 Answer 1

3

I don't know if this will help, but the v4ljmyron project purports to implement JMyron support for Linux. The most recent version is on github here.

You will need to build from source ... follow the instructions.

4
  • Thank you.So only i have to add the"V4ljmyron-master.zip" to the libary for the above mentioned code right?
    – Anu Shaji
    Jan 31, 2013 at 5:48
  • 1
    No ... you have to BUILD IT ... as described in the README file.
    – Stephen C
    Jan 31, 2013 at 7:31
  • actually that README is something confusing to me atlaest.especially "Get the current webcam extra source from SourceForge" ,since iam new to linux.Could you please help me to install it properly
    – Anu Shaji
    Jan 31, 2013 at 8:47
  • 1
    I think that you are going to struggle with this. I suggest that you ask a friend / co-worker / fellow student who is knows Linux to help you out. Someone who can sit down at your computer and help you. Hand-holding someone through the steps of building and installing code is off-topic for StackOverflow.
    – Stephen C
    Jan 31, 2013 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.