Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
273
Issues
273
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
95a6649b
Commit
95a6649b
authored
Feb 05, 2015
by
Christophe Palmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TEST: added new test for BCO interpolation
parent
53978c44
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
98 additions
and
0 deletions
+98
-0
Testing/Code/BasicFilters/CMakeLists.txt
Testing/Code/BasicFilters/CMakeLists.txt
+14
-0
Testing/Code/BasicFilters/otbBCOInterpolateImageFunction.cxx
Testing/Code/BasicFilters/otbBCOInterpolateImageFunction.cxx
+83
-0
Testing/Code/BasicFilters/otbBasicFiltersTests6.cxx
Testing/Code/BasicFilters/otbBasicFiltersTests6.cxx
+1
-0
No files found.
Testing/Code/BasicFilters/CMakeLists.txt
View file @
95a6649b
...
...
@@ -841,6 +841,20 @@ add_test(bfTvBCOInterpolateImageFunction ${BASICFILTERS_TESTS6}
-1 -1
)
add_test
(
bfTvBCOInterpolateImageFunction2
${
BASICFILTERS_TESTS6
}
otbBCOInterpolateImageFunction2
3
# radius
-0.5
# optimised bicubic
0.5 0.5
127.33 44.9
259.67 21.43
12.13 61.79
89.5 11
128 128
127.255 128.73
-1 -1
)
add_test
(
bfTuBCOInterpolateImageFunctionOverVectorImageNew
${
BASICFILTERS_TESTS6
}
otbBCOInterpolateImageFunctionOverVectorImageNew
)
...
...
Testing/Code/BasicFilters/otbBCOInterpolateImageFunction.cxx
View file @
95a6649b
...
...
@@ -97,6 +97,89 @@ int otbBCOInterpolateImageFunction(int argc, char * argv[])
}
int
otbBCOInterpolateImageFunction2
(
int
argc
,
char
*
argv
[])
{
typedef
otb
::
Image
<
double
,
2
>
ImageType
;
ImageType
::
Pointer
inputImage
=
ImageType
::
New
();
const
unsigned
int
N
=
100
;
ImageType
::
SizeType
size
;
size
.
Fill
(
N
);
ImageType
::
IndexType
index
;
index
.
Fill
(
0
);
ImageType
::
RegionType
region
;
region
.
SetSize
(
size
);
region
.
SetIndex
(
index
);
inputImage
->
SetLargestPossibleRegion
(
region
);
inputImage
->
SetBufferedRegion
(
region
);
inputImage
->
SetRequestedRegion
(
region
);
inputImage
->
SetNumberOfComponentsPerPixel
(
1
);
inputImage
->
Allocate
();
typedef
itk
::
ImageRegionIterator
<
ImageType
>
IteratorType
;
IteratorType
it1
(
inputImage
,
region
);
for
(
it1
.
GoToBegin
();
!
it1
.
IsAtEnd
();
++
it1
)
it1
.
Set
(
1.0
);
const
unsigned
int
radius
=
atoi
(
argv
[
1
]);
const
double
alpha
=
atof
(
argv
[
2
]);
typedef
otb
::
BCOInterpolateImageFunction
<
ImageType
,
double
>
InterpolatorType
;
typedef
InterpolatorType
::
ContinuousIndexType
ContinuousIndexType
;
typedef
otb
::
ImageFileReader
<
ImageType
>
ReaderType
;
std
::
vector
<
ContinuousIndexType
>
indicesList
;
for
(
unsigned
int
i
=
3
;
i
+
1
<
argc
;
i
=
i
+
2
)
{
ContinuousIndexType
idx
;
idx
[
0
]
=
atof
(
argv
[
i
]);
idx
[
1
]
=
atof
(
argv
[
i
+
1
]);
std
::
cout
<<
idx
[
0
]
<<
" "
<<
idx
[
1
]
<<
std
::
endl
;
indicesList
.
push_back
(
idx
);
}
// Instantiating object
InterpolatorType
::
Pointer
filter
=
InterpolatorType
::
New
();
ReaderType
::
Pointer
reader
=
ReaderType
::
New
();
std
::
cout
<<
"Alpha Checking : "
<<
std
::
endl
<<
filter
->
GetAlpha
()
<<
std
::
endl
;
filter
->
SetAlpha
(
-
1.0
);
std
::
cout
<<
filter
->
GetAlpha
()
<<
std
::
endl
;
filter
->
SetAlpha
(
alpha
);
std
::
cout
<<
filter
->
GetAlpha
()
<<
std
::
endl
;
std
::
cout
<<
"Radius Checking : "
<<
std
::
endl
<<
filter
->
GetRadius
()
<<
std
::
endl
;
filter
->
SetRadius
(
radius
);
std
::
cout
<<
filter
->
GetRadius
()
<<
std
::
endl
;
filter
->
SetInputImage
(
inputImage
);
for
(
std
::
vector
<
ContinuousIndexType
>::
iterator
it
=
indicesList
.
begin
();
it
!=
indicesList
.
end
();
++
it
)
{
std
::
cout
<<
(
*
it
)
<<
" -> "
<<
filter
->
EvaluateAtContinuousIndex
((
*
it
))
<<
std
::
endl
;
if
(
vcl_abs
(
filter
->
EvaluateAtContinuousIndex
((
*
it
))
-
1.0
)
>
1e-6
)
return
EXIT_FAILURE
;
}
return
EXIT_SUCCESS
;
}
int
otbBCOInterpolateImageFunctionOverVectorImageNew
(
int
itkNotUsed
(
argc
),
char
*
itkNotUsed
(
argv
)
[])
{
typedef
otb
::
VectorImage
<
double
,
2
>
ImageType
;
...
...
Testing/Code/BasicFilters/otbBasicFiltersTests6.cxx
View file @
95a6649b
...
...
@@ -37,6 +37,7 @@ void RegisterTests()
REGISTER_TEST
(
otbWindowedSincInterpolateImageHammingFunction
);
REGISTER_TEST
(
otbBCOInterpolateImageFunctionNew
);
REGISTER_TEST
(
otbBCOInterpolateImageFunction
);
REGISTER_TEST
(
otbBCOInterpolateImageFunction2
);
REGISTER_TEST
(
otbBCOInterpolateImageFunctionOverVectorImageNew
);
REGISTER_TEST
(
otbBCOInterpolateImageFunctionOverVectorImage
);
REGISTER_TEST
(
otbBCOInterpolateImageFunctionTest
);
...
...
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