Stack Exchange
Can not process the image on unix from opencv but same program works on windows
I have tested my program on windows platform, works perfectly. But when I try to run it on Raspbian, Unix, it doesn't go further after iplcvLoadimage.
What could be the problem?
Here is my code 


mport com.googlecode.javacv.cpp.opencv_core.CvPoint;
import com.googlecode.javacv.cpp.opencv_core.IplImage;
import static com.googlecode.javacv.cpp.opencv_core.cvSize;
import static com.googlecode.javacv.cpp.opencv_core.cvZero;
import static com.googlecode.javacv.cpp.opencv_core.cvMinMaxLoc;
import static com.googlecode.javacv.cpp.opencv_core.IPL_DEPTH_32F;
import static com.googlecode.javacv.cpp.opencv_core.cvCreateImage;
import static com.googlecode.javacv.cpp.opencv_imgproc.cvMatchTemplate;
import static com.googlecode.javacv.cpp.opencv_highgui.cvLoadImage;
import static com.googlecode.javacv.cpp.opencv_imgproc.CV_TM_SQDIFF;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import org.opencv.core.Core;

public class MatchTemplateTest {
    
    public static HashMap<String,Double> getPatternMatch(String img)
    {
        ArrayList<String>names=new ArrayList<>();
        HashMap<String,Double> MatchMap=new HashMap<>();
        
        File []f=null;
        try
        {
           
            String path=new File(new File(".").getCanonicalPath()+"/Output"+"/Logo").getAbsolutePath();
            f=new File(path).listFiles();
        } catch (Exception e) {
        }
        IplImage src=null;
        try {
          
    // this is where the problem is 
    
            src= cvLoadImage(img,0);
   
   // can not process further 
        } catch (Exception e) {
            System.out.println("ERROR  "+e);
        }




If the problem is with reading the image, then there are two possiblities

The image does not exist, or the path to the image is wrong. In *nix the path is separated with a slash '/', e.g. /home/asharma/data/myimage.pgm, but in windows it is separated with a backslash, e.g. C:\User\Data\My Image.pgm
The image decoder for the image does not exist in the version of the library. For example, if the image is in PNG format, but opencv was not compiled with PNG, then you cannot read the image.

what is the output of System.out.println("ERROR  "+e);?

thanks . option 1 might be the possibility .  i tried to print exception also it sayas "unsatisfied link error : no jniopencv_highgui in java.library.path"

Then, it is option 2. Your opencv version was not compiled with the highgui module. Try compiling the library yourself, or check that the jre path is correct. That is my best guess.

can you guide me how to do that ?
