1

I am working as java developer. I am working on a project that involves car number plate extraction. There are three steps involved in it: First conversion of image to grays scale, then detecting edges in the image using Canny Edge Detection algorithm, third is passing image to a matlab compiled code which extract number plate from the image. First two steps are successful. In third step when i pass image to matlab compiled .exe application it gives me error: Runtime erro '5': invalid procedure call or argument.

Below is code that i use for passing image to matlab compiled application:

Process p = null;
        try {
            // TODO add your handling code here:
             p = Runtime.getRuntime()
                      .exec("c:/ImageResources/enp   c:/ImageResources/edges.jpg");
        } catch (IOException ex) {
            Logger.getLogger(MatlabGUIForm.class.getName()).log(Level.SEVERE, null, ex);
        }
        System.out.println("Debug ");
        try {
            p.waitFor();
        } catch (InterruptedException ex) {
            Logger.getLogger(MatlabGUIForm.class.getName()).log(Level.SEVERE, null, ex);
        }
Cœur
  • 37,241
  • 25
  • 195
  • 267
  • Could it be that you don't have the appropriate Matlab Compiler Runtime installed? Also as you develop in Java - wouldn't it be easier if you use Matlab Builder for Java and create a class? – bdecaf Jun 01 '12 at 07:51

1 Answers1

0

I think the problem is related to the way you pass argument to the executable. If you put executable name and the argument in array, it may help. Here is related discussion, ProcessBuilder vs Runtime.exec(). Also, you can try ProcessBuilder.

Community
  • 1
  • 1
seninp
  • 712
  • 1
  • 6
  • 23
  • Sorry for late reply. I tried to put executable name and arguments in an array,but it didn't solved my problem. –  Jun 04 '12 at 18:19