4 Replies Latest reply on Oct 24, 2012 12:47 PM by 818772

    Interfacing java application with digital camera

      Dear all,
      I've a question and I need your help.
      I've my swing/javafx application and I need to interface it with a digital camera.
      How should I proceed? How can I understand which digital camera offers support for java integration?
      Do you have some model for me?
        • 1. Re: Interfacing java application with digital camera
          If you have a digital camera sitting on your desk without any documentation on a Java interface for it, then throw it away and buy one that does. In the case you need to use a specific camera and you do not have any docs on it, then gracefully accept your "F" on your project and hope you can make it up on the next one.

          Now if you have documentation, that is a developer level of documentation, then you should have some Files with a ".h" extension for use with Java Native Interface, which is a C level of interface for Java. You will need to look up the JNI type of coding and have a C/C++ compiler to use in the project. If you do not have the ".h" files, then you should have a Java interface, a piece of code for your camera, that will allow you to use Java along with your device.

          If you do not have any of these, then see the beginning of this post. Java is not make to do device level of interfacing, and as such, you need to use the JNI C level interface to incorporate unsupported devices into Java.
          • 2. Re: Interfacing java application with digital camera
            I don't know anything about using Java directly with digital cameras. However I have a few observations. When you say you want to interface Java with a digital camera, do you mean you just want to display the image in a Java application? If so, you can use the software that came with the digital camera to download the images as *.jpeg (or whatever) to the hard disk. Then you can use Java to easily read the files from the hard disk and display them or move them to some other location. For instance, when you display them in Java, then you can then ask the user to fill out various textfields to go along with the image such as giving a title to the image or a description.

            If instead you want to write Java to grab the images from the camera directly, I think that's a bad idea. I imagine different digital cameras have uniquely written custom software to communicate between the digital camera and say, Windows 7 (I'm guessing). I doubt all the manufacturers have agreed upon a common way to communicate. Therefore if you take this route, you will end up creating a large set of Java programs to communicate with each model of camera. A maintenance nightmare.

            However, I have seen applications such as taking passport photos that appear to communicate directly with a digital camera wired to the computer which I imagine the vendor supplied with the application.
            • 3. Re: Interfacing java application with digital camera
              A simple search for "java webcam" turned this up as the first hit, which lists a good number of possibilities to investigate:

              • 4. Re: Interfacing java application with digital camera
                thanks for your reply.
                I'd like to hava a java app very simple with two features:
                1) a button, that once clicked forces camera (linked to pc via usb) to take a photograph
                2) a list that can show image from a folder of camera

                I don't need an universal solution, I can do this also with a specific camera, I need just to know how can I buy a camera that surely make me possible to do it, if there's some specification that I should ask to camera.