2

我已经安装了 OpenCV-3.0.0 并配置了 BUILD_EXTRA_MODULES 以启用对 SIFT 和 SURF 算法的访问。我想在两个简单地相互旋转一点点的 jpeg 图像上运行拼接示例。这些图像是我自己的,而不是任何标准图像(我在哪里可以找到这些标准拼接示例图像,如果有的话?)然后我继续执行

./cpp-example-stitching_detailed source_image1.jpg source_image2.jpg

我收到以下错误:

OpenCV Error: Assertion failed (timelapse) in main, file   /path/to/opencv-3.0.0/samples/cpp/stitching_detailed.cpp, line  818
terminate called after throwing an instance of 'cv::Exception'
what():  /path/to/opencv-3.0.0/samples/cpp/stitching_detailed.cpp:818:   
error: (-215) timelapse in function main

Aborted (core dumped)

当我尝试更简单并执行简单的 ./cpp-example-stitching 可执行文件时,如下所示:

./cpp-example-stitching source_image1.jpg source_image2.jpg

那么输出错误是

pure virtual method called
terminate called without an active exception
Aborted (core dumped)

如果它有任何用途,以下是运行 opencv_test_stitching 和 opencv_perf_stitching 的结果

./opencv_test_stitching 
OpenCV version: 3.0.0
OpenCV VCS version: unknown
Build type: release
Parallel framework: pthreads
CPU features: mmx sse sse2 sse3
OpenCL is disabled
[==========] Running 5 tests from 5 test cases.
[----------] Global test environment set-up.
[----------] 1 test from OCL_SphericalWarperTest 
[ RUN      ] OCL_SphericalWarperTest.Mat
[       OK ] OCL_SphericalWarperTest.Mat (1 ms)
[----------] 1 test from OCL_SphericalWarperTest (1 ms total)

[----------] 1 test from OCL_CylindricalWarperTest
[ RUN      ] OCL_CylindricalWarperTest.Mat
[       OK ] OCL_CylindricalWarperTest.Mat (0 ms)
[----------] 1 test from OCL_CylindricalWarperTest (0 ms total)

[----------] 1 test from OCL_PlaneWarperTest
[ RUN      ] OCL_PlaneWarperTest.Mat
[       OK ] OCL_PlaneWarperTest.Mat (1 ms)
[----------] 1 test from OCL_PlaneWarperTest (1 ms total)

[----------] 1 test from MultiBandBlender
[ RUN      ] MultiBandBlender.CanBlendTwoImages
unknown file: Failure
C++ exception with description "vector::_M_fill_insert" thrown in the  test body.
[  FAILED  ] MultiBandBlender.CanBlendTwoImages (0 ms)
[----------] 1 test from MultiBandBlender (0 ms total)

[----------] 1 test from SurfFeaturesFinder
[ RUN      ] SurfFeaturesFinder.CanFindInROIs
unknown file: Failure
C++ exception with description "/home/taeten/Downloads/opencv_contrib- 
master/modules/xfeatures2d/src/surf.cpp:892: error: (-215) !_img.empty() 
&& CV_MAT_DEPTH(imgtype) == CV_8U && (imgcn == 1 || imgcn == 3 || imgcn 
== 4) in function detectAndCompute
" thrown in the test body.
[  FAILED  ] SurfFeaturesFinder.CanFindInROIs (1 ms)
[----------] 1 test from SurfFeaturesFinder (1 ms total)
[----------] Global test environment tear-down
[==========] 5 tests from 5 test cases ran. (3 ms total)
[  PASSED  ] 3 tests.
[  FAILED  ] 2 tests, listed below:
[  FAILED  ] MultiBandBlender.CanBlendTwoImages
[  FAILED  ] SurfFeaturesFinder.CanFindInROIs

这是运行 opencv_perf_stitching 的更长输出:

./opencv_perf_stitching 
Time compensation is 0
OpenCV version: 3.0.0
OpenCV VCS version: unknown
Build type: release
Parallel framework: pthreads
CPU features: mmx sse sse2 sse3
OpenCL is disabled
[==========] Running 33 tests from 9 test cases.
[----------] Global test environment set-up.
[----------] 1 test from OCL_stitch_a123
[ RUN      ] OCL_stitch_a123.a123/0
/home/taeten/Downloads/opencv-3.0.0/modules/ts/src/ts_perf.cpp:1665: 
Failure
Failed
Requested file "./stitching/a1.png" does not exist.
params    =       "orb"
termination reason:  aborted by the performance testing framework
bytesIn   =          0
bytesOut  =          0
samples   =          0 of 100
outliers  =          0
frequency =          0
[  FAILED  ] OCL_stitch_a123.a123/0, where GetParam() = "orb" (0 ms)
[----------] 1 test from OCL_stitch_a123 (0 ms total)

[----------] 1 test from OCL_stitch_b12
[ RUN      ] OCL_stitch_b12.b12/0
/home/taeten/Downloads/opencv-3.0.0/modules/ts/src/ts_perf.cpp:1665:  
Failure
Failed
Requested file "./stitching/b1.png" does not exist.
params    =       "orb"
termination reason:  aborted by the performance testing framework
bytesIn   =          0
bytesOut  =          0
samples   =          0 of 100
outliers  =          0
frequency =          0
[  FAILED  ] OCL_stitch_b12.b12/0, where GetParam() = "orb" (0 ms)
[----------] 1 test from OCL_stitch_b12 (0 ms total)

[----------] 1 test from OCL_stitch_boat
[ RUN      ] OCL_stitch_boat.boat/0
/home/taeten/Downloads/opencv-3.0.0/modules/ts/src/ts_perf.cpp:1665:  
Failure
Failed
Requested file "./stitching/boat1.jpg" does not exist.
params    =       "orb"
termination reason:  aborted by the performance testing framework
bytesIn   =          0
bytesOut  =          0
samples   =          0 of 100
outliers  =          0
frequency =          0
[  FAILED  ] OCL_stitch_boat.boat/0, where GetParam() = "orb" (0 ms)
[----------] 1 test from OCL_stitch_boat (0 ms total)

[----------] 12 tests from  
OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps
[ RUN      ]                                                                                                            

OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/0
[ PERFSTAT ]    (samples = 10, mean = 11.67, median = 11.57, stddev = 0.25 (2.1%))
[ VALUE    ]    (640x480, SphericalWarperType)
[       OK ]   
OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/0 (117 ms)
[ RUN      ]  
OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/1
[ PERFSTAT ]    (samples = 10, mean = 10.32, median = 10.31, stddev = 0.05 (0.5%))
[ VALUE    ]    (640x480, CylindricalWarperType)
[       OK ]
OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/1 (103 ms)
[ RUN      ] 
OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/2

[ PERFSTAT ]    (samples = 10, mean = 5.11, median = 5.09, stddev = 0.04 (0.7%))
[ VALUE    ]    (640x480, PlaneWarperType)
[       OK ] OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/2 (52 ms)
[ RUN      ] OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/3
[ PERFSTAT ]    (samples = 10, mean = 46.64, median = 46.15, stddev = 0.85 (1.8%))
[ VALUE    ]    (1280x720, SphericalWarperType)
[       OK ] OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/3 (466 ms)
[ RUN      ] OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/4
[ PERFSTAT ]    (samples = 10, mean = 41.16, median = 41.12, stddev = 0.13 (0.3%))
[ VALUE    ]    (1280x720, CylindricalWarperType)
[       OK ] OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/4 (412 ms)
[ RUN      ] OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/5
[ PERFSTAT ]    (samples = 10, mean = 20.38, median = 20.34, stddev = 0.09 (0.4%))
[ VALUE    ]    (1280x720, PlaneWarperType)
[       OK ] OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/5 (204 ms)
[ RUN      ] OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/6
[ PERFSTAT ]    (samples = 10, mean = 104.23, median = 103.85, stddev = 0.91 (0.9%))
[ VALUE    ]    (1920x1080, SphericalWarperType)
[       OK ] OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/6 (1042 ms)
[ RUN      ] OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/7
[ PERFSTAT ]    (samples = 10, mean = 92.62, median = 92.53, stddev = 0.27 (0.3%))
[ VALUE    ]    (1920x1080, CylindricalWarperType)
[       OK ] OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/7 (927 ms)
[ RUN      ] OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/8
[ PERFSTAT ]    (samples = 10, mean = 45.97, median = 45.82, stddev = 0.36 (0.8%))
[ VALUE    ]    (1920x1080, PlaneWarperType)
[       OK ] OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/8 (460 ms)
[ RUN      ] OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/9
[ PERFSTAT ]    (samples = 10, mean = 415.69, median = 414.93, stddev = 2.51 (0.6%))
[ VALUE    ]    (3840x2160, SphericalWarperType)
[       OK ] OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/9 (4157 ms)
[ RUN      ] OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/10
[ PERFSTAT ]    (samples = 10, mean = 370.34, median = 369.69, stddev = 2.09 (0.6%))
[ VALUE    ]    (3840x2160, CylindricalWarperType)
[       OK ] OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/10 (3704 ms)
[ RUN      ] OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/11
[ PERFSTAT ]    (samples = 10, mean = 184.04, median = 183.20, stddev = 2.34 (1.3%))
[ VALUE    ]    (3840x2160, PlaneWarperType)
[       OK ] OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps.
StitchingWarpers_BuildMaps/11 (1842 ms)
[----------] 12 tests from 
OCL_StitchingWarpersFixture_StitchingWarpers_BuildMaps (13486 ms total)

[----------] 12 tests from OCL_StitchingWarpersFixture_StitchingWarpers_Warp
[ RUN      ] OCL_StitchingWarpersFixture_StitchingWarpers_Warp.StitchingWarpers_Warp/0
[ PERFSTAT ]    (samples = 10, mean = 12.48, median = 12.34, stddev = 0.33 (2.7%))
[ VALUE    ]    (640x480, SphericalWarperType)
[       OK ] OCL_StitchingWarpersFixture_StitchingWarpers_Warp.StitchingWarpers_Warp/0 (125 ms)
[ RUN      ] OCL_StitchingWarpersFixture_StitchingWarpers_Warp.StitchingWarpers_Warp/1
[ PERFSTAT ]    (samples = 10, mean = 11.22, median = 11.14, stddev = 0.17 (1.5%))
[ VALUE    ]    (640x480, CylindricalWarperType)
[       OK ] OCL_StitchingWarpersFixture_StitchingWarpers_Warp.StitchingWarpers_Warp/1 (112 ms)
[ RUN      ] OCL_StitchingWarpersFixture_StitchingWarpers_Warp.StitchingWarpers_Warp/2
[ PERFSTAT ]    (samples = 13, mean = 5.88, median = 5.87, stddev = 0.03 (0.5%))
[ VALUE    ]    (640x480, PlaneWarperType)
[       OK ] 
OCL_StitchingWarpersFixture_StitchingWarpers_Warp.
StitchingWarpers_Warp/2 (78 ms)
[ RUN      ] 
OCL_StitchingWarpersFixture_StitchingWarpers_Warp.
StitchingWarpers_Warp/3
[ PERFSTAT ]    (samples = 10, mean = 49.28, median = 49.25, stddev = 0.10 (0.2%))
[ VALUE    ]    (1280x720, SphericalWarperType)
[       OK ] 
OCL_StitchingWarpersFixture_StitchingWarpers_Warp.
StitchingWarpers_Warp/3 (493 ms)
[ RUN      ] 
OCL_StitchingWarpersFixture_StitchingWarpers_Warp.
StitchingWarpers_Warp/4
[ PERFSTAT ]    (samples = 10, mean = 44.59, median = 44.47, stddev = 0.29 (0.7%))
[ VALUE    ]    (1280x720, CylindricalWarperType)
[       OK ] OCL_StitchingWarpersFixture_StitchingWarpers_Warp.StitchingWarpers_Warp/4 (446 ms)
[ RUN      ] OCL_StitchingWarpersFixture_StitchingWarpers_Warp.StitchingWarpers_Warp/5
[ PERFSTAT ]    (samples = 10, mean = 23.65, median = 23.63, stddev = 0.05 (0.2%))
[ VALUE    ]    (1280x720, PlaneWarperType)
[       OK ] OCL_StitchingWarpersFixture_StitchingWarpers_Warp.StitchingWarpers_Warp/5 (237 ms)
[ RUN      ] OCL_StitchingWarpersFixture_StitchingWarpers_Warp.StitchingWarpers_Warp/6
[ PERFSTAT ]    (samples = 10, mean = 110.46, median = 110.13, stddev = 0.60 (0.5%))
[ VALUE    ]    (1920x1080, SphericalWarperType)
[       OK ] OCL_StitchingWarpersFixture_StitchingWarpers_Warp.StitchingWarpers_Warp/6 (1105 ms)
[ RUN      ] OCL_StitchingWarpersFixture_StitchingWarpers_Warp.StitchingWarpers_Warp/7
[ PERFSTAT ]    (samples = 10, mean = 99.67, median = 99.51, stddev = 0.41 (0.4%))
[ VALUE    ]    (1920x1080, CylindricalWarperType)
[       OK ] OCL_StitchingWarpersFixture_StitchingWarpers_Warp.StitchingWarpers_Warp/7 (998 ms)
[ RUN      ] OCL_StitchingWarpersFixture_StitchingWarpers_Warp.StitchingWarpers_Warp/8
[ PERFSTAT ]    (samples = 10, mean = 53.08, median = 53.04, stddev = 0.31 (0.6%))
[ VALUE    ]    (1920x1080, PlaneWarperType)
[       OK ] OCL_StitchingWarpersFixture_StitchingWarpers_Warp.StitchingWarpers_Warp/8 (531 ms)
[ RUN      ] 
OCL_StitchingWarpersFixture_StitchingWarpers_Warp.
StitchingWarpers_Warp/9
[ PERFSTAT ]    (samples = 10, mean = 447.03, median = 446.33, stddev = 1.87 (0.4%))
[ VALUE    ]    (3840x2160, SphericalWarperType)
[       OK ] 
OCL_StitchingWarpersFixture_StitchingWarpers_Warp.
StitchingWarpers_Warp/9 (4472 ms)
[ RUN      ] 
OCL_StitchingWarpersFixture_StitchingWarpers_Warp.
StitchingWarpers_Warp/10
[ PERFSTAT ]    (samples = 10, mean = 403.88, median = 403.82, stddev = 0.40 (0.1%))
[ VALUE    ]    (3840x2160, CylindricalWarperType)
[       OK ] OCL_StitchingWarpersFixture_StitchingWarpers_Warp.
StitchingWarpers_Warp/10 (4041 ms)
[ RUN      ] 
OCL_StitchingWarpersFixture_StitchingWarpers_Warp.
StitchingWarpers_Warp/11
[ PERFSTAT ]    (samples = 10, mean = 219.04, median = 219.16, stddev = 0.87 (0.4%))
[ VALUE    ]    (3840x2160, PlaneWarperType)
[       OK ]   
OCL_StitchingWarpersFixture_StitchingWarpers_Warp.
StitchingWarpers_Warp/11  (2192 ms)
[----------] 12 tests from 
OCL_StitchingWarpersFixture_StitchingWarpers_Warp (14830 ms total)

[----------] 1 test from stitch_a123
[ RUN      ] stitch_a123.a123/0
/home/taeten/Downloads/opencv-3.0.0/modules/ts/src/ts_perf.cpp:1665: 
Failure
Failed
Requested file "./stitching/a1.png" does not exist.
params    =       "orb"
termination reason:  aborted by the performance testing framework
bytesIn   =          0
bytesOut  =          0
samples   =          0 of 100
outliers  =          0
frequency =          0
[  FAILED  ] stitch_a123.a123/0, where GetParam() = "orb" (0 ms)
[----------] 1 test from stitch_a123 (0 ms total)

[----------] 1 test from stitch_b12
[ RUN      ] stitch_b12.b12/0
/home/taeten/Downloads/opencv-3.0.0/modules/ts/src/ts_perf.cpp:1665: 
Failure
Failed
Requested file "./stitching/b1.png" does not exist.
params    =       "orb"
termination reason:  aborted by the performance testing framework
bytesIn   =          0
bytesOut  =          0
samples   =          0 of 100
outliers  =          0
frequency =          0
[  FAILED  ] stitch_b12.b12/0, where GetParam() = "orb" (0 ms)
[----------] 1 test from stitch_b12 (0 ms total)

[----------] 1 test from match_bestOf2Nearest
[ RUN      ] match_bestOf2Nearest.bestOf2Nearest/0
/home/taeten/Downloads/opencv-3.0.0/modules/ts/src/ts_perf.cpp:1665:  
Failure
Failed
Requested file "./stitching/b1.png" does not exist.
params    =       "orb"
termination reason:  aborted by the performance testing framework
bytesIn   =          0
bytesOut  =          0
samples   =          0 of 100
outliers  =          0
frequency =          0
[  FAILED  ] match_bestOf2Nearest.bestOf2Nearest/0, where GetParam() = "orb" (0 ms)
[----------] 1 test from match_bestOf2Nearest (0 ms total)

[----------] 3 tests from matchVector_bestOf2NearestVectorFeatures
[ RUN      ]   
matchVector_bestOf2NearestVectorFeatures.bestOf2NearestVectorFeatures/0
/home/taeten/Downloads/opencv-3.0.0/modules/ts/src/ts_perf.cpp:1665:  
Failure
Failed
Requested file "./stitching/b1.png" does not exist.
params    =  ("orb", 2)
termination reason:  aborted by the performance testing framework
bytesIn   =          0
bytesOut  =          0
samples   =          0 of 100
outliers  =          0
frequency =          0
[  FAILED  ] 
matchVector_bestOf2NearestVectorFeatures.bestOf2NearestVectorFeatures/0, 
where GetParam() = ("orb", 2) (0 ms)
[ RUN      ] 
matchVector_bestOf2NearestVectorFeatures.bestOf2NearestVectorFeatures/1
/home/taeten/Downloads/opencv-3.0.0/modules/ts/src/ts_perf.cpp:1665:
Failure
Failed
Requested file "./stitching/b1.png" does not exist.
params    =  ("orb", 4)
termination reason:  aborted by the performance testing framework
bytesIn   =          0
bytesOut  =          0
samples   =          0 of 100
outliers  =          0
frequency =          0
[  FAILED  ]  
matchVector_bestOf2NearestVectorFeatures.bestOf2NearestVectorFeatures/1,
where GetParam() = ("orb", 4) (0 ms)
[ RUN      ] 
 matchVector_bestOf2NearestVectorFeatures.bestOf2NearestVectorFeatures/2
/home/taeten/Downloads/opencv-3.0.0/modules/ts/src/ts_perf.cpp:1665: 
Failure
Failed
Requested file "./stitching/b1.png" does not exist.
params    =  ("orb", 8)
termination reason:  aborted by the performance testing framework
bytesIn   =          0
bytesOut  =          0
samples   =          0 of 100
outliers  =          0
frequency =          0
[  FAILED  ]  
matchVector_bestOf2NearestVectorFeatures.bestOf2NearestVectorFeatures/2,
where GetParam() = ("orb", 8) (0 ms)
[----------] 3 tests from matchVector_bestOf2NearestVectorFeatures (0 ms total)

[----------] Global test environment tear-down
[==========] 33 tests from 9 test cases ran. (28316 ms total)
[  PASSED  ] 24 tests.
[  FAILED  ] 9 tests, listed below:
[  FAILED  ] OCL_stitch_a123.a123/0, where GetParam() = "orb"
[  FAILED  ] OCL_stitch_b12.b12/0, where GetParam() = "orb"
[  FAILED  ] OCL_stitch_boat.boat/0, where GetParam() = "orb"
[  FAILED  ] stitch_a123.a123/0, where GetParam() = "orb"
[  FAILED  ] stitch_b12.b12/0, where GetParam() = "orb"
[  FAILED  ] match_bestOf2Nearest.bestOf2Nearest/0, where GetParam() = "orb"
[  FAILED  ] 
 matchVector_bestOf2NearestVectorFeatures.bestOf2NearestVectorFeatures/0,
 where GetParam() = ("orb", 2)
[  FAILED  ] 
matchVector_bestOf2NearestVectorFeatures.bestOf2NearestVectorFeatures/1, 
where GetParam() = ("orb", 4)
[  FAILED  ] 
matchVector_bestOf2NearestVectorFeatures.bestOf2NearestVectorFeatures/2,
where GetParam() = ("orb", 8)

 9 FAILED TESTS
4

0 回答 0