Skip to content

Commit

Permalink
Renamed modrec to dml.
Browse files Browse the repository at this point in the history
  • Loading branch information
mleotta committed Aug 31, 2010
1 parent 919d5bb commit 7586b96
Show file tree
Hide file tree
Showing 52 changed files with 1,056 additions and 1,051 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if(VXL_FOUND)

add_subdirectory(vpro)
add_subdirectory(klt)
add_subdirectory(modrec)
add_subdirectory(dml)
add_subdirectory(cmd)
add_subdirectory(gui)
endif(VXL_FOUND)
Expand Down
12 changes: 6 additions & 6 deletions cmd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ ADD_EXECUTABLE(mesh_subdivide mesh_subdivide.cxx)
TARGET_LINK_LIBRARIES(mesh_subdivide imesh_algo vul)

ADD_EXECUTABLE(mesh_extract_features mesh_extract_features.cxx)
TARGET_LINK_LIBRARIES(mesh_extract_features imesh_algo modrec vul)
TARGET_LINK_LIBRARIES(mesh_extract_features imesh_algo dml vul)

ADD_EXECUTABLE(make_vehicle_mesh make_vehicle_mesh.cxx)
TARGET_LINK_LIBRARIES(make_vehicle_mesh modrec imesh_algo vul)
TARGET_LINK_LIBRARIES(make_vehicle_mesh dml imesh_algo vul)

ADD_EXECUTABLE(fit_mesh_body fit_mesh_body.cxx)
TARGET_LINK_LIBRARIES(fit_mesh_body modrec imesh_algo vul)
TARGET_LINK_LIBRARIES(fit_mesh_body dml imesh_algo vul)

ADD_EXECUTABLE(fit_parts fit_parts.cxx)
TARGET_LINK_LIBRARIES(fit_parts modrec vul)
TARGET_LINK_LIBRARIES(fit_parts dml vul)

ADD_EXECUTABLE(parts2svg parts2svg.cxx)
TARGET_LINK_LIBRARIES(parts2svg modrec vul)
TARGET_LINK_LIBRARIES(parts2svg dml vul)

ADD_EXECUTABLE(pca_fit_mesh_body pca_fit_mesh_body.cxx)
TARGET_LINK_LIBRARIES(pca_fit_mesh_body imesh_algo vul)
Expand All @@ -34,7 +34,7 @@ ADD_EXECUTABLE(mesh_pca mesh_pca.cxx)
TARGET_LINK_LIBRARIES(mesh_pca imesh_algo vul)

ADD_EXECUTABLE(parts_pca parts_pca.cxx)
TARGET_LINK_LIBRARIES(parts_pca modrec vul)
TARGET_LINK_LIBRARIES(parts_pca dml vul)

ADD_EXECUTABLE(mesh_exterior mesh_exterior.cxx)
TARGET_LINK_LIBRARIES(mesh_exterior imesh_algo vul)
Expand Down
8 changes: 4 additions & 4 deletions cmd/fit_mesh_body.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <imesh/algo/imesh_intersect.h>
#include <imesh/algo/imesh_imls_surface.h>
#include <imesh/algo/imesh_operations.h>
#include <modrec/modrec_vehicle_mesh.h>
#include <dml/dml_vehicle_mesh.h>


#include <vcl_algorithm.h>
Expand Down Expand Up @@ -413,15 +413,15 @@ int main(int argc, char** argv)

#if 0
vcl_map<vcl_string,double> params;
modrec_read_vehicle_params(a_in_file(),params);
dml_read_vehicle_params(a_in_file(),params);

double r1 = params["wheel_rad"];
double r2 = r1+params["tire_thick"];
double ww = params["wheel_width"];
double so = params["susp_offset"];

vcl_auto_ptr<imesh_vertex_array_base> verts(modrec_generate_vehicle_body_verts(params));
vcl_auto_ptr<imesh_face_array_base> faces(modrec_generate_vehicle_body_faces());
vcl_auto_ptr<imesh_vertex_array_base> verts(dml_generate_vehicle_body_verts(params));
vcl_auto_ptr<imesh_face_array_base> faces(dml_generate_vehicle_body_faces());

imesh_mesh model_mesh(verts,faces);
imesh_transform_inplace(model_mesh,vgl_vector_3d<double>(0,0,r2+so));
Expand Down
10 changes: 5 additions & 5 deletions cmd/fit_parts.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <vcl_iostream.h>
#include <vcl_limits.h>
#include <vul/vul_arg.h>
#include <modrec/modrec_vehicle_parts.h>
#include <dml/dml_vehicle_parts.h>
#include <vgl/vgl_closest_point.h>
#include <vgl/vgl_area.h>
#include <vgl/vgl_vector_2d.h>
Expand Down Expand Up @@ -109,12 +109,12 @@ int main(int argc, char** argv)

typedef vcl_map<vcl_string, vgl_polygon<double> > pmap;

pmap iparts = modrec_read_vehicle_parts(a_in_file());
pmap mparts = modrec_read_vehicle_parts(a_model_file());
pmap iparts = dml_read_vehicle_parts(a_in_file());
pmap mparts = dml_read_vehicle_parts(a_model_file());

pmap parts;

//modrec_write_svg(a_out_file(),parts);
//dml_write_svg(a_out_file(),parts);
//return 0;

for(pmap::const_iterator itr=mparts.begin(); itr!=mparts.end(); ++itr)
Expand Down Expand Up @@ -188,7 +188,7 @@ int main(int argc, char** argv)

}

modrec_write_vehicle_parts(a_out_file(),parts);
dml_write_vehicle_parts(a_out_file(),parts);

return 0;

Expand Down
10 changes: 5 additions & 5 deletions cmd/make_vehicle_mesh.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <vul/vul_file.h>
#include <imesh/imesh_mesh.h>
#include <imesh/imesh_fileio.h>
#include <modrec/modrec_vehicle_mesh.h>
#include <dml/dml_vehicle_mesh.h>



Expand All @@ -33,15 +33,15 @@ int main(int argc, char** argv)
}

vcl_map<vcl_string,double> params;
modrec_read_vehicle_params(a_in_file(),params);
dml_read_vehicle_params(a_in_file(),params);

imesh_mesh mesh;
if(a_dodec())
modrec_generate_dodec_vehicle(params, mesh);
dml_generate_dodec_vehicle(params, mesh);
else if(a_ferryman())
modrec_generate_ferryman_vehicle(params, mesh);
dml_generate_ferryman_vehicle(params, mesh);
else
modrec_generate_vehicle(params, mesh);
dml_generate_vehicle(params, mesh);

imesh_write_obj(a_out_file(), mesh);

Expand Down
6 changes: 3 additions & 3 deletions cmd/mesh_extract_features.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <imesh/imesh_operations.h>
#include <imesh/imesh_detection.h>
#include <imesh/algo/imesh_intersect.h>
#include <modrec/modrec_vehicle_parts.h>
#include <dml/dml_vehicle_parts.h>



Expand Down Expand Up @@ -174,8 +174,8 @@ int main(int argc, char** argv)
}

if(a_svg_file.set())
modrec_write_svg(a_svg_file(), parts);
modrec_write_vehicle_parts(a_out_file(), parts);
dml_write_svg(a_svg_file(), parts);
dml_write_vehicle_parts(a_out_file(), parts);

return 0;
}
6 changes: 3 additions & 3 deletions cmd/parts2svg.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <vcl_iostream.h>
#include <vul/vul_arg.h>
#include <modrec/modrec_vehicle_parts.h>
#include <dml/dml_vehicle_parts.h>



Expand All @@ -27,9 +27,9 @@ int main(int argc, char** argv)

typedef vcl_map<vcl_string, vgl_polygon<double> > pmap;

pmap parts = modrec_read_vehicle_parts(a_in_file());
pmap parts = dml_read_vehicle_parts(a_in_file());

modrec_write_svg(a_out_file(),parts);
dml_write_svg(a_out_file(),parts);

return 0;

Expand Down
10 changes: 5 additions & 5 deletions cmd/parts_pca.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#include <vnl/vnl_math.h>
#include <imesh/imesh_mesh.h>
#include <imesh/imesh_fileio.h>
#include <modrec/modrec_pca_vehicle.h>
#include <modrec/modrec_vehicle_parts.h>
#include <dml/dml_pca_vehicle.h>
#include <dml/dml_vehicle_parts.h>



Expand Down Expand Up @@ -62,7 +62,7 @@ int main(int argc, char** argv)
vcl_string fname;
while(ifs >> fname){
vcl_cout << "loading: " << fname << vcl_endl;
pmap parts = modrec_read_vehicle_parts(fname);
pmap parts = dml_read_vehicle_parts(fname);
parts["hubcap1"] = h1;
parts["hubcap2"] = h2;
parts["hubcap3"] = h3;
Expand All @@ -85,9 +85,9 @@ int main(int argc, char** argv)
ifs.close();
}

modrec_pca_vehicle pca_vehicle(meshes,part_groups);
dml_pca_vehicle pca_vehicle(meshes,part_groups);

modrec_write_pca_vehicle(a_mean_mesh_file(),
dml_write_pca_vehicle(a_mean_mesh_file(),
a_mean_parts_file(),
a_pca_file(),
pca_vehicle);
Expand Down
70 changes: 70 additions & 0 deletions dml/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@

# Copyright Matthew Leotta 2006 - 2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file ../LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

# dml/CMakeLists.txt


include_directories( ${VXL_GEL_INCLUDE_DIR}/mrc )
include_directories( ${VXL_RPL_INCLUDE_DIR} )
include_directories( ${VXL_BRL_INCLUDE_DIR}/bbas )

set(dml_sources
dml_proj_cost_func.cxx dml_proj_cost_func.h
dml_proj_lsqr_cost_func.cxx dml_proj_lsqr_cost_func.h

dml_vehicle_mesh.cxx dml_vehicle_mesh.h
dml_vehicle_parts.cxx dml_vehicle_parts.h
dml_vehicle_fit.cxx dml_vehicle_fit.h
dml_vehicle_fit_multiview.cxx dml_vehicle_fit_multiview.h
dml_vehicle_fit_video.cxx dml_vehicle_fit_video.h
dml_vehicle_state.cxx dml_vehicle_state.h
dml_vehicle_tracker.cxx dml_vehicle_tracker.h
dml_vehicle_track_init.cxx dml_vehicle_track_init.h
dml_pca_vehicle.cxx dml_pca_vehicle.h
dml_pca_vehicle_projector.cxx dml_pca_vehicle_projector.h

dml_solar_position.cxx dml_solar_position.h

dml_edgel.cxx dml_edgel.h
)

add_library(dml ${dml_sources})

target_link_libraries(dml vpro vpro_filters bbgm rrel imesh_algo vpgl vil_algo klt)

if( BUILD_TESTING )
add_subdirectory(tests)
endif()

# Make the Python Module for running experiemnts
include( ${VXL_CMAKE_DIR}/NewCMake/FindPython.cmake )
if( PYTHON_FOUND )
include_directories( ${PYTHON_INCLUDE_PATH} )

set(py_dml_sources
py_dml.cxx
py_dml_manager.cxx py_dml_manager.h
)

add_library(py_dml MODULE ${py_dml_sources})

if(WIN32)
#library has to have different name depending on debug or release version.
set_target_properties(py_dml PROPERTIES OUTPUT_NAME py_dml DEBUG_POSTFIX _d SUFFIX .pyd)
endif(WIN32)
set_target_properties(py_dml PROPERTIES PREFIX "")

target_link_libraries(py_dml dml)

if (PYTHON_DEBUG_LIBRARIES)
target_link_libraries( py_dml debug ${PYTHON_DEBUG_LIBRARY})
endif(PYTHON_DEBUG_LIBRARIES )

if(PYTHON_LIBRARIES)
target_link_libraries( py_dml optimized ${PYTHON_LIBRARY})
endif(PYTHON_LIBRARIES)
endif( PYTHON_FOUND )

30 changes: 15 additions & 15 deletions modrec/modrec_edgel.cxx → dml/dml_edgel.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This is modrec/modrec_edgel.cxx
// This is dml/dml_edgel.cxx

// Copyright Matthew Leotta 2006 - 2010.
// Distributed under the Boost Software License, Version 1.0.
Expand All @@ -8,7 +8,7 @@
//:
// \file

#include "modrec_edgel.h"
#include "dml_edgel.h"

#include <vnl/vnl_math.h>

Expand All @@ -32,7 +32,7 @@ inline double angle_diff(double a1, double a2)
inline void scan_edgels(const vil_image_view<float>& edge_map,
double angle, double ang_t,
vgl_triangle_scan_iterator<double>& tsi,
vcl_vector<modrec_edgel>& edgels)
vcl_vector<dml_edgel>& edgels)
{
int ni = edge_map.ni();
int nj = edge_map.nj();
Expand All @@ -51,8 +51,8 @@ inline void scan_edgels(const vil_image_view<float>& edge_map,
double offset = edge_map(x,y,2);
double gx = vcl_cos(theta);
double gy = vcl_sin(theta);
edgels.push_back(modrec_edgel(x+gx*offset, y+gy*offset,
theta, edge_map(x,y,0)));
edgels.push_back(dml_edgel(x+gx*offset, y+gy*offset,
theta, edge_map(x,y,0)));
}
}
}
Expand All @@ -62,10 +62,10 @@ inline void scan_edgels(const vil_image_view<float>& edge_map,


//: Return a vector of all edgels in the edge map
vcl_vector<modrec_edgel>
modrec_find_all_edgels(const vil_image_view<float>& edge_map)
vcl_vector<dml_edgel>
dml_find_all_edgels(const vil_image_view<float>& edge_map)
{
vcl_vector<modrec_edgel> edgels;
vcl_vector<dml_edgel> edgels;

const unsigned ni = edge_map.ni();
const unsigned nj = edge_map.nj();
Expand All @@ -76,8 +76,8 @@ modrec_find_all_edgels(const vil_image_view<float>& edge_map)
double offset = edge_map(i,j,2);
double gx = vcl_cos(theta);
double gy = vcl_sin(theta);
edgels.push_back(modrec_edgel(i+gx*offset, j+gy*offset,
theta, edge_map(i,j,0)));
edgels.push_back(dml_edgel(i+gx*offset, j+gy*offset,
theta, edge_map(i,j,0)));
}
}
}
Expand All @@ -89,12 +89,12 @@ modrec_find_all_edgels(const vil_image_view<float>& edge_map)
// return a vector of edgels found within \a ndist pixel in the normal direction,
// with a \a edist pixel padding added in the line direction.
// Edgel orientation must form an angle with the line less than \a ang_t (modulo pi radians)
vcl_vector<modrec_edgel>
modrec_find_edgel_neighbors(const vil_image_view<float>& edge_map,
const vgl_line_segment_2d<double>& line,
int ndist, int edist, double ang_t)
vcl_vector<dml_edgel>
dml_find_edgel_neighbors(const vil_image_view<float>& edge_map,
const vgl_line_segment_2d<double>& line,
int ndist, int edist, double ang_t)
{
vcl_vector<modrec_edgel> edgels;
vcl_vector<dml_edgel> edgels;

vgl_vector_2d<double> v = line.direction();
double angle = atan2(-v.x(),v.y());
Expand Down
Loading

0 comments on commit 7586b96

Please sign in to comment.