mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
3845 initial version of object detection module
This commit is contained in:
parent
d0308d2b91
commit
13402bc358
@ -3,7 +3,7 @@ file.reference.c3p0-0.9.5.jar=release/modules/ext/c3p0-0.9.5.jar
|
||||
file.reference.commons-compress-1.14.jar=release/modules/ext/commons-compress-1.14.jar
|
||||
file.reference.commons-dbcp2-2.1.1.jar=release\\modules\\ext\\commons-dbcp2-2.1.1.jar
|
||||
file.reference.commons-pool2-2.4.2.jar=release\\modules\\ext\\commons-pool2-2.4.2.jar
|
||||
file.reference.dd-plist-1.20.jar=release\\modules\\ext\\dd-plist-1.20.jar
|
||||
file.reference.dd-plist-1.20.jar=release/modules/ext/dd-plist-1.20.jar
|
||||
file.reference.jdom-2.0.5-contrib.jar=release/modules/ext/jdom-2.0.5-contrib.jar
|
||||
file.reference.jdom-2.0.5.jar=release/modules/ext/jdom-2.0.5.jar
|
||||
file.reference.jgraphx-v3.8.0.jar=release/modules/ext/jgraphx-v3.8.0.jar
|
||||
@ -12,7 +12,7 @@ file.reference.jython-standalone-2.7.0.jar=release/modules/ext/jython-standalone
|
||||
file.reference.mchange-commons-java-0.2.9.jar=release/modules/ext/mchange-commons-java-0.2.9.jar
|
||||
file.reference.metadata-extractor-2.10.1.jar=release/modules/ext/metadata-extractor-2.10.1.jar
|
||||
file.reference.postgresql-9.4.1211.jre7.jar=release/modules/ext/postgresql-9.4.1211.jre7.jar
|
||||
file.reference.opencv-248.jar=release/modules/ext/opencv-248.jar
|
||||
file.reference.opencv-2413.jar=release/modules/ext/opencv-2413.jar
|
||||
file.reference.Rejistry-1.0-SNAPSHOT.jar=release/modules/ext/Rejistry-1.0-SNAPSHOT.jar
|
||||
file.reference.sevenzipjbinding-AllPlatforms.jar=release/modules/ext/sevenzipjbinding-AllPlatforms.jar
|
||||
file.reference.sevenzipjbinding.jar=release/modules/ext/sevenzipjbinding.jar
|
||||
|
@ -339,6 +339,10 @@
|
||||
<package>org.sleuthkit.autopsy.report</package>
|
||||
<package>org.sleuthkit.datamodel</package>
|
||||
</public-packages>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/jackcess-2.1.8.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/jackcess-2.1.8.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/zookeeper-3.4.6.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/zookeeper-3.4.6.jar</binary-origin>
|
||||
@ -348,33 +352,37 @@
|
||||
<binary-origin>release/modules/ext/jdom-2.0.5.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/sleuthkit-postgresql-4.6.1.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/sleuthkit-postgresql-4.6.1.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/opencv-248.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/opencv-248.jar</binary-origin>
|
||||
<runtime-relative-path>ext/cxf-rt-transports-http-3.0.16.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/cxf-rt-transports-http-3.0.16.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/curator-framework-2.8.0.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/curator-framework-2.8.0.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/commons-dbcp2-2.1.1.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/commons-dbcp2-2.1.1.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/jgraphx-v3.8.0.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/jgraphx-v3.8.0.jar</binary-origin>
|
||||
<runtime-relative-path>ext/bcprov-jdk15on-1.54.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/bcprov-jdk15on-1.54.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/commons-compress-1.14.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/commons-compress-1.14.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/fontbox-2.0.8.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/fontbox-2.0.8.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/commons-dbcp2-2.1.1.jar</runtime-relative-path>
|
||||
<binary-origin>release\modules\ext\commons-dbcp2-2.1.1.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/jgraphx-v3.8.0.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/jgraphx-v3.8.0.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/opencv-2413.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/opencv-2413.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/jython-standalone-2.7.0.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/jython-standalone-2.7.0.jar</binary-origin>
|
||||
@ -387,6 +395,14 @@
|
||||
<runtime-relative-path>ext/mchange-commons-java-0.2.9.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/mchange-commons-java-0.2.9.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/cxf-core-3.0.16.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/cxf-core-3.0.16.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/javax.ws.rs-api-2.0.1.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/javax.ws.rs-api-2.0.1.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/postgresql-9.4.1211.jre7.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/postgresql-9.4.1211.jre7.jar</binary-origin>
|
||||
@ -399,6 +415,10 @@
|
||||
<runtime-relative-path>ext/metadata-extractor-2.10.1.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/metadata-extractor-2.10.1.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/sleuthkit-postgresql-4.6.1.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/sleuthkit-postgresql-4.6.1.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/tika-core-1.17.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/tika-core-1.17.jar</binary-origin>
|
||||
@ -411,58 +431,18 @@
|
||||
<runtime-relative-path>ext/curator-client-2.8.0.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/curator-client-2.8.0.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/bcprov-jdk15on-1.54.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/bcprov-jdk15on-1.54.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/jackcess-2.1.8.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/jackcess-2.1.8.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/jackcess-encrypt-2.1.2.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/jackcess-encrypt-2.1.2.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/jempbox-1.8.13.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/jempbox-1.8.13.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/javax.ws.rs-api-2.0.1.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/javax.ws.rs-api-2.0.1.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/cxf-rt-rs-client-3.0.16.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/cxf-rt-rs-client-3.0.16.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/cxf-rt-transports-http-3.0.16.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/cxf-rt-transports-http-3.0.16.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/cxf-core-3.0.16.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/cxf-core-3.0.16.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/cxf-rt-frontend-jaxrs-3.0.16.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/cxf-rt-frontend-jaxrs-3.0.16.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/tika-parsers-1.17.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/tika-parsers-1.17.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/fontbox-2.0.8.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/fontbox-2.0.8.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/pdfbox-2.0.8.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/pdfbox-2.0.8.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/pdfbox-tools-2.0.8.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/pdfbox-tools-2.0.8.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/tika-parsers-1.17.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/tika-parsers-1.17.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/sqlite-jdbc-3.8.11.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/sqlite-jdbc-3.8.11.jar</binary-origin>
|
||||
@ -483,6 +463,14 @@
|
||||
<runtime-relative-path>ext/dd-plist-1.20.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/dd-plist-1.20.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/jempbox-1.8.13.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/jempbox-1.8.13.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/cxf-rt-rs-client-3.0.16.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/cxf-rt-rs-client-3.0.16.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/sevenzipjbinding-AllPlatforms.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/sevenzipjbinding-AllPlatforms.jar</binary-origin>
|
||||
@ -491,6 +479,10 @@
|
||||
<runtime-relative-path>ext/commons-pool2-2.4.2.jar</runtime-relative-path>
|
||||
<binary-origin>release\modules\ext\commons-pool2-2.4.2.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/jackcess-encrypt-2.1.2.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/jackcess-encrypt-2.1.2.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/jsoup-1.10.3.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/jsoup-1.10.3.jar</binary-origin>
|
||||
@ -499,6 +491,10 @@
|
||||
<runtime-relative-path>ext/jdom-2.0.5-contrib.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/jdom-2.0.5-contrib.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/pdfbox-2.0.8.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/pdfbox-2.0.8.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/c3p0-0.9.5.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/c3p0-0.9.5.jar</binary-origin>
|
||||
|
@ -267,7 +267,11 @@ public class Installer extends ModuleInstall {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private static void ensureClassifierFolderExists() {
|
||||
File objectDetectionClassifierDir = new File(PlatformUtil.getObjectDetectionClassifierPath());
|
||||
objectDetectionClassifierDir.mkdir();
|
||||
}
|
||||
|
||||
private static void ensurePythonModulesFolderExists() {
|
||||
File pythonModulesDir = new File(PlatformUtil.getUserPythonModulesPath());
|
||||
pythonModulesDir.mkdir();
|
||||
@ -277,6 +281,7 @@ public class Installer extends ModuleInstall {
|
||||
public void restored() {
|
||||
super.restored();
|
||||
ensurePythonModulesFolderExists();
|
||||
ensureClassifierFolderExists();
|
||||
initJavaFx();
|
||||
for (ModuleInstall mi : packageInstallers) {
|
||||
try {
|
||||
|
@ -123,9 +123,9 @@ public class ImageUtils {
|
||||
try {
|
||||
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
|
||||
if (System.getProperty("os.arch").equals("amd64") || System.getProperty("os.arch").equals("x86_64")) { //NON-NLS
|
||||
System.loadLibrary("opencv_ffmpeg248_64"); //NON-NLS
|
||||
System.loadLibrary("opencv_ffmpeg2413_64"); //NON-NLS
|
||||
} else {
|
||||
System.loadLibrary("opencv_ffmpeg248"); //NON-NLS
|
||||
System.loadLibrary("opencv_ffmpeg2413"); //NON-NLS
|
||||
}
|
||||
|
||||
openCVLoadedTemp = true;
|
||||
|
@ -51,6 +51,7 @@ import org.sleuthkit.datamodel.TskCoreException;
|
||||
public class PlatformUtil {
|
||||
|
||||
private static final String PYTHON_MODULES_SUBDIRECTORY = "python_modules"; //NON-NLS
|
||||
private static final String CLASSIFIERS_SUBDIRECTORY = "object_detection_classifiers"; //NON-NLS
|
||||
private static String javaPath = null;
|
||||
public static final String OS_NAME_UNKNOWN = NbBundle.getMessage(PlatformUtil.class, "PlatformUtil.nameUnknown");
|
||||
public static final String OS_VERSION_UNKNOWN = NbBundle.getMessage(PlatformUtil.class, "PlatformUtil.verUnknown");
|
||||
@ -116,6 +117,10 @@ public class PlatformUtil {
|
||||
return getUserDirectory().getAbsolutePath() + File.separator + PYTHON_MODULES_SUBDIRECTORY;
|
||||
}
|
||||
|
||||
public static String getObjectDetectionClassifierPath() {
|
||||
return getUserDirectory().getAbsolutePath() + File.separator + CLASSIFIERS_SUBDIRECTORY;
|
||||
}
|
||||
|
||||
/**
|
||||
* get file path to the java executable binary use embedded java if
|
||||
* available, otherwise use system java in PATH no validation is done if
|
||||
@ -310,19 +315,17 @@ public class PlatformUtil {
|
||||
return (System.getProperty("os.arch").contains("64")); //NON-NLS
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Attempts to determine whether the JVM is 64-bit or 32-bit.
|
||||
* May not be completely reliable for non-Windows operating systems.
|
||||
* Attempts to determine whether the JVM is 64-bit or 32-bit. May not be
|
||||
* completely reliable for non-Windows operating systems.
|
||||
*
|
||||
* @return True if the JVM is 64-bit. False otherwise.
|
||||
*/
|
||||
public static boolean is64BitJVM() {
|
||||
return (System.getProperty("sun.arch.data.model").equals("64"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get a list of all physical drives attached to the client's machine. Error
|
||||
* threshold of 4 non-existent physical drives before giving up.
|
||||
|
@ -2,6 +2,7 @@ file.reference.c3p0-0.9.5.jar=release/modules/ext/c3p0-0.9.5.jar
|
||||
file.reference.jackson-core-2.7.0.jar=release/modules/ext/jackson-core-2.7.0.jar
|
||||
file.reference.LGoodDatePicker-10.3.1.jar=release/modules/ext/LGoodDatePicker-10.3.1.jar
|
||||
file.reference.mchange-commons-java-0.2.9.jar=release/modules/ext/mchange-commons-java-0.2.9.jar
|
||||
file.reference.opencv-2413.jar=release/modules/ext/opencv-2413.jar
|
||||
file.reference.postgresql-9.4-1201-jdbc41.jar=release/modules/ext/postgresql-9.4-1201-jdbc41.jar
|
||||
file.reference.tika-core-1.17.jar=release/modules/ext/tika-core-1.17.jar
|
||||
javac.source=1.8
|
||||
|
@ -161,6 +161,10 @@
|
||||
<package>org.sleuthkit.autopsy.experimental.autoingest</package>
|
||||
<package>org.sleuthkit.autopsy.experimental.configuration</package>
|
||||
</public-packages>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/opencv-2413.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/opencv-2413.jar</binary-origin>
|
||||
</class-path-extension>
|
||||
<class-path-extension>
|
||||
<runtime-relative-path>ext/LGoodDatePicker-10.3.1.jar</runtime-relative-path>
|
||||
<binary-origin>release/modules/ext/LGoodDatePicker-10.3.1.jar</binary-origin>
|
||||
|
@ -0,0 +1,127 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2018 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.sleuthkit.autopsy.experimental.objectDetection;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.opencv.core.Mat;
|
||||
import org.opencv.core.MatOfRect;
|
||||
import org.opencv.highgui.Highgui;
|
||||
import org.opencv.imgproc.Imgproc;
|
||||
import org.opencv.objdetect.CascadeClassifier;
|
||||
import org.sleuthkit.autopsy.casemodule.Case;
|
||||
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
|
||||
import org.sleuthkit.autopsy.coreutils.ImageUtils;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
||||
import org.sleuthkit.autopsy.ingest.FileIngestModuleAdapter;
|
||||
import org.sleuthkit.autopsy.ingest.IngestJobContext;
|
||||
import org.sleuthkit.autopsy.ingest.IngestModule;
|
||||
import org.sleuthkit.autopsy.ingest.IngestServices;
|
||||
import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
|
||||
import org.sleuthkit.datamodel.AbstractFile;
|
||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||
import static org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE.TSK_OBJECT_DETECTED;
|
||||
import org.sleuthkit.datamodel.BlackboardAttribute;
|
||||
import org.sleuthkit.datamodel.TskCoreException;
|
||||
|
||||
public class ObjectDetectectionFileIngestModule extends FileIngestModuleAdapter {
|
||||
|
||||
private Map<String, CascadeClassifier> cascades;
|
||||
private final IngestServices services = IngestServices.getInstance();
|
||||
private final static Logger logger = Logger.getLogger(ObjectDetectectionFileIngestModule.class.getName());
|
||||
private Blackboard blackboard;
|
||||
|
||||
@Override
|
||||
public void startUp(IngestJobContext context) throws IngestModule.IngestModuleException {
|
||||
System.load("C:\\project_code\\autopsy\\thirdparty\\opencv\\lib\\amd64\\opencv_java2413.dll");
|
||||
File classifierDir = new File(PlatformUtil.getObjectDetectionClassifierPath());
|
||||
cascades = new HashMap<>();
|
||||
if (classifierDir.exists() && classifierDir.isDirectory()) {
|
||||
for (File classifier : classifierDir.listFiles()) {
|
||||
if (classifier.isFile() && FilenameUtils.getExtension(classifier.getName()).equalsIgnoreCase("xml")) {
|
||||
cascades.put(classifier.getName(), new CascadeClassifier(classifier.getAbsolutePath()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
blackboard = Case.getCurrentCaseThrows().getServices().getBlackboard();
|
||||
} catch (NoCurrentCaseException ex) {
|
||||
throw new IngestModule.IngestModuleException("Exception while getting open case.", ex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProcessResult process(AbstractFile file) {
|
||||
try {
|
||||
if (ImageUtils.isImageThumbnailSupported(file)) {
|
||||
Mat originalImage = Highgui.imread(file.getLocalPath());
|
||||
MatOfRect detectionRectangles = new MatOfRect();
|
||||
// Mat grayImage = new Mat();
|
||||
// convert the frame in gray scale
|
||||
// Imgproc.cvtColor(originalImage, grayImage, Imgproc.COLOR_BGR2GRAY);
|
||||
// equalize the frame histogram to improve the result -doesn't always
|
||||
// Imgproc.equalizeHist(grayImage, grayImage);
|
||||
for (String cascadeKey : cascades.keySet()) {
|
||||
cascades.get(cascadeKey).detectMultiScale(originalImage, detectionRectangles);
|
||||
|
||||
String comment = "Classifier detected " + (int) detectionRectangles.size().height + " object(s)";
|
||||
System.out.println(comment);
|
||||
if (!detectionRectangles.empty()) {
|
||||
try {
|
||||
BlackboardArtifact artifact = file.newArtifact(TSK_OBJECT_DETECTED);
|
||||
artifact.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DESCRIPTION, ObjectDetectionModuleFactory.getModuleName(), cascadeKey));
|
||||
artifact.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_COMMENT, ObjectDetectionModuleFactory.getModuleName(), comment));
|
||||
|
||||
try {
|
||||
/*
|
||||
* Index the artifact for keyword search.
|
||||
*/
|
||||
blackboard.indexArtifact(artifact);
|
||||
} catch (Blackboard.BlackboardException ex) {
|
||||
logger.log(Level.SEVERE, "Unable to index blackboard artifact " + artifact.getArtifactID(), ex); //NON-NLS
|
||||
}
|
||||
|
||||
/*
|
||||
* Send an event to update the view with the new
|
||||
* result.
|
||||
*/
|
||||
services.fireModuleDataEvent(new ModuleDataEvent(ObjectDetectionModuleFactory.getModuleName(), TSK_OBJECT_DETECTED, Collections.singletonList(artifact)));
|
||||
} catch (TskCoreException ex) {
|
||||
logger.log(Level.SEVERE, String.format("Failed to create blackboard artifact for '%s'.", file.getParentPath() + file.getName()), ex); //NON-NLS
|
||||
return IngestModule.ProcessResult.ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
System.out.println(file.getName() + " IS NOT A PICTURE");
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
logger.log(Level.INFO, "EXCEPTION processing file: " + file.getName(), ex);
|
||||
}
|
||||
return IngestModule.ProcessResult.OK;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2018 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.sleuthkit.autopsy.experimental.objectDetection;
|
||||
|
||||
import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings;
|
||||
|
||||
public class ObjectDetectionIngestJobSettings implements IngestModuleIngestJobSettings {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public long getVersionNumber() {
|
||||
return serialVersionUID;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2018 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.sleuthkit.autopsy.experimental.objectDetection;
|
||||
|
||||
import org.openide.util.NbBundle.Messages;
|
||||
import org.openide.util.lookup.ServiceProvider;
|
||||
import org.sleuthkit.autopsy.coreutils.Version;
|
||||
import org.sleuthkit.autopsy.ingest.FileIngestModule;
|
||||
import org.sleuthkit.autopsy.ingest.IngestModuleFactory;
|
||||
import org.sleuthkit.autopsy.ingest.IngestModuleFactoryAdapter;
|
||||
import org.sleuthkit.autopsy.ingest.IngestModuleIngestJobSettings;
|
||||
|
||||
/**
|
||||
* A factory that creates ingest modules which uses classifiers to detect
|
||||
* objects in pictures.
|
||||
*/
|
||||
@ServiceProvider(service = IngestModuleFactory.class)
|
||||
public class ObjectDetectionModuleFactory extends IngestModuleFactoryAdapter {
|
||||
|
||||
@Messages({"ObjectDetectionModuleFactory.moduleName.text=Object Detection"})
|
||||
@Override
|
||||
public String getModuleDisplayName() {
|
||||
return getModuleName();
|
||||
}
|
||||
|
||||
static String getModuleName() {
|
||||
return Bundle.ObjectDetectionModuleFactory_moduleName_text();
|
||||
}
|
||||
|
||||
@Messages({"ObjectDetectionModuleFactory.moduleDescription.text=Use object classifiers to identify objects in pictures."})
|
||||
@Override
|
||||
public String getModuleDescription() {
|
||||
return Bundle.ObjectDetectionModuleFactory_moduleDescription_text();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModuleVersionNumber() {
|
||||
return Version.getVersion();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFileIngestModuleFactory() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FileIngestModule createFileIngestModule(IngestModuleIngestJobSettings settings) {
|
||||
return new ObjectDetectectionFileIngestModule();
|
||||
}
|
||||
|
||||
}
|
BIN
thirdparty/opencv/ext/opencv-2413.jar
vendored
Normal file
BIN
thirdparty/opencv/ext/opencv-2413.jar
vendored
Normal file
Binary file not shown.
BIN
thirdparty/opencv/ext/opencv-248.jar
vendored
BIN
thirdparty/opencv/ext/opencv-248.jar
vendored
Binary file not shown.
0
thirdparty/opencv/lib/amd64/opencv_ffmpeg248_64.dll → thirdparty/opencv/lib/amd64/opencv_ffmpeg2413_64.dll
vendored
Executable file → Normal file
0
thirdparty/opencv/lib/amd64/opencv_ffmpeg248_64.dll → thirdparty/opencv/lib/amd64/opencv_ffmpeg2413_64.dll
vendored
Executable file → Normal file
BIN
thirdparty/opencv/lib/amd64/opencv_java2413.dll
vendored
Normal file
BIN
thirdparty/opencv/lib/amd64/opencv_java2413.dll
vendored
Normal file
Binary file not shown.
0
thirdparty/opencv/lib/i386/opencv_ffmpeg248.dll → thirdparty/opencv/lib/i386/opencv_ffmpeg2413.dll
vendored
Executable file → Normal file
0
thirdparty/opencv/lib/i386/opencv_ffmpeg248.dll → thirdparty/opencv/lib/i386/opencv_ffmpeg2413.dll
vendored
Executable file → Normal file
BIN
thirdparty/opencv/lib/x86_64/opencv_java248.dll → thirdparty/opencv/lib/i386/opencv_java2413.dll
vendored
Executable file → Normal file
BIN
thirdparty/opencv/lib/x86_64/opencv_java248.dll → thirdparty/opencv/lib/i386/opencv_java2413.dll
vendored
Executable file → Normal file
Binary file not shown.
BIN
thirdparty/opencv/lib/i386/opencv_java248.dll
vendored
BIN
thirdparty/opencv/lib/i386/opencv_java248.dll
vendored
Binary file not shown.
0
thirdparty/opencv/lib/x86_64/opencv_ffmpeg248_64.dll → thirdparty/opencv/lib/i586/opencv_ffmpeg2413_64.dll
vendored
Executable file → Normal file
0
thirdparty/opencv/lib/x86_64/opencv_ffmpeg248_64.dll → thirdparty/opencv/lib/i586/opencv_ffmpeg2413_64.dll
vendored
Executable file → Normal file
BIN
thirdparty/opencv/lib/i586/opencv_java2413.dll
vendored
Normal file
BIN
thirdparty/opencv/lib/i586/opencv_java2413.dll
vendored
Normal file
Binary file not shown.
BIN
thirdparty/opencv/lib/i586/opencv_java248.dll
vendored
BIN
thirdparty/opencv/lib/i586/opencv_java248.dll
vendored
Binary file not shown.
BIN
thirdparty/opencv/lib/i686/opencv_ffmpeg248_64.dll → thirdparty/opencv/lib/i686/opencv_ffmpeg2413_64.dll
vendored
Executable file → Normal file
BIN
thirdparty/opencv/lib/i686/opencv_ffmpeg248_64.dll → thirdparty/opencv/lib/i686/opencv_ffmpeg2413_64.dll
vendored
Executable file → Normal file
Binary file not shown.
BIN
thirdparty/opencv/lib/i686/opencv_java2413.dll
vendored
Normal file
BIN
thirdparty/opencv/lib/i686/opencv_java2413.dll
vendored
Normal file
Binary file not shown.
BIN
thirdparty/opencv/lib/i686/opencv_java248.dll
vendored
BIN
thirdparty/opencv/lib/i686/opencv_java248.dll
vendored
Binary file not shown.
0
thirdparty/opencv/lib/i586/opencv_ffmpeg248_64.dll → thirdparty/opencv/lib/x86/opencv_ffmpeg2413.dll
vendored
Executable file → Normal file
0
thirdparty/opencv/lib/i586/opencv_ffmpeg248_64.dll → thirdparty/opencv/lib/x86/opencv_ffmpeg2413.dll
vendored
Executable file → Normal file
BIN
thirdparty/opencv/lib/amd64/opencv_java248.dll → thirdparty/opencv/lib/x86/opencv_java2413.dll
vendored
Executable file → Normal file
BIN
thirdparty/opencv/lib/amd64/opencv_java248.dll → thirdparty/opencv/lib/x86/opencv_java2413.dll
vendored
Executable file → Normal file
Binary file not shown.
BIN
thirdparty/opencv/lib/x86/opencv_java248.dll
vendored
BIN
thirdparty/opencv/lib/x86/opencv_java248.dll
vendored
Binary file not shown.
BIN
thirdparty/opencv/lib/x86/opencv_ffmpeg248.dll → thirdparty/opencv/lib/x86_64/opencv_ffmpeg2413_64.dll
vendored
Executable file → Normal file
BIN
thirdparty/opencv/lib/x86/opencv_ffmpeg248.dll → thirdparty/opencv/lib/x86_64/opencv_ffmpeg2413_64.dll
vendored
Executable file → Normal file
Binary file not shown.
BIN
thirdparty/opencv/lib/x86_64/opencv_java2413.dll
vendored
Normal file
BIN
thirdparty/opencv/lib/x86_64/opencv_java2413.dll
vendored
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user