35 using Pointer = std::shared_ptr<OpticalFlowSegmentation>;
44 template <
typename... Args>
47 return std::make_shared<OpticalFlowSegmentation>(
48 std::forward<Args>(args)...);
112 -> std::vector<Voxel>;
124 int particleIndex = -1,
125 bool showSpline = false) const -> cv::Mat;
Base class for segmentation algorithms that propagate a collected chain of points.
std::shared_ptr< ChainSegmentationAlgorithm > Pointer
Fits a curve to a set of points for resampling.
Optical Flow Segmentation.
std::uint32_t opticalFlowDisplacementThreshold_
void setOFDispThreshold(std::uint32_t ofDispThrs)
Set the maximum single pixel optical flow displacement before interpolating a pixel region.
void setTargetZIndex(int z)
Set the target z-index.
void setMaterialThickness(double m)
Set the estimated thickness of the substrate (in um)
double materialThickness_
auto draw_particle_on_slice_(const FittedCurve &curve, int sliceIndex, int particleIndex=-1, bool showSpline=false) const -> cv::Mat
Debug: Draw curve on slice image.
OpticalFlowSegmentation()=default
Default constructor.
auto compute() -> PointSet override
Compute the segmentation.
void resetMaxThreads()
Clear the maximum number of threads.
static auto New(Args... args) -> Pointer
auto create_final_pointset_(const std::vector< std::vector< Voxel > > &points) -> PointSet
Convert the internal storage array into a final PointSet.
void setMaxThreads(std::uint32_t t)
Set the maximum number of threads.
auto compute_curve_(const FittedCurve ¤tCurve, int zIndex) -> std::vector< Voxel >
Compute the curve for z + 1 given a curve on z using the optical flow between the two slices.
void setOutsideThreshold(std::uint8_t outside)
Set the threshold of what pixel brightness is considered inside a sheet (higher as threshold) and out...
void setVisualize(bool b)
void setSmoothBrightnessThreshold(std::uint8_t brightness)
Set the threshold for what pixel brightness is considered as being outside the sheet....
std::uint8_t smoothByBrightness_
std::uint8_t opticalFlowPixelThreshold_
void setOFThreshold(std::uint8_t ofThr)
Set the threshold of what pixel brightness is considered while calculating optical flow,...
~OpticalFlowSegmentation() override=default
auto progressIterations() const -> std::size_t override
Returns the maximum progress value.
std::uint8_t outsideThreshold_
std::optional< std::uint32_t > maxThreads_
Segmentation algorithms and utilities library