use std::os::raw::{c_char, c_void};
use libc::size_t;
use crate::{Error, Result, core, sys, types};
pub const MM_AFFINE: i32 = 5;
pub const MM_HOMOGRAPHY: i32 = 6;
pub const MM_RIGID: i32 = 3;
pub const MM_ROTATION: i32 = 2;
pub const MM_SIMILARITY: i32 = 4;
pub const MM_TRANSLATION: i32 = 0;
pub const MM_TRANSLATION_AND_SCALE: i32 = 1;
pub const MM_UNKNOWN: i32 = 7;
pub fn calc_blurriness(frame: &core::Mat) -> Result<f32> {
unsafe { sys::cv_videostab_cv_videostab_calcBlurriness_Mat_frame(frame.as_raw_Mat()) }.into_result()
}
pub fn calc_flow_mask(flow_x: &core::Mat, flow_y: &core::Mat, errors: &core::Mat, max_error: f32, mask0: &core::Mat, mask1: &core::Mat, flow_mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_calcFlowMask_Mat_flowX_Mat_flowY_Mat_errors_float_maxError_Mat_mask0_Mat_mask1_Mat_flowMask(flow_x.as_raw_Mat(), flow_y.as_raw_Mat(), errors.as_raw_Mat(), max_error, mask0.as_raw_Mat(), mask1.as_raw_Mat(), flow_mask.as_raw_Mat()) }.into_result()
}
pub fn complete_frame_according_to_flow(flow_mask: &core::Mat, flow_x: &core::Mat, flow_y: &core::Mat, frame1: &core::Mat, mask1: &core::Mat, dist_thresh: f32, frame0: &core::Mat, mask0: &core::Mat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_completeFrameAccordingToFlow_Mat_flowMask_Mat_flowX_Mat_flowY_Mat_frame1_Mat_mask1_float_distThresh_Mat_frame0_Mat_mask0(flow_mask.as_raw_Mat(), flow_x.as_raw_Mat(), flow_y.as_raw_Mat(), frame1.as_raw_Mat(), mask1.as_raw_Mat(), dist_thresh, frame0.as_raw_Mat(), mask0.as_raw_Mat()) }.into_result()
}
pub fn ensure_inclusion_constraint(m: &core::Mat, size: core::Size, trim_ratio: f32) -> Result<core::Mat> {
unsafe { sys::cv_videostab_cv_videostab_ensureInclusionConstraint_Mat_M_Size_size_float_trimRatio(m.as_raw_Mat(), size, trim_ratio) }.into_result().map(|x| core::Mat { ptr: x })
}
pub fn estimate_global_motion_least_squares(points0: &mut core::Mat, points1: &mut core::Mat, model: i32, rmse: &mut f32) -> Result<core::Mat> {
unsafe { sys::cv_videostab_cv_videostab_estimateGlobalMotionLeastSquares_Mat_points0_Mat_points1_int_model_float_X_rmse(points0.as_raw_Mat(), points1.as_raw_Mat(), model, rmse) }.into_result().map(|x| core::Mat { ptr: x })
}
pub fn estimate_optimal_trim_ratio(m: &core::Mat, size: core::Size) -> Result<f32> {
unsafe { sys::cv_videostab_cv_videostab_estimateOptimalTrimRatio_Mat_M_Size_size(m.as_raw_Mat(), size) }.into_result()
}
pub fn get_motion(from: i32, to: i32, motions: &types::VectorOfMat) -> Result<core::Mat> {
unsafe { sys::cv_videostab_cv_videostab_getMotion_int_from_int_to_VectorOfMat_motions(from, to, motions.as_raw_VectorOfMat()) }.into_result().map(|x| core::Mat { ptr: x })
}
#[allow(dead_code)]
pub struct ColorAverageInpainter {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::ColorAverageInpainter {
fn drop(&mut self) {
unsafe { sys::cv_delete_ColorAverageInpainter(self.ptr) };
}
}
impl crate::videostab::ColorAverageInpainter {
#[doc(hidden)] pub fn as_raw_ColorAverageInpainter(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::InpainterBase for ColorAverageInpainter {
#[doc(hidden)] fn as_raw_InpainterBase(&self) -> *mut c_void { self.ptr }
}
impl ColorAverageInpainter {
pub fn inpaint(&mut self, idx: i32, frame: &core::Mat, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_ColorAverageInpainter_inpaint_int_idx_Mat_frame_Mat_mask(self.as_raw_ColorAverageInpainter(), idx, frame.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
}
#[allow(dead_code)]
pub struct ColorInpainter {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::ColorInpainter {
fn drop(&mut self) {
unsafe { sys::cv_delete_ColorInpainter(self.ptr) };
}
}
impl crate::videostab::ColorInpainter {
#[doc(hidden)] pub fn as_raw_ColorInpainter(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::InpainterBase for ColorInpainter {
#[doc(hidden)] fn as_raw_InpainterBase(&self) -> *mut c_void { self.ptr }
}
impl ColorInpainter {
pub fn new(method: i32, radius: f64) -> Result<crate::videostab::ColorInpainter> {
unsafe { sys::cv_videostab_cv_videostab_ColorInpainter_ColorInpainter_int_method_double_radius(method, radius) }.into_result().map(|x| crate::videostab::ColorInpainter { ptr: x })
}
pub fn inpaint(&mut self, idx: i32, frame: &core::Mat, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_ColorInpainter_inpaint_int_idx_Mat_frame_Mat_mask(self.as_raw_ColorInpainter(), idx, frame.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
}
#[allow(dead_code)]
pub struct ConsistentMosaicInpainter {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::ConsistentMosaicInpainter {
fn drop(&mut self) {
unsafe { sys::cv_delete_ConsistentMosaicInpainter(self.ptr) };
}
}
impl crate::videostab::ConsistentMosaicInpainter {
#[doc(hidden)] pub fn as_raw_ConsistentMosaicInpainter(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::InpainterBase for ConsistentMosaicInpainter {
#[doc(hidden)] fn as_raw_InpainterBase(&self) -> *mut c_void { self.ptr }
}
impl ConsistentMosaicInpainter {
pub fn new() -> Result<crate::videostab::ConsistentMosaicInpainter> {
unsafe { sys::cv_videostab_cv_videostab_ConsistentMosaicInpainter_ConsistentMosaicInpainter() }.into_result().map(|x| crate::videostab::ConsistentMosaicInpainter { ptr: x })
}
pub fn set_stdev_thresh(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_ConsistentMosaicInpainter_setStdevThresh_float_val(self.as_raw_ConsistentMosaicInpainter(), val) }.into_result()
}
pub fn stdev_thresh(&self) -> Result<f32> {
unsafe { sys::cv_videostab_cv_videostab_ConsistentMosaicInpainter_stdevThresh_const(self.as_raw_ConsistentMosaicInpainter()) }.into_result()
}
pub fn inpaint(&mut self, idx: i32, frame: &core::Mat, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_ConsistentMosaicInpainter_inpaint_int_idx_Mat_frame_Mat_mask(self.as_raw_ConsistentMosaicInpainter(), idx, frame.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
}
pub trait DeblurerBase {
#[doc(hidden)] fn as_raw_DeblurerBase(&self) -> *mut c_void;
fn set_radius(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_DeblurerBase_setRadius_int_val(self.as_raw_DeblurerBase(), val) }.into_result()
}
fn radius(&self) -> Result<i32> {
unsafe { sys::cv_videostab_cv_videostab_DeblurerBase_radius_const(self.as_raw_DeblurerBase()) }.into_result()
}
fn deblur(&mut self, idx: i32, frame: &core::Mat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_DeblurerBase_deblur_int_idx_Mat_frame(self.as_raw_DeblurerBase(), idx, frame.as_raw_Mat()) }.into_result()
}
fn set_frames(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_DeblurerBase_setFrames_VectorOfMat_val(self.as_raw_DeblurerBase(), val.as_raw_VectorOfMat()) }.into_result()
}
fn frames(&self) -> Result<types::VectorOfMat> {
unsafe { sys::cv_videostab_cv_videostab_DeblurerBase_frames_const(self.as_raw_DeblurerBase()) }.into_result().map(|x| types::VectorOfMat { ptr: x })
}
fn set_motions(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_DeblurerBase_setMotions_VectorOfMat_val(self.as_raw_DeblurerBase(), val.as_raw_VectorOfMat()) }.into_result()
}
fn motions(&self) -> Result<types::VectorOfMat> {
unsafe { sys::cv_videostab_cv_videostab_DeblurerBase_motions_const(self.as_raw_DeblurerBase()) }.into_result().map(|x| types::VectorOfMat { ptr: x })
}
fn set_blurriness_rates(&mut self, val: &types::VectorOffloat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_DeblurerBase_setBlurrinessRates_VectorOffloat_val(self.as_raw_DeblurerBase(), val.as_raw_VectorOffloat()) }.into_result()
}
fn blurriness_rates(&self) -> Result<types::VectorOffloat> {
unsafe { sys::cv_videostab_cv_videostab_DeblurerBase_blurrinessRates_const(self.as_raw_DeblurerBase()) }.into_result().map(|x| types::VectorOffloat { ptr: x })
}
}
impl<'a> DeblurerBase + 'a {
}
#[allow(dead_code)]
pub struct FastMarchingMethod {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::FastMarchingMethod {
fn drop(&mut self) {
unsafe { sys::cv_delete_FastMarchingMethod(self.ptr) };
}
}
impl crate::videostab::FastMarchingMethod {
#[doc(hidden)] pub fn as_raw_FastMarchingMethod(&self) -> *mut c_void { self.ptr }
}
impl FastMarchingMethod {
pub fn distance_map(&self) -> Result<core::Mat> {
unsafe { sys::cv_videostab_cv_videostab_FastMarchingMethod_distanceMap_const(self.as_raw_FastMarchingMethod()) }.into_result().map(|x| core::Mat { ptr: x })
}
}
#[allow(dead_code)]
pub struct FromFileMotionReader {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::FromFileMotionReader {
fn drop(&mut self) {
unsafe { sys::cv_delete_FromFileMotionReader(self.ptr) };
}
}
impl crate::videostab::FromFileMotionReader {
#[doc(hidden)] pub fn as_raw_FromFileMotionReader(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::ImageMotionEstimatorBase for FromFileMotionReader {
#[doc(hidden)] fn as_raw_ImageMotionEstimatorBase(&self) -> *mut c_void { self.ptr }
}
impl FromFileMotionReader {
pub fn new(path: &str) -> Result<crate::videostab::FromFileMotionReader> {
string_arg!(path);
unsafe { sys::cv_videostab_cv_videostab_FromFileMotionReader_FromFileMotionReader_String_path(path.as_ptr()) }.into_result().map(|x| crate::videostab::FromFileMotionReader { ptr: x })
}
pub fn estimate(&mut self, frame0: &core::Mat, frame1: &core::Mat, ok: &mut bool) -> Result<core::Mat> {
unsafe { sys::cv_videostab_cv_videostab_FromFileMotionReader_estimate_Mat_frame0_Mat_frame1_bool_X_ok(self.as_raw_FromFileMotionReader(), frame0.as_raw_Mat(), frame1.as_raw_Mat(), ok) }.into_result().map(|x| core::Mat { ptr: x })
}
}
#[allow(dead_code)]
pub struct GaussianMotionFilter {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::GaussianMotionFilter {
fn drop(&mut self) {
unsafe { sys::cv_delete_GaussianMotionFilter(self.ptr) };
}
}
impl crate::videostab::GaussianMotionFilter {
#[doc(hidden)] pub fn as_raw_GaussianMotionFilter(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::IMotionStabilizer for GaussianMotionFilter {
#[doc(hidden)] fn as_raw_IMotionStabilizer(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::MotionFilterBase for GaussianMotionFilter {
#[doc(hidden)] fn as_raw_MotionFilterBase(&self) -> *mut c_void { self.ptr }
}
impl GaussianMotionFilter {
pub fn new(radius: i32, stdev: f32) -> Result<crate::videostab::GaussianMotionFilter> {
unsafe { sys::cv_videostab_cv_videostab_GaussianMotionFilter_GaussianMotionFilter_int_radius_float_stdev(radius, stdev) }.into_result().map(|x| crate::videostab::GaussianMotionFilter { ptr: x })
}
pub fn set_params(&mut self, radius: i32, stdev: f32) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_GaussianMotionFilter_setParams_int_radius_float_stdev(self.as_raw_GaussianMotionFilter(), radius, stdev) }.into_result()
}
pub fn radius(&self) -> Result<i32> {
unsafe { sys::cv_videostab_cv_videostab_GaussianMotionFilter_radius_const(self.as_raw_GaussianMotionFilter()) }.into_result()
}
pub fn stdev(&self) -> Result<f32> {
unsafe { sys::cv_videostab_cv_videostab_GaussianMotionFilter_stdev_const(self.as_raw_GaussianMotionFilter()) }.into_result()
}
pub fn new_1(_radius: i32, _stdev: f32) -> Result<crate::videostab::GaussianMotionFilter> {
unsafe { sys::cv_videostab_cv_videostab_GaussianMotionFilter_GaussianMotionFilter_int__radius_float__stdev(_radius, _stdev) }.into_result().map(|x| crate::videostab::GaussianMotionFilter { ptr: x })
}
}
pub trait IDenseOptFlowEstimator {
#[doc(hidden)] fn as_raw_IDenseOptFlowEstimator(&self) -> *mut c_void;
fn run(&mut self, frame0: &core::Mat, frame1: &core::Mat, flow_x: &mut core::Mat, flow_y: &mut core::Mat, errors: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_IDenseOptFlowEstimator_run_Mat_frame0_Mat_frame1_Mat_flowX_Mat_flowY_Mat_errors(self.as_raw_IDenseOptFlowEstimator(), frame0.as_raw_Mat(), frame1.as_raw_Mat(), flow_x.as_raw_Mat(), flow_y.as_raw_Mat(), errors.as_raw_Mat()) }.into_result()
}
}
impl<'a> IDenseOptFlowEstimator + 'a {
}
pub trait IFrameSource {
#[doc(hidden)] fn as_raw_IFrameSource(&self) -> *mut c_void;
fn reset(&mut self) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_IFrameSource_reset(self.as_raw_IFrameSource()) }.into_result()
}
fn next_frame(&mut self) -> Result<core::Mat> {
unsafe { sys::cv_videostab_cv_videostab_IFrameSource_nextFrame(self.as_raw_IFrameSource()) }.into_result().map(|x| core::Mat { ptr: x })
}
}
impl<'a> IFrameSource + 'a {
}
pub trait ILog {
#[doc(hidden)] fn as_raw_ILog(&self) -> *mut c_void;
}
impl<'a> ILog + 'a {
}
pub trait IMotionStabilizer {
#[doc(hidden)] fn as_raw_IMotionStabilizer(&self) -> *mut c_void;
}
impl<'a> IMotionStabilizer + 'a {
}
pub trait IOutlierRejector {
#[doc(hidden)] fn as_raw_IOutlierRejector(&self) -> *mut c_void;
fn process(&mut self, frame_size: core::Size, points0: &core::Mat, points1: &core::Mat, mask: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_IOutlierRejector_process_Size_frameSize_Mat_points0_Mat_points1_Mat_mask(self.as_raw_IOutlierRejector(), frame_size, points0.as_raw_Mat(), points1.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
}
impl<'a> IOutlierRejector + 'a {
}
pub trait ISparseOptFlowEstimator {
#[doc(hidden)] fn as_raw_ISparseOptFlowEstimator(&self) -> *mut c_void;
fn run(&mut self, frame0: &core::Mat, frame1: &core::Mat, points0: &core::Mat, points1: &mut core::Mat, status: &mut core::Mat, errors: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_ISparseOptFlowEstimator_run_Mat_frame0_Mat_frame1_Mat_points0_Mat_points1_Mat_status_Mat_errors(self.as_raw_ISparseOptFlowEstimator(), frame0.as_raw_Mat(), frame1.as_raw_Mat(), points0.as_raw_Mat(), points1.as_raw_Mat(), status.as_raw_Mat(), errors.as_raw_Mat()) }.into_result()
}
}
impl<'a> ISparseOptFlowEstimator + 'a {
}
pub trait ImageMotionEstimatorBase {
#[doc(hidden)] fn as_raw_ImageMotionEstimatorBase(&self) -> *mut c_void;
fn estimate(&mut self, frame0: &core::Mat, frame1: &core::Mat, ok: &mut bool) -> Result<core::Mat> {
unsafe { sys::cv_videostab_cv_videostab_ImageMotionEstimatorBase_estimate_Mat_frame0_Mat_frame1_bool_X_ok(self.as_raw_ImageMotionEstimatorBase(), frame0.as_raw_Mat(), frame1.as_raw_Mat(), ok) }.into_result().map(|x| core::Mat { ptr: x })
}
}
impl<'a> ImageMotionEstimatorBase + 'a {
}
pub trait InpainterBase {
#[doc(hidden)] fn as_raw_InpainterBase(&self) -> *mut c_void;
fn set_radius(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_InpainterBase_setRadius_int_val(self.as_raw_InpainterBase(), val) }.into_result()
}
fn radius(&self) -> Result<i32> {
unsafe { sys::cv_videostab_cv_videostab_InpainterBase_radius_const(self.as_raw_InpainterBase()) }.into_result()
}
fn inpaint(&mut self, idx: i32, frame: &core::Mat, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_InpainterBase_inpaint_int_idx_Mat_frame_Mat_mask(self.as_raw_InpainterBase(), idx, frame.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
fn set_frames(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_InpainterBase_setFrames_VectorOfMat_val(self.as_raw_InpainterBase(), val.as_raw_VectorOfMat()) }.into_result()
}
fn frames(&self) -> Result<types::VectorOfMat> {
unsafe { sys::cv_videostab_cv_videostab_InpainterBase_frames_const(self.as_raw_InpainterBase()) }.into_result().map(|x| types::VectorOfMat { ptr: x })
}
fn set_motions(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_InpainterBase_setMotions_VectorOfMat_val(self.as_raw_InpainterBase(), val.as_raw_VectorOfMat()) }.into_result()
}
fn motions(&self) -> Result<types::VectorOfMat> {
unsafe { sys::cv_videostab_cv_videostab_InpainterBase_motions_const(self.as_raw_InpainterBase()) }.into_result().map(|x| types::VectorOfMat { ptr: x })
}
fn set_stabilized_frames(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_InpainterBase_setStabilizedFrames_VectorOfMat_val(self.as_raw_InpainterBase(), val.as_raw_VectorOfMat()) }.into_result()
}
fn stabilized_frames(&self) -> Result<types::VectorOfMat> {
unsafe { sys::cv_videostab_cv_videostab_InpainterBase_stabilizedFrames_const(self.as_raw_InpainterBase()) }.into_result().map(|x| types::VectorOfMat { ptr: x })
}
fn set_stabilization_motions(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_InpainterBase_setStabilizationMotions_VectorOfMat_val(self.as_raw_InpainterBase(), val.as_raw_VectorOfMat()) }.into_result()
}
fn stabilization_motions(&self) -> Result<types::VectorOfMat> {
unsafe { sys::cv_videostab_cv_videostab_InpainterBase_stabilizationMotions_const(self.as_raw_InpainterBase()) }.into_result().map(|x| types::VectorOfMat { ptr: x })
}
}
impl<'a> InpainterBase + 'a {
}
#[allow(dead_code)]
pub struct InpaintingPipeline {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::InpaintingPipeline {
fn drop(&mut self) {
unsafe { sys::cv_delete_InpaintingPipeline(self.ptr) };
}
}
impl crate::videostab::InpaintingPipeline {
#[doc(hidden)] pub fn as_raw_InpaintingPipeline(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::InpainterBase for InpaintingPipeline {
#[doc(hidden)] fn as_raw_InpainterBase(&self) -> *mut c_void { self.ptr }
}
impl InpaintingPipeline {
pub fn push_back(&mut self, inpainter: &types::PtrOfInpainterBase) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_InpaintingPipeline_pushBack_PtrOfInpainterBase_inpainter(self.as_raw_InpaintingPipeline(), inpainter.as_raw_PtrOfInpainterBase()) }.into_result()
}
pub fn empty(&self) -> Result<bool> {
unsafe { sys::cv_videostab_cv_videostab_InpaintingPipeline_empty_const(self.as_raw_InpaintingPipeline()) }.into_result()
}
pub fn set_radius(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_InpaintingPipeline_setRadius_int_val(self.as_raw_InpaintingPipeline(), val) }.into_result()
}
pub fn set_frames(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_InpaintingPipeline_setFrames_VectorOfMat_val(self.as_raw_InpaintingPipeline(), val.as_raw_VectorOfMat()) }.into_result()
}
pub fn set_motions(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_InpaintingPipeline_setMotions_VectorOfMat_val(self.as_raw_InpaintingPipeline(), val.as_raw_VectorOfMat()) }.into_result()
}
pub fn set_stabilized_frames(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_InpaintingPipeline_setStabilizedFrames_VectorOfMat_val(self.as_raw_InpaintingPipeline(), val.as_raw_VectorOfMat()) }.into_result()
}
pub fn set_stabilization_motions(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_InpaintingPipeline_setStabilizationMotions_VectorOfMat_val(self.as_raw_InpaintingPipeline(), val.as_raw_VectorOfMat()) }.into_result()
}
pub fn inpaint(&mut self, idx: i32, frame: &core::Mat, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_InpaintingPipeline_inpaint_int_idx_Mat_frame_Mat_mask(self.as_raw_InpaintingPipeline(), idx, frame.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
}
#[allow(dead_code)]
pub struct KeypointBasedMotionEstimator {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::KeypointBasedMotionEstimator {
fn drop(&mut self) {
unsafe { sys::cv_delete_KeypointBasedMotionEstimator(self.ptr) };
}
}
impl crate::videostab::KeypointBasedMotionEstimator {
#[doc(hidden)] pub fn as_raw_KeypointBasedMotionEstimator(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::ImageMotionEstimatorBase for KeypointBasedMotionEstimator {
#[doc(hidden)] fn as_raw_ImageMotionEstimatorBase(&self) -> *mut c_void { self.ptr }
}
impl KeypointBasedMotionEstimator {
pub fn new(estimator: &types::PtrOfMotionEstimatorBase) -> Result<crate::videostab::KeypointBasedMotionEstimator> {
unsafe { sys::cv_videostab_cv_videostab_KeypointBasedMotionEstimator_KeypointBasedMotionEstimator_PtrOfMotionEstimatorBase_estimator(estimator.as_raw_PtrOfMotionEstimatorBase()) }.into_result().map(|x| crate::videostab::KeypointBasedMotionEstimator { ptr: x })
}
pub fn estimate(&mut self, frame0: &core::Mat, frame1: &core::Mat, ok: &mut bool) -> Result<core::Mat> {
unsafe { sys::cv_videostab_cv_videostab_KeypointBasedMotionEstimator_estimate_Mat_frame0_Mat_frame1_bool_X_ok(self.as_raw_KeypointBasedMotionEstimator(), frame0.as_raw_Mat(), frame1.as_raw_Mat(), ok) }.into_result().map(|x| core::Mat { ptr: x })
}
}
#[allow(dead_code)]
pub struct LogToStdout {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::LogToStdout {
fn drop(&mut self) {
unsafe { sys::cv_delete_LogToStdout(self.ptr) };
}
}
impl crate::videostab::LogToStdout {
#[doc(hidden)] pub fn as_raw_LogToStdout(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::ILog for LogToStdout {
#[doc(hidden)] fn as_raw_ILog(&self) -> *mut c_void { self.ptr }
}
impl LogToStdout {
}
#[allow(dead_code)]
pub struct LpMotionStabilizer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::LpMotionStabilizer {
fn drop(&mut self) {
unsafe { sys::cv_delete_LpMotionStabilizer(self.ptr) };
}
}
impl crate::videostab::LpMotionStabilizer {
#[doc(hidden)] pub fn as_raw_LpMotionStabilizer(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::IMotionStabilizer for LpMotionStabilizer {
#[doc(hidden)] fn as_raw_IMotionStabilizer(&self) -> *mut c_void { self.ptr }
}
impl LpMotionStabilizer {
pub fn set_frame_size(&mut self, val: core::Size) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_LpMotionStabilizer_setFrameSize_Size_val(self.as_raw_LpMotionStabilizer(), val) }.into_result()
}
pub fn frame_size(&self) -> Result<core::Size> {
unsafe { sys::cv_videostab_cv_videostab_LpMotionStabilizer_frameSize_const(self.as_raw_LpMotionStabilizer()) }.into_result()
}
pub fn set_trim_ratio(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_LpMotionStabilizer_setTrimRatio_float_val(self.as_raw_LpMotionStabilizer(), val) }.into_result()
}
pub fn trim_ratio(&self) -> Result<f32> {
unsafe { sys::cv_videostab_cv_videostab_LpMotionStabilizer_trimRatio_const(self.as_raw_LpMotionStabilizer()) }.into_result()
}
pub fn set_weight1(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_LpMotionStabilizer_setWeight1_float_val(self.as_raw_LpMotionStabilizer(), val) }.into_result()
}
pub fn weight1(&self) -> Result<f32> {
unsafe { sys::cv_videostab_cv_videostab_LpMotionStabilizer_weight1_const(self.as_raw_LpMotionStabilizer()) }.into_result()
}
pub fn set_weight2(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_LpMotionStabilizer_setWeight2_float_val(self.as_raw_LpMotionStabilizer(), val) }.into_result()
}
pub fn weight2(&self) -> Result<f32> {
unsafe { sys::cv_videostab_cv_videostab_LpMotionStabilizer_weight2_const(self.as_raw_LpMotionStabilizer()) }.into_result()
}
pub fn set_weight3(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_LpMotionStabilizer_setWeight3_float_val(self.as_raw_LpMotionStabilizer(), val) }.into_result()
}
pub fn weight3(&self) -> Result<f32> {
unsafe { sys::cv_videostab_cv_videostab_LpMotionStabilizer_weight3_const(self.as_raw_LpMotionStabilizer()) }.into_result()
}
pub fn set_weight4(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_LpMotionStabilizer_setWeight4_float_val(self.as_raw_LpMotionStabilizer(), val) }.into_result()
}
pub fn weight4(&self) -> Result<f32> {
unsafe { sys::cv_videostab_cv_videostab_LpMotionStabilizer_weight4_const(self.as_raw_LpMotionStabilizer()) }.into_result()
}
}
#[allow(dead_code)]
pub struct MoreAccurateMotionWobbleSuppressor {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::MoreAccurateMotionWobbleSuppressor {
fn drop(&mut self) {
unsafe { sys::cv_delete_MoreAccurateMotionWobbleSuppressor(self.ptr) };
}
}
impl crate::videostab::MoreAccurateMotionWobbleSuppressor {
#[doc(hidden)] pub fn as_raw_MoreAccurateMotionWobbleSuppressor(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::WobbleSuppressorBase for MoreAccurateMotionWobbleSuppressor {
#[doc(hidden)] fn as_raw_WobbleSuppressorBase(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::MoreAccurateMotionWobbleSuppressorBase for MoreAccurateMotionWobbleSuppressor {
#[doc(hidden)] fn as_raw_MoreAccurateMotionWobbleSuppressorBase(&self) -> *mut c_void { self.ptr }
}
impl MoreAccurateMotionWobbleSuppressor {
pub fn suppress(&mut self, idx: i32, frame: &core::Mat, result: &core::Mat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_MoreAccurateMotionWobbleSuppressor_suppress_int_idx_Mat_frame_Mat_result(self.as_raw_MoreAccurateMotionWobbleSuppressor(), idx, frame.as_raw_Mat(), result.as_raw_Mat()) }.into_result()
}
}
pub trait MoreAccurateMotionWobbleSuppressorBase : crate::videostab::WobbleSuppressorBase {
#[doc(hidden)] fn as_raw_MoreAccurateMotionWobbleSuppressorBase(&self) -> *mut c_void;
fn set_period(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_MoreAccurateMotionWobbleSuppressorBase_setPeriod_int_val(self.as_raw_MoreAccurateMotionWobbleSuppressorBase(), val) }.into_result()
}
fn period(&self) -> Result<i32> {
unsafe { sys::cv_videostab_cv_videostab_MoreAccurateMotionWobbleSuppressorBase_period_const(self.as_raw_MoreAccurateMotionWobbleSuppressorBase()) }.into_result()
}
}
impl<'a> MoreAccurateMotionWobbleSuppressorBase + 'a {
}
pub trait MotionEstimatorBase {
#[doc(hidden)] fn as_raw_MotionEstimatorBase(&self) -> *mut c_void;
fn estimate(&mut self, points0: &core::Mat, points1: &core::Mat, ok: &mut bool) -> Result<core::Mat> {
unsafe { sys::cv_videostab_cv_videostab_MotionEstimatorBase_estimate_Mat_points0_Mat_points1_bool_X_ok(self.as_raw_MotionEstimatorBase(), points0.as_raw_Mat(), points1.as_raw_Mat(), ok) }.into_result().map(|x| core::Mat { ptr: x })
}
}
impl<'a> MotionEstimatorBase + 'a {
}
#[allow(dead_code)]
pub struct MotionEstimatorL1 {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::MotionEstimatorL1 {
fn drop(&mut self) {
unsafe { sys::cv_delete_MotionEstimatorL1(self.ptr) };
}
}
impl crate::videostab::MotionEstimatorL1 {
#[doc(hidden)] pub fn as_raw_MotionEstimatorL1(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::MotionEstimatorBase for MotionEstimatorL1 {
#[doc(hidden)] fn as_raw_MotionEstimatorBase(&self) -> *mut c_void { self.ptr }
}
impl MotionEstimatorL1 {
pub fn estimate(&mut self, points0: &core::Mat, points1: &core::Mat, ok: &mut bool) -> Result<core::Mat> {
unsafe { sys::cv_videostab_cv_videostab_MotionEstimatorL1_estimate_Mat_points0_Mat_points1_bool_X_ok(self.as_raw_MotionEstimatorL1(), points0.as_raw_Mat(), points1.as_raw_Mat(), ok) }.into_result().map(|x| core::Mat { ptr: x })
}
}
#[allow(dead_code)]
pub struct MotionEstimatorRansacL2 {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::MotionEstimatorRansacL2 {
fn drop(&mut self) {
unsafe { sys::cv_delete_MotionEstimatorRansacL2(self.ptr) };
}
}
impl crate::videostab::MotionEstimatorRansacL2 {
#[doc(hidden)] pub fn as_raw_MotionEstimatorRansacL2(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::MotionEstimatorBase for MotionEstimatorRansacL2 {
#[doc(hidden)] fn as_raw_MotionEstimatorBase(&self) -> *mut c_void { self.ptr }
}
impl MotionEstimatorRansacL2 {
pub fn set_min_inlier_ratio(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_MotionEstimatorRansacL2_setMinInlierRatio_float_val(self.as_raw_MotionEstimatorRansacL2(), val) }.into_result()
}
pub fn min_inlier_ratio(&self) -> Result<f32> {
unsafe { sys::cv_videostab_cv_videostab_MotionEstimatorRansacL2_minInlierRatio_const(self.as_raw_MotionEstimatorRansacL2()) }.into_result()
}
pub fn estimate(&mut self, points0: &core::Mat, points1: &core::Mat, ok: &mut bool) -> Result<core::Mat> {
unsafe { sys::cv_videostab_cv_videostab_MotionEstimatorRansacL2_estimate_Mat_points0_Mat_points1_bool_X_ok(self.as_raw_MotionEstimatorRansacL2(), points0.as_raw_Mat(), points1.as_raw_Mat(), ok) }.into_result().map(|x| core::Mat { ptr: x })
}
}
pub trait MotionFilterBase : crate::videostab::IMotionStabilizer {
#[doc(hidden)] fn as_raw_MotionFilterBase(&self) -> *mut c_void;
}
impl<'a> MotionFilterBase + 'a {
}
#[allow(dead_code)]
pub struct MotionInpainter {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::MotionInpainter {
fn drop(&mut self) {
unsafe { sys::cv_delete_MotionInpainter(self.ptr) };
}
}
impl crate::videostab::MotionInpainter {
#[doc(hidden)] pub fn as_raw_MotionInpainter(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::InpainterBase for MotionInpainter {
#[doc(hidden)] fn as_raw_InpainterBase(&self) -> *mut c_void { self.ptr }
}
impl MotionInpainter {
pub fn new() -> Result<crate::videostab::MotionInpainter> {
unsafe { sys::cv_videostab_cv_videostab_MotionInpainter_MotionInpainter() }.into_result().map(|x| crate::videostab::MotionInpainter { ptr: x })
}
pub fn set_flow_error_threshold(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_MotionInpainter_setFlowErrorThreshold_float_val(self.as_raw_MotionInpainter(), val) }.into_result()
}
pub fn flow_error_threshold(&self) -> Result<f32> {
unsafe { sys::cv_videostab_cv_videostab_MotionInpainter_flowErrorThreshold_const(self.as_raw_MotionInpainter()) }.into_result()
}
pub fn set_dist_threshold(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_MotionInpainter_setDistThreshold_float_val(self.as_raw_MotionInpainter(), val) }.into_result()
}
pub fn dist_thresh(&self) -> Result<f32> {
unsafe { sys::cv_videostab_cv_videostab_MotionInpainter_distThresh_const(self.as_raw_MotionInpainter()) }.into_result()
}
pub fn set_border_mode(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_MotionInpainter_setBorderMode_int_val(self.as_raw_MotionInpainter(), val) }.into_result()
}
pub fn border_mode(&self) -> Result<i32> {
unsafe { sys::cv_videostab_cv_videostab_MotionInpainter_borderMode_const(self.as_raw_MotionInpainter()) }.into_result()
}
pub fn inpaint(&mut self, idx: i32, frame: &core::Mat, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_MotionInpainter_inpaint_int_idx_Mat_frame_Mat_mask(self.as_raw_MotionInpainter(), idx, frame.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
}
#[allow(dead_code)]
pub struct MotionStabilizationPipeline {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::MotionStabilizationPipeline {
fn drop(&mut self) {
unsafe { sys::cv_delete_MotionStabilizationPipeline(self.ptr) };
}
}
impl crate::videostab::MotionStabilizationPipeline {
#[doc(hidden)] pub fn as_raw_MotionStabilizationPipeline(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::IMotionStabilizer for MotionStabilizationPipeline {
#[doc(hidden)] fn as_raw_IMotionStabilizer(&self) -> *mut c_void { self.ptr }
}
impl MotionStabilizationPipeline {
pub fn push_back(&mut self, stabilizer: &types::PtrOfIMotionStabilizer) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_MotionStabilizationPipeline_pushBack_PtrOfIMotionStabilizer_stabilizer(self.as_raw_MotionStabilizationPipeline(), stabilizer.as_raw_PtrOfIMotionStabilizer()) }.into_result()
}
pub fn empty(&self) -> Result<bool> {
unsafe { sys::cv_videostab_cv_videostab_MotionStabilizationPipeline_empty_const(self.as_raw_MotionStabilizationPipeline()) }.into_result()
}
}
#[allow(dead_code)]
pub struct NullDeblurer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::NullDeblurer {
fn drop(&mut self) {
unsafe { sys::cv_delete_NullDeblurer(self.ptr) };
}
}
impl crate::videostab::NullDeblurer {
#[doc(hidden)] pub fn as_raw_NullDeblurer(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::DeblurerBase for NullDeblurer {
#[doc(hidden)] fn as_raw_DeblurerBase(&self) -> *mut c_void { self.ptr }
}
impl NullDeblurer {
pub fn deblur(&mut self, unnamed_arg: i32, unnamed_arg_1: &core::Mat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_NullDeblurer_deblur_int_unnamed_arg_Mat_unnamed_arg_1(self.as_raw_NullDeblurer(), unnamed_arg, unnamed_arg_1.as_raw_Mat()) }.into_result()
}
}
#[allow(dead_code)]
pub struct NullFrameSource {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::NullFrameSource {
fn drop(&mut self) {
unsafe { sys::cv_delete_NullFrameSource(self.ptr) };
}
}
impl crate::videostab::NullFrameSource {
#[doc(hidden)] pub fn as_raw_NullFrameSource(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::IFrameSource for NullFrameSource {
#[doc(hidden)] fn as_raw_IFrameSource(&self) -> *mut c_void { self.ptr }
}
impl NullFrameSource {
pub fn reset(&mut self) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_NullFrameSource_reset(self.as_raw_NullFrameSource()) }.into_result()
}
pub fn next_frame(&mut self) -> Result<core::Mat> {
unsafe { sys::cv_videostab_cv_videostab_NullFrameSource_nextFrame(self.as_raw_NullFrameSource()) }.into_result().map(|x| core::Mat { ptr: x })
}
}
#[allow(dead_code)]
pub struct NullInpainter {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::NullInpainter {
fn drop(&mut self) {
unsafe { sys::cv_delete_NullInpainter(self.ptr) };
}
}
impl crate::videostab::NullInpainter {
#[doc(hidden)] pub fn as_raw_NullInpainter(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::InpainterBase for NullInpainter {
#[doc(hidden)] fn as_raw_InpainterBase(&self) -> *mut c_void { self.ptr }
}
impl NullInpainter {
pub fn inpaint(&mut self, unnamed_arg: i32, unnamed_arg_1: &core::Mat, unnamed_arg_2: &core::Mat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_NullInpainter_inpaint_int_unnamed_arg_Mat_unnamed_arg_1_Mat_unnamed_arg_2(self.as_raw_NullInpainter(), unnamed_arg, unnamed_arg_1.as_raw_Mat(), unnamed_arg_2.as_raw_Mat()) }.into_result()
}
}
#[allow(dead_code)]
pub struct NullLog {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::NullLog {
fn drop(&mut self) {
unsafe { sys::cv_delete_NullLog(self.ptr) };
}
}
impl crate::videostab::NullLog {
#[doc(hidden)] pub fn as_raw_NullLog(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::ILog for NullLog {
#[doc(hidden)] fn as_raw_ILog(&self) -> *mut c_void { self.ptr }
}
impl NullLog {
}
#[allow(dead_code)]
pub struct NullOutlierRejector {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::NullOutlierRejector {
fn drop(&mut self) {
unsafe { sys::cv_delete_NullOutlierRejector(self.ptr) };
}
}
impl crate::videostab::NullOutlierRejector {
#[doc(hidden)] pub fn as_raw_NullOutlierRejector(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::IOutlierRejector for NullOutlierRejector {
#[doc(hidden)] fn as_raw_IOutlierRejector(&self) -> *mut c_void { self.ptr }
}
impl NullOutlierRejector {
pub fn process(&mut self, frame_size: core::Size, points0: &core::Mat, points1: &core::Mat, mask: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_NullOutlierRejector_process_Size_frameSize_Mat_points0_Mat_points1_Mat_mask(self.as_raw_NullOutlierRejector(), frame_size, points0.as_raw_Mat(), points1.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
}
#[allow(dead_code)]
pub struct NullWobbleSuppressor {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::NullWobbleSuppressor {
fn drop(&mut self) {
unsafe { sys::cv_delete_NullWobbleSuppressor(self.ptr) };
}
}
impl crate::videostab::NullWobbleSuppressor {
#[doc(hidden)] pub fn as_raw_NullWobbleSuppressor(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::WobbleSuppressorBase for NullWobbleSuppressor {
#[doc(hidden)] fn as_raw_WobbleSuppressorBase(&self) -> *mut c_void { self.ptr }
}
impl NullWobbleSuppressor {
pub fn suppress(&mut self, idx: i32, frame: &core::Mat, result: &core::Mat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_NullWobbleSuppressor_suppress_int_idx_Mat_frame_Mat_result(self.as_raw_NullWobbleSuppressor(), idx, frame.as_raw_Mat(), result.as_raw_Mat()) }.into_result()
}
}
#[allow(dead_code)]
pub struct OnePassStabilizer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::OnePassStabilizer {
fn drop(&mut self) {
unsafe { sys::cv_delete_OnePassStabilizer(self.ptr) };
}
}
impl crate::videostab::OnePassStabilizer {
#[doc(hidden)] pub fn as_raw_OnePassStabilizer(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::IFrameSource for OnePassStabilizer {
#[doc(hidden)] fn as_raw_IFrameSource(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::StabilizerBase for OnePassStabilizer {
#[doc(hidden)] fn as_raw_StabilizerBase(&self) -> *mut c_void { self.ptr }
}
impl OnePassStabilizer {
pub fn new() -> Result<crate::videostab::OnePassStabilizer> {
unsafe { sys::cv_videostab_cv_videostab_OnePassStabilizer_OnePassStabilizer() }.into_result().map(|x| crate::videostab::OnePassStabilizer { ptr: x })
}
pub fn set_motion_filter(&mut self, val: &types::PtrOfMotionFilterBase) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_OnePassStabilizer_setMotionFilter_PtrOfMotionFilterBase_val(self.as_raw_OnePassStabilizer(), val.as_raw_PtrOfMotionFilterBase()) }.into_result()
}
pub fn motion_filter(&self) -> Result<types::PtrOfMotionFilterBase> {
unsafe { sys::cv_videostab_cv_videostab_OnePassStabilizer_motionFilter_const(self.as_raw_OnePassStabilizer()) }.into_result().map(|x| types::PtrOfMotionFilterBase { ptr: x })
}
pub fn reset(&mut self) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_OnePassStabilizer_reset(self.as_raw_OnePassStabilizer()) }.into_result()
}
pub fn next_frame(&mut self) -> Result<core::Mat> {
unsafe { sys::cv_videostab_cv_videostab_OnePassStabilizer_nextFrame(self.as_raw_OnePassStabilizer()) }.into_result().map(|x| core::Mat { ptr: x })
}
}
pub trait PyrLkOptFlowEstimatorBase {
#[doc(hidden)] fn as_raw_PyrLkOptFlowEstimatorBase(&self) -> *mut c_void;
fn set_win_size(&mut self, val: core::Size) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_PyrLkOptFlowEstimatorBase_setWinSize_Size_val(self.as_raw_PyrLkOptFlowEstimatorBase(), val) }.into_result()
}
fn win_size(&self) -> Result<core::Size> {
unsafe { sys::cv_videostab_cv_videostab_PyrLkOptFlowEstimatorBase_winSize_const(self.as_raw_PyrLkOptFlowEstimatorBase()) }.into_result()
}
fn set_max_level(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_PyrLkOptFlowEstimatorBase_setMaxLevel_int_val(self.as_raw_PyrLkOptFlowEstimatorBase(), val) }.into_result()
}
fn max_level(&self) -> Result<i32> {
unsafe { sys::cv_videostab_cv_videostab_PyrLkOptFlowEstimatorBase_maxLevel_const(self.as_raw_PyrLkOptFlowEstimatorBase()) }.into_result()
}
}
impl<'a> PyrLkOptFlowEstimatorBase + 'a {
}
#[allow(dead_code)]
pub struct RansacParams {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::RansacParams {
fn drop(&mut self) {
unsafe { sys::cv_delete_RansacParams(self.ptr) };
}
}
impl crate::videostab::RansacParams {
#[doc(hidden)] pub fn as_raw_RansacParams(&self) -> *mut c_void { self.ptr }
}
impl RansacParams {
pub fn niters(&self) -> Result<i32> {
unsafe { sys::cv_videostab_cv_videostab_RansacParams_niters_const(self.as_raw_RansacParams()) }.into_result()
}
}
#[allow(dead_code)]
pub struct SparsePyrLkOptFlowEstimator {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::SparsePyrLkOptFlowEstimator {
fn drop(&mut self) {
unsafe { sys::cv_delete_SparsePyrLkOptFlowEstimator(self.ptr) };
}
}
impl crate::videostab::SparsePyrLkOptFlowEstimator {
#[doc(hidden)] pub fn as_raw_SparsePyrLkOptFlowEstimator(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::ISparseOptFlowEstimator for SparsePyrLkOptFlowEstimator {
#[doc(hidden)] fn as_raw_ISparseOptFlowEstimator(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::PyrLkOptFlowEstimatorBase for SparsePyrLkOptFlowEstimator {
#[doc(hidden)] fn as_raw_PyrLkOptFlowEstimatorBase(&self) -> *mut c_void { self.ptr }
}
impl SparsePyrLkOptFlowEstimator {
pub fn run(&mut self, frame0: &core::Mat, frame1: &core::Mat, points0: &core::Mat, points1: &mut core::Mat, status: &mut core::Mat, errors: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_SparsePyrLkOptFlowEstimator_run_Mat_frame0_Mat_frame1_Mat_points0_Mat_points1_Mat_status_Mat_errors(self.as_raw_SparsePyrLkOptFlowEstimator(), frame0.as_raw_Mat(), frame1.as_raw_Mat(), points0.as_raw_Mat(), points1.as_raw_Mat(), status.as_raw_Mat(), errors.as_raw_Mat()) }.into_result()
}
}
pub trait StabilizerBase {
#[doc(hidden)] fn as_raw_StabilizerBase(&self) -> *mut c_void;
fn set_log(&mut self, ilog: &types::PtrOfILog) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_StabilizerBase_setLog_PtrOfILog_ilog(self.as_raw_StabilizerBase(), ilog.as_raw_PtrOfILog()) }.into_result()
}
fn log(&self) -> Result<types::PtrOfILog> {
unsafe { sys::cv_videostab_cv_videostab_StabilizerBase_log_const(self.as_raw_StabilizerBase()) }.into_result().map(|x| types::PtrOfILog { ptr: x })
}
fn set_radius(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_StabilizerBase_setRadius_int_val(self.as_raw_StabilizerBase(), val) }.into_result()
}
fn radius(&self) -> Result<i32> {
unsafe { sys::cv_videostab_cv_videostab_StabilizerBase_radius_const(self.as_raw_StabilizerBase()) }.into_result()
}
fn set_frame_source(&mut self, val: &types::PtrOfIFrameSource) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_StabilizerBase_setFrameSource_PtrOfIFrameSource_val(self.as_raw_StabilizerBase(), val.as_raw_PtrOfIFrameSource()) }.into_result()
}
fn frame_source(&self) -> Result<types::PtrOfIFrameSource> {
unsafe { sys::cv_videostab_cv_videostab_StabilizerBase_frameSource_const(self.as_raw_StabilizerBase()) }.into_result().map(|x| types::PtrOfIFrameSource { ptr: x })
}
fn set_motion_estimator(&mut self, val: &types::PtrOfImageMotionEstimatorBase) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_StabilizerBase_setMotionEstimator_PtrOfImageMotionEstimatorBase_val(self.as_raw_StabilizerBase(), val.as_raw_PtrOfImageMotionEstimatorBase()) }.into_result()
}
fn motion_estimator(&self) -> Result<types::PtrOfImageMotionEstimatorBase> {
unsafe { sys::cv_videostab_cv_videostab_StabilizerBase_motionEstimator_const(self.as_raw_StabilizerBase()) }.into_result().map(|x| types::PtrOfImageMotionEstimatorBase { ptr: x })
}
fn set_deblurer(&mut self, val: &types::PtrOfDeblurerBase) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_StabilizerBase_setDeblurer_PtrOfDeblurerBase_val(self.as_raw_StabilizerBase(), val.as_raw_PtrOfDeblurerBase()) }.into_result()
}
fn deblurrer(&self) -> Result<types::PtrOfDeblurerBase> {
unsafe { sys::cv_videostab_cv_videostab_StabilizerBase_deblurrer_const(self.as_raw_StabilizerBase()) }.into_result().map(|x| types::PtrOfDeblurerBase { ptr: x })
}
fn set_trim_ratio(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_StabilizerBase_setTrimRatio_float_val(self.as_raw_StabilizerBase(), val) }.into_result()
}
fn trim_ratio(&self) -> Result<f32> {
unsafe { sys::cv_videostab_cv_videostab_StabilizerBase_trimRatio_const(self.as_raw_StabilizerBase()) }.into_result()
}
fn set_correction_for_inclusion(&mut self, val: bool) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_StabilizerBase_setCorrectionForInclusion_bool_val(self.as_raw_StabilizerBase(), val) }.into_result()
}
fn do_correction_for_inclusion(&self) -> Result<bool> {
unsafe { sys::cv_videostab_cv_videostab_StabilizerBase_doCorrectionForInclusion_const(self.as_raw_StabilizerBase()) }.into_result()
}
fn set_border_mode(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_StabilizerBase_setBorderMode_int_val(self.as_raw_StabilizerBase(), val) }.into_result()
}
fn border_mode(&self) -> Result<i32> {
unsafe { sys::cv_videostab_cv_videostab_StabilizerBase_borderMode_const(self.as_raw_StabilizerBase()) }.into_result()
}
fn set_inpainter(&mut self, val: &types::PtrOfInpainterBase) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_StabilizerBase_setInpainter_PtrOfInpainterBase_val(self.as_raw_StabilizerBase(), val.as_raw_PtrOfInpainterBase()) }.into_result()
}
fn inpainter(&self) -> Result<types::PtrOfInpainterBase> {
unsafe { sys::cv_videostab_cv_videostab_StabilizerBase_inpainter_const(self.as_raw_StabilizerBase()) }.into_result().map(|x| types::PtrOfInpainterBase { ptr: x })
}
}
impl<'a> StabilizerBase + 'a {
}
#[allow(dead_code)]
pub struct ToFileMotionWriter {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::ToFileMotionWriter {
fn drop(&mut self) {
unsafe { sys::cv_delete_ToFileMotionWriter(self.ptr) };
}
}
impl crate::videostab::ToFileMotionWriter {
#[doc(hidden)] pub fn as_raw_ToFileMotionWriter(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::ImageMotionEstimatorBase for ToFileMotionWriter {
#[doc(hidden)] fn as_raw_ImageMotionEstimatorBase(&self) -> *mut c_void { self.ptr }
}
impl ToFileMotionWriter {
pub fn new(path: &str, estimator: &types::PtrOfImageMotionEstimatorBase) -> Result<crate::videostab::ToFileMotionWriter> {
string_arg!(path);
unsafe { sys::cv_videostab_cv_videostab_ToFileMotionWriter_ToFileMotionWriter_String_path_PtrOfImageMotionEstimatorBase_estimator(path.as_ptr(), estimator.as_raw_PtrOfImageMotionEstimatorBase()) }.into_result().map(|x| crate::videostab::ToFileMotionWriter { ptr: x })
}
pub fn estimate(&mut self, frame0: &core::Mat, frame1: &core::Mat, ok: &mut bool) -> Result<core::Mat> {
unsafe { sys::cv_videostab_cv_videostab_ToFileMotionWriter_estimate_Mat_frame0_Mat_frame1_bool_X_ok(self.as_raw_ToFileMotionWriter(), frame0.as_raw_Mat(), frame1.as_raw_Mat(), ok) }.into_result().map(|x| core::Mat { ptr: x })
}
}
#[allow(dead_code)]
pub struct TranslationBasedLocalOutlierRejector {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::TranslationBasedLocalOutlierRejector {
fn drop(&mut self) {
unsafe { sys::cv_delete_TranslationBasedLocalOutlierRejector(self.ptr) };
}
}
impl crate::videostab::TranslationBasedLocalOutlierRejector {
#[doc(hidden)] pub fn as_raw_TranslationBasedLocalOutlierRejector(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::IOutlierRejector for TranslationBasedLocalOutlierRejector {
#[doc(hidden)] fn as_raw_IOutlierRejector(&self) -> *mut c_void { self.ptr }
}
impl TranslationBasedLocalOutlierRejector {
pub fn new() -> Result<crate::videostab::TranslationBasedLocalOutlierRejector> {
unsafe { sys::cv_videostab_cv_videostab_TranslationBasedLocalOutlierRejector_TranslationBasedLocalOutlierRejector() }.into_result().map(|x| crate::videostab::TranslationBasedLocalOutlierRejector { ptr: x })
}
pub fn set_cell_size(&mut self, val: core::Size) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_TranslationBasedLocalOutlierRejector_setCellSize_Size_val(self.as_raw_TranslationBasedLocalOutlierRejector(), val) }.into_result()
}
pub fn cell_size(&self) -> Result<core::Size> {
unsafe { sys::cv_videostab_cv_videostab_TranslationBasedLocalOutlierRejector_cellSize_const(self.as_raw_TranslationBasedLocalOutlierRejector()) }.into_result()
}
pub fn process(&mut self, frame_size: core::Size, points0: &core::Mat, points1: &core::Mat, mask: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_TranslationBasedLocalOutlierRejector_process_Size_frameSize_Mat_points0_Mat_points1_Mat_mask(self.as_raw_TranslationBasedLocalOutlierRejector(), frame_size, points0.as_raw_Mat(), points1.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
}
#[allow(dead_code)]
pub struct TwoPassStabilizer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::TwoPassStabilizer {
fn drop(&mut self) {
unsafe { sys::cv_delete_TwoPassStabilizer(self.ptr) };
}
}
impl crate::videostab::TwoPassStabilizer {
#[doc(hidden)] pub fn as_raw_TwoPassStabilizer(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::IFrameSource for TwoPassStabilizer {
#[doc(hidden)] fn as_raw_IFrameSource(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::StabilizerBase for TwoPassStabilizer {
#[doc(hidden)] fn as_raw_StabilizerBase(&self) -> *mut c_void { self.ptr }
}
impl TwoPassStabilizer {
pub fn new() -> Result<crate::videostab::TwoPassStabilizer> {
unsafe { sys::cv_videostab_cv_videostab_TwoPassStabilizer_TwoPassStabilizer() }.into_result().map(|x| crate::videostab::TwoPassStabilizer { ptr: x })
}
pub fn set_motion_stabilizer(&mut self, val: &types::PtrOfIMotionStabilizer) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_TwoPassStabilizer_setMotionStabilizer_PtrOfIMotionStabilizer_val(self.as_raw_TwoPassStabilizer(), val.as_raw_PtrOfIMotionStabilizer()) }.into_result()
}
pub fn motion_stabilizer(&self) -> Result<types::PtrOfIMotionStabilizer> {
unsafe { sys::cv_videostab_cv_videostab_TwoPassStabilizer_motionStabilizer_const(self.as_raw_TwoPassStabilizer()) }.into_result().map(|x| types::PtrOfIMotionStabilizer { ptr: x })
}
pub fn set_estimate_trim_ratio(&mut self, val: bool) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_TwoPassStabilizer_setEstimateTrimRatio_bool_val(self.as_raw_TwoPassStabilizer(), val) }.into_result()
}
pub fn must_estimate_trima_ratio(&self) -> Result<bool> {
unsafe { sys::cv_videostab_cv_videostab_TwoPassStabilizer_mustEstimateTrimaRatio_const(self.as_raw_TwoPassStabilizer()) }.into_result()
}
pub fn reset(&mut self) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_TwoPassStabilizer_reset(self.as_raw_TwoPassStabilizer()) }.into_result()
}
pub fn next_frame(&mut self) -> Result<core::Mat> {
unsafe { sys::cv_videostab_cv_videostab_TwoPassStabilizer_nextFrame(self.as_raw_TwoPassStabilizer()) }.into_result().map(|x| core::Mat { ptr: x })
}
}
#[allow(dead_code)]
pub struct VideoFileSource {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::VideoFileSource {
fn drop(&mut self) {
unsafe { sys::cv_delete_VideoFileSource(self.ptr) };
}
}
impl crate::videostab::VideoFileSource {
#[doc(hidden)] pub fn as_raw_VideoFileSource(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::IFrameSource for VideoFileSource {
#[doc(hidden)] fn as_raw_IFrameSource(&self) -> *mut c_void { self.ptr }
}
impl VideoFileSource {
pub fn new(path: &str, volatile_frame: bool) -> Result<crate::videostab::VideoFileSource> {
string_arg!(path);
unsafe { sys::cv_videostab_cv_videostab_VideoFileSource_VideoFileSource_String_path_bool_volatileFrame(path.as_ptr(), volatile_frame) }.into_result().map(|x| crate::videostab::VideoFileSource { ptr: x })
}
pub fn reset(&mut self) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_VideoFileSource_reset(self.as_raw_VideoFileSource()) }.into_result()
}
pub fn next_frame(&mut self) -> Result<core::Mat> {
unsafe { sys::cv_videostab_cv_videostab_VideoFileSource_nextFrame(self.as_raw_VideoFileSource()) }.into_result().map(|x| core::Mat { ptr: x })
}
pub fn width(&mut self) -> Result<i32> {
unsafe { sys::cv_videostab_cv_videostab_VideoFileSource_width(self.as_raw_VideoFileSource()) }.into_result()
}
pub fn height(&mut self) -> Result<i32> {
unsafe { sys::cv_videostab_cv_videostab_VideoFileSource_height(self.as_raw_VideoFileSource()) }.into_result()
}
pub fn count(&mut self) -> Result<i32> {
unsafe { sys::cv_videostab_cv_videostab_VideoFileSource_count(self.as_raw_VideoFileSource()) }.into_result()
}
pub fn fps(&mut self) -> Result<f64> {
unsafe { sys::cv_videostab_cv_videostab_VideoFileSource_fps(self.as_raw_VideoFileSource()) }.into_result()
}
}
#[allow(dead_code)]
pub struct WeightingDeblurer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for crate::videostab::WeightingDeblurer {
fn drop(&mut self) {
unsafe { sys::cv_delete_WeightingDeblurer(self.ptr) };
}
}
impl crate::videostab::WeightingDeblurer {
#[doc(hidden)] pub fn as_raw_WeightingDeblurer(&self) -> *mut c_void { self.ptr }
}
impl crate::videostab::DeblurerBase for WeightingDeblurer {
#[doc(hidden)] fn as_raw_DeblurerBase(&self) -> *mut c_void { self.ptr }
}
impl WeightingDeblurer {
pub fn new() -> Result<crate::videostab::WeightingDeblurer> {
unsafe { sys::cv_videostab_cv_videostab_WeightingDeblurer_WeightingDeblurer() }.into_result().map(|x| crate::videostab::WeightingDeblurer { ptr: x })
}
pub fn set_sensitivity(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_WeightingDeblurer_setSensitivity_float_val(self.as_raw_WeightingDeblurer(), val) }.into_result()
}
pub fn sensitivity(&self) -> Result<f32> {
unsafe { sys::cv_videostab_cv_videostab_WeightingDeblurer_sensitivity_const(self.as_raw_WeightingDeblurer()) }.into_result()
}
pub fn deblur(&mut self, idx: i32, frame: &core::Mat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_WeightingDeblurer_deblur_int_idx_Mat_frame(self.as_raw_WeightingDeblurer(), idx, frame.as_raw_Mat()) }.into_result()
}
}
pub trait WobbleSuppressorBase {
#[doc(hidden)] fn as_raw_WobbleSuppressorBase(&self) -> *mut c_void;
fn set_motion_estimator(&mut self, val: &types::PtrOfImageMotionEstimatorBase) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_WobbleSuppressorBase_setMotionEstimator_PtrOfImageMotionEstimatorBase_val(self.as_raw_WobbleSuppressorBase(), val.as_raw_PtrOfImageMotionEstimatorBase()) }.into_result()
}
fn motion_estimator(&self) -> Result<types::PtrOfImageMotionEstimatorBase> {
unsafe { sys::cv_videostab_cv_videostab_WobbleSuppressorBase_motionEstimator_const(self.as_raw_WobbleSuppressorBase()) }.into_result().map(|x| types::PtrOfImageMotionEstimatorBase { ptr: x })
}
fn suppress(&mut self, idx: i32, frame: &core::Mat, result: &core::Mat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_WobbleSuppressorBase_suppress_int_idx_Mat_frame_Mat_result(self.as_raw_WobbleSuppressorBase(), idx, frame.as_raw_Mat(), result.as_raw_Mat()) }.into_result()
}
fn set_frame_count(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_WobbleSuppressorBase_setFrameCount_int_val(self.as_raw_WobbleSuppressorBase(), val) }.into_result()
}
fn frame_count(&self) -> Result<i32> {
unsafe { sys::cv_videostab_cv_videostab_WobbleSuppressorBase_frameCount_const(self.as_raw_WobbleSuppressorBase()) }.into_result()
}
fn set_motions(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_WobbleSuppressorBase_setMotions_VectorOfMat_val(self.as_raw_WobbleSuppressorBase(), val.as_raw_VectorOfMat()) }.into_result()
}
fn motions(&self) -> Result<types::VectorOfMat> {
unsafe { sys::cv_videostab_cv_videostab_WobbleSuppressorBase_motions_const(self.as_raw_WobbleSuppressorBase()) }.into_result().map(|x| types::VectorOfMat { ptr: x })
}
fn set_motions2(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_WobbleSuppressorBase_setMotions2_VectorOfMat_val(self.as_raw_WobbleSuppressorBase(), val.as_raw_VectorOfMat()) }.into_result()
}
fn motions2(&self) -> Result<types::VectorOfMat> {
unsafe { sys::cv_videostab_cv_videostab_WobbleSuppressorBase_motions2_const(self.as_raw_WobbleSuppressorBase()) }.into_result().map(|x| types::VectorOfMat { ptr: x })
}
fn set_stabilization_motions(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_videostab_cv_videostab_WobbleSuppressorBase_setStabilizationMotions_VectorOfMat_val(self.as_raw_WobbleSuppressorBase(), val.as_raw_VectorOfMat()) }.into_result()
}
fn stabilization_motions(&self) -> Result<types::VectorOfMat> {
unsafe { sys::cv_videostab_cv_videostab_WobbleSuppressorBase_stabilizationMotions_const(self.as_raw_WobbleSuppressorBase()) }.into_result().map(|x| types::VectorOfMat { ptr: x })
}
}
impl<'a> WobbleSuppressorBase + 'a {
}