diff --git a/LinearRegressionTool/pom.xml b/LinearRegressionTool/pom.xml
index 7f049aa..3653ea1 100644
--- a/LinearRegressionTool/pom.xml
+++ b/LinearRegressionTool/pom.xml
@@ -1,53 +1,126 @@
- 4.0.0
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 4.0.0
- wwu
- masterarbeit
- 1.0-SNAPSHOT
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
-
-
- 1.8
-
-
-
-
+ wwu
+ Masterarbeit
+ 1.0
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+
+ 1.8
+
+
-
-
-
- org.jfree
- jfreechart
- 1.0.14
-
+
+
+ org.apache.maven.plugins
+ maven-assembly-plugin
+ 2.4.1
+
+
+
+ jar-with-dependencies
+
+
+
+
+ App
+
+
-
-
- junit
- junit
- 4.12
-
+
+
+
+ make-assembly
+
+ package
+
+ single
+
+
+
+
+
+ com.googlecode.mavennatives
+ maven-nativedependencies-plugin
+ 0.0.7
+
+
+ unpacknatives
+ generate-resources
+
+ copy
+
+
+
+
-
-
- com.opencsv
- opencsv
- 3.9
-
+
+
-
-
- com.jtattoo
- JTattoo
- 1.6.11
-
-
+
+
+
+
+ org.jfree
+ jfreechart
+ 1.0.14
+
+
+
+
+ junit
+ junit
+ 4.12
+
+
+
+
+ com.opencsv
+ opencsv
+ 3.9
+
+
+
+
+ com.jtattoo
+ JTattoo
+ 1.6.11
+
+
+
+
+ org
+ opencv
+ 2.4.13
+ ${project.basedir}/src/main/resources/libs/opencv-2413.jar
+
+
+
+ org
+ opencv
+ 2.4.13
+ system
+ dll
+ ${project.basedir}/src/main/resources/libs/x64/opencv_java2413.dll
+ native-all
+
+
+
+
+ org.apache.commons
+ commons-io
+ 1.3.2
+
+
+
\ No newline at end of file
diff --git a/LinearRegressionTool/src/main/java/App.java b/LinearRegressionTool/src/main/java/App.java
index ff5755b..03ce55b 100644
--- a/LinearRegressionTool/src/main/java/App.java
+++ b/LinearRegressionTool/src/main/java/App.java
@@ -1,12 +1,16 @@
import model.LineModel;
+
+import org.apache.commons.io.IOUtils;
import org.opencv.core.Core;
import presenter.Presenter;
-import presenter.evaluation.PictureProcessor;
import view.MainFrame;
import javax.swing.*;
import java.awt.*;
-import java.lang.reflect.InvocationTargetException;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
/**
* Implementierung verschiedener Algorithmen zur Berechnung von Ausgleichsgeraden.
@@ -17,7 +21,33 @@ import java.lang.reflect.InvocationTargetException;
*/
public class App {
- static {System.loadLibrary(Core.NATIVE_LIBRARY_NAME);}
+
+
+ private static void loadLibrary() {
+ try {
+ InputStream in = null;
+ File fileOut = null;
+ String osName = System.getProperty("os.name");
+
+ int bitness = Integer.parseInt(System.getProperty("sun.arch.data.model"));
+ if(bitness == 32){
+ in = App.class.getResourceAsStream("/libs/x86/opencv_java2413.dll");
+ fileOut = File.createTempFile("tmp", ".dll");
+ }
+ else if (bitness == 64){
+ in = App.class.getResourceAsStream("/libs/x64/opencv_java2413.dll");
+ fileOut = File.createTempFile("tmp", ".dll");
+ }
+
+ OutputStream out = new FileOutputStream(fileOut);
+ IOUtils.copy(in, out);
+ in.close();
+ out.close();
+ System.load(fileOut.toString());
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to load opencv native library", e);
+ }
+ }
private static void setUIFont(javax.swing.plaf.FontUIResource f) {
java.util.Enumeration