PageRenderTime 49ms CodeModel.GetById 2ms app.highlight 38ms RepoModel.GetById 1ms app.codeStats 1ms

/cli/otap-word-spot/CMakeLists.txt

https://bitbucket.org/iesahin/otapexplorer
CMake | 1052 lines | 806 code | 210 blank | 36 comment | 17 complexity | ac4599170848ca2bc0cd2a6accdf8145 MD5 | raw file
   1
   2# This was depending to otap-database
   3
   4# include_directories(${PROJECT_SOURCE_DIR}/otap-database)
   5
   6set(OTAP_WORD_SPOT_VERSION_MAJOR 0)
   7set(OTAP_WORD_SPOT_VERSION_MINOR 1)
   8
   9set(CC_FILES connected-component line-pair-feature single-line-feature shape-context-feature sift-feature surf-feature freak-feature orb-feature chamfer-feature component-area-feature projection-profile-feature feature comparator aggregate-comparator feature-factory curve-approximation otap-common)
  10
  11set(ALL_SERIAL_FEATURES contour-line-pair contour-single-line shape-context sift surf freak chamfer orb profile-projection upper-projection lower-projection upper-word-profile lower-word-profile background-transitions)
  12
  13set(ALL_FEATURES aspect-ratio component-area ${ALL_SERIAL_FEATURES})
  14
  15option(TRACE_CHECK_POINTS "Convert CPx to Trace Points in the code" OFF)
  16option(USE_ASPECT_RATIO "Use Aspect Ratio as a default feature" OFF)
  17option(USE_LINE_PAIR "Use Line Pair as a default feature" OFF)
  18option(USE_SINGLE_LINE "Use Single Line as a default feature" OFF)
  19option(USE_SHAPE_CONTEXT "Use Shape Context as a default feauture" OFF)
  20
  21set(DO_CC_MATRIX_TESTS 1)
  22set(DO_WS_MATRIX_TESTS 0)
  23set(DO_OTAP_WS_OTM20_TEST 0)
  24set(DO_OTAP_WS_OTM5_TEST 0)
  25set(DO_OTAP_WS_GW20_TEST 0)
  26set(DO_IMAGE_RETRIEVAL_GW20_TESTS 0)
  27set(DO_IMAGE_RETRIEVAL_LM_TESTS 0)
  28set(DO_RECALL_PRECISION_LM_TESTS 0)
  29set(DO_RECALL_PRECISION_LMSMALL_TESTS 0)
  30set(DO_RECALL_PRECISION_GW77_TESTS 0)
  31set(DO_RECALL_PRECISION_GW16_TESTS 1)
  32set(DO_RECALL_PRECISION_IFNC5I300_TESTS 0)
  33set(DO_RECALL_PRECISION_IFNC44I1000_TESTS 0)
  34set(DO_RECALL_PRECISION_DEBUG_TESTS 0)
  35
  36configure_file(cmake-options.hpp.in ${PROJECT_SOURCE_DIR}/otap-word-spot/cmake-options.hpp)
  37
  38## global tags for all dependencies etc
  39
  40# set_source_files_properties( GTAGS PROPERTIES GENERATED true)
  41# add_custom_command ( OUTPUT GTAGS
  42#    COMMAND gtags
  43#    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/../ )
  44
  45# TEST TARGETS
  46
  47add_executable(abc abc.cpp)
  48
  49add_executable(cppdeneme cppdeneme)
  50
  51add_executable(otap-common-test otap-common-test otap-common)
  52
  53
  54add_executable(feature-test
  55  feature-test
  56  feature
  57  otap-common
  58  test-common-defs)
  59  
  60add_executable(comparator-test
  61  comparator-test
  62  comparator
  63  feature
  64  curve-approximation
  65  otap-common
  66  test-common-defs)
  67
  68add_executable(aggregate-comparator-test
  69  aggregate-comparator-test
  70  aggregate-comparator
  71  comparator
  72  feature
  73  curve-approximation
  74  otap-common
  75  test-common-defs)
  76
  77add_executable(line-pair-feature-test
  78  line-pair-feature-test
  79  line-pair-feature
  80  feature
  81  comparator
  82  otap-common 
  83  test-common-defs)
  84
  85add_executable(single-line-feature-test
  86  single-line-feature-test
  87  single-line-feature
  88  feature
  89  comparator
  90  otap-common 
  91  test-common-defs)
  92
  93add_executable(shape-context-feature-test
  94  shape-context-feature-test
  95  shape-context-feature
  96  feature
  97  comparator
  98  otap-common 
  99  test-common-defs)
 100
 101add_executable(sift-feature-test
 102  sift-feature-test
 103  ${CC_FILES}
 104  test-common-defs)
 105
 106add_executable(surf-feature-test
 107  surf-feature-test
 108  ${CC_FILES}
 109  test-common-defs)
 110
 111add_executable(freak-feature-test
 112  freak-feature-test
 113  ${CC_FILES}
 114  test-common-defs)
 115
 116add_executable(chamfer-feature-test
 117  chamfer-feature-test
 118  chamfer-feature
 119  surf-feature
 120  sift-feature
 121  freak-feature
 122  feature
 123  comparator
 124  connected-component
 125  otap-common 
 126  test-common-defs)
 127
 128add_executable(component-area-feature-test
 129  component-area-feature-test
 130  component-area-feature
 131  surf-feature
 132  sift-feature
 133  freak-feature
 134  feature
 135  comparator
 136  connected-component
 137  otap-common 
 138  test-common-defs)
 139
 140add_executable(projection-profile-feature-test
 141  projection-profile-feature-test
 142  ${CC_FILES}
 143  test-common-defs)
 144
 145add_executable(connected-component-test 
 146  connected-component-test
 147  test-common-defs 
 148  ${CC_FILES})
 149
 150add_executable(component-filter-test
 151  component-filter-test
 152  component-filter
 153  test-common-defs 
 154  ${CC_FILES})
 155
 156add_executable(page-image-test 
 157  page-image-test 
 158  page-image 
 159  test-common-defs
 160  ${CC_FILES})
 161
 162add_executable(curve-approximation-test
 163  curve-approximation-test
 164  curve-approximation
 165  page-image
 166  test-common-defs
 167  ${CC_FILES})
 168
 169add_executable(word-spot-test 
 170  word-spot-test 
 171  word-spot 
 172  page-image
 173  test-common-defs
 174  ${CC_FILES})
 175
 176add_executable(word-spot-page-query-test 
 177  word-spot-page-query-test 
 178  word-spot-page-query 
 179  word-spot
 180  page-image
 181  ${CC_FILES}
 182  test-common-defs)
 183
 184add_executable(word-spot-query-test 
 185  word-spot-query-test 
 186  word-spot-query 
 187  word-spot-page-query
 188  word-spot-page-query
 189  word-spot
 190  page-image
 191  test-common-defs
 192  ${CC_FILES})
 193
 194add_executable(word-spot-query-manager-test 
 195  word-spot-query-manager-test 
 196  word-spot-query-manager 
 197  word-spot-query
 198  word-spot-page-query
 199  word-spot
 200  page-image
 201  ${CC_FILES}
 202  test-common-defs)
 203
 204
 205# MAIN TARGETS
 206
 207add_executable(similar-files
 208  similar-files
 209  page-image
 210  ${CC_FILES})
 211
 212add_executable(cc-matrix
 213  cc-matrix
 214  curve-approximation
 215  page-image
 216  ${CC_FILES})
 217  
 218add_executable(ws-matrix
 219  ws-matrix
 220  word-spot-query
 221  word-spot-page-query
 222  word-spot
 223  page-image
 224  ${CC_FILES})
 225
 226add_executable(image-retrieval
 227  image-retrieval
 228  word-spot
 229  page-image
 230  ${CC_FILES})
 231
 232add_executable(retrieval-recall-precision
 233  retrieval-recall-precision
 234  word-spot
 235  page-image
 236  ${CC_FILES})
 237
 238add_executable(shard-page-components
 239  shard-page-components
 240  page-image
 241  ${CC_FILES})
 242
 243add_executable(otap-word-spot
 244  main
 245  word-spot-query-manager 
 246  word-spot-query
 247  word-spot-page-query
 248  word-spot
 249  page-image
 250  ${CC_FILES})  
 251
 252
 253
 254# LINK DEFINITIONS
 255
 256target_link_libraries(abc opencv_core opencv_highgui opencv_imgproc boost_program_options)
 257
 258target_link_libraries(cppdeneme ${OTAP_TESTING_LIBS})
 259
 260target_link_libraries(otap-common-test ${OTAP_TESTING_LIBS})
 261
 262target_link_libraries(feature-test ${OTAP_TESTING_LIBS})
 263
 264target_link_libraries(comparator-test ${OTAP_TESTING_LIBS})
 265
 266target_link_libraries(aggregate-comparator-test ${OTAP_TESTING_LIBS})
 267
 268target_link_libraries(line-pair-feature-test ${OTAP_TESTING_LIBS})
 269
 270target_link_libraries(single-line-feature-test ${OTAP_TESTING_LIBS})
 271
 272target_link_libraries(shape-context-feature-test ${OTAP_TESTING_LIBS})
 273
 274target_link_libraries(sift-feature-test ${OTAP_TESTING_LIBS})
 275
 276target_link_libraries(surf-feature-test ${OTAP_TESTING_LIBS})
 277
 278target_link_libraries(chamfer-feature-test ${OTAP_TESTING_LIBS})
 279
 280target_link_libraries(component-area-feature-test ${OTAP_TESTING_LIBS})
 281
 282target_link_libraries(freak-feature-test ${OTAP_TESTING_LIBS})
 283
 284target_link_libraries(projection-profile-feature-test ${OTAP_TESTING_LIBS})
 285
 286target_link_libraries(connected-component-test ${OTAP_TESTING_LIBS})
 287
 288target_link_libraries(component-filter-test ${OTAP_TESTING_LIBS})
 289
 290target_link_libraries(page-image-test ${OTAP_TESTING_LIBS})
 291
 292target_link_libraries(curve-approximation-test ${OTAP_TESTING_LIBS})
 293
 294target_link_libraries(word-spot-test ${OTAP_TESTING_LIBS})
 295
 296target_link_libraries(word-spot-page-query-test ${OTAP_TESTING_LIBS})
 297
 298target_link_libraries(word-spot-query-test ${OTAP_TESTING_LIBS})
 299
 300target_link_libraries(word-spot-query-manager-test ${OTAP_TESTING_LIBS})
 301
 302target_link_libraries(otap-word-spot ${OTAP_COMMON_LIBS})
 303
 304target_link_libraries(cc-matrix ${OTAP_TESTING_LIBS})
 305
 306target_link_libraries(ws-matrix ${OTAP_TESTING_LIBS})
 307
 308target_link_libraries(image-retrieval ${OTAP_TESTING_LIBS})
 309
 310target_link_libraries(retrieval-recall-precision ${OTAP_TESTING_LIBS})
 311
 312target_link_libraries(shard-page-components ${OTAP_COMMON_LIBS})
 313
 314target_link_libraries(similar-files ${OTAP_COMMON_LIBS})
 315
 316# add_custom_command(TARGET abc
 317#   POST_BUILD
 318#   COMMAND abc ../test-image.png)
 319
 320add_custom_command(TARGET cppdeneme
 321  POST_BUILD
 322  COMMAND cppdeneme)
 323
 324add_custom_command(TARGET otap-common-test
 325  POST_BUILD
 326  COMMAND otap-common-test)
 327
 328add_custom_command(TARGET feature-test
 329  POST_BUILD
 330  COMMAND feature-test)
 331
 332add_custom_command(TARGET comparator-test
 333  POST_BUILD
 334  COMMAND comparator-test)
 335
 336add_custom_command(TARGET aggregate-comparator-test
 337  POST_BUILD
 338  COMMAND aggregate-comparator-test)
 339
 340add_custom_command(TARGET line-pair-feature-test
 341   POST_BUILD
 342   COMMAND line-pair-feature-test)
 343
 344add_custom_command(TARGET single-line-feature-test
 345   POST_BUILD
 346   COMMAND single-line-feature-test)
 347
 348add_custom_command(TARGET shape-context-feature-test
 349   POST_BUILD
 350   COMMAND shape-context-feature-test)
 351
 352
 353add_custom_command(TARGET sift-feature-test
 354   POST_BUILD
 355   COMMAND sift-feature-test)
 356
 357add_custom_command(TARGET surf-feature-test
 358   POST_BUILD
 359   COMMAND surf-feature-test)
 360
 361add_custom_command(TARGET chamfer-feature-test
 362   POST_BUILD
 363   COMMAND chamfer-feature-test)
 364
 365add_custom_command(TARGET component-area-feature-test
 366   POST_BUILD
 367   COMMAND component-area-feature-test)
 368
 369add_custom_command(TARGET projection-profile-feature-test
 370   POST_BUILD
 371   COMMAND projection-profile-feature-test)
 372
 373add_custom_command(TARGET freak-feature-test
 374   POST_BUILD
 375   COMMAND freak-feature-test)
 376
 377add_custom_command(TARGET connected-component-test
 378  POST_BUILD
 379  COMMAND connected-component-test)
 380
 381add_custom_command(TARGET component-filter-test
 382  POST_BUILD
 383  COMMAND component-filter-test)
 384
 385add_custom_command(TARGET page-image-test
 386   POST_BUILD
 387   COMMAND page-image-test)
 388
 389add_custom_command(TARGET curve-approximation-test
 390   POST_BUILD
 391   COMMAND curve-approximation-test)
 392
 393add_custom_command(TARGET word-spot-test
 394  POST_BUILD
 395  COMMAND word-spot-test)
 396
 397add_custom_command(TARGET word-spot-page-query-test
 398  POST_BUILD
 399  COMMAND word-spot-page-query-test)
 400
 401add_custom_command(TARGET word-spot-query-test
 402  POST_BUILD
 403  COMMAND word-spot-query-test)
 404
 405add_custom_command(TARGET word-spot-query-manager-test
 406  POST_BUILD
 407  COMMAND word-spot-query-manager-test)
 408
 409# add_custom_command(TARGET cc-matrix
 410#   POST_BUILD
 411#   COMMAND valgrind --tool=memcheck --leak-check=yes ./cc-matrix --result-size 100 --input ../../../experiments/two/2.png --output-file cc-matrix-result.yml)
 412
 413
 414
 415
 416if(${DO_OTAP_WS_OTM20_TEST})
 417  set (OTAP_WS_PAGE_DIR ${PROJECT_SOURCE_DIR}/../web/static/wordspot/pages20/)
 418  file(GLOB OTAP_WS_QUERY_FILES ${PROJECT_SOURCE_DIR}/../experiments/otap-word-spot/otm20/queries/*.png)
 419  foreach(ff ${OTAP_WS_QUERY_FILES})
 420    message (${ff})
 421  endforeach(ff)
 422  set (OTAP_WS_OUTPUT_DIR ${PROJECT_SOURCE_DIR}/../experiments/otap-word-spot/otm20/results/)
 423#  set (OTAP_WS_FEATURES contour-line-pair contour-single-line shape-context)
 424  set (OTAP_WS_FEATURES shape-context)
 425#  set (OTAP_WS_SERIAL_COMPARATORS minimums in-order spanning-minimums)
 426  set (OTAP_WS_SERIAL_COMPARATORS minimums minimums in-order spanning-minimums)
 427
 428  set (OTAP_WS_SCALAR_COMPARATORS plain)
 429  
 430  foreach(query_file ${OTAP_WS_QUERY_FILES})
 431    string(RANDOM outdir_name)
 432    add_custom_command(TARGET otap-word-spot
 433      POST_BUILD
 434      COMMAND mkdir -p ${OTAP_WS_OUTPUT_DIR}/${outdir_name})
 435    add_custom_command(TARGET otap-word-spot
 436      POST_BUILD
 437      COMMAND ${PROJECT_SOURCE_DIR}/../scripts/2colorthresh ${query_file} ${OTAP_WS_OUTPUT_DIR}${outdir_name}/query.png)
 438
 439    foreach(feature ${OTAP_WS_FEATURES})
 440      foreach(serial_cmp ${OTAP_WS_SERIAL_COMPARATORS})
 441	foreach(scalar_cmp ${OTAP_WS_SCALAR_COMPARATORS})
 442	  add_custom_command(TARGET otap-word-spot
 443	    POST_BUILD
 444	    COMMAND mkdir -p ${OTAP_WS_OUTPUT_DIR}/${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp})
 445	  add_custom_command(TARGET otap-word-spot
 446	    POST_BUILD
 447	    COMMAND otap-word-spot --result-size 20 --image-dir ${OTAP_WS_PAGE_DIR} --query-dir ${OTAP_WS_OUTPUT_DIR}/${outdir_name}/query.png --output-filename ${OTAP_WS_OUTPUT_DIR}/${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp}/result.html --features ${feature} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} --span-size 5)
 448	endforeach(scalar_cmp)
 449      endforeach(serial_cmp)
 450    endforeach(feature)
 451  endforeach(query_file)
 452endif()
 453
 454
 455
 456
 457if(${DO_OTAP_WS_OTM5_TEST})
 458  set (OTAP_WS_PAGE_DIR ${PROJECT_SOURCE_DIR}/../web/static/wordspot/pages/)
 459  file(GLOB OTAP_WS_QUERY_FILES ${PROJECT_SOURCE_DIR}/../experiments/otap-word-spot/otm5/queries/*.png)
 460  foreach(ff ${OTAP_WS_QUERY_FILES})
 461    message (${ff})
 462  endforeach(ff)
 463  set (OTAP_WS_OUTPUT_DIR ${PROJECT_SOURCE_DIR}/../experiments/otap-word-spot/otm5/results/)
 464#  set (OTAP_WS_FEATURES contour-line-pair contour-single-line shape-context)
 465  set (OTAP_WS_FEATURES contour-single-line shape-context)
 466#  set (OTAP_WS_SERIAL_COMPARATORS minimums in-order spanning-minimums)
 467  set (OTAP_WS_SERIAL_COMPARATORS minimums)
 468
 469  set (OTAP_WS_SCALAR_COMPARATORS plain)
 470  
 471  foreach(query_file ${OTAP_WS_QUERY_FILES})
 472    string(RANDOM outdir_name)
 473    add_custom_command(TARGET otap-word-spot
 474      POST_BUILD
 475      COMMAND mkdir -p ${OTAP_WS_OUTPUT_DIR}/${outdir_name})
 476    add_custom_command(TARGET otap-word-spot
 477      POST_BUILD
 478      COMMAND ${PROJECT_SOURCE_DIR}/../scripts/2colorthresh ${query_file} ${OTAP_WS_OUTPUT_DIR}${outdir_name}/query.png)
 479
 480    foreach(feature ${OTAP_WS_FEATURES})
 481      foreach(serial_cmp ${OTAP_WS_SERIAL_COMPARATORS})
 482	foreach(scalar_cmp ${OTAP_WS_SCALAR_COMPARATORS})
 483	  add_custom_command(TARGET otap-word-spot
 484	    POST_BUILD
 485	    COMMAND mkdir -p ${OTAP_WS_OUTPUT_DIR}/${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp})
 486	  add_custom_command(TARGET otap-word-spot
 487	    POST_BUILD
 488	    COMMAND otap-word-spot --result-size 20 --image-dir ${OTAP_WS_PAGE_DIR} --query-dir ${OTAP_WS_OUTPUT_DIR}/${outdir_name}/query.png --output-filename ${OTAP_WS_OUTPUT_DIR}/${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp}/result.html --features ${feature} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp})
 489	endforeach(scalar_cmp)
 490      endforeach(serial_cmp)
 491    endforeach(feature)
 492  endforeach(query_file)
 493endif()
 494
 495
 496
 497
 498if(${DO_OTAP_WS_GW20_TEST})
 499  set (OTAP_WS_PAGE_DIR ../../../experiments/iam-gw/gw/data/line_images_normalized/)
 500  file(GLOB OTAP_WS_QUERY_FILES ../../experiments/iam-gw/gw/queries/*.png)
 501  foreach(ff ${OTAP_WS_QUERY_FILES})
 502    message (${ff})
 503  endforeach(ff)
 504  set (OTAP_WS_OUTPUT_DIR ../../../experiments/iam-gw/gw/results/)
 505#  set (OTAP_WS_FEATURES contour-line-pair contour-single-line shape-context)
 506  set (OTAP_WS_FEATURES shape-context)
 507#  set (OTAP_WS_SERIAL_COMPARATORS minimums in-order spanning-minimums)
 508  set (OTAP_WS_SERIAL_COMPARATORS minimums)
 509  set (OTAP_WS_SCALAR_COMPARATORS plain)
 510  
 511  foreach(query_file ${OTAP_WS_QUERY_FILES})
 512    string(RANDOM outdir_name)
 513     add_custom_command(TARGET otap-word-spot
 514       POST_BUILD
 515       COMMAND mkdir -p ${OTAP_WS_OUTPUT_DIR}/${outdir_name} && cp ${query_file} ${OTAP_WS_OUTPUT_DIR}/${outdir_name}/query.png)
 516    foreach(feature ${OTAP_WS_FEATURES})
 517      foreach(serial_cmp ${OTAP_WS_SERIAL_COMPARATORS})
 518	foreach(scalar_cmp ${OTAP_WS_SCALAR_COMPARATORS})
 519	  add_custom_command(TARGET otap-word-spot
 520	    POST_BUILD
 521	    COMMAND mkdir -p ${OTAP_WS_OUTPUT_DIR}/${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp})
 522	  add_custom_command(TARGET otap-word-spot
 523	    POST_BUILD
 524	    COMMAND otap-word-spot --result-size 20 --image-dir ${OTAP_WS_PAGE_DIR} --query-dir ${OTAP_WS_OUTPUT_DIR}/${outdir_name}/query.png --output-filename ${OTAP_WS_OUTPUT_DIR}/${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp}/result.html --features ${feature} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} > ${OTAP_WS_OUTPUT_DIR}/${outdir_name}/output.log)
 525	endforeach(scalar_cmp)
 526      endforeach(serial_cmp)
 527    endforeach(feature)
 528  endforeach(query_file)
 529endif()
 530
 531
 532if(${DO_CC_MATRIX_TESTS})
 533
 534  set (CC_MATRIX_PAGE_IMAGE ../../../experiments/three/page.png)
 535  set (CC_MATRIX_QUERY_IMAGE ../../../experiments/three/query.png)
 536  set (CC_MATRIX_OUTPUT_DIR ../../../experiments/three/)
 537  set (CC_MATRIX_FEATURES ${ALL_FEATURES})
 538  set (CC_MATRIX_RICH_FEATURES sift freak surf)
 539  #  set (CC_MATRIX_SERIAL_COMPARATORS minimums maximums in-order spanning-minimums spanning-maximums)
 540  set (CC_MATRIX_SERIAL_COMPARATORS minimums dynamic-minimums)
 541  # set (CC_MATRIX_SCALAR_COMPARATORS plain sigmoid sigmoid-square)
 542  set (CC_MATRIX_SCALAR_COMPARATORS plain)
 543
 544  foreach(feature ${CC_MATRIX_RICH_FEATURES})
 545    foreach(serial_cmp ${CC_MATRIX_SERIAL_COMPARATORS})
 546      foreach(scalar_cmp ${CC_MATRIX_SCALAR_COMPARATORS})
 547	foreach(desc_size 1 2 4 9)
 548	add_custom_command(TARGET cc-matrix
 549	  POST_BUILD
 550	  COMMAND echo Processing: ${feature}-K${desc_size}-${serial_cmp}-${scalar_cmp}-)
 551	add_custom_command(TARGET cc-matrix
 552	  POST_BUILD
 553	  COMMAND mkdir -p ${CC_MATRIX_OUTPUT_DIR}/${feature}-K${desc_size}-${serial_cmp}-${scalar_cmp})
 554	add_custom_command(TARGET cc-matrix
 555	  POST_BUILD
 556	  COMMAND cc-matrix --result-size 100 --input ${CC_MATRIX_PAGE_IMAGE} --output-file ${CC_MATRIX_OUTPUT_DIR}/${feature}-K${desc_size}-${serial_cmp}-${scalar_cmp}/${feature}-K${desc_size}-${serial_cmp}-${scalar_cmp}.html --descriptor-size ${desc_size} --features ${feature} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} > ${CC_MATRIX_OUTPUT_DIR}/${feature}-K${desc_size}-${serial_cmp}-${scalar_cmp}/${feature}-K${desc_size}-${serial_cmp}-${scalar_cmp}.log)
 557	endforeach(desc_size)
 558      endforeach(scalar_cmp)
 559    endforeach(serial_cmp)
 560  endforeach(feature)
 561
 562  foreach(feature ${CC_MATRIX_FEATURES})
 563    foreach(serial_cmp ${CC_MATRIX_SERIAL_COMPARATORS})
 564      foreach(scalar_cmp ${CC_MATRIX_SCALAR_COMPARATORS})
 565	add_custom_command(TARGET cc-matrix
 566	  POST_BUILD
 567	  COMMAND echo Processing: ${feature}-${serial_cmp}-${scalar_cmp})
 568	add_custom_command(TARGET cc-matrix
 569	  POST_BUILD
 570	  COMMAND mkdir -p ${CC_MATRIX_OUTPUT_DIR}/${feature}-${serial_cmp}-${scalar_cmp})
 571	add_custom_command(TARGET cc-matrix
 572	  POST_BUILD
 573	  COMMAND cc-matrix --result-size 100 --input ${CC_MATRIX_PAGE_IMAGE} --output-file ${CC_MATRIX_OUTPUT_DIR}/${feature}-${serial_cmp}-${scalar_cmp}/${feature}-${serial_cmp}-${scalar_cmp}.html --features ${feature} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} > ${CC_MATRIX_OUTPUT_DIR}/${feature}-${serial_cmp}-${scalar_cmp}/${feature}-${serial_cmp}-${scalar_cmp}.log)
 574      endforeach(scalar_cmp)
 575    endforeach(serial_cmp)
 576  endforeach(feature)
 577
 578endif()
 579
 580
 581if(${DO_IMAGE_RETRIEVAL_GW20_TESTS})
 582  set (GW20_WORDS ../../../experiments/iam-gw/gw/data/word_images_normalized/)
 583  file(GLOB IMAGE_RETRIEVAL_QUERY_FILES ../../experiments/iam-gw/image-retrieval/queries/*.png)
 584  foreach(ff ${IMAGE_RETRIEVAL_QUERY_FILES})
 585    message (${ff})
 586  endforeach(ff)
 587
 588  set (IMAGE_RETRIEVAL_OUTPUT_DIR ../../../experiments/iam-gw/image-retrieval/results/)
 589#  set (IMAGE_RETRIEVAL_FEATURES contour-line-pair contour-single-line shape-context)
 590  set (IMAGE_RETRIEVAL_FEATURES chamfer freak sift surf contour-line-pair contour-single-line shape-context)
 591#  set (IMAGE_RETRIEVAL_SERIAL_COMPARATORS minimums in-order spanning-minimums)
 592  set (IMAGE_RETRIEVAL_SERIAL_COMPARATORS dynamic-minimums)
 593  set (IMAGE_RETRIEVAL_SCALAR_COMPARATORS euclidean)
 594  foreach(query_file ${IMAGE_RETRIEVAL_QUERY_FILES})
 595    string(RANDOM outdir_name)
 596     add_custom_command(TARGET image-retrieval
 597       POST_BUILD
 598       COMMAND mkdir -p ${IMAGE_RETRIEVAL_OUTPUT_DIR}/${outdir_name} && cp ${query_file} ${IMAGE_RETRIEVAL_OUTPUT_DIR}/${outdir_name}/)
 599    foreach(feature ${IMAGE_RETRIEVAL_FEATURES})
 600      foreach(serial_cmp ${IMAGE_RETRIEVAL_SERIAL_COMPARATORS})
 601	foreach(scalar_cmp ${IMAGE_RETRIEVAL_SCALAR_COMPARATORS})
 602	  add_custom_command(TARGET image-retrieval 
 603	    POST_BUILD
 604	    COMMAND echo Processing: ${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp})
 605	  add_custom_command(TARGET image-retrieval
 606	    POST_BUILD
 607	    COMMAND mkdir -p ${IMAGE_RETRIEVAL_OUTPUT_DIR}/${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp})
 608	  add_custom_command(TARGET image-retrieval
 609	    POST_BUILD
 610	    COMMAND image-retrieval --result-size 20 --input ${GW20_WORDS} --query-image ${query_file} --output-file ${IMAGE_RETRIEVAL_OUTPUT_DIR}/${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp}/result.html --features ${feature} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} > ${IMAGE_RETRIEVAL_OUTPUT_DIR}/${outdir_name}/output.log)
 611	endforeach(scalar_cmp)
 612      endforeach(serial_cmp)
 613    endforeach(feature)
 614  endforeach(query_file)
 615endif()
 616
 617
 618if(${DO_IMAGE_RETRIEVAL_LM_TESTS})
 619  set (LM_WORDS ../../../experiments/leylamecnun/words/)
 620  file(GLOB IMAGE_RETRIEVAL_QUERY_FILES ../../experiments/leylamecnun/queries/*.png)
 621  foreach(ff ${IMAGE_RETRIEVAL_QUERY_FILES})
 622    message (${ff})
 623  endforeach(ff)
 624
 625  set (IMAGE_RETRIEVAL_OUTPUT_DIR ../../../experiments/leylamecnun/results/)
 626#  set (IMAGE_RETRIEVAL_FEATURES contour-line-pair contour-single-line shape-context)
 627  set (IMAGE_RETRIEVAL_FEATURES component-area chamfer freak sift surf contour-line-pair contour-single-line shape-context)
 628#  set (IMAGE_RETRIEVAL_SERIAL_COMPARATORS minimums in-order spanning-minimums)
 629  set (IMAGE_RETRIEVAL_SERIAL_COMPARATORS dynamic-minimums)
 630  set (IMAGE_RETRIEVAL_SCALAR_COMPARATORS euclidean)
 631  foreach(query_file ${IMAGE_RETRIEVAL_QUERY_FILES})
 632    string(RANDOM outdir_name)
 633     add_custom_command(TARGET image-retrieval
 634       POST_BUILD
 635       COMMAND mkdir -p ${IMAGE_RETRIEVAL_OUTPUT_DIR}/${outdir_name} && cp ${query_file} ${IMAGE_RETRIEVAL_OUTPUT_DIR}/${outdir_name}/)
 636    foreach(feature ${IMAGE_RETRIEVAL_FEATURES})
 637      foreach(serial_cmp ${IMAGE_RETRIEVAL_SERIAL_COMPARATORS})
 638	foreach(scalar_cmp ${IMAGE_RETRIEVAL_SCALAR_COMPARATORS})
 639	  add_custom_command(TARGET image-retrieval 
 640	    POST_BUILD
 641	    COMMAND echo Processing: ${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp})
 642	  add_custom_command(TARGET image-retrieval
 643	    POST_BUILD
 644	    COMMAND mkdir -p ${IMAGE_RETRIEVAL_OUTPUT_DIR}/${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp})
 645	  add_custom_command(TARGET image-retrieval
 646	    POST_BUILD
 647	    COMMAND image-retrieval --result-size 20 --input ${LM_WORDS} --query-image ${query_file} --output-file ${IMAGE_RETRIEVAL_OUTPUT_DIR}/${outdir_name}/${feature}-${serial_cmp}-${scalar_cmp}/result.html --features ${feature} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} > ${IMAGE_RETRIEVAL_OUTPUT_DIR}/${outdir_name}/output.log)
 648	endforeach(scalar_cmp)
 649      endforeach(serial_cmp)
 650    endforeach(feature)
 651  endforeach(query_file)
 652endif()
 653
 654if(${DO_WS_MATRIX_TESTS})
 655
 656  set (WS_MATRIX_PAGE_IMAGE ../../../experiments/ws/three/page.png)
 657  set (WS_MATRIX_QUERY_IMAGE ../../../experiments/ws/three/query.png)
 658  set (WS_MATRIX_OUTPUT_DIR ../../../experiments/ws/three/)
 659  set (WS_MATRIX_FEATURES aspect-ratio contour-line-pair contour-single-line shape-context)
 660  #  set (WS_MATRIX_SERIAL_COMPARATORS minimums maximums in-order spanning-minimums spanning-maximums)
 661  set (WS_MATRIX_SERIAL_COMPARATORS minimums)
 662  # set (WS_MATRIX_SCALAR_COMPARATORS plain sigmoid sigmoid-square)
 663  set (WS_MATRIX_SCALAR_COMPARATORS plain)
 664  
 665  foreach(feature ${WS_MATRIX_FEATURES})
 666    foreach(serial_cmp ${WS_MATRIX_SERIAL_COMPARATORS})
 667      foreach(scalar_cmp ${WS_MATRIX_SCALAR_COMPARATORS})
 668	add_custom_command(TARGET ws-matrix
 669	  POST_BUILD
 670	  COMMAND mkdir -p ${WS_MATRIX_OUTPUT_DIR}/${feature}-${serial_cmp}-${scalar_cmp})
 671	add_custom_command(TARGET ws-matrix
 672	  POST_BUILD
 673	  COMMAND ws-matrix --result-size 100 --page-image ${WS_MATRIX_PAGE_IMAGE} --query-image ${WS_MATRIX_QUERY_IMAGE} --output-file ${WS_MATRIX_OUTPUT_DIR}/${feature}-${serial_cmp}-${scalar_cmp}/${feature}-${serial_cmp}-${scalar_cmp}.html --features ${feature} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp})
 674      endforeach(scalar_cmp)
 675    endforeach(serial_cmp)
 676  endforeach(feature)
 677endif()
 678
 679if(${DO_RECALL_PRECISION_LMSMALL_TESTS})
 680  set (RP_INPUT_DIR ../../../experiments/rp/leylamecnun-small/)
 681  set (RP_OUTPUT_DIR ../../../experiments/rp/results/leylamecnun-small/)
 682#  set (RP_FEATURES freak sift surf contour-line-pair contour-single-line shape-context chamfer)
 683set (RP_FEATURES contour-line-pair contour-single-line shape-context)
 684  set (RP_SERIAL_COMPARATORS dynamic-minimums minimums matching-minimums)
 685  set (RP_SCALAR_COMPARATORS plain )
 686
 687  add_custom_command(TARGET retrieval-recall-precision
 688    POST_BUILD
 689    COMMAND mkdir -p ${RP_OUTPUT_DIR})
 690
 691  foreach(feature ${RP_FEATURES})
 692    foreach(serial_cmp ${RP_SERIAL_COMPARATORS})
 693      foreach(scalar_cmp ${RP_SCALAR_COMPARATORS})
 694	foreach(desc_size 4)
 695	  foreach(subst_cost_func const)
 696	    foreach(subst_cost_mod 1)
 697	      foreach(delete_cost_func pow)
 698		foreach(delete_cost_mod 2)
 699		  foreach(location_weight 0.0 0.8 1.6 3.2 6.4 12.8)
 700		  string(RANDOM outfile_suffix)
 701		  
 702		  set(output_file ${RP_OUTPUT_DIR}/${feature}-K${desc_size}-${serial_cmp}-sub-${subst_cost_func}-${subst_cost_mod}-del-${delete_cost_func}-${delete_cost_mod}-feat-0.8-loc-${location_weight}-${scalar_cmp}-pooling-${outfile_suffix}.csv)
 703
 704		  add_custom_command(TARGET retrieval-recall-precision 
 705		    POST_BUILD
 706		    COMMAND echo Processing: ${output_file})
 707		  
 708		  add_custom_command(TARGET retrieval-recall-precision
 709		    POST_BUILD
 710		    COMMAND retrieval-recall-precision --input ${RP_INPUT_DIR} --output-file ${output_file} --features ${feature} --descriptor-size ${desc_size} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} --substitute-cost-function ${subst_cost_func} --substitute-cost-modifier ${subst_cost_mod} --delete-cost-function ${delete_cost_func} --delete-cost-modifier ${delete_cost_mod} --wordspot-feature-weight 0.8 --wordspot-location-weight ${location_weight} --wordspot-use-feature-pool > ${output_file}.log 
 711		    )
 712		  add_custom_command(TARGET retrieval-recall-precision
 713		    POST_BUILD
 714		    COMMAND head -n 100 ${output_file}.log > ${output_file}.info)
 715
 716		  add_custom_command(TARGET retrieval-recall-precision
 717		    POST_BUILD
 718		    COMMAND rm ${output_file}.log)
 719
 720		  add_custom_command(TARGET retrieval-recall-precision
 721		    POST_BUILD
 722		    COMMAND mv ${output_file}*.csv ${RP_OUTPUT_DIR}/words/)
 723
 724		  endforeach(location_weight)
 725		endforeach(delete_cost_mod)
 726	      endforeach(delete_cost_func)
 727	    endforeach(subst_cost_mod)
 728	  endforeach(subst_cost_func)
 729	endforeach(desc_size)
 730      endforeach(scalar_cmp)
 731    endforeach(serial_cmp)
 732  endforeach(feature)
 733endif()
 734
 735if(${DO_RECALL_PRECISION_LM_TESTS})
 736  set (RP_INPUT_DIR ../../../experiments/rp/leylamecnun/)
 737  set (RP_OUTPUT_DIR ../../../experiments/rp/results/leylamecnun/)
 738#  set (RP_FEATURES freak sift surf contour-line-pair contour-single-line shape-context chamfer)
 739  set (RP_FEATURES contour-line-pair contour-single-line shape-context sift surf freak chamfer profile-projection upper-projection lower-projection upper-word-profile lower-word-profile background-transitions)
 740  set (RP_SERIAL_COMPARATORS dynamic-minimums)
 741  set (RP_SCALAR_COMPARATORS euclidean )
 742  set (RP_COST_MODIFIERS 2)
 743
 744  add_custom_command(TARGET retrieval-recall-precision
 745    POST_BUILD
 746    COMMAND mkdir -p ${RP_OUTPUT_DIR})
 747
 748  foreach(feature ${RP_FEATURES})
 749    foreach(serial_cmp ${RP_SERIAL_COMPARATORS})
 750      foreach(scalar_cmp ${RP_SCALAR_COMPARATORS})
 751	foreach(desc_size 4)
 752	  foreach(subst_cost_func const)
 753	    foreach(subst_cost_mod ${RP_COST_MODIFIERS})
 754	      foreach(delete_cost_func pow)
 755		foreach(delete_cost_mod ${RP_COST_MODIFIERS})
 756		  foreach(location_weight 3.2)
 757		  string(RANDOM outfile_suffix)
 758		  set(output_file ${RP_OUTPUT_DIR}/${feature}-K${desc_size}-${serial_cmp}-sub-${subst_cost_func}-${subst_cost_mod}-del-${delete_cost_func}-${delete_cost_mod}-subst-0.8-loc-${location_weight}-${scalar_cmp}-pooling-${outfile_suffix}.csv)
 759
 760		  add_custom_command(TARGET retrieval-recall-precision 
 761		    POST_BUILD
 762		    COMMAND echo Processing: ${output_file})
 763		  
 764		  add_custom_command(TARGET retrieval-recall-precision
 765		    POST_BUILD
 766		    COMMAND retrieval-recall-precision --input ${RP_INPUT_DIR} --output-file ${output_file} --features ${feature} --descriptor-size ${desc_size} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} --substitute-cost-function ${subst_cost_func} --substitute-cost-modifier ${subst_cost_mod} --delete-cost-function ${delete_cost_func} --delete-cost-modifier ${delete_cost_mod} --wordspot-feature-weight 0.8 --wordspot-location-weight ${location_weight} --wordspot-use-feature-pool > ${output_file}.log 
 767		    )
 768
 769		  add_custom_command(TARGET retrieval-recall-precision
 770		    POST_BUILD
 771		    COMMAND head -n 100 ${output_file}.log > ${output_file}.info)
 772
 773		  add_custom_command(TARGET retrieval-recall-precision
 774		    POST_BUILD
 775		    COMMAND rm ${output_file}.log)
 776
 777		  add_custom_command(TARGET retrieval-recall-precision
 778		    POST_BUILD
 779		    COMMAND mv ${output_file}*.csv ${RP_OUTPUT_DIR}/words/)
 780
 781
 782
 783		  endforeach(location_weight)
 784		endforeach(delete_cost_mod)
 785	      endforeach(delete_cost_func)
 786	    endforeach(subst_cost_mod)
 787	  endforeach(subst_cost_func)
 788	endforeach(desc_size)
 789      endforeach(scalar_cmp)
 790    endforeach(serial_cmp)
 791  endforeach(feature)
 792endif()
 793
 794
 795if(${DO_RECALL_PRECISION_GW16_TESTS})
 796  set (RP_INPUT_DIR ../../../experiments/rp/iam-gw-small/)
 797  set (RP_OUTPUT_DIR ../../../experiments/rp/results/iam-gw-small-new-dynamic-mins/)
 798#  set (RP_FEATURES freak sift surf contour-line-pair contour-single-line shape-context chamfer)
 799  set (RP_FEATURES ${ALL_SERIAL_FEATURES})
 800  set (RP_SERIAL_COMPARATORS dynamic-time-warping)
 801  set (RP_SCALAR_COMPARATORS plain)
 802
 803  add_custom_command(TARGET retrieval-recall-precision
 804    POST_BUILD
 805    COMMAND mkdir -p ${RP_OUTPUT_DIR})
 806
 807  foreach(feature ${RP_FEATURES})
 808    foreach(serial_cmp ${RP_SERIAL_COMPARATORS})
 809      foreach(scalar_cmp ${RP_SCALAR_COMPARATORS})
 810	foreach(desc_size 4)
 811	  foreach(subst_cost_func const)
 812	    foreach(subst_cost_mod 1)
 813	      foreach(delete_cost_func pow)
 814		foreach(delete_cost_mod 2)
 815		  foreach(location_weight 0.0)
 816		  string(RANDOM outfile_suffix)
 817		  set(output_file ${RP_OUTPUT_DIR}/${feature}-K${desc_size}-${serial_cmp}-sub-${subst_cost_func}-${subst_cost_mod}-del-${delete_cost_func}-${delete_cost_mod}-subst-0.8-loc-${location_weight}-${scalar_cmp}-pooling-${outfile_suffix}.csv)
 818
 819		  add_custom_command(TARGET retrieval-recall-precision 
 820		    POST_BUILD
 821		    COMMAND echo Processing: ${output_file})
 822		  
 823		  add_custom_command(TARGET retrieval-recall-precision
 824		    POST_BUILD
 825		    COMMAND retrieval-recall-precision --input ${RP_INPUT_DIR} --output-file ${output_file} --features ${feature} --descriptor-size ${desc_size} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} --substitute-cost-function ${subst_cost_func} --substitute-cost-modifier ${subst_cost_mod} --delete-cost-function ${delete_cost_func} --delete-cost-modifier ${delete_cost_mod} --wordspot-use-feature-pool > ${output_file}.log 
 826		    )
 827
 828		  add_custom_command(TARGET retrieval-recall-precision
 829		    POST_BUILD
 830		    COMMAND head -n 100 ${output_file}.log > ${output_file}.info)
 831
 832		  add_custom_command(TARGET retrieval-recall-precision
 833		    POST_BUILD
 834		    COMMAND rm ${output_file}.log)
 835
 836		  add_custom_command(TARGET retrieval-recall-precision
 837		    POST_BUILD
 838		    COMMAND mv ${output_file}*.csv ${RP_OUTPUT_DIR}/words/)
 839
 840		  endforeach(location_weight)
 841		endforeach(delete_cost_mod)
 842	      endforeach(delete_cost_func)
 843	    endforeach(subst_cost_mod)
 844	  endforeach(subst_cost_func)
 845	endforeach(desc_size)
 846      endforeach(scalar_cmp)
 847    endforeach(serial_cmp)
 848  endforeach(feature)
 849endif()
 850
 851
 852
 853if(${DO_RECALL_PRECISION_GW77_TESTS})
 854  set (RP_INPUT_DIR ../../../experiments/rp/iam-gw/)
 855  set (RP_OUTPUT_DIR ../../../experiments/rp/results/iam-gw/)
 856  set (RP_FEATURES freak sift surf contour-line-pair contour-single-line shape-context chamfer)
 857  set (RP_FEATURES profile-projection chamfer contour-line-pair sift)
 858  set (RP_SERIAL_COMPARATORS dynamic-minimums)
 859  set (RP_SCALAR_COMPARATORS euclidean )
 860
 861  add_custom_command(TARGET retrieval-recall-precision
 862    POST_BUILD
 863    COMMAND mkdir -p ${RP_OUTPUT_DIR})
 864
 865  foreach(feature ${RP_FEATURES})
 866    foreach(serial_cmp ${RP_SERIAL_COMPARATORS})
 867      foreach(scalar_cmp ${RP_SCALAR_COMPARATORS})
 868	foreach(desc_size 4)
 869	  foreach(subst_cost_func const)
 870	    foreach(subst_cost_mod 1)
 871	      foreach(delete_cost_func pow)
 872		foreach(delete_cost_mod 4)
 873		  foreach(location_weight 0)
 874		  string(RANDOM outfile_suffix)
 875
 876		  set(output_file ${RP_OUTPUT_DIR}/${feature}-K${desc_size}-${serial_cmp}-sub-${subst_cost_func}-${subst_cost_mod}-del-${delete_cost_func}-${delete_cost_mod}-subst-0.8-loc-${location_weight}-${scalar_cmp}-${outfile_suffix}.csv)
 877
 878		  add_custom_command(TARGET retrieval-recall-precision 
 879		    POST_BUILD
 880		    COMMAND echo Processing: ${output_file})
 881		  
 882		  add_custom_command(TARGET retrieval-recall-precision
 883		    POST_BUILD
 884		    COMMAND retrieval-recall-precision --input ${RP_INPUT_DIR} --output-file ${output_file} --features ${feature} --descriptor-size ${desc_size} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} --substitute-cost-function ${subst_cost_func} --substitute-cost-modifier ${subst_cost_mod} --delete-cost-function ${delete_cost_func} --delete-cost-modifier ${delete_cost_mod} --wordspot-location-weight ${location_weight} > ${output_file}.log 
 885		    )
 886
 887		  add_custom_command(TARGET retrieval-recall-precision
 888		    POST_BUILD
 889		    COMMAND rm ${output_file}.log)
 890
 891		  endforeach(location_weight)
 892		endforeach(delete_cost_mod)
 893	      endforeach(delete_cost_func)
 894	    endforeach(subst_cost_mod)
 895	  endforeach(subst_cost_func)
 896	endforeach(desc_size)
 897      endforeach(scalar_cmp)
 898    endforeach(serial_cmp)
 899  endforeach(feature)
 900endif()
 901
 902
 903
 904if(${DO_RECALL_PRECISION_IFNC5I300_TESTS})
 905  set (RP_INPUT_DIR ../../../experiments/ifnenit_C5_I300/)
 906  set (RP_OUTPUT_DIR ../../../experiments/rp/results/ifnenit_C5_I300/)
 907  set (RP_FEATURES shape-context)
 908#  set (RP_FEATURES contour-line-pair contour-single-line shape-context sift surf freak chamfer profile-projection upper-projection lower-projection upper-word-profile lower-word-profile background-transitions)
 909#  set (RP_FEATURES ${ALL_SERIAL_FEATURES})
 910  set (RP_SERIAL_COMPARATORS minimums dynamic-minimums)
 911  set (RP_SCALAR_COMPARATORS euclidean)
 912
 913  add_custom_command(TARGET retrieval-recall-precision
 914    POST_BUILD
 915    COMMAND mkdir -p ${RP_OUTPUT_DIR})
 916
 917  foreach(feature ${RP_FEATURES})
 918    foreach(serial_cmp ${RP_SERIAL_COMPARATORS})
 919      foreach(scalar_cmp ${RP_SCALAR_COMPARATORS})
 920	foreach(desc_size 4)
 921	  foreach(subst_cost_func const)
 922	    foreach(subst_cost_mod 1)
 923	      foreach(delete_cost_func pow)
 924		foreach(delete_cost_mod 2)
 925		  foreach(location_weight 1.6)
 926		  string(RANDOM outfile_suffix)
 927		  set(output_file ${RP_OUTPUT_DIR}/${feature}-K${desc_size}-${serial_cmp}-sub-${subst_cost_func}-${subst_cost_mod}-del-${delete_cost_func}-${delete_cost_mod}-subst-0.8-loc-${location_weight}-${scalar_cmp}-pooling-${outfile_suffix}.csv)
 928
 929		  add_custom_command(TARGET retrieval-recall-precision 
 930		    POST_BUILD
 931		    COMMAND echo Processing: ${output_file})
 932		  
 933		  add_custom_command(TARGET retrieval-recall-precision
 934		    POST_BUILD
 935		    COMMAND retrieval-recall-precision --input ${RP_INPUT_DIR} --output-file ${output_file} --features ${feature} --descriptor-size ${desc_size} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} --substitute-cost-function ${subst_cost_func} --substitute-cost-modifier ${subst_cost_mod} --delete-cost-function ${delete_cost_func} --delete-cost-modifier ${delete_cost_mod} --wordspot-use-feature-pool > ${output_file}.log 
 936		    )
 937
 938		  add_custom_command(TARGET retrieval-recall-precision
 939		    POST_BUILD
 940		    COMMAND head -n 100 ${output_file}.log > ${output_file}.info)
 941
 942		  add_custom_command(TARGET retrieval-recall-precision
 943		    POST_BUILD
 944		    COMMAND rm ${output_file}.log)
 945
 946		  add_custom_command(TARGET retrieval-recall-precision
 947		    POST_BUILD
 948		    COMMAND mv ${output_file}*.csv ${RP_OUTPUT_DIR}/words/)
 949
 950
 951		  endforeach(location_weight)
 952		endforeach(delete_cost_mod)
 953	      endforeach(delete_cost_func)
 954	    endforeach(subst_cost_mod)
 955	  endforeach(subst_cost_func)
 956	endforeach(desc_size)
 957      endforeach(scalar_cmp)
 958    endforeach(serial_cmp)
 959  endforeach(feature)
 960endif()
 961
 962
 963if(${DO_RECALL_PRECISION_IFNC44I1000_TESTS})
 964  set (RP_INPUT_DIR ../../../experiments/ifnenit_C44_I1000/)
 965  set (RP_OUTPUT_DIR ../../../experiments/rp/results/ifnenit_C44_I1000/)
 966#  set (RP_FEATURES freak sift surf contour-line-pair contour-single-line shape-context chamfer)
 967  set (RP_FEATURES contour-line-pair contour-single-line shape-context sift surf freak chamfer profile-projection upper-projection lower-projection upper-word-profile lower-word-profile background-transitions)
 968  set (RP_SERIAL_COMPARATORS dynamic-minimums minimums matching-minimums)
 969  set (RP_SCALAR_COMPARATORS euclidean)
 970
 971  add_custom_command(TARGET retrieval-recall-precision
 972    POST_BUILD
 973    COMMAND mkdir -p ${RP_OUTPUT_DIR})
 974
 975  foreach(feature ${RP_FEATURES})
 976    foreach(serial_cmp ${RP_SERIAL_COMPARATORS})
 977      foreach(scalar_cmp ${RP_SCALAR_COMPARATORS})
 978	foreach(desc_size 4)
 979	  foreach(subst_cost_func const)
 980	    foreach(subst_cost_mod 1)
 981	      foreach(delete_cost_func const)
 982		foreach(delete_cost_mod 5)
 983		  foreach(location_weight 1.6)
 984		  string(RANDOM outfile_suffix)
 985		  set(output_file ${RP_OUTPUT_DIR}/${feature}-K${desc_size}-${serial_cmp}-sub-${subst_cost_func}-${subst_cost_mod}-del-${delete_cost_func}-${delete_cost_mod}-subst-0.8-loc-${location_weight}-${scalar_cmp}-pooling-${outfile_suffix}.csv)
 986
 987		  add_custom_command(TARGET retrieval-recall-precision 
 988		    POST_BUILD
 989		    COMMAND echo Processing: ${output_file})
 990		  
 991		  add_custom_command(TARGET retrieval-recall-precision
 992		    POST_BUILD
 993		    COMMAND retrieval-recall-precision --input ${RP_INPUT_DIR} --output-file ${output_file} --features ${feature} --descriptor-size ${desc_size} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} --substitute-cost-function ${subst_cost_func} --substitute-cost-modifier ${subst_cost_mod} --delete-cost-function ${delete_cost_func} --delete-cost-modifier ${delete_cost_mod} --wordspot-use-feature-pool > ${output_file}.log 
 994		    )
 995
 996		  add_custom_command(TARGET retrieval-recall-precision
 997		    POST_BUILD
 998		    COMMAND head -n 100 ${output_file}.log > ${output_file}.info)
 999
1000		  add_custom_command(TARGET retrieval-recall-precision
1001		    POST_BUILD
1002		    COMMAND rm ${output_file}.log)
1003
1004		  add_custom_command(TARGET retrieval-recall-precision
1005		    POST_BUILD
1006		    COMMAND mv ${output_file}*.csv ${RP_OUTPUT_DIR}/words/)
1007
1008		  endforeach(location_weight)
1009		endforeach(delete_cost_mod)
1010	      endforeach(delete_cost_func)
1011	    endforeach(subst_cost_mod)
1012	  endforeach(subst_cost_func)
1013	endforeach(desc_size)
1014      endforeach(scalar_cmp)
1015    endforeach(serial_cmp)
1016  endforeach(feature)
1017endif()
1018
1019
1020
1021
1022if(${DO_RECALL_PRECISION_DEBUG_TESTS})
1023  set (RP_INPUT_DIR ../../../experiments/rp/test/)
1024  set (RP_OUTPUT_DIR ../../../experiments/rp/results/test/)
1025  set (RP_FEATURES contour-line-pair profile-projection upper-projection lower-projection upper-word-profile lower-word-profile background-transitions)
1026  set (RP_SERIAL_COMPARATORS dynamic-minimums minimums)
1027  set (RP_SCALAR_COMPARATORS euclidean)
1028
1029  add_custom_command(TARGET retrieval-recall-precision
1030    POST_BUILD
1031    COMMAND mkdir -p ${RP_OUTPUT_DIR})
1032
1033  foreach(feature ${RP_FEATURES})
1034    foreach(serial_cmp ${RP_SERIAL_COMPARATORS})
1035      foreach(scalar_cmp ${RP_SCALAR_COMPARATORS})
1036	string(RANDOM outfile_suffix)
1037	set(output-file ${RP_OUTPUT_DIR}/${feature}-${serial_cmp}-${scalar_cmp}-${outfile_suffix}.csv)
1038
1039	add_custom_command(TARGET retrieval-recall-precision 
1040	  POST_BUILD
1041	  COMMAND echo Processing: ${feature}-${serial_cmp}-${scalar_cmp})
1042
1043	add_custom_command(TARGET retrieval-recall-precision
1044	  POST_BUILD
1045	  COMMAND retrieval-recall-precision --input ${RP_INPUT_DIR} --output-file ${output-file} --features ${feature} --serial-comparator ${serial_cmp} --scalar-comparator ${scalar_cmp} --wordspot-aggregate-query > ${output-file}.log )
1046	
1047      endforeach(scalar_cmp)
1048    endforeach(serial_cmp)
1049  endforeach(feature)
1050endif()
1051
1052