Skip to content
Snippets Groups Projects
Commit 08b77be0 authored by Angel Santamaria-Navarro's avatar Angel Santamaria-Navarro
Browse files

added akaze and fixed problem with yaml

parent 67e3f479
No related branches found
No related tags found
No related merge requests found
Showing
with 86 additions and 63 deletions
......@@ -27,7 +27,7 @@
#include "../descriptors/surf/descriptor_surf.h"
#include "../descriptors/brisk/descriptor_brisk.h"
#include "../descriptors/kaze/descriptor_kaze.h"
//#include "../descriptors/akaze/descriptor_akaze.h"
#include "../descriptors/akaze/descriptor_akaze.h"
//#include "../descriptors/latch/descriptor_latch.h"
//#include "../descriptors/freak/descriptor_freak.h"
//#include "../descriptors/brief/descriptor_brief.h"
......@@ -48,69 +48,69 @@ int main(void)
std::string vu_root = _VU_ROOT_DIR;
// Setup camera sensor by default
SensorBasePtr sen_b_ptr = setupSensor("USB CAM", "CAMERA test", vu_root + path_yaml_file + "/FAST.yaml"); // Any YAML with sensor type setup correctly
SensorBasePtr sen_b_ptr = setupSensor("USB_CAM", "CAMERA_test", vu_root + path_yaml_file + "/FAST.yaml"); // Any YAML with sensor type setup correctly
SensorCameraPtr sen_ptr = std::static_pointer_cast<SensorCamera>(sen_b_ptr);
std::string def_detector = "ORB DET";
std::string def_detector = "ORB";
std::cout << std::endl << "Which DETECTOR do you want to test? Type one of the registered names [default: " << def_detector << "]: ";
std::string det_name = readFromUser(def_detector);
DetectorBasePtr det_ptr = setupDetector(det_name, det_name + " detector", vu_root + path_yaml_file + "/" + det_name + ".yaml");
if (det_name.compare("ORB DET") == 0)
if (det_name.compare("ORB") == 0)
det_ptr = std::static_pointer_cast<DetectorORB>(det_ptr);
else if (det_name.compare("FAST DET") == 0)
else if (det_name.compare("FAST") == 0)
det_ptr = std::static_pointer_cast<DetectorFAST>(det_ptr);
else if (det_name.compare("SIFT DET") == 0)
else if (det_name.compare("SIFT") == 0)
det_ptr = std::static_pointer_cast<DetectorSIFT>(det_ptr);
else if (det_name.compare("SURF DET") == 0)
else if (det_name.compare("SURF") == 0)
det_ptr = std::static_pointer_cast<DetectorSURF>(det_ptr);
else if (det_name.compare("BRISK DET") == 0)
else if (det_name.compare("BRISK") == 0)
det_ptr = std::static_pointer_cast<DetectorBRISK>(det_ptr);
else if (det_name.compare("MSER DET") == 0)
else if (det_name.compare("MSER") == 0)
det_ptr = std::static_pointer_cast<DetectorMSER>(det_ptr);
else if (det_name.compare("GFTT DET") == 0)
else if (det_name.compare("GFTT") == 0)
det_ptr = std::static_pointer_cast<DetectorGFTT>(det_ptr);
else if (det_name.compare("HARRIS DET") == 0)
else if (det_name.compare("HARRIS") == 0)
det_ptr = std::static_pointer_cast<DetectorHARRIS>(det_ptr);
else if (det_name.compare("SBD DET") == 0)
else if (det_name.compare("SBD") == 0)
det_ptr = std::static_pointer_cast<DetectorSBD>(det_ptr);
else if (det_name.compare("KAZE DET") == 0)
else if (det_name.compare("KAZE") == 0)
det_ptr = std::static_pointer_cast<DetectorKAZE>(det_ptr);
else if (det_name.compare("AKAZE DET") == 0)
else if (det_name.compare("AKAZE") == 0)
det_ptr = std::static_pointer_cast<DetectorAKAZE>(det_ptr);
else if (det_name.compare("AGAST DET") == 0)
else if (det_name.compare("AGAST") == 0)
det_ptr = std::static_pointer_cast<DetectorAGAST>(det_ptr);
std::cout << "\n================ DESCRIPTOR TEST =================" << std::endl;
std::string def_descriptor = "ORB DES";
std::string def_descriptor = "ORB";
std::cout << std::endl << "Which DESCRIPTOR do you want to test? Type one of the registered names [default: " << def_descriptor << "]: ";
std::string des_name = readFromUser(def_descriptor);
DescriptorBasePtr des_ptr = setupDescriptor(des_name, des_name + " descriptor", vu_root + path_yaml_file + "/" + des_name + ".yaml");
if (des_name.compare("ORB DES") == 0)
if (des_name.compare("ORB") == 0)
des_ptr = std::static_pointer_cast<DescriptorORB>(des_ptr);
else if (des_name.compare("SIFT DES") == 0)
else if (des_name.compare("SIFT") == 0)
des_ptr = std::static_pointer_cast<DescriptorSIFT>(des_ptr);
else if (des_name.compare("SURF DES") == 0)
else if (des_name.compare("SURF") == 0)
des_ptr = std::static_pointer_cast<DescriptorSURF>(des_ptr);
else if (des_name.compare("BRISK DES") == 0)
else if (des_name.compare("BRISK") == 0)
des_ptr = std::static_pointer_cast<DescriptorBRISK>(des_ptr);
else if (des_name.compare("KAZE DES") == 0)
else if (des_name.compare("KAZE") == 0)
des_ptr = std::static_pointer_cast<DescriptorKAZE>(des_ptr);
// else if (des_name.compare("AKAZE DES") == 0)
// des_ptr = std::static_pointer_cast<DescriptorAKAZE>(des_ptr);
// else if (des_name.compare("LATCH DES") == 0)
else if (des_name.compare("AKAZE") == 0)
des_ptr = std::static_pointer_cast<DescriptorAKAZE>(des_ptr);
// else if (des_name.compare("LATCH") == 0)
// des_ptr = std::static_pointer_cast<DescriptorLATCH>(des_ptr);
// else if (des_name.compare("FREAK DES") == 0)
// else if (des_name.compare("FREAK") == 0)
// des_ptr = std::static_pointer_cast<DescriptorFREAK>(des_ptr);
// else if (des_name.compare("BRIEF DES") == 0)
// else if (des_name.compare("BRIEF") == 0)
// des_ptr = std::static_pointer_cast<DescriptorBRIEF>(des_ptr);
// else if (des_name.compare("DAISY DES") == 0)
// else if (des_name.compare("DAISY") == 0)
// des_ptr = std::static_pointer_cast<DescriptorDAISY>(des_ptr);
// else if (des_name.compare("LUCID DES") == 0)
// else if (des_name.compare("LUCID") == 0)
// des_ptr = std::static_pointer_cast<DescriptorLUCID>(des_ptr);
std::cout << std::endl << "... Testing " << det_ptr->getName() << " with " << des_ptr->getName() << " ..." << std::endl;
......
......@@ -35,40 +35,40 @@ int main(void)
std::string vu_root = _VU_ROOT_DIR;
// Setup camera sensor by default
SensorBasePtr sen_b_ptr = setupSensor("USB CAM", "CAMERA test", vu_root + path_yaml_file + "/FAST.yaml"); // Any YAML with sensor type setup correctly
SensorBasePtr sen_b_ptr = setupSensor("USB_CAM", "CAMERA_test", vu_root + path_yaml_file + "/FAST.yaml"); // Any YAML with sensor type setup correctly
SensorCameraPtr sen_ptr = std::static_pointer_cast<SensorCamera>(sen_b_ptr);
std::cout << "\n================ DETECTOR TEST =================" << std::endl;
std::string def_detector = "ORB DET";
std::string def_detector = "ORB";
std::cout << std::endl << "Which DETECTOR do you want to test? Type one of the registered names [default: " << def_detector << "]: ";
std::string det_name = readFromUser(def_detector);
DetectorBasePtr det_ptr = setupDetector(det_name, det_name + " detector", vu_root + path_yaml_file + "/" + det_name + ".yaml");
if (det_name.compare("ORB DET") == 0)
if (det_name.compare("ORB") == 0)
det_ptr = std::static_pointer_cast<DetectorORB>(det_ptr);
else if (det_name.compare("FAST DET") == 0)
else if (det_name.compare("FAST") == 0)
det_ptr = std::static_pointer_cast<DetectorFAST>(det_ptr);
else if (det_name.compare("SIFT DET") == 0)
else if (det_name.compare("SIFT") == 0)
det_ptr = std::static_pointer_cast<DetectorSIFT>(det_ptr);
else if (det_name.compare("SURF DET") == 0)
else if (det_name.compare("SURF") == 0)
det_ptr = std::static_pointer_cast<DetectorSURF>(det_ptr);
else if (det_name.compare("BRISK DET") == 0)
else if (det_name.compare("BRISK") == 0)
det_ptr = std::static_pointer_cast<DetectorBRISK>(det_ptr);
else if (det_name.compare("MSER DET") == 0)
else if (det_name.compare("MSER") == 0)
det_ptr = std::static_pointer_cast<DetectorMSER>(det_ptr);
else if (det_name.compare("GFTT DET") == 0)
else if (det_name.compare("GFTT") == 0)
det_ptr = std::static_pointer_cast<DetectorGFTT>(det_ptr);
else if (det_name.compare("HARRIS DET") == 0)
else if (det_name.compare("HARRIS") == 0)
det_ptr = std::static_pointer_cast<DetectorHARRIS>(det_ptr);
else if (det_name.compare("SBD DET") == 0)
else if (det_name.compare("SBD") == 0)
det_ptr = std::static_pointer_cast<DetectorSBD>(det_ptr);
else if (det_name.compare("KAZE DET") == 0)
else if (det_name.compare("KAZE") == 0)
det_ptr = std::static_pointer_cast<DetectorKAZE>(det_ptr);
else if (det_name.compare("AKAZE DET") == 0)
else if (det_name.compare("AKAZE") == 0)
det_ptr = std::static_pointer_cast<DetectorAKAZE>(det_ptr);
else if (det_name.compare("AGAST DET") == 0)
else if (det_name.compare("AGAST") == 0)
det_ptr = std::static_pointer_cast<DetectorAGAST>(det_ptr);
std::cout << std::endl << "... Testing " << det_ptr->getName() << " ..." << std::endl;
......
......@@ -22,6 +22,18 @@ int main(void)
"There is only one attempt per class, and it is successful!\n"
"We do this by registering in the class\'s .cpp file.\n";
// Root dir path
std::string vu_root = _VU_ROOT_DIR;
std::string def_sensor = "USB_CAM";
std::string sen_name = readFromUser(def_sensor);
std::string file_dot_yaml = "/src/examples/yaml/FAST.yaml"; // Any yaml with sensor configured
SensorBasePtr sen_b_ptr = setupSensor(sen_name, sen_name + "_test", vu_root + file_dot_yaml);
SensorCameraPtr usb_cam_ptr = std::static_pointer_cast<SensorCamera>(sen_b_ptr);
return 0;
}
......@@ -21,7 +21,7 @@ int main(void)
std::cout << std::endl << "Which SENSOR do you want to test? Type one of the registered names [default: " << def_sensor << "]: ";
std::string sen_name = readFromUser(def_sensor);
std::string file_dot_yaml = "/src/examples/yaml/example.yaml";
std::string file_dot_yaml = "/src/examples/yaml/FAST.yaml"; // Any yaml with sensor configured
SensorBasePtr sen_b_ptr = setupSensor(sen_name, sen_name + "_test", vu_root + file_dot_yaml);
SensorCameraPtr usb_cam_ptr = std::static_pointer_cast<SensorCamera>(sen_b_ptr);
......
sensor:
type: "USB_CAM"
detector:
type: "AGAST DET"
type: "AGAST"
threshold: 10
nonmaxSuppression: true
detection type: 3 # AGAST_5_8=0, AGAST_7_12d=1, AGAST_7_12s=2, OAST_9_16=3, THRESHOLD=10000, NONMAX_SUPPRESSION=10001
sensor:
type: "USB_CAM"
detector:
type: "AKAZE DET"
type: "AKAZE"
descriptor_type: 5 # Type of the extracted descriptor. DESCRIPTOR_KAZE_UPRIGHT=2, DESCRIPTOR_KAZE=3, DESCRIPTOR_MLDB_UPRIGHT=4, DESCRIPTOR_MLDB=5
descriptor_size: 0
descriptor_channels: 3
threshold: 0.001
nOctaves: 4
nOctaveLayers: 4
diffusivity: 1 # Diffusivity type. DIFF_PM_G1=0, DIFF_PM_G2=1, DIFF_WEICKERT=2, DIFF_CHARBONNIER=3
descriptor:
type: "AKAZE"
descriptor_type: 5 # Type of the extracted descriptor. DESCRIPTOR_KAZE_UPRIGHT=2, DESCRIPTOR_KAZE=3, DESCRIPTOR_MLDB_UPRIGHT=4, DESCRIPTOR_MLDB=5
descriptor_size: 0
descriptor_channels: 3
......
......@@ -2,13 +2,13 @@ sensor:
type: "USB_CAM"
detector:
type: "BRISK DET"
type: "BRISK"
thresh: 30
octaves: 3
patternScale: 1.0
descriptor:
type: "BRISK DES"
type: "BRISK"
thresh: 30
octaves: 3
patternScale: 1.0
\ No newline at end of file
sensor:
type: "USB_CAM"
detector:
type: "FAST DET"
type: "FAST"
threshold: 10
nonmaxSuppression: true
neighbor type: 0 #enum { TYPE_9_16=0, TYPE_7_12=1, TYPE_5_8=2 };
sensor:
type: "USB_CAM"
detector:
type: "GFTT DET"
type: "GFTT"
maxCorners: 1000
qualityLevel: 0.01
minDistance: 1.0
......
sensor:
type: "USB_CAM"
detector:
type: "HARRIS DET"
type: "HARRIS"
maxCorners: 1000
qualityLevel: 0.01
minDistance: 1.0
......
......@@ -2,7 +2,7 @@ sensor:
type: "USB_CAM"
detector:
type: "KAZE DET"
type: "KAZE"
extended: false
upright: false
threshold: 0.001
......@@ -11,7 +11,7 @@ detector:
diffusivity: 1 # Diffusivity type. DIFF_PM_G1=0, DIFF_PM_G2=1, DIFF_WEICKERT=2, DIFF_CHARBONNIER=3
descriptor:
type: "KAZE DES"
type: "KAZE"
extended: false
upright: false
threshold: 0.001
......
sensor:
type: "USB_CAM"
detector:
type: "MSER DET"
type: "MSER"
delta: 5
min_area: 60
max_area: 14400
......
......@@ -2,7 +2,7 @@ sensor:
type: "USB_CAM"
detector:
type: "ORB DET"
type: "ORB"
nfeatures: 100
scale factor: 2
nlevels: 8
......@@ -13,7 +13,7 @@ detector:
patch size: 15 # 31
descriptor:
type: "ORB DES"
type: "ORB"
nfeatures: 100
scale factor: 2
nlevels: 8
......
sensor:
type: "USB_CAM"
detector:
type: "SBD DET"
type: "SBD"
thresholdStep: 10.0
minThreshold: 50.0
maxThreshold: 220.0
......
......@@ -2,7 +2,7 @@ sensor:
type: "USB_CAM"
detector:
type: "SIFT DET"
type: "SIFT"
nfeatures: 0
nOctaveLayers: 3
contrastThreshold: 0.04
......@@ -10,7 +10,7 @@ detector:
sigma: 1.6
descriptor:
type: "SIFT DES"
type: "SIFT"
nfeatures: 0
nOctaveLayers: 3
contrastThreshold: 0.04
......
......@@ -2,7 +2,7 @@ sensor:
type: "USB_CAM"
detector:
type: "SURF DET"
type: "SURF"
hessianThreshold: 400
nOctaves: 4
nOctaveLayers: 2
......@@ -10,7 +10,7 @@ detector:
upright: false
descriptor:
type: "SURF DES"
type: "SURF"
hessianThreshold: 400
nOctaves: 4
nOctaveLayers: 2
......
......@@ -14,5 +14,5 @@ SensorCamera::~SensorCamera(void)
#include "../sensor_factory.h"
namespace vision_utils
{
VU_REGISTER_SENSOR("USB CAM", SensorCamera);
VU_REGISTER_SENSOR("USB_CAM", SensorCamera);
} /* namespace vision_utils */
......@@ -22,7 +22,7 @@ static ParamsBasePtr createParamsUSBCAMSensor(const std::string & _filename_dot_
if (!yaml_params.IsNull())
{
Node d_yaml = yaml_params["sensor"];
if(d_yaml["type"].as<string>() == "USB CAM")
if(d_yaml["type"].as<string>() == "USB_CAM")
{
// TODO: Load intrinsic parametes if any function needs them.
}else
......@@ -35,7 +35,7 @@ static ParamsBasePtr createParamsUSBCAMSensor(const std::string & _filename_dot_
}
// Register in the SensorFactory
const bool registered_usbcam_params = ParamsFactory::get().registerCreator("USB CAM", createParamsUSBCAMSensor);
const bool registered_usbcam_params = ParamsFactory::get().registerCreator("USB_CAM", createParamsUSBCAMSensor);
} /* namespace [unnamed] */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment