Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
c13f46e0
Commit
c13f46e0
authored
Oct 10, 2011
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added functions for computing the convolution and cross-correlation between
two matrices.
parent
3acb55b2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
139 additions
and
0 deletions
+139
-0
matrix.h
dlib/matrix.h
+1
-0
matrix_conv.h
dlib/matrix/matrix_conv.h
+0
-0
matrix_conv_abstract.h
dlib/matrix/matrix_conv_abstract.h
+138
-0
No files found.
dlib/matrix.h
View file @
c13f46e0
...
...
@@ -10,6 +10,7 @@
#include "matrix/matrix_assign.h"
#include "matrix/matrix_la.h"
#include "matrix/symmetric_matrix_cache.h"
#include "matrix/matrix_conv.h"
#ifdef DLIB_USE_BLAS
#include "matrix/matrix_blas_bindings.h"
...
...
dlib/matrix/matrix_conv.h
0 → 100644
View file @
c13f46e0
This diff is collapsed.
Click to expand it.
dlib/matrix/matrix_conv_abstract.h
0 → 100644
View file @
c13f46e0
// Copyright (C) 2011 Davis E. King (davis@dlib.net)
// License: Boost Software License See LICENSE.txt for the full license.
#undef DLIB_MATRIx_CONV_ABSTRACT_H__
#ifdef DLIB_MATRIx_CONV_ABSTRACT_H__
#include "matrix_abstract.h"
namespace
dlib
{
// ----------------------------------------------------------------------------------------
const
matrix_exp
conv
(
const
matrix_exp
&
m1
,
const
matrix_exp
&
m2
);
/*!
requires
- m1 and m2 both contain elements of the same type
ensures
- returns a matrix R such that:
- R is the convolution of m1 with m2. In particular, this function is
equivalent to performing the following in matlab: R = conv2(m1,m2).
- R::type == the same type that was in m1 and m2.
- R.nr() == m1.nr()+m2.nr()-1
- R.nc() == m1.nc()+m2.nc()-1
!*/
// ----------------------------------------------------------------------------------------
const
matrix_exp
xcorr
(
const
matrix_exp
&
m1
,
const
matrix_exp
&
m2
);
/*!
requires
- m1 and m2 both contain elements of the same type
ensures
- returns a matrix R such that:
- R is the cross-correlation of m1 with m2. In particular, this
function returns conv(m1,flip(m2)).
- R::type == the same type that was in m1 and m2.
- R.nr() == m1.nr()+m2.nr()-1
- R.nc() == m1.nc()+m2.nc()-1
!*/
// ----------------------------------------------------------------------------------------
const
matrix_exp
conv_same
(
const
matrix_exp
&
m1
,
const
matrix_exp
&
m2
);
/*!
requires
- m1 and m2 both contain elements of the same type
ensures
- returns a matrix R such that:
- R is the convolution of m1 with m2. In particular, this function is
equivalent to performing the following in matlab: R = conv2(m1,m2,'same').
In particular, this means the result will have the same dimensions as m1 and will
contain the central part of the full convolution. This means conv_same(m1,m2) is
equivalent to subm(conv(m1,m2), m2.nr()/2, m2.nc()/2, m1.nr(), m1.nc()).
- R::type == the same type that was in m1 and m2.
- R.nr() == m1.nr()
- R.nc() == m1.nc()
!*/
// ----------------------------------------------------------------------------------------
const
matrix_exp
xcorr_same
(
const
matrix_exp
&
m1
,
const
matrix_exp
&
m2
);
/*!
requires
- m1 and m2 both contain elements of the same type
ensures
- returns a matrix R such that:
- R is the cross-correlation of m1 with m2. In particular, this
function returns conv_same(m1,flip(m2)).
- R::type == the same type that was in m1 and m2.
- R.nr() == m1.nr()
- R.nc() == m1.nc()
!*/
// ----------------------------------------------------------------------------------------
const
matrix_exp
conv_valid
(
const
matrix_exp
&
m1
,
const
matrix_exp
&
m2
);
/*!
requires
- m1 and m2 both contain elements of the same type
ensures
- returns a matrix R such that:
- R is the convolution of m1 with m2. In particular, this function is
equivalent to performing the following in matlab: R = conv2(m1,m2,'valid').
In particular, this means only elements of the convolution which don't require
zero padding are included in the result.
- R::type == the same type that was in m1 and m2.
- if (m1 has larger dimensions than m2) then
- R.nr() == m1.nr()-m2.nr()+1
- R.nc() == m1.nc()-m2.nc()+1
- else
- R.nr() == 0
- R.nc() == 0
!*/
// ----------------------------------------------------------------------------------------
const
matrix_exp
xcorr_valid
(
const
matrix_exp
&
m1
,
const
matrix_exp
&
m2
);
/*!
requires
- m1 and m2 both contain elements of the same type
ensures
- returns a matrix R such that:
- R is the cross-correlation of m1 with m2. In particular, this
function returns conv_valid(m1,flip(m2)).
- R::type == the same type that was in m1 and m2.
- if (m1 has larger dimensions than m2) then
- R.nr() == m1.nr()-m2.nr()+1
- R.nc() == m1.nc()-m2.nc()+1
- else
- R.nr() == 0
- R.nc() == 0
!*/
// ----------------------------------------------------------------------------------------
}
#endif // DLIB_MATRIx_CONV_ABSTRACT_H__
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment