|
35 | 35 | import gab.opencv.Line; |
36 | 36 |
|
37 | 37 | import java.awt.Rectangle; |
38 | | - |
39 | 38 | import java.awt.image.BufferedImage; |
40 | 39 | import java.awt.image.DataBufferInt; |
41 | 40 | import java.nio.ByteBuffer; |
42 | 41 | import java.nio.IntBuffer; |
43 | | - |
| 42 | +import java.io.File; |
44 | 43 | import java.lang.reflect.Field; |
45 | 44 | import java.net.URL; |
46 | | - |
47 | 45 | import java.util.ArrayList; |
48 | 46 | import java.util.Collections; |
49 | 47 |
|
|
62 | 60 | import org.opencv.calib3d.Calib3d; |
63 | 61 | import org.opencv.core.CvException; |
64 | 62 | import org.opencv.core.Core.MinMaxLocResult; |
65 | | - |
66 | 63 | import org.opencv.video.BackgroundSubtractorMOG; |
67 | | - |
68 | 64 | import org.opencv.objdetect.CascadeClassifier; |
69 | 65 | import org.opencv.imgproc.Imgproc; |
70 | 66 |
|
@@ -354,14 +350,24 @@ private void initNative(){ |
354 | 350 | if(!nativeLoaded){ |
355 | 351 | int bitsJVM = PApplet.parseInt(System.getProperty("sun.arch.data.model")); |
356 | 352 | String nativeLibPath = getLibPath() ; |
| 353 | + |
357 | 354 | if (PApplet.platform == PConstants.WINDOWS) { //platform Windows |
358 | | - nativeLibPath = nativeLibPath + "windows" + bitsJVM; |
| 355 | + File path = new File(nativeLibPath + "windows" + bitsJVM); |
| 356 | + if (path.exists()) { |
| 357 | + nativeLibPath = nativeLibPath + "windows" + bitsJVM; |
| 358 | + } |
359 | 359 | } |
360 | 360 | if (PApplet.platform == PConstants.MACOSX) { //platform Mac |
361 | | - nativeLibPath = nativeLibPath + "macosx" + bitsJVM; |
| 361 | + File path = new File(nativeLibPath + "macosx" + bitsJVM); |
| 362 | + if (path.exists()) { |
| 363 | + nativeLibPath = nativeLibPath + "macosx" + bitsJVM; |
| 364 | + } |
362 | 365 | } |
363 | 366 | if (PApplet.platform == PConstants.LINUX) { //platform Linux |
364 | | - nativeLibPath = nativeLibPath + "linux" + bitsJVM; |
| 367 | + File path = new File(nativeLibPath + "linux" + bitsJVM); |
| 368 | + if (path.exists()) { |
| 369 | + nativeLibPath = nativeLibPath + "linux" + bitsJVM; |
| 370 | + } |
365 | 371 | } |
366 | 372 |
|
367 | 373 | if((PApplet.platform == PConstants.MACOSX && bitsJVM == 64) || (PApplet.platform == PConstants.WINDOWS && bitsJVM == 32) || (PApplet.platform == PConstants.LINUX)){ |
|
0 commit comments