23 #include <pybind11/pybind11.h> 24 #include <pybind11/stl.h> 36 py::class_<Threshold, std::shared_ptr<Threshold>> clsThreshold(mod,
"Threshold");
39 py::enum_<Threshold::ThresholdType>(clsThreshold,
"ThresholdType")
40 .value(
"VALUE", Threshold::ThresholdType::VALUE)
41 .value(
"BITMASK", Threshold::ThresholdType::BITMASK)
44 .value(
"PIXEL_STDEV", Threshold::ThresholdType::PIXEL_STDEV)
49 py::init<double const, typename Threshold::ThresholdType const, bool const, double const>(),
50 "value"_a,
"type"_a = Threshold::VALUE,
"polarity"_a =
true,
"includeMultiplier"_a = 1.0);
53 clsThreshold.def(
"getType", &Threshold::getType);
54 clsThreshold.def_static(
"parseTypeString", Threshold::parseTypeString);
55 clsThreshold.def_static(
"getTypeString", Threshold::getTypeString);
56 clsThreshold.def(
"getValue", (
double (
Threshold::*)(
const double)
const) & Threshold::getValue,
62 clsThreshold.def(
"getPolarity", &Threshold::getPolarity);
63 clsThreshold.def(
"setPolarity", &Threshold::setPolarity);
64 clsThreshold.def(
"getIncludeMultiplier", &Threshold::getIncludeMultiplier);
65 clsThreshold.def(
"setIncludeMultiplier", &Threshold::setIncludeMultiplier);
68 mod.def(
"createThreshold",
createThreshold,
"value"_a,
"type"_a =
"value",
"polarity"_a =
true);
estimate sample standard deviation
PYBIND11_MODULE(threshold, mod)
A Threshold is used to pass a threshold value to detection algorithms.
A base class for image defects.
Threshold createThreshold(const double value, const std::string type="value", const bool polarity=true)
Factory method for creating Threshold objects.