Skip to content

Commit

Permalink
wrap DISOpticalFlow
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Mar 19, 2023
1 parent 145d3aa commit 6ad6bf1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
13 changes: 13 additions & 0 deletions Tracking/classes.pl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@
* as well as the matlab implementation. For more information about KCF with color-names features, please refer to
* <http://www.cvl.isy.liu.se/research/objrec/visualtracking/colvistrack/index.html>.',1,'cv::TrackerKCF::create',[],'@brief Create KCF tracker instance
@param parameters KCF parameters TrackerKCF::Params'],
['DISOpticalFlow',['DenseOpticalFlow'],'@brief DIS optical flow algorithm.
This class implements the Dense Inverse Search (DIS) optical flow algorithm. More
details about the algorithm can be found at @cite Kroeger2016 . Includes three presets with preselected
parameters to provide reasonable trade-off between speed and quality. However, even the slowest preset is
still relatively fast, use DeepFlow if you need better quality and don\'t care about speed.
This implementation includes several additional features compared to the algorithm described in the paper,
including spatial propagation of flow vectors (@ref getUseSpatialPropagation), as well as an option to
utilize an initial flow approximation passed to @ref calc (which is, essentially, temporal propagation,
if the previous frame\'s flow field is passed).',1,'cv::DISOpticalFlow::create',[['int','preset','DISOpticalFlow::PRESET_FAST',[]]],'@brief Creates an instance of DISOpticalFlow
@param preset one of PRESET_ULTRAFAST, PRESET_FAST and PRESET_MEDIUM'],
['SparsePyrLKOpticalFlow',['SparseOpticalFlow'],'@brief Class used for calculating a sparse optical flow.
The class can calculate an optical flow for a sparse feature set using the
Expand Down
5 changes: 3 additions & 2 deletions genpp.pl
Original file line number Diff line number Diff line change
Expand Up @@ -187,21 +187,22 @@ sub destroy_code {
sub default_pl {
my ($self) = @_;
my $d = $self->{default} // '';
$d =~ s/[A-Z][A-Z0-9_]+/$&()/g if length $d and $d !~ /\(/;
$d =~ s/[A-Z][A-Z0-9_]+/$&()/g if length $d and $d !~ /\(|::/;
if ($self->{is_output}) {
$d = 'PDL->null' if !$self->{is_other} and (!length $d or $d eq 'Mat()' or ($d eq '0' && $self->{was_ptr}));
}
if ($default_overrides{$d}) {
$d = $default_overrides{$d}[0];
}
$d =~ s/([A-Za-z0-9_:]+::[A-Za-z_][A-Za-z0-9_]+)/PDL::OpenCV::$1()/g;
length $d ? "\$$self->{name} = $d if !defined \$$self->{name};" : ();
}
sub xs_par {
my ($self) = @_;
my $xs_par = ($self->{type} =~ /^[A-Z]/ && $self->{is_other}) ? $self->par : "@$self{qw(type_c name)}";
my $d = $self->{default} // '';
$d = $default_overrides{$d}[1] if $default_overrides{$d};
$d = 'cw_const_' . $d . '()' if length $d and $d !~ /\(/ and $d =~ /[^0-9\.\-]/;
$d = 'cw_const_' . $d . '()' if length $d and $d !~ /\(/ and $d =~ /[^0-9\.\-]/ and ($d =~ s/::/_/g or 1);
$xs_par . (length $d ? "=$d" : '');
}
sub cdecl {
Expand Down
2 changes: 1 addition & 1 deletion maint/genlists
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ my %class = map +($_=>1), qw(
LineSegmentDetector Tracker VideoCapture VideoWriter QRCodeDetector
CascadeClassifier Subdiv2D TrackerKCF TrackerCSRT TrackerMIL
FileNode FileStorage DMatch KeyPoint Algorithm CLAHE GeneralizedHough
HOGDescriptor SparsePyrLKOpticalFlow
HOGDescriptor SparsePyrLKOpticalFlow DISOpticalFlow
);
my $no_want = qr/^(TermCriteria|RNG|RotatedRect)/;

Expand Down

0 comments on commit 6ad6bf1

Please sign in to comment.