mirror of
https://github.com/opencv/opencv_contrib.git
synced 2025-10-20 12:55:15 +08:00
Testing line_descriptor, reg, rgbd
This commit is contained in:
@@ -50,7 +50,6 @@ using namespace cv::line_descriptor;
|
||||
|
||||
const std::string LINE_DESCRIPTOR_DIR = "line_descriptor";
|
||||
const std::string IMAGE_FILENAME = "cameraman.jpg";
|
||||
const std::string DESCRIPTORS_DIR = LINE_DESCRIPTOR_DIR + "/descriptors";
|
||||
|
||||
template<class Distance>
|
||||
class CV_BD_DescriptorsTest : public cvtest::BaseTest
|
||||
@@ -120,7 +119,7 @@ class CV_BD_DescriptorsTest : public cvtest::BaseTest
|
||||
Mat readDescriptors()
|
||||
{
|
||||
Mat descriptors;
|
||||
FileStorage fs( std::string( ts->get_data_path() ) + LINE_DESCRIPTOR_DIR + "/descriptors/" + fs_name, FileStorage::READ );
|
||||
FileStorage fs( std::string( ts->get_data_path() ) + LINE_DESCRIPTOR_DIR + "/" + fs_name, FileStorage::READ );
|
||||
fs["descriptors"] >> descriptors;
|
||||
|
||||
return descriptors;
|
||||
@@ -128,7 +127,7 @@ class CV_BD_DescriptorsTest : public cvtest::BaseTest
|
||||
|
||||
bool writeDescriptors( Mat& descs )
|
||||
{
|
||||
FileStorage fs( std::string( ts->get_data_path() ) + LINE_DESCRIPTOR_DIR + "/descriptors/" + fs_name, FileStorage::WRITE );
|
||||
FileStorage fs( std::string( ts->get_data_path() ) + LINE_DESCRIPTOR_DIR + "/" + fs_name, FileStorage::WRITE );
|
||||
fs << "descriptors" << descs;
|
||||
|
||||
return true;
|
||||
@@ -270,7 +269,7 @@ class CV_BD_DescriptorsTest : public cvtest::BaseTest
|
||||
}
|
||||
|
||||
std::vector<KeyLine> keylines;
|
||||
FileStorage fs( std::string( ts->get_data_path() ) + LINE_DESCRIPTOR_DIR + "/detectors/edl_detector_keylines_cameraman.yaml", FileStorage::READ );
|
||||
FileStorage fs( std::string( ts->get_data_path() ) + LINE_DESCRIPTOR_DIR + "/edl_detector_keylines_cameraman.yaml", FileStorage::READ );
|
||||
if( fs.isOpened() )
|
||||
{
|
||||
//read( fs.getFirstTopLevelNode(), keypoints );
|
||||
@@ -326,7 +325,7 @@ class CV_BD_DescriptorsTest : public cvtest::BaseTest
|
||||
else
|
||||
{
|
||||
ts->printf( cvtest::TS::LOG, "Compute and write keylines.\n" );
|
||||
fs.open( std::string( ts->get_data_path() ) + LINE_DESCRIPTOR_DIR + "/detectors/edl_detector_keylines_cameraman.yaml", FileStorage::WRITE );
|
||||
fs.open( std::string( ts->get_data_path() ) + LINE_DESCRIPTOR_DIR + "/edl_detector_keylines_cameraman.yaml", FileStorage::WRITE );
|
||||
if( fs.isOpened() )
|
||||
{
|
||||
bd->detect( img, keylines );
|
||||
|
@@ -50,7 +50,6 @@ using namespace cv::line_descriptor;
|
||||
|
||||
const std::string LINE_DESCRIPTOR_DIR = "line_descriptor";
|
||||
const std::string IMAGE_FILENAME = "cameraman.jpg";
|
||||
const std::string DETECTOR_DIR = LINE_DESCRIPTOR_DIR + "/detectors";
|
||||
|
||||
class CV_BinaryDescriptorDetectorTest : public cvtest::BaseTest
|
||||
{
|
||||
@@ -256,7 +255,7 @@ void CV_BinaryDescriptorDetectorTest::regressionTest()
|
||||
{
|
||||
assert( bd );
|
||||
std::string imgFilename = std::string( ts->get_data_path() ) + LINE_DESCRIPTOR_DIR + "/" + IMAGE_FILENAME;
|
||||
std::string resFilename = std::string( ts->get_data_path() ) + DETECTOR_DIR + "/" + fs_name + ".yaml";
|
||||
std::string resFilename = std::string( ts->get_data_path() ) + LINE_DESCRIPTOR_DIR + "/" + fs_name + ".yaml";
|
||||
|
||||
// Read the test image.
|
||||
Mat image = imread( imgFilename );
|
||||
|
@@ -43,4 +43,4 @@
|
||||
|
||||
#include "test_precomp.hpp"
|
||||
|
||||
CV_TEST_MAIN("reg")
|
||||
CV_TEST_MAIN("cv")
|
||||
|
@@ -244,7 +244,7 @@ void RegTest::testProjective()
|
||||
|
||||
void RegTest::loadImage()
|
||||
{
|
||||
const string imageName = cvtest::TS::ptr()->get_data_path() + "home.png";
|
||||
const string imageName = cvtest::TS::ptr()->get_data_path() + "reg/home.png";
|
||||
|
||||
img1 = imread(imageName, -1);
|
||||
ASSERT_TRUE(img1.data != 0);
|
||||
|
@@ -173,7 +173,7 @@ int main(int argc, char** argv)
|
||||
|
||||
Ptr<OdometryFrame> frame_prev = Ptr<OdometryFrame>(new OdometryFrame()),
|
||||
frame_curr = Ptr<OdometryFrame>(new OdometryFrame());
|
||||
Ptr<Odometry> odometry = Odometry::create("RGBD." + string(argv[3]) + "Odometry");
|
||||
Ptr<Odometry> odometry = Odometry::create(string(argv[3]) + "Odometry");
|
||||
if(odometry.empty())
|
||||
{
|
||||
cout << "Can not create Odometry algorithm. Check the passed odometry name." << endl;
|
||||
|
@@ -1,3 +1,3 @@
|
||||
#include "test_precomp.hpp"
|
||||
|
||||
CV_TEST_MAIN("rgbd")
|
||||
CV_TEST_MAIN("cv")
|
||||
|
@@ -450,7 +450,7 @@ protected:
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
TEST(Rgbd_Normals, compute)
|
||||
TEST(DISABLED_Rgbd_Normals, compute)
|
||||
{
|
||||
cv::rgbd::CV_RgbdNormalsTest test;
|
||||
test.safe_run();
|
||||
|
@@ -175,8 +175,8 @@ protected:
|
||||
|
||||
bool CV_OdometryTest::readData(Mat& image, Mat& depth) const
|
||||
{
|
||||
std::string imageFilename = std::string(ts->get_data_path()) + "/odometry/rgb.png";
|
||||
std::string depthFilename = std::string(ts->get_data_path()) + "/odometry/depth.png";
|
||||
std::string imageFilename = ts->get_data_path() + "rgbd/rgb.png";
|
||||
std::string depthFilename = ts->get_data_path() + "rgbd/depth.png";
|
||||
|
||||
image = imread(imageFilename, 0);
|
||||
depth = imread(depthFilename, -1);
|
||||
@@ -338,18 +338,18 @@ void CV_OdometryTest::run(int)
|
||||
|
||||
TEST(RGBD_Odometry_Rgbd, algorithmic)
|
||||
{
|
||||
cv::rgbd::CV_OdometryTest test(cv::rgbd::Odometry::create("RGBD.RgbdOdometry"), 0.99, 0.94);
|
||||
cv::rgbd::CV_OdometryTest test(cv::rgbd::Odometry::create("RgbdOdometry"), 0.99, 0.94);
|
||||
test.safe_run();
|
||||
}
|
||||
|
||||
TEST(RGBD_Odometry_ICP, algorithmic)
|
||||
TEST(DISABLED_RGBD_Odometry_ICP, algorithmic)
|
||||
{
|
||||
cv::rgbd::CV_OdometryTest test(cv::rgbd::Odometry::create("RGBD.ICPOdometry"), 0.99, 0.99);
|
||||
cv::rgbd::CV_OdometryTest test(cv::rgbd::Odometry::create("ICPOdometry"), 0.99, 0.99);
|
||||
test.safe_run();
|
||||
}
|
||||
|
||||
TEST(RGBD_Odometry_RgbdICP, algorithmic)
|
||||
TEST(DISABLED_RGBD_Odometry_RgbdICP, algorithmic)
|
||||
{
|
||||
cv::rgbd::CV_OdometryTest test(cv::rgbd::Odometry::create("RGBD.RgbdICPOdometry"), 0.99, 0.99);
|
||||
cv::rgbd::CV_OdometryTest test(cv::rgbd::Odometry::create("RgbdICPOdometry"), 0.99, 0.99);
|
||||
test.safe_run();
|
||||
}
|
||||
|
BIN
modules/rgbd/testdata/rgbd/odometry/depth.png
vendored
BIN
modules/rgbd/testdata/rgbd/odometry/depth.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 120 KiB |
BIN
modules/rgbd/testdata/rgbd/odometry/rgb.png
vendored
BIN
modules/rgbd/testdata/rgbd/odometry/rgb.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 511 KiB |
Reference in New Issue
Block a user