Compare commits
6 Commits
d85c25b21e
...
develop
Author | SHA1 | Date | |
---|---|---|---|
b84d40fd14 | |||
e1137844ac | |||
301fc2ca75 | |||
3022adcbb7 | |||
2e304394e5 | |||
7d225729ec |
BIN
assets/test/frames/0002.png
Normal file
After Width: | Height: | Size: 466 KiB |
BIN
assets/test/frames/0003.png
Normal file
After Width: | Height: | Size: 469 KiB |
BIN
assets/test/frames/0004.png
Normal file
After Width: | Height: | Size: 473 KiB |
BIN
assets/test/frames/0005.png
Normal file
After Width: | Height: | Size: 474 KiB |
BIN
assets/test/frames/0006.png
Normal file
After Width: | Height: | Size: 475 KiB |
BIN
assets/test/frames/0007.png
Normal file
After Width: | Height: | Size: 476 KiB |
BIN
assets/test/frames/0008.png
Normal file
After Width: | Height: | Size: 476 KiB |
BIN
assets/test/frames/0009.png
Normal file
After Width: | Height: | Size: 479 KiB |
BIN
assets/test/frames/0010.png
Normal file
After Width: | Height: | Size: 479 KiB |
BIN
assets/test/frames/0011.png
Normal file
After Width: | Height: | Size: 479 KiB |
BIN
assets/test/frames/0012.png
Normal file
After Width: | Height: | Size: 480 KiB |
BIN
assets/test/frames/0013.png
Normal file
After Width: | Height: | Size: 480 KiB |
BIN
assets/test/frames/0014.png
Normal file
After Width: | Height: | Size: 477 KiB |
BIN
assets/test/frames/0015.png
Normal file
After Width: | Height: | Size: 476 KiB |
BIN
assets/test/frames/0016.png
Normal file
After Width: | Height: | Size: 475 KiB |
BIN
assets/test/frames/0017.png
Normal file
After Width: | Height: | Size: 474 KiB |
BIN
assets/test/frames/0018.png
Normal file
After Width: | Height: | Size: 474 KiB |
BIN
assets/test/frames/0019.png
Normal file
After Width: | Height: | Size: 476 KiB |
BIN
assets/test/frames/0020.png
Normal file
After Width: | Height: | Size: 475 KiB |
BIN
assets/test/frames/0021.png
Normal file
After Width: | Height: | Size: 475 KiB |
BIN
assets/test/frames/0022.png
Normal file
After Width: | Height: | Size: 475 KiB |
BIN
assets/test/frames/0023.png
Normal file
After Width: | Height: | Size: 478 KiB |
BIN
assets/test/frames/0024.png
Normal file
After Width: | Height: | Size: 476 KiB |
BIN
assets/test/frames/0025.png
Normal file
After Width: | Height: | Size: 476 KiB |
BIN
assets/test/frames/0026.png
Normal file
After Width: | Height: | Size: 475 KiB |
BIN
assets/test/frames/0027.png
Normal file
After Width: | Height: | Size: 476 KiB |
BIN
assets/test/frames/0028.png
Normal file
After Width: | Height: | Size: 475 KiB |
BIN
assets/test/frames/0029.png
Normal file
After Width: | Height: | Size: 474 KiB |
BIN
assets/test/frames/0030.png
Normal file
After Width: | Height: | Size: 473 KiB |
BIN
assets/test/frames/0031.png
Normal file
After Width: | Height: | Size: 474 KiB |
BIN
assets/test/frames/0032.png
Normal file
After Width: | Height: | Size: 477 KiB |
BIN
assets/test/frames/0033.png
Normal file
After Width: | Height: | Size: 477 KiB |
BIN
assets/test/frames/0034.png
Normal file
After Width: | Height: | Size: 479 KiB |
BIN
assets/test/frames/0035.png
Normal file
After Width: | Height: | Size: 480 KiB |
BIN
assets/test/frames/0036.png
Normal file
After Width: | Height: | Size: 481 KiB |
BIN
assets/test/frames/0037.png
Normal file
After Width: | Height: | Size: 482 KiB |
BIN
assets/test/frames/0038.png
Normal file
After Width: | Height: | Size: 482 KiB |
BIN
assets/test/frames/0039.png
Normal file
After Width: | Height: | Size: 482 KiB |
BIN
assets/test/frames/0040.png
Normal file
After Width: | Height: | Size: 481 KiB |
BIN
assets/test/frames/0041.png
Normal file
After Width: | Height: | Size: 480 KiB |
BIN
assets/test/frames/0042.png
Normal file
After Width: | Height: | Size: 477 KiB |
BIN
assets/test/frames/0043.png
Normal file
After Width: | Height: | Size: 476 KiB |
BIN
assets/test/frames/0044.png
Normal file
After Width: | Height: | Size: 475 KiB |
BIN
assets/test/frames/0045.png
Normal file
After Width: | Height: | Size: 475 KiB |
BIN
assets/test/frames/0046.png
Normal file
After Width: | Height: | Size: 470 KiB |
BIN
assets/test/frames/0047.png
Normal file
After Width: | Height: | Size: 467 KiB |
BIN
assets/test/frames/0048.png
Normal file
After Width: | Height: | Size: 468 KiB |
BIN
assets/test/frames/0049.png
Normal file
After Width: | Height: | Size: 466 KiB |
BIN
assets/test/frames/0050.png
Normal file
After Width: | Height: | Size: 468 KiB |
BIN
assets/test/frames/0051.png
Normal file
After Width: | Height: | Size: 467 KiB |
BIN
assets/test/frames/0052.png
Normal file
After Width: | Height: | Size: 470 KiB |
BIN
assets/test/frames/0053.png
Normal file
After Width: | Height: | Size: 474 KiB |
BIN
assets/test/frames/0054.png
Normal file
After Width: | Height: | Size: 478 KiB |
BIN
assets/test/frames/0055.png
Normal file
After Width: | Height: | Size: 480 KiB |
BIN
assets/test/frames/0056.png
Normal file
After Width: | Height: | Size: 482 KiB |
BIN
assets/test/frames/0057.png
Normal file
After Width: | Height: | Size: 484 KiB |
BIN
assets/test/frames/0058.png
Normal file
After Width: | Height: | Size: 485 KiB |
BIN
assets/test/frames/0059.png
Normal file
After Width: | Height: | Size: 486 KiB |
BIN
assets/test/frames/0060.png
Normal file
After Width: | Height: | Size: 488 KiB |
BIN
assets/test/frames/0061.png
Normal file
After Width: | Height: | Size: 488 KiB |
BIN
assets/test/frames/0062.png
Normal file
After Width: | Height: | Size: 487 KiB |
BIN
assets/test/frames/0063.png
Normal file
After Width: | Height: | Size: 485 KiB |
BIN
assets/test/frames/0064.png
Normal file
After Width: | Height: | Size: 484 KiB |
BIN
assets/test/frames/0065.png
Normal file
After Width: | Height: | Size: 481 KiB |
BIN
assets/test/frames/0066.png
Normal file
After Width: | Height: | Size: 479 KiB |
BIN
assets/test/frames/0067.png
Normal file
After Width: | Height: | Size: 479 KiB |
BIN
assets/test/frames/0068.png
Normal file
After Width: | Height: | Size: 479 KiB |
BIN
assets/test/frames/0069.png
Normal file
After Width: | Height: | Size: 479 KiB |
BIN
assets/test/frames/0070.png
Normal file
After Width: | Height: | Size: 479 KiB |
BIN
assets/test/frames/0071.png
Normal file
After Width: | Height: | Size: 480 KiB |
BIN
assets/test/frames/0072.png
Normal file
After Width: | Height: | Size: 481 KiB |
BIN
assets/test/frames/0073.png
Normal file
After Width: | Height: | Size: 480 KiB |
BIN
assets/test/frames/0074.png
Normal file
After Width: | Height: | Size: 480 KiB |
BIN
assets/test/frames/0075.png
Normal file
After Width: | Height: | Size: 479 KiB |
BIN
assets/test/frames/0076.png
Normal file
After Width: | Height: | Size: 480 KiB |
BIN
assets/test/frames/0077.png
Normal file
After Width: | Height: | Size: 481 KiB |
BIN
assets/test/frames/0078.png
Normal file
After Width: | Height: | Size: 482 KiB |
BIN
assets/test/frames/0079.png
Normal file
After Width: | Height: | Size: 483 KiB |
BIN
assets/test/frames/0080.png
Normal file
After Width: | Height: | Size: 483 KiB |
BIN
assets/test/frames/0081.png
Normal file
After Width: | Height: | Size: 484 KiB |
BIN
assets/test/frames/0082.png
Normal file
After Width: | Height: | Size: 483 KiB |
BIN
assets/test/frames/0083.png
Normal file
After Width: | Height: | Size: 484 KiB |
BIN
assets/test/frames/0084.png
Normal file
After Width: | Height: | Size: 483 KiB |
BIN
assets/test/frames/0085.png
Normal file
After Width: | Height: | Size: 482 KiB |
BIN
assets/test/frames/0086.png
Normal file
After Width: | Height: | Size: 482 KiB |
BIN
assets/test/frames/0087.png
Normal file
After Width: | Height: | Size: 481 KiB |
BIN
assets/test/frames/0088.png
Normal file
After Width: | Height: | Size: 481 KiB |
BIN
assets/test/frames/0089.png
Normal file
After Width: | Height: | Size: 478 KiB |
BIN
assets/test/frames/0090.png
Normal file
After Width: | Height: | Size: 476 KiB |
BIN
assets/test/frames/0091.png
Normal file
After Width: | Height: | Size: 473 KiB |
BIN
assets/test/frames/0092.png
Normal file
After Width: | Height: | Size: 470 KiB |
BIN
assets/test/frames/0093.png
Normal file
After Width: | Height: | Size: 469 KiB |
BIN
assets/test/frames/0094.png
Normal file
After Width: | Height: | Size: 468 KiB |
BIN
assets/test/frames/0095.png
Normal file
After Width: | Height: | Size: 465 KiB |
BIN
assets/test/frames/0096.png
Normal file
After Width: | Height: | Size: 461 KiB |
BIN
assets/test/frames/0097.png
Normal file
After Width: | Height: | Size: 457 KiB |
BIN
assets/test/frames/0098.png
Normal file
After Width: | Height: | Size: 455 KiB |
BIN
assets/test/frames/0099.png
Normal file
After Width: | Height: | Size: 453 KiB |
BIN
assets/test/frames/0100.png
Normal file
After Width: | Height: | Size: 452 KiB |
BIN
assets/test/frames/0101.png
Normal file
After Width: | Height: | Size: 452 KiB |
BIN
assets/test/frames/0102.png
Normal file
After Width: | Height: | Size: 453 KiB |
BIN
assets/test/frames/0103.png
Normal file
After Width: | Height: | Size: 454 KiB |
BIN
assets/test/frames/0104.png
Normal file
After Width: | Height: | Size: 458 KiB |
BIN
assets/test/frames/0105.png
Normal file
After Width: | Height: | Size: 460 KiB |
BIN
assets/test/frames/0106.png
Normal file
After Width: | Height: | Size: 462 KiB |
BIN
assets/test/frames/0107.png
Normal file
After Width: | Height: | Size: 463 KiB |
BIN
assets/test/frames/0108.png
Normal file
After Width: | Height: | Size: 465 KiB |
BIN
assets/test/frames/0109.png
Normal file
After Width: | Height: | Size: 468 KiB |
BIN
assets/test/frames/0110.png
Normal file
After Width: | Height: | Size: 469 KiB |
BIN
assets/test/frames/0111.png
Normal file
After Width: | Height: | Size: 469 KiB |
BIN
assets/test/frames/0112.png
Normal file
After Width: | Height: | Size: 470 KiB |
BIN
assets/test/frames/0113.png
Normal file
After Width: | Height: | Size: 471 KiB |
BIN
assets/test/frames/0114.png
Normal file
After Width: | Height: | Size: 472 KiB |
BIN
assets/test/frames/0115.png
Normal file
After Width: | Height: | Size: 474 KiB |
BIN
assets/test/frames/0116.png
Normal file
After Width: | Height: | Size: 474 KiB |
BIN
assets/test/frames/0117.png
Normal file
After Width: | Height: | Size: 475 KiB |
BIN
assets/test/frames/0118.png
Normal file
After Width: | Height: | Size: 476 KiB |
BIN
assets/test/frames/0119.png
Normal file
After Width: | Height: | Size: 476 KiB |
BIN
assets/test/frames/0120.png
Normal file
After Width: | Height: | Size: 475 KiB |
BIN
assets/test/frames/0121.png
Normal file
After Width: | Height: | Size: 476 KiB |
BIN
assets/test/frames/0122.png
Normal file
After Width: | Height: | Size: 476 KiB |
BIN
assets/test/frames/0123.png
Normal file
After Width: | Height: | Size: 477 KiB |
BIN
assets/test/frames/0124.png
Normal file
After Width: | Height: | Size: 475 KiB |
BIN
assets/test/frames/0125.png
Normal file
After Width: | Height: | Size: 476 KiB |
BIN
assets/test/frames/0126.png
Normal file
After Width: | Height: | Size: 476 KiB |
BIN
assets/test/frames/0127.png
Normal file
After Width: | Height: | Size: 477 KiB |
BIN
assets/test/frames/0128.png
Normal file
After Width: | Height: | Size: 478 KiB |
BIN
assets/test/frames/0129.png
Normal file
After Width: | Height: | Size: 477 KiB |
BIN
assets/test/frames/0130.png
Normal file
After Width: | Height: | Size: 477 KiB |
BIN
assets/test/frames/0131.png
Normal file
After Width: | Height: | Size: 477 KiB |
BIN
assets/test/frames/0132.png
Normal file
After Width: | Height: | Size: 476 KiB |
BIN
assets/test/frames/0133.png
Normal file
After Width: | Height: | Size: 475 KiB |
BIN
assets/test/frames/0134.png
Normal file
After Width: | Height: | Size: 474 KiB |
BIN
assets/test/frames/0135.png
Normal file
After Width: | Height: | Size: 472 KiB |
BIN
assets/test/frames/0136.png
Normal file
After Width: | Height: | Size: 471 KiB |
BIN
assets/test/frames/0137.png
Normal file
After Width: | Height: | Size: 470 KiB |
BIN
assets/test/frames/0138.png
Normal file
After Width: | Height: | Size: 468 KiB |
BIN
assets/test/frames/0139.png
Normal file
After Width: | Height: | Size: 468 KiB |
BIN
assets/test/frames/0140.png
Normal file
After Width: | Height: | Size: 465 KiB |
BIN
assets/test/frames/0141.png
Normal file
After Width: | Height: | Size: 463 KiB |
BIN
assets/test/frames/0142.png
Normal file
After Width: | Height: | Size: 462 KiB |
BIN
assets/test/frames/0143.png
Normal file
After Width: | Height: | Size: 460 KiB |
BIN
assets/test/frames/0144.png
Normal file
After Width: | Height: | Size: 460 KiB |
BIN
assets/test/frames/0145.png
Normal file
After Width: | Height: | Size: 459 KiB |
BIN
assets/test/frames/0146.png
Normal file
After Width: | Height: | Size: 457 KiB |
BIN
assets/test/frames/0147.png
Normal file
After Width: | Height: | Size: 456 KiB |
BIN
assets/test/frames/0148.png
Normal file
After Width: | Height: | Size: 454 KiB |
BIN
assets/test/frames/0149.png
Normal file
After Width: | Height: | Size: 453 KiB |
BIN
assets/test/frames/0150.png
Normal file
After Width: | Height: | Size: 454 KiB |
BIN
assets/test/frames/0151.png
Normal file
After Width: | Height: | Size: 454 KiB |
BIN
assets/test/frames/0152.png
Normal file
After Width: | Height: | Size: 456 KiB |
BIN
assets/test/frames/0153.png
Normal file
After Width: | Height: | Size: 458 KiB |
BIN
assets/test/frames/0154.png
Normal file
After Width: | Height: | Size: 460 KiB |
BIN
assets/test/frames/0155.png
Normal file
After Width: | Height: | Size: 464 KiB |
BIN
assets/test/frames/0156.png
Normal file
After Width: | Height: | Size: 467 KiB |
BIN
assets/test/frames/0157.png
Normal file
After Width: | Height: | Size: 469 KiB |
BIN
assets/test/frames/0158.png
Normal file
After Width: | Height: | Size: 472 KiB |
BIN
assets/test/frames/0159.png
Normal file
After Width: | Height: | Size: 474 KiB |
BIN
assets/test/frames/0160.png
Normal file
After Width: | Height: | Size: 477 KiB |
BIN
assets/test/frames/0161.png
Normal file
After Width: | Height: | Size: 478 KiB |
BIN
assets/test/frames/0162.png
Normal file
After Width: | Height: | Size: 478 KiB |
BIN
assets/test/frames/0163.png
Normal file
After Width: | Height: | Size: 478 KiB |
BIN
assets/test/frames/0164.png
Normal file
After Width: | Height: | Size: 478 KiB |
BIN
assets/test/frames/0165.png
Normal file
After Width: | Height: | Size: 477 KiB |
BIN
assets/test/frames/0166.png
Normal file
After Width: | Height: | Size: 476 KiB |
BIN
assets/test/frames/0167.png
Normal file
After Width: | Height: | Size: 476 KiB |
BIN
assets/test/frames/0168.png
Normal file
After Width: | Height: | Size: 477 KiB |
BIN
assets/test/frames/0169.png
Normal file
After Width: | Height: | Size: 477 KiB |
BIN
assets/test/frames/0170.png
Normal file
After Width: | Height: | Size: 478 KiB |
BIN
assets/test/frames/0171.png
Normal file
After Width: | Height: | Size: 480 KiB |
BIN
assets/test/frames/0172.png
Normal file
After Width: | Height: | Size: 481 KiB |
BIN
assets/test/frames/0173.png
Normal file
After Width: | Height: | Size: 480 KiB |
BIN
assets/test/frames/0174.png
Normal file
After Width: | Height: | Size: 482 KiB |
BIN
assets/test/frames/0175.png
Normal file
After Width: | Height: | Size: 483 KiB |
BIN
assets/test/frames/0176.png
Normal file
After Width: | Height: | Size: 484 KiB |
BIN
assets/test/frames/0177.png
Normal file
After Width: | Height: | Size: 485 KiB |
BIN
assets/test/frames/0178.png
Normal file
After Width: | Height: | Size: 486 KiB |
BIN
assets/test/frames/0179.png
Normal file
After Width: | Height: | Size: 489 KiB |
BIN
assets/test/frames/0180.png
Normal file
After Width: | Height: | Size: 489 KiB |
BIN
assets/test/frames/0181.png
Normal file
After Width: | Height: | Size: 490 KiB |
BIN
assets/test/frames/0182.png
Normal file
After Width: | Height: | Size: 492 KiB |
BIN
assets/test/frames/0183.png
Normal file
After Width: | Height: | Size: 493 KiB |
BIN
assets/test/frames/0184.png
Normal file
After Width: | Height: | Size: 494 KiB |
BIN
assets/test/frames/0185.png
Normal file
After Width: | Height: | Size: 495 KiB |
BIN
assets/test/frames/0186.png
Normal file
After Width: | Height: | Size: 495 KiB |
BIN
assets/test/frames/0187.png
Normal file
After Width: | Height: | Size: 493 KiB |
BIN
assets/test/frames/0188.png
Normal file
After Width: | Height: | Size: 491 KiB |
BIN
assets/test/frames/0189.png
Normal file
After Width: | Height: | Size: 490 KiB |
BIN
assets/test/frames/0190.png
Normal file
After Width: | Height: | Size: 486 KiB |
BIN
assets/test/frames/0191.png
Normal file
After Width: | Height: | Size: 485 KiB |
BIN
assets/test/frames/0192.png
Normal file
After Width: | Height: | Size: 483 KiB |
BIN
assets/test/frames/0193.png
Normal file
After Width: | Height: | Size: 482 KiB |
BIN
assets/test/frames/0194.png
Normal file
After Width: | Height: | Size: 478 KiB |
BIN
assets/test/frames/0195.png
Normal file
After Width: | Height: | Size: 476 KiB |
BIN
assets/test/frames/0196.png
Normal file
After Width: | Height: | Size: 471 KiB |
BIN
assets/test/frames/0197.png
Normal file
After Width: | Height: | Size: 468 KiB |
BIN
assets/test/frames/0198.png
Normal file
After Width: | Height: | Size: 466 KiB |
BIN
assets/test/frames/0199.png
Normal file
After Width: | Height: | Size: 465 KiB |
BIN
assets/test/frames/0200.png
Normal file
After Width: | Height: | Size: 465 KiB |
@ -11,4 +11,4 @@ DIR=$(cd -P "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd)
|
|||||||
BUILD_DIR=$(realpath ${DIR}/../build)
|
BUILD_DIR=$(realpath ${DIR}/../build)
|
||||||
|
|
||||||
printf '\033c'
|
printf '\033c'
|
||||||
${BUILD_DIR}/test_image
|
${BUILD_DIR}/test_frame
|
@ -10,4 +10,4 @@ DIR=$(cd -P "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd)
|
|||||||
|
|
||||||
BUILD_DIR=$(realpath ${DIR}/../build)
|
BUILD_DIR=$(realpath ${DIR}/../build)
|
||||||
|
|
||||||
echo ${BUILD_DIR}/test_image | entr -r ${DIR}/runtests.sh
|
echo ${BUILD_DIR}/test_frame | entr -r ${DIR}/runtests.sh
|
@ -39,6 +39,7 @@ set (LIBDART_OPENMVG_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
|||||||
|
|
||||||
find_package(JPEG REQUIRED)
|
find_package(JPEG REQUIRED)
|
||||||
find_package(TIFF REQUIRED)
|
find_package(TIFF REQUIRED)
|
||||||
|
find_package(OpenCV REQUIRED)
|
||||||
|
|
||||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extlib/cwalk)
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extlib/cwalk)
|
||||||
|
|
||||||
@ -59,13 +60,17 @@ set(SKIP_INSTALL_ALL OFF CACHE BOOL "" FORCE) # we only want lib
|
|||||||
add_definitions(${PNG_DEFINITIONS})
|
add_definitions(${PNG_DEFINITIONS})
|
||||||
|
|
||||||
add_library(${LIBDART_OPENMVG} SHARED
|
add_library(${LIBDART_OPENMVG} SHARED
|
||||||
|
"mvg_override/describer/akaze.hpp"
|
||||||
"frame.cxx"
|
"frame.cxx"
|
||||||
"streamingview.cxx"
|
"streamingview.cxx"
|
||||||
"image.cxx"
|
"image.cxx"
|
||||||
|
"util.cpp"
|
||||||
)
|
)
|
||||||
|
|
||||||
set(CEREAL_INCLUDE_DIR ${OpenMVG_DIR}/../../../include/openMVG_dependencies/cereal/include/cereal/)
|
set(CEREAL_INCLUDE_DIR ${OpenMVG_DIR}/../../../include/openMVG_dependencies/cereal/include/cereal/)
|
||||||
|
|
||||||
|
dump_cmake_variables("^opencv")
|
||||||
|
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
${LIBDART_OPENMVG}
|
${LIBDART_OPENMVG}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
@ -73,6 +78,7 @@ target_include_directories(
|
|||||||
${PNG_INCLUDE_DIRS}
|
${PNG_INCLUDE_DIRS}
|
||||||
${ARCHIMEDES_INCLUDE_DIRS}
|
${ARCHIMEDES_INCLUDE_DIRS}
|
||||||
${CEREAL_INCLUDE_DIR}
|
${CEREAL_INCLUDE_DIR}
|
||||||
|
${OpenCV_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
@ -81,6 +87,7 @@ target_link_libraries(
|
|||||||
jpeg
|
jpeg
|
||||||
tiff
|
tiff
|
||||||
png
|
png
|
||||||
|
${OpenCV_LIBS}
|
||||||
OpenMVG::openMVG_image
|
OpenMVG::openMVG_image
|
||||||
OpenMVG::openMVG_numeric
|
OpenMVG::openMVG_numeric
|
||||||
OpenMVG::openMVG_features
|
OpenMVG::openMVG_features
|
||||||
@ -102,6 +109,11 @@ add_executable(
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/tests/test_image.cxx
|
${CMAKE_CURRENT_SOURCE_DIR}/tests/test_image.cxx
|
||||||
)
|
)
|
||||||
|
|
||||||
|
add_executable(
|
||||||
|
test_frame
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/tests/test_frame.cxx
|
||||||
|
)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
test_image
|
test_image
|
||||||
cunit
|
cunit
|
||||||
@ -116,6 +128,20 @@ target_link_libraries(
|
|||||||
OpenMVG::openMVG_exif
|
OpenMVG::openMVG_exif
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_link_libraries(
|
||||||
|
test_frame
|
||||||
|
cunit
|
||||||
|
cwalk
|
||||||
|
${LIBDART_OPENMVG}
|
||||||
|
png
|
||||||
|
OpenMVG::openMVG_image
|
||||||
|
OpenMVG::openMVG_numeric
|
||||||
|
OpenMVG::openMVG_features
|
||||||
|
OpenMVG::openMVG_sfm
|
||||||
|
OpenMVG::openMVG_features
|
||||||
|
OpenMVG::openMVG_exif
|
||||||
|
)
|
||||||
|
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
test_image
|
test_image
|
||||||
PRIVATE
|
PRIVATE
|
||||||
@ -124,9 +150,18 @@ target_include_directories(
|
|||||||
${CEREAL_INCLUDE_DIR}
|
${CEREAL_INCLUDE_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(test_image
|
target_include_directories(
|
||||||
PROPERTIES
|
test_frame
|
||||||
LINKER_LANGUAGE CXX
|
PRIVATE
|
||||||
|
${LIBDART_OPENMVG_INCLUDE_DIRS}
|
||||||
|
${OpenMVG_INCLUDE_DIRS}/src
|
||||||
|
${CEREAL_INCLUDE_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
set_target_properties(
|
||||||
|
test_image
|
||||||
|
PROPERTIES
|
||||||
|
LINKER_LANGUAGE CXX
|
||||||
)
|
)
|
||||||
|
|
||||||
add_test (
|
add_test (
|
||||||
@ -134,4 +169,9 @@ add_test (
|
|||||||
COMMAND test_image
|
COMMAND test_image
|
||||||
)
|
)
|
||||||
|
|
||||||
|
add_test (
|
||||||
|
NAME test_frame
|
||||||
|
COMMAND test_frame
|
||||||
|
)
|
||||||
|
|
||||||
target_compile_definitions(${LIBDART_OPENMVG} PUBLIC DART_SHARED_LIB)
|
target_compile_definitions(${LIBDART_OPENMVG} PUBLIC DART_SHARED_LIB)
|
124
src/frame.cxx
@ -1,5 +1,7 @@
|
|||||||
#include "frame.h"
|
#include "frame.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
FILE *make_buffer(const uint8_t *data, const size_t data_len)
|
FILE *make_buffer(const uint8_t *data, const size_t data_len)
|
||||||
{
|
{
|
||||||
@ -70,8 +72,20 @@ Frame *new_frame_from_handle(FILE *stream, int w, int h, int depth)
|
|||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clean_frame(Frame *f)
|
||||||
|
{
|
||||||
|
fclose(f->stream);
|
||||||
|
free(f);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
|
DartOpenMvg::Frame::Frame(const DartOpenMvg::Frame &frame)
|
||||||
|
{
|
||||||
|
cFrame = frame.cFrame;
|
||||||
|
// mRegions = std::unique_ptr<openMVG::features::Regions>(frame.mRegions.get());
|
||||||
|
}
|
||||||
|
|
||||||
openMVG::image::Image<u_char> DartOpenMvg::imageFromFrame(const CFrame *frame)
|
openMVG::image::Image<u_char> DartOpenMvg::imageFromFrame(const CFrame *frame)
|
||||||
{
|
{
|
||||||
rewind(frame->stream);
|
rewind(frame->stream);
|
||||||
@ -90,39 +104,103 @@ openMVG::image::Image<u_char> DartOpenMvg::imageFromFrame(const CFrame *frame)
|
|||||||
return openMVG::image::Image<uint8_t>(eigenMatrix);
|
return openMVG::image::Image<uint8_t>(eigenMatrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DartOpenMvg::Frame::calculateFeatures()
|
DartOpenMvg::Frames::Frames(openMVG::sfm::Bundle_Adjustment_Ceres::BA_Ceres_options &options)
|
||||||
{
|
{
|
||||||
using namespace openMVG::image;
|
mAdjustment = openMVG::sfm::Bundle_Adjustment_Ceres(options);
|
||||||
using namespace openMVG::features;
|
|
||||||
auto desc = SIFT_Anatomy_Image_describer(SIFT_Anatomy_Image_describer::Params());
|
|
||||||
auto image = imageFromFrame(cFrame);
|
|
||||||
mRegions = desc.Describe(image);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
openMVG::image::Image<u_char> DartOpenMvg::Frame::getMvgImage() {
|
void DartOpenMvg::Frames::add_frame(FILE *handle, int w, int h, int depth)
|
||||||
return imageFromFrame(this->cFrame);
|
{
|
||||||
|
CFrame *f = new_frame_from_handle(handle, w, h, depth);
|
||||||
|
mFrames.push_back(
|
||||||
|
Frame(f));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DartOpenMvg::Frames::computeMatches()
|
void DartOpenMvg::Frames::computeMatches()
|
||||||
{
|
{
|
||||||
using namespace openMVG::matching;
|
|
||||||
using namespace openMVG::matching_image_collection;
|
// Match the pairs as a sequence
|
||||||
using namespace openMVG::sfm;
|
// Within openMvg::matching_image_collection::Matcher
|
||||||
|
// they matcha gainst *ALL* images. However, since we know the order of the
|
||||||
|
// image sequences (video frames), we'll stick to the sequence order.
|
||||||
|
for (size_t i = 0; i < mFrames.size() - 1; ++i)
|
||||||
|
{
|
||||||
|
Frame &frame1 = mFrames[i];
|
||||||
|
Frame &frame2 = mFrames[i + 1];
|
||||||
|
frame1.calculateFeatures();
|
||||||
|
frame2.calculateFeatures();
|
||||||
|
auto regions1 = frame1.mRegions.get();
|
||||||
|
auto regions2 = frame2.mRegions.get();
|
||||||
|
if (!regions1)
|
||||||
|
{
|
||||||
|
std::string msg = std::string("No frame. Did you remember to calculate regions for frame ") + std::to_string(i) + "?";
|
||||||
|
throw std::out_of_range(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
// regions1->Load();
|
||||||
|
std::cerr << "Loading " << std::to_string(regions1->RegionCount()) << " regions" << std::endl;
|
||||||
|
|
||||||
|
auto is_binary = regions1->IsBinary();
|
||||||
|
|
||||||
|
// Initialize the matching interface
|
||||||
|
const std::unique_ptr<openMVG::matching::RegionsMatcher> matcher =
|
||||||
|
openMVG::matching::RegionMatcherFactory(openMVG::matching::EMatcherType::HNSW_L2, *regions1);
|
||||||
|
if (!matcher)
|
||||||
|
continue;
|
||||||
|
openMVG::matching::IndMatches vec_putative_matches;
|
||||||
|
matcher->MatchDistanceRatio(0.5, *regions2, vec_putative_matches);
|
||||||
|
if (vec_putative_matches.empty())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mFeatureMap[std::make_pair(i, i + 1)] = vec_putative_matches;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void DartOpenMvg::Frames::buildTracks()
|
||||||
|
{
|
||||||
|
openMVG::tracks::TracksBuilder trackBuilder;
|
||||||
|
|
||||||
|
openMVG::matching::PairWiseMatches matches;
|
||||||
|
|
||||||
|
trackBuilder.Build(mFeatureMap);
|
||||||
|
trackBuilder.Filter();
|
||||||
|
trackBuilder.ExportToSTL(mTracks);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DartOpenMvg::Frames::adjust()
|
||||||
|
{
|
||||||
|
const openMVG::sfm::Optimize_Options ba_refine_options(openMVG::cameras::Intrinsic_Parameter_Type::ADJUST_ALL,
|
||||||
|
openMVG::sfm::Extrinsic_Parameter_Type::ADJUST_ALL, // Adjust camera motion
|
||||||
|
openMVG::sfm::Structure_Parameter_Type::ADJUST_ALL, // Adjust scene structure
|
||||||
|
openMVG::sfm::Control_Point_Parameter(),
|
||||||
|
false);
|
||||||
|
mAdjustment.Adjust(mSfmData, ba_refine_options);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DartOpenMvg::Frame::calculateFeatures()
|
||||||
|
{
|
||||||
using namespace openMVG::image;
|
using namespace openMVG::image;
|
||||||
Matcher *matcher = nullptr;
|
using namespace openMVG::features;
|
||||||
|
MvgOverride::AKAZE_OCV_Image_describer desc;
|
||||||
|
auto im = imageFromFrame(cFrame);
|
||||||
|
mRegions = desc.Describe(im);
|
||||||
|
|
||||||
Regions_Provider provider = Regions_Provider();
|
if (!mRegions.get()) {
|
||||||
|
throw std::range_error("Could not set regions member.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
matcher = new Matcher_Regions(0.8f, CASCADE_HASHING_L2);
|
void DartOpenMvg::Frames::resection()
|
||||||
|
{
|
||||||
|
// openMVG::tracks::TracksUtilsMap::GetFeatIndexPerViewAndTrackId(
|
||||||
|
// mTracks;
|
||||||
|
// )
|
||||||
|
}
|
||||||
|
|
||||||
openMVG::Pair_Set pairs = openMVG::Pair_Set();
|
openMVG::image::Image<u_char> DartOpenMvg::Frame::getMvgImage()
|
||||||
Image im1 = this->at(0).getMvgImage();
|
{
|
||||||
Image im2 = this->at(1).getMvgImage();
|
return imageFromFrame(this->cFrame);
|
||||||
auto pair = openMVG::Pair(0, 1);
|
}
|
||||||
pairs.insert(pair);
|
|
||||||
|
|
||||||
PairWiseMatches map_punitive_matches;
|
|
||||||
|
|
||||||
// matcher->Match(provider, pairs, map_punitive_matches, NULL);
|
|
||||||
|
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
59
src/frame.h
@ -8,6 +8,8 @@
|
|||||||
#include <openMVG/matching_image_collection/Matcher_Regions.hpp>
|
#include <openMVG/matching_image_collection/Matcher_Regions.hpp>
|
||||||
#include <openMVG/matching_image_collection/Pair_Builder.hpp>
|
#include <openMVG/matching_image_collection/Pair_Builder.hpp>
|
||||||
#include <openMVG/sfm/pipelines/sfm_regions_provider.hpp>
|
#include <openMVG/sfm/pipelines/sfm_regions_provider.hpp>
|
||||||
|
#include <openMVG/sfm/pipelines/sfm_engine.hpp>
|
||||||
|
#include <openMVG/sfm/sfm_data_BA_ceres.hpp>
|
||||||
#include <openMVG/features/feature.hpp>
|
#include <openMVG/features/feature.hpp>
|
||||||
#include <openMVG/features/sift/octaver.hpp>
|
#include <openMVG/features/sift/octaver.hpp>
|
||||||
#include <openMVG/features/sift/SIFT_Anatomy_Image_Describer.hpp>
|
#include <openMVG/features/sift/SIFT_Anatomy_Image_Describer.hpp>
|
||||||
@ -17,10 +19,25 @@
|
|||||||
#include <openMVG/image/image_container.hpp>
|
#include <openMVG/image/image_container.hpp>
|
||||||
#include <openMVG/image/image_io.hpp>
|
#include <openMVG/image/image_io.hpp>
|
||||||
#include <openMVG/numeric/numeric.h>
|
#include <openMVG/numeric/numeric.h>
|
||||||
|
#include <openMVG/tracks/tracks.hpp>
|
||||||
|
#include <opencv2/opencv.hpp>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#include <openMVG/matching/indMatch.hpp>
|
||||||
|
#include <openMVG/matching_image_collection/Matcher_Regions.hpp>
|
||||||
|
#include <openMVG/matching_image_collection/Matcher.hpp>
|
||||||
|
#include <openMVG/matching/regions_matcher.hpp>
|
||||||
|
#include <openMVG/sfm/pipelines/sfm_regions_provider.hpp>
|
||||||
|
#include <openMVG/system/progressinterface.hpp>
|
||||||
|
#include <openMVG/system/logger.hpp>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include "./base.hpp"
|
#include "./base.hpp"
|
||||||
|
#include "./mvg_override/describer/akaze.hpp"
|
||||||
|
|
||||||
#ifndef __FRAME_H
|
#ifndef __FRAME_H
|
||||||
#define __FRAME_H
|
#define __FRAME_H
|
||||||
@ -44,46 +61,56 @@ namespace DartOpenMvg
|
|||||||
{
|
{
|
||||||
openMVG::image::Image<uint8_t> imageFromFrame(const Frame *);
|
openMVG::image::Image<uint8_t> imageFromFrame(const Frame *);
|
||||||
|
|
||||||
class InMemoryMatcherRegions : public openMVG::matching_image_collection::Matcher {
|
|
||||||
void Match(
|
|
||||||
const Pair_Set &,
|
|
||||||
PariWiseMatchesContainer &,
|
|
||||||
) const override;
|
|
||||||
};
|
|
||||||
|
|
||||||
class Frame
|
class Frame
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
const CFrame *cFrame;
|
|
||||||
std::stringstream mStream;
|
std::stringstream mStream;
|
||||||
int mW;
|
int mW;
|
||||||
int mH;
|
int mH;
|
||||||
int mDepth;
|
int mDepth;
|
||||||
std::unique_ptr<openMVG::features::Regions> mRegions;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Frame(const _Frame *f) : mW(f->w), mH(f->h), mDepth(f->depth)
|
// TODO make this private
|
||||||
|
const CFrame *cFrame;
|
||||||
|
// TODO make this private
|
||||||
|
std::unique_ptr<openMVG::features::Regions> mRegions;
|
||||||
|
Frame(const CFrame *f) : mW(f->w), mH(f->h), mDepth(f->depth)
|
||||||
{
|
{
|
||||||
cFrame = f;
|
cFrame = f;
|
||||||
uint8_t *buffer_data = NULL;
|
uint8_t *buffer_data = NULL;
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
|
rewind(f->stream);
|
||||||
read_buffer(f->stream, &buffer_data, &len);
|
read_buffer(f->stream, &buffer_data, &len);
|
||||||
mStream = std::stringstream(std::string((char *)buffer_data));
|
mStream = std::stringstream(std::string((char *)buffer_data));
|
||||||
}
|
}
|
||||||
openMVG::image::Image<u_char> DartOpenMvg::Frame::getMvgImage();
|
Frame(const Frame &);
|
||||||
|
openMVG::image::Image<u_char> getMvgImage();
|
||||||
void calculateFeatures();
|
void calculateFeatures();
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::pair<Frame, Frame> FrameMatchKey;
|
typedef std::pair<const Frame &, const Frame &> FrameMatchKey;
|
||||||
typedef std::map<FrameMatchKey, openMVG::matching::IndMatches> FrameFeatureMatch;
|
typedef std::map<std::pair<size_t, size_t>, openMVG::matching::IndMatches> FrameFeatureMatch;
|
||||||
|
|
||||||
class Frames : std::vector<Frame>
|
class Frames
|
||||||
{
|
{
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
FrameFeatureMatch mFeatureMap;
|
|
||||||
public:
|
public:
|
||||||
|
// TODO: make private with accessors
|
||||||
|
openMVG::matching::PairWiseMatches mFeatureMap;
|
||||||
|
openMVG::tracks::STLMAPTracks mTracks;
|
||||||
|
openMVG::sfm::SfM_Data mSfmData;
|
||||||
|
openMVG::sfm::Bundle_Adjustment_Ceres mAdjustment;
|
||||||
|
std::vector<Frame> mFrames;
|
||||||
|
|
||||||
|
Frames(openMVG::sfm::Bundle_Adjustment_Ceres::BA_Ceres_options &);
|
||||||
|
void add_frame(FILE *, int, int, int);
|
||||||
void computeMatches();
|
void computeMatches();
|
||||||
|
void buildTracks();
|
||||||
|
void adjust();
|
||||||
|
void resection();
|
||||||
|
void resectionAll();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -94,4 +121,6 @@ Frame *new_frame_from_handle(FILE *, int, int, int);
|
|||||||
_FFI_PLUGIN
|
_FFI_PLUGIN
|
||||||
Frame *new_frame_from_data(const uint8_t *, const size_t, int, int, int);
|
Frame *new_frame_from_data(const uint8_t *, const size_t, int, int, int);
|
||||||
|
|
||||||
|
void frame_cleanup(Frame *);
|
||||||
|
|
||||||
#endif // __FRAME_H
|
#endif // __FRAME_H
|
152
src/mvg_override/describer/akaze.hpp
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
// This file is part of OpenMVG, an Open Multiple View Geometry C++ library.
|
||||||
|
|
||||||
|
// Copyright (c) 2012, 2013 Pierre MOULON.
|
||||||
|
|
||||||
|
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
// The <cereal/archives> headers are special and must be included first.
|
||||||
|
#include <cereal/archives/json.hpp>
|
||||||
|
|
||||||
|
#include "openMVG/image/image_io.hpp"
|
||||||
|
#include "openMVG/features/regions_factory_io.hpp"
|
||||||
|
#include "openMVG/sfm/sfm.hpp"
|
||||||
|
#include "openMVG/system/timer.hpp"
|
||||||
|
|
||||||
|
/// OpenCV Includes
|
||||||
|
#include <opencv2/opencv.hpp>
|
||||||
|
#include <opencv2/core/eigen.hpp>
|
||||||
|
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
|
#ifndef __MVG_OVERRIDE_DESCRIBER_AKAZE_H
|
||||||
|
#define __MVG_OVERRIDE_DESCRIBER_AKAZE_H
|
||||||
|
|
||||||
|
|
||||||
|
namespace MvgOverride
|
||||||
|
{
|
||||||
|
|
||||||
|
using namespace openMVG;
|
||||||
|
using namespace openMVG::image;
|
||||||
|
using namespace openMVG::features;
|
||||||
|
using namespace openMVG::sfm;
|
||||||
|
|
||||||
|
enum eGeometricModel
|
||||||
|
{
|
||||||
|
FUNDAMENTAL_MATRIX = 0,
|
||||||
|
ESSENTIAL_MATRIX = 1,
|
||||||
|
HOMOGRAPHY_MATRIX = 2
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ePairMode
|
||||||
|
{
|
||||||
|
PAIR_EXHAUSTIVE = 0,
|
||||||
|
PAIR_CONTIGUOUS = 1,
|
||||||
|
PAIR_FROM_FILE = 2
|
||||||
|
};
|
||||||
|
|
||||||
|
///
|
||||||
|
//- Create an Image_describer interface that use an OpenCV feature extraction method
|
||||||
|
// i.e. with the AKAZE detector+descriptor
|
||||||
|
//--/!\ If you use a new Regions type you define and register it in
|
||||||
|
// "openMVG/features/regions_factory.hpp" file.
|
||||||
|
///
|
||||||
|
// Reuse the existing AKAZE floating point Keypoint.
|
||||||
|
typedef features::AKAZE_Float_Regions AKAZE_OpenCV_Regions;
|
||||||
|
// Define the Interface
|
||||||
|
class AKAZE_OCV_Image_describer : public Image_describer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
using Regions_type = AKAZE_OpenCV_Regions;
|
||||||
|
|
||||||
|
cv::Ptr<cv::Feature2D> extractor;
|
||||||
|
|
||||||
|
AKAZE_OCV_Image_describer() : Image_describer()
|
||||||
|
{
|
||||||
|
extractor = cv::AKAZE::create(cv::AKAZE::DESCRIPTOR_KAZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Set_configuration_preset(EDESCRIBER_PRESET preset) override
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
@brief Detect regions on the image and compute their attributes (description)
|
||||||
|
@param image Image.
|
||||||
|
@param mask 8-bit gray image for keypoint filtering (optional).
|
||||||
|
Non-zero values depict the region of interest.
|
||||||
|
@return regions The detected regions and attributes (the caller must delete the allocated data)
|
||||||
|
*/
|
||||||
|
std::unique_ptr<Regions> Describe(
|
||||||
|
const Image<unsigned char> &image,
|
||||||
|
const Image<unsigned char> *mask = nullptr) override
|
||||||
|
{
|
||||||
|
return Describe_AKAZE_OCV(image, mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief Detect regions on the image and compute their attributes (description)
|
||||||
|
@param image Image.
|
||||||
|
@param mask 8-bit gray image for keypoint filtering (optional).
|
||||||
|
Non-zero values depict the region of interest.
|
||||||
|
@return regions The detected regions and attributes (the caller must delete the allocated data)
|
||||||
|
*/
|
||||||
|
std::unique_ptr<Regions_type> Describe_AKAZE_OCV(
|
||||||
|
const Image<unsigned char> &image,
|
||||||
|
const Image<unsigned char> *mask = nullptr)
|
||||||
|
{
|
||||||
|
auto regions = std::unique_ptr<Regions_type>(new Regions_type);
|
||||||
|
|
||||||
|
cv::Mat img;
|
||||||
|
cv::eigen2cv(image.GetMat(), img);
|
||||||
|
|
||||||
|
cv::Mat m_mask;
|
||||||
|
if (mask != nullptr)
|
||||||
|
{
|
||||||
|
cv::eigen2cv(mask->GetMat(), m_mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<cv::KeyPoint> vec_keypoints;
|
||||||
|
cv::Mat m_desc;
|
||||||
|
|
||||||
|
extractor->detectAndCompute(img, m_mask, vec_keypoints, m_desc);
|
||||||
|
|
||||||
|
if (!vec_keypoints.empty())
|
||||||
|
{
|
||||||
|
// reserve some memory for faster keypoint saving
|
||||||
|
regions->Features().reserve(vec_keypoints.size());
|
||||||
|
regions->Descriptors().reserve(vec_keypoints.size());
|
||||||
|
|
||||||
|
using DescriptorT = Descriptor<float, 64>;
|
||||||
|
DescriptorT descriptor;
|
||||||
|
int cpt = 0;
|
||||||
|
for (auto i_keypoint = vec_keypoints.begin(); i_keypoint != vec_keypoints.end(); ++i_keypoint, ++cpt)
|
||||||
|
{
|
||||||
|
const SIOPointFeature feat((*i_keypoint).pt.x, (*i_keypoint).pt.y, (*i_keypoint).size, (*i_keypoint).angle);
|
||||||
|
regions->Features().push_back(feat);
|
||||||
|
|
||||||
|
memcpy(descriptor.data(),
|
||||||
|
m_desc.ptr<typename DescriptorT::bin_type>(cpt),
|
||||||
|
DescriptorT::static_size * sizeof(DescriptorT::bin_type));
|
||||||
|
regions->Descriptors().push_back(descriptor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return regions;
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Allocate Regions type depending of the Image_describer
|
||||||
|
std::unique_ptr<Regions> Allocate() const override
|
||||||
|
{
|
||||||
|
return std::unique_ptr<Regions_type>(new Regions_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Archive>
|
||||||
|
void serialize(Archive &ar)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // __MVG_OVERRIDE_DESCRIBER_AKAZE_H
|
130
src/tests/test_frame.cxx
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
#include <sys/stat.h>
|
||||||
|
#include <archives/binary.hpp>
|
||||||
|
#include <CUnit/Basic.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <ios>
|
||||||
|
#include "../image.h"
|
||||||
|
#include "../streamingview.hpp"
|
||||||
|
#include "../util.h"
|
||||||
|
#include <cwalk.h>
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#include <iostream>
|
||||||
|
#endif // __cplusplus
|
||||||
|
|
||||||
|
#define STRLEN 2048
|
||||||
|
#define FRAME_COUNT 200
|
||||||
|
|
||||||
|
typedef Frame CFrame;
|
||||||
|
|
||||||
|
char *framePaths[FRAME_COUNT];
|
||||||
|
|
||||||
|
#define HERE __FILE__
|
||||||
|
|
||||||
|
int setUp(void)
|
||||||
|
{
|
||||||
|
char framesDir[STRLEN];
|
||||||
|
size_t length;
|
||||||
|
char framePathTpl[STRLEN];
|
||||||
|
cwk_path_get_dirname(HERE, &length); // archimedes_mobile_lib/src/tests
|
||||||
|
cwk_path_join(HERE, "../../../assets/test/frames", framesDir, STRLEN);
|
||||||
|
cwk_path_join(framesDir, "%04d.png", framePathTpl, STRLEN);
|
||||||
|
// Set the length to be the length of the "template" plus enough room
|
||||||
|
// for the sequence number.
|
||||||
|
size_t pathLen = strlen(framePathTpl) + 5;
|
||||||
|
for (size_t i = 0; i < FRAME_COUNT; ++i)
|
||||||
|
{
|
||||||
|
framePaths[i] = (char *)calloc(pathLen, sizeof(char *));
|
||||||
|
snprintf(framePaths[i], pathLen, framePathTpl, i+1, 4);
|
||||||
|
printf("Load frame %s\n", framePaths[i]);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
CFrame *get_nth_frame(size_t frame_num)
|
||||||
|
{
|
||||||
|
struct stat statbuf;
|
||||||
|
if (stat(framePaths[frame_num], &statbuf) < 0)
|
||||||
|
{
|
||||||
|
// std::cerr << "ERROR reading \"" << framePaths << "\"" << std::endl;
|
||||||
|
std::cerr << std::string("Reading \"") << std::string(framePaths[frame_num]) << std::string("\"") << std::endl;
|
||||||
|
throw new std::ios_base::failure(std::string(strerror(errno)));
|
||||||
|
}
|
||||||
|
FILE *handle = fopen(framePaths[frame_num], "r");
|
||||||
|
|
||||||
|
CFrame *f = new_frame_from_handle(
|
||||||
|
handle,
|
||||||
|
768,
|
||||||
|
768,
|
||||||
|
64);
|
||||||
|
return f;
|
||||||
|
}
|
||||||
|
|
||||||
|
int tearDown(void)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < FRAME_COUNT; ++i)
|
||||||
|
{
|
||||||
|
free(framePaths[i]);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_calculate_fetures(void)
|
||||||
|
{
|
||||||
|
Frame *f = get_nth_frame(0);
|
||||||
|
DartOpenMvg::Frame frame(f);
|
||||||
|
|
||||||
|
frame.calculateFeatures();
|
||||||
|
CU_ASSERT_TRUE(frame.mRegions.get()->RegionCount() > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_compute_matches(void)
|
||||||
|
{
|
||||||
|
Frame *f1 = get_nth_frame(0);
|
||||||
|
Frame *f2 = get_nth_frame(1);
|
||||||
|
DartOpenMvg::Frame frame1(f1), frame2(f2);
|
||||||
|
openMVG::sfm::Bundle_Adjustment_Ceres::BA_Ceres_options opts;
|
||||||
|
DartOpenMvg::Frames frames(opts);
|
||||||
|
|
||||||
|
frame1.calculateFeatures();
|
||||||
|
frame2.calculateFeatures();
|
||||||
|
|
||||||
|
frames.mFrames.push_back(frame1);
|
||||||
|
frames.mFrames.push_back(frame2);
|
||||||
|
|
||||||
|
CU_ASSERT_EQUAL(frames.mFeatureMap.size(), 0)
|
||||||
|
|
||||||
|
frames.computeMatches();
|
||||||
|
|
||||||
|
CU_ASSERT_TRUE(frames.mFeatureMap.size() > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
CU_pSuite pSuite = NULL;
|
||||||
|
|
||||||
|
/* initialize the CUnit test registry */
|
||||||
|
if (CUE_SUCCESS != CU_initialize_registry())
|
||||||
|
return CU_get_error();
|
||||||
|
|
||||||
|
/* add a suite to the registry */
|
||||||
|
pSuite = CU_add_suite("FrameSuite", setUp, tearDown);
|
||||||
|
if (NULL == pSuite)
|
||||||
|
{
|
||||||
|
CU_cleanup_registry();
|
||||||
|
return CU_get_error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* add the tests to the suite */
|
||||||
|
if ((NULL == CU_add_test(pSuite, "frame features can be calculated", test_calculate_fetures)) ||
|
||||||
|
(NULL == CU_add_test(pSuite, "matches can be computed", test_compute_matches)))
|
||||||
|
{
|
||||||
|
CU_cleanup_registry();
|
||||||
|
return CU_get_error();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Run all tests using the CUnit Basic interface */
|
||||||
|
CU_basic_set_mode(CU_BRM_VERBOSE);
|
||||||
|
CU_basic_run_tests();
|
||||||
|
CU_cleanup_registry();
|
||||||
|
return CU_get_error();
|
||||||
|
}
|
@ -2,6 +2,7 @@
|
|||||||
#include <CUnit/Basic.h>
|
#include <CUnit/Basic.h>
|
||||||
#include "../image.h"
|
#include "../image.h"
|
||||||
#include "../streamingview.hpp"
|
#include "../streamingview.hpp"
|
||||||
|
#include "../util.h"
|
||||||
#include <cwalk.h>
|
#include <cwalk.h>
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -12,41 +13,6 @@
|
|||||||
FILE *imageHandle = NULL;
|
FILE *imageHandle = NULL;
|
||||||
char frame1Path[STRLEN];
|
char frame1Path[STRLEN];
|
||||||
|
|
||||||
/*
|
|
||||||
* Read the contents of a file into an array
|
|
||||||
* path: path to the file
|
|
||||||
* contents: array we'll write to that contains the contents of the file.
|
|
||||||
*/
|
|
||||||
size_t read_file(const char *path, uint8_t **contents)
|
|
||||||
{
|
|
||||||
FILE *file = fopen(path, "rb");
|
|
||||||
if (file == NULL)
|
|
||||||
{
|
|
||||||
printf("Error: Unable to open file.\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Determine the file size
|
|
||||||
fseek(file, 0, SEEK_END);
|
|
||||||
size_t file_size = ftell(file);
|
|
||||||
rewind(file);
|
|
||||||
|
|
||||||
// Allocate memory for the contents array
|
|
||||||
*contents = (uint8_t *)malloc(file_size);
|
|
||||||
if (*contents == NULL)
|
|
||||||
{
|
|
||||||
printf("Error: Unable to allocate memory.\n");
|
|
||||||
fclose(file);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Read the file contents into the array
|
|
||||||
fread(*contents, 1, file_size, file);
|
|
||||||
fclose(file);
|
|
||||||
|
|
||||||
return file_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define HERE __FILE__
|
#define HERE __FILE__
|
||||||
|
|
||||||
int setUp(void)
|
int setUp(void)
|
||||||
|
31
src/util.cpp
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#include "./util.h"
|
||||||
|
|
||||||
|
size_t read_file(const char *path, uint8_t **contents)
|
||||||
|
{
|
||||||
|
FILE *file = fopen(path, "rb");
|
||||||
|
if (file == NULL)
|
||||||
|
{
|
||||||
|
printf("Error: Unable to open file.\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Determine the file size
|
||||||
|
fseek(file, 0, SEEK_END);
|
||||||
|
size_t file_size = ftell(file);
|
||||||
|
rewind(file);
|
||||||
|
|
||||||
|
// Allocate memory for the contents array
|
||||||
|
*contents = (uint8_t *)malloc(file_size);
|
||||||
|
if (*contents == NULL)
|
||||||
|
{
|
||||||
|
printf("Error: Unable to allocate memory.\n");
|
||||||
|
fclose(file);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read the file contents into the array
|
||||||
|
fread(*contents, 1, file_size, file);
|
||||||
|
fclose(file);
|
||||||
|
|
||||||
|
return file_size;
|
||||||
|
}
|
10
src/util.h
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read the contents of a file into an array
|
||||||
|
* path: path to the file
|
||||||
|
* contents: array we'll write to that contains the contents of the file.
|
||||||
|
*/
|
||||||
|
size_t read_file(const char *path, uint8_t **contents);
|
14
src/workflow.h
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#ifndef __WORKFLOW_H
|
||||||
|
#define __WORKFLOW_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
namespace DartOpenmvg {
|
||||||
|
class MvgWorkflow {
|
||||||
|
MvgWorkflow();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
#endif // __cplusplus
|
||||||
|
|
||||||
|
#endif // __WORKFLOW_H
|