23 #include <pybind11/pybind11.h>
24 #include <pybind11/stl.h>
28 namespace py = pybind11;
29 using namespace py::literals;
36 py::module mod(
"_threshold",
"Python wrapper for afw _threshold library");
38 py::class_<Threshold, std::shared_ptr<Threshold>> clsThreshold(mod,
"Threshold");
41 py::enum_<Threshold::ThresholdType>(clsThreshold,
"ThresholdType")
42 .value(
"VALUE", Threshold::ThresholdType::VALUE)
43 .value(
"BITMASK", Threshold::ThresholdType::BITMASK)
46 .value(
"PIXEL_STDEV", Threshold::ThresholdType::PIXEL_STDEV)
51 py::init<double const, typename Threshold::ThresholdType const, bool const, double const>(),
52 "value"_a,
"type"_a = Threshold::VALUE,
"polarity"_a =
true,
"includeMultiplier"_a = 1.0);
55 clsThreshold.def(
"getType", &Threshold::getType);
56 clsThreshold.def_static(
"parseTypeString", Threshold::parseTypeString);
57 clsThreshold.def_static(
"getTypeString", Threshold::getTypeString);
58 clsThreshold.def(
"getValue", (
double (
Threshold::*)(
const double)
const) & Threshold::getValue,
64 clsThreshold.def(
"getPolarity", &Threshold::getPolarity);
65 clsThreshold.def(
"setPolarity", &Threshold::setPolarity);
66 clsThreshold.def(
"getIncludeMultiplier", &Threshold::getIncludeMultiplier);
67 clsThreshold.def(
"setIncludeMultiplier", &Threshold::setIncludeMultiplier);
estimate sample standard deviation
A Threshold is used to pass a threshold value to detection algorithms.
PYBIND11_PLUGIN(_cameraPoint)
Threshold createThreshold(const double value, const std::string type="value", const bool polarity=true)
Factory method for creating Threshold objects.