Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
986a2837
Commit
986a2837
authored
Jul 15, 2016
by
Maksim Shabunin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #702 from LaurentBerger:PaillouFilter
parents
55e119ce
42640a33
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
188 additions
and
0 deletions
+188
-0
README.md
modules/ximgproc/README.md
+1
-0
ximgproc.bib
modules/ximgproc/doc/ximgproc.bib
+10
-0
ximgproc.hpp
modules/ximgproc/include/opencv2/ximgproc.hpp
+2
-0
paillou_filter.hpp
modules/ximgproc/include/opencv2/ximgproc/paillou_filter.hpp
+67
-0
paillou_demo.cpp
modules/ximgproc/samples/paillou_demo.cpp
+108
-0
paillou_filter.cpp
modules/ximgproc/src/paillou_filter.cpp
+0
-0
No files found.
modules/ximgproc/README.md
View file @
986a2837
...
...
@@ -9,3 +9,4 @@ Extended Image Processing
6.
Superpixels
7.
Graph segmentation
8.
Selective search from segmentation
10.
Paillou Filter
modules/ximgproc/doc/ximgproc.bib
View file @
986a2837
...
...
@@ -166,3 +166,13 @@
year={2014},
organization={IEEE}
}
@article{paillou1997detecting,
title={Detecting step edges in noisy SAR images: a new linear operator},
author={Paillou, Philippe},
journal={IEEE transactions on geoscience and remote sensing},
volume={35},
number={1},
pages={191--196},
year={1997}
}
modules/ximgproc/include/opencv2/ximgproc.hpp
View file @
986a2837
...
...
@@ -48,6 +48,8 @@
#include "ximgproc/weighted_median_filter.hpp"
#include "ximgproc/slic.hpp"
#include "ximgproc/lsc.hpp"
#include "ximgproc/paillou_filter.hpp"
/** @defgroup ximgproc Extended Image Processing
@{
...
...
modules/ximgproc/include/opencv2/ximgproc/paillou_filter.hpp
0 → 100644
View file @
986a2837
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3 - clause BSD License)
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met :
*
* *Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and / or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort(including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#ifndef __OPENCV_PAILLOUFILTER_HPP__
#define __OPENCV_PAILLOUFILTER_HPP__
#ifdef __cplusplus
#include <opencv2/core.hpp>
namespace
cv
{
namespace
ximgproc
{
//! @addtogroup ximgproc_filters
//! @{
/**
* @brief Applies Paillou filter to an image.
*
* For more details about this implementation, please see @cite paillou1997detecting
*
* @param op Source 8-bit or 16bit image, 1-channel or 3-channel image.
* @param _dst result CV_32F image with same numeber of channel than op.
* @param omega double see paper
* @param alpha double see paper
*
* @sa GradientPaillouX, GradientPaillouY
*/
CV_EXPORTS
void
GradientPaillouY
(
InputArray
op
,
OutputArray
_dst
,
double
alpha
,
double
omega
);
CV_EXPORTS
void
GradientPaillouX
(
InputArray
op
,
OutputArray
_dst
,
double
alpha
,
double
omega
);
}
}
#endif
#endif
modules/ximgproc/samples/paillou_demo.cpp
0 → 100644
View file @
986a2837
/*
* By downloading, copying, installing or using the software you agree to this license.
* If you do not agree to this license, do not download, install,
* copy or use the software.
*
*
* License Agreement
* For Open Source Computer Vision Library
* (3 - clause BSD License)
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met :
*
* *Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and / or other materials provided with the distribution.
*
* * Neither the names of the copyright holders nor the names of the contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* This software is provided by the copyright holders and contributors "as is" and
* any express or implied warranties, including, but not limited to, the implied
* warranties of merchantability and fitness for a particular purpose are disclaimed.
* In no event shall copyright holders or contributors be liable for any direct,
* indirect, incidental, special, exemplary, or consequential damages
* (including, but not limited to, procurement of substitute goods or services;
* loss of use, data, or profits; or business interruption) however caused
* and on any theory of liability, whether in contract, strict liability,
* or tort(including negligence or otherwise) arising in any way out of
* the use of this software, even if advised of the possibility of such damage.
*/
#include <opencv2/core.hpp>
#include <opencv2/core/utility.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/ximgproc.hpp>
#include "opencv2/ximgproc/paillou_filter.hpp"
using
namespace
cv
;
using
namespace
cv
::
ximgproc
;
#include <iostream>
using
namespace
std
;
int
aa
=
100
,
ww
=
10
;
Mat
dx
,
dy
;
UMat
img
;
const
char
*
window_name
=
"Gradient Modulus"
;
static
void
DisplayImage
(
Mat
x
,
string
s
)
{
vector
<
Mat
>
sx
;
split
(
x
,
sx
);
vector
<
double
>
minVal
(
3
),
maxVal
(
3
);
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
sx
.
size
());
i
++
)
{
minMaxLoc
(
sx
[
i
],
&
minVal
[
i
],
&
maxVal
[
i
]);
}
maxVal
[
0
]
=
*
max_element
(
maxVal
.
begin
(),
maxVal
.
end
());
minVal
[
0
]
=
*
min_element
(
minVal
.
begin
(),
minVal
.
end
());
Mat
uc
;
x
.
convertTo
(
uc
,
CV_8U
,
255
/
(
maxVal
[
0
]
-
minVal
[
0
]),
-
255
*
minVal
[
0
]
/
(
maxVal
[
0
]
-
minVal
[
0
]));
imshow
(
s
,
uc
);
}
/**
* @function paillouFilter
* @brief Trackbar callback
*/
static
void
PaillouFilter
(
int
,
void
*
)
{
Mat
dst
;
double
a
=
aa
/
100.0
,
w
=
ww
/
100.0
;
Mat
rx
,
ry
;
GradientPaillouX
(
img
,
rx
,
a
,
w
);
GradientPaillouY
(
img
,
ry
,
a
,
w
);
DisplayImage
(
rx
,
"Gx"
);
DisplayImage
(
ry
,
"Gy"
);
add
(
rx
.
mul
(
rx
),
ry
.
mul
(
ry
),
dst
);
sqrt
(
dst
,
dst
);
DisplayImage
(
dst
,
window_name
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
argc
==
2
)
imread
(
argv
[
1
]).
copyTo
(
img
);
if
(
img
.
empty
())
{
cout
<<
"File not found or empty image
\n
"
;
}
imshow
(
"Original"
,
img
);
namedWindow
(
window_name
,
WINDOW_AUTOSIZE
);
/// Create a Trackbar for user to enter threshold
createTrackbar
(
"a:"
,
window_name
,
&
aa
,
400
,
PaillouFilter
);
createTrackbar
(
"w:"
,
window_name
,
&
ww
,
400
,
PaillouFilter
);
PaillouFilter
(
0
,
NULL
);
waitKey
();
return
0
;
}
\ No newline at end of file
modules/ximgproc/src/paillou_filter.cpp
0 → 100644
View file @
986a2837
This diff is collapsed.
Click to expand it.
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