RPD Design

Shengjie Lin's graduation project at the Department of Electronic Engineering, Tsinghua University.

RpdDesign

Given both the base image and the descriptive Ontology file, the program will generate the RPD design layout.

Build

To build the project, you will need:

Set new environment variables:

  • OPENCV_DIR="C:\Program Files\opencv\build\" or alike
  • JDK_DIR="C:\Program Files\Java\jdk1.8.0_131\" or alike

Add to PATH:

  • %OPENCV_DIR%\x64\vc14\bin\
  • C:\Program Files\Java\jre1.8.0_131\bin\server\ or alike

In %ROOT%\RpdDesign\RpdDesign.cpp, modify accordingly the following line:

string RpdDesign::jenaLibPath = "D:/Utilities/apache-jena-3.3.0/lib/";

Use lrelease to generate Qt Linguist translation files from sources %ROOT%\RpdDesign\rpddesign_[en,zh].ts.

Run & Test

After successful build, the executable will be stored as %ROOT%\x64\[Debug,Release]\RpdDesign.exe.

Before execution, add to PATH:

  • C:\Qt\Qt5.9.0\5.9\msvc2017_64\bin\ or alike

You may use sample resources in %ROOT%\sample\ to produce the following design:

RpdDesignLib

Wraps the above-mentioned functionality into a library (DLL), to be called by Java users.

Build

Same as above, except that Qt is not required, and that Jena is not explictly required (should be provided instead by the Java caller). In addition, by default this project will be built together with RpdDesign, as they share one Visual Studio solution.

N.B. RpdDesignLib.h is directly related to the Java caller, and may be auto-generated.

Run & Test

After successful compilation, the DLL will be stored as %ROOT%\x64\[Debug,Release]\RpdDesignLib.dll. Please refer to RpdDesignLibTest below for actual test details.

RpdDesignLibTest

Serves as a test program, which calls in Java RpdDesignLib.dll to generate RPD designs provided the Ontology model and an optional base image.

Build

To build the project, you will need:

Open Project Structure (Ctrl+Alt+Shift+S) and specify accordingly items of Dependencies in Modules (or modify %ROOT%\RpdDesignLibTest\RpdDesignLibTest.iml directly).

N.B. generate_header.bat contains the command that will call javah to generate the C++ header for RpdDesignLib. Modify the arguments to specify the valid classpath (-cp) and the desired output path (-o). Before run, add %JDK_DIR%\bin\ to PATH. Then use the function signatures as indicated in the generated header to replace the ones in %ROOT%\RpdDesignLib\RpdDesignLib.[h,cpp].

Run & Test

After successful build, running the program directly will produce design_with_base.png and design.png in %ROOT%\RpdDesignLibTest\. They should both resemble %ROOT%\sample\sample.png.