Added delta builds of Matlab executables. Imgproc module now compiling

This commit is contained in:
hbristow 2013-06-27 00:25:48 -07:00
parent 136f205fb3
commit bb56ac4ae6
7 changed files with 36 additions and 9 deletions

View File

@ -313,7 +313,7 @@ macro(ocv_glob_modules)
# TODO: Undo this change to build all modules
#file(GLOB __ocvmodules RELATIVE "${__path}" "${__path}/*")
file(GLOB __ocvmodules RELATIVE "${__path}" "${__path}/core" "${__path}/matlab")
file(GLOB __ocvmodules RELATIVE "${__path}" "${__path}/core" "${__path}/imgproc" "${__path}/matlab")
if(__ocvmodules)
list(SORT __ocvmodules)
foreach(mod ${__ocvmodules})

View File

@ -159,6 +159,7 @@ add_custom_command(
add_custom_command(
OUTPUT ${COMPILE_PROXY}
COMMAND ${CMAKE_COMMAND} -DMATLAB_MEX_SCRIPT=${MATLAB_MEX_SCRIPT}
-DMATLAB_MEXEXT=${MATLAB_MEXEXT}
-DMEX_OPTS=${MEX_OPTS}
-DMEX_INCLUDE_DIRS="${MEX_INCLUDE_DIRS}"
-DMEX_LIB_DIR=${MEX_LIB_DIR}

View File

@ -8,12 +8,14 @@ foreach(SOURCE_FILE ${SOURCE_FILES})
# strip out the filename
get_filename_component(FILENAME ${SOURCE_FILE} NAME_WE)
# compile the source file using mex
execute_process(
COMMAND ${MATLAB_MEX_SCRIPT} ${MEX_OPTS} ${MEX_INCLUDE_DIRS_LIST}
${MEX_LIB_DIR} ${MEX_LIBS} ${SOURCE_FILE}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/+cv
ERROR_VARIABLE FAILED
)
if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/+cv/${FILENAME}.${MATLAB_MEXEXT})
execute_process(
COMMAND ${MATLAB_MEX_SCRIPT} ${MEX_OPTS} ${MEX_INCLUDE_DIRS_LIST}
${MEX_LIB_DIR} ${MEX_LIBS} ${SOURCE_FILE}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/+cv
ERROR_VARIABLE FAILED
)
endif()
# TODO: If a mex file fails to cmpile, should we error out?
if (FAILED)
message(FATAL_ERROR "Failed to compile ${FILENAME}: ${FAILED}")

View File

@ -12,9 +12,11 @@ class MatlabWrapperGenerator(object):
name = os.path.splitext(os.path.basename(file))[0]
ns[name] = parser.parse(file)
print ns['imgproc']
# cleanify the parser output
parse_tree = ParseTree()
parse_tree.build(ns)
print parse_tree
# setup the template engine
jtemplate = Environment(loader=PackageLoader('templates', ''), trim_blocks=True, lstrip_blocks=True)

View File

@ -1,5 +1,6 @@
from string import join
from textwrap import fill
from filters import *
class ParseTree(object):
def __init__(self, namespaces=None):
@ -52,7 +53,7 @@ class Translator(object):
return self.translateClass(defn)
# --- function ---
# functions either need to have input arguments, or not uppercase names
elif defn[3] or not self.translateName(defn[0]).isupper():
elif defn[3] or not self.translateName(defn[0]).split('_')[0].isupper():
return self.translateFunction(defn)
# --- constant ---
else:

View File

@ -12,7 +12,7 @@ typedef std::unordered_map Map;
* from Matlab as, e.g.
* cv.dft(x, xf, "DFT_FORWARD");
*
* Note that an alternative MAtlab class exists as well, so that functions
* Note that an alternative Matlab class exists as well, so that functions
* can be called as, e.g.
* cv.dft(x, xf, cv.DFT_FORWARD);
*

View File

@ -13,6 +13,7 @@
typedef std::vector<cv::Mat> vector_Mat;
typedef std::vector<cv::Point> vector_Point;
typedef std::vector<int> vector_int;
typedef std::vector<float> vector_float;
void conditionalError(bool expr, const std::string& str) {
@ -127,6 +128,11 @@ public:
vector_int toVectorInt() { return vector_int(); }
operator vector_int() { return toVectorInt(); }
// --------------------------- vector_float ----------------------------------
Bridge& operator=(const vector_float& obj) { return *this; }
vector_float toVectorFloat() { return vector_float(); }
operator vector_float() { return toVectorFloat(); }
// --------------------------- string --------------------------------------
Bridge& operator=(const std::string& obj) { return *this; }
std::string toString() { return ""; }
@ -147,11 +153,26 @@ public:
cv::Point toPoint() { return cv::Point(); }
operator cv::Point() { return toPoint(); }
// -------------------------- Point2f ------------------------------------
Bridge& operator=(const cv::Point2f& obj) { return *this; }
cv::Point2f toPoint2f() { return cv::Point2f(); }
operator cv::Point2f() { return toPoint2f(); }
// -------------------------- Point2d ------------------------------------
Bridge& operator=(const cv::Point2d& obj) { return *this; }
cv::Point2d toPoint2d() { return cv::Point2d(); }
operator cv::Point2d() { return toPoint2d(); }
// -------------------------- Size ---------------------------------------
Bridge& operator=(const cv::Size& obj) { return *this; }
cv::Size toSize() { return cv::Size(); }
operator cv::Size() { return toSize(); }
// -------------------------- Moments ---------------------------------------
Bridge& operator=(const cv::Moments& obj) { return *this; }
cv::Moments toMoments() { return cv::Moments(); }
operator cv::Moments() { return toMoments(); }
// ------------------------ vector_Point ------------------------------------
Bridge& operator=(const vector_Point& obj) { return *this; }
vector_Point toVectorPoint() { return vector_Point(); }