MiaoRong / javacv

Automatically exported from code.google.com/p/javacv
GNU General Public License v2.0
0 stars 0 forks source link

MultitrackerTrack causes invalid memory access #213

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Instal OpenCv 2.4.1
2. Compile the code
3. Run

What is the expected output? What do you see instead?

I would like for the program not to crash

What version of the product are you using? On what operating system?

javacv 0.0.1 -> via maven

$ java -version
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-10M3720)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode)

Please provide any additional information below.

I am attaching the necessary files in order to be able to compile an run the 
code, just correct the paths.

Original issue reported on code.google.com by fota...@gmail.com on 29 Jun 2012 at 9:23

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry I didn't add the error

Invalid memory access of location 0x70 rip=0x10a5f45b7

Original comment by fota...@gmail.com on 29 Jun 2012 at 9:23

GoogleCodeExporter commented 9 years ago
Why do you specify both
    tracker.setMarkerMode(ARToolKitPlus.MARKER_ID_BCH);
    tracker.setMarkerMode(ARToolKitPlus.MARKER_ID_SIMPLE);
?

Original comment by samuel.a...@gmail.com on 30 Jun 2012 at 3:59

GoogleCodeExporter commented 9 years ago
Hello,

When I saw your comment I thought this was an RTFM thing, but regardless of the 
mode the same error occurs.

Any other ideas, or information I can provide?

Does this code run for you?

Original comment by fota...@gmail.com on 30 Jun 2012 at 10:10

GoogleCodeExporter commented 9 years ago
I tried with the trunk of opencv and still the same error. I am attaching the 
OSX error report

Original comment by fota...@gmail.com on 30 Jun 2012 at 7:46

Attachments:

GoogleCodeExporter commented 9 years ago
It looks like there is something wrong with your camera_para.dat and ride.pat 
files. It doesn't crash if I change those for the sample LogitechPro4000.dat 
and markerboard_480-499.cfg ones that come with ARToolKitPlus...

Original comment by samuel.a...@gmail.com on 1 Jul 2012 at 1:00

GoogleCodeExporter commented 9 years ago
Hello,

Thank you for your feedback, I tried with those files, and still getting the 
same error. This is my new run method using the fiels from the ARTToolkitPlus  
sample 

@Override
    public void run() {

        try {

            int numDetected = 0;
            tracker = new ARToolKitPlus.MultiTracker(320, 240);

            tracker.init(
                    "/Users/fotis/Development/idea/JOpenCV/src/main/art/LogitechPro4000.dat",
                    "/Users/fotis/Development/idea/JOpenCV/src/main/art/markerboard_480-499.cfg",
                    1.0f,
                    1000.0f,
                    null);
            tracker.setPixelFormat(ARToolKitPlus.PIXEL_FORMAT_RGB);
                        tracker.setBorderWidth(0.125f);
                        tracker.setThreshold(100);
                        tracker.setUndistortionMode(ARToolKitPlus.UNDIST_LUT);
                        tracker.setPoseEstimator(ARToolKitPlus.POSE_ESTIMATOR_ORIGINAL);
//                        tracker.setMarkerMode(ARToolKitPlus.MARKER_ID_BCH);
                        tracker.setMarkerMode(ARToolKitPlus.MARKER_ID_SIMPLE);
                        tracker.setImageProcessingMode(ARToolKitPlus.IMAGE_FULL_RES);

            iplImage = IplImage.createFrom(ImageIO.read(Tracker.class.getResourceAsStream("/markerboard_480-499.jpg")));
            numDetected = tracker.calc(iplImage.imageData());

            System.out.println(numDetected);
        } catch (Exception e) {
            e.printStackTrace();

        }

    }

If you can run it please let me know of your specs as in OpenCv, java version 
and OS so I can pinpoint the problem :(

Best,
Fotis

Original comment by fota...@gmail.com on 1 Jul 2012 at 9:58

GoogleCodeExporter commented 9 years ago
Yes, it works just fine. I get "9" as output. 

$ java -version
Picked up _JAVA_OPTIONS: -Dsun.java2d.opengl=True
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.10) (fedora-55.1.9.10.fc14-x86_64)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)

and OpenCV 2.4.1, but that shouldn't matter.

I would check that the C++ sample code of ARToolKitPlus actually works. If it 
doesn't, then it's not a problem related with JavaCV.

Original comment by samuel.a...@gmail.com on 1 Jul 2012 at 12:30

GoogleCodeExporter commented 9 years ago
Hello Again,

The samples from 2.71 version of ARToolKitPlus works. Compling the 2.1.1t which 
is downloaded from the project page on OSX doesn't seem trivial to me.

Furthermore I would like to point out the the dynamic dylib created at runtime 
seems to have a hardcoded path, can this be the problem? 

$ otool -L 
/var/folders/lO/lOweRzLKH6epGZNAI-HcN++++TI/-Tmp-/javacpp1341155420676882000/lib
jniARToolKitPlus.dylib
/var/folders/lO/lOweRzLKH6epGZNAI-HcN++++TI/-Tmp-/javacpp1341155420676882000/lib
jniARToolKitPlus.dylib:
    /Users/saudet/NetBeansProjects/javacv/build/classes/com/googlecode/javacv/cpp/macosx-x86_64/libjniARToolKitPlus.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.1)

BTW- I am at the edge of my knowledge zone, so please excuse me.

Thanks

Original comment by fota...@gmail.com on 1 Jul 2012 at 3:15

GoogleCodeExporter commented 9 years ago
I think you are confusing ARToolKit with ARToolKitPlus. I am not aware of any 
version of ARToolKitPlus beyond 2.1.1, except maybe these 
https://launchpad.net/artoolkitplus/2.1.x/ . For ARToolKit, there are a couple 
of other libraries like http://nyatla.jp/nyartoolkit/wp/?page_id=315

GCC on Mac OS X likes to put hardcoded path like that by default. I don't think 
Java minds any of that, but if it does, let me know

Original comment by samuel.a...@gmail.com on 2 Jul 2012 at 1:21