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
otbtf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
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
Lozac'h Loic
otbtf
Commits
32e3699f
Commit
32e3699f
authored
Dec 14, 2018
by
Cresson Remi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: print info
parent
793e9c96
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
15 deletions
+20
-15
app/otbPatchesSelection.cxx
app/otbPatchesSelection.cxx
+20
-15
No files found.
app/otbPatchesSelection.cxx
View file @
32e3699f
...
...
@@ -315,6 +315,20 @@ public:
return
bundles
;
}
void
SetBlackOrWhiteBundle
(
SampleBundle
&
bundle
,
unsigned
int
&
count
,
const
UInt8ImageType
::
IndexType
&
pos
,
const
UInt8ImageType
::
PointType
&
geo
)
{
// Black or white
bool
black
=
((
pos
[
0
]
+
pos
[
1
])
%
2
==
0
);
bundle
.
GetModifiableSampleID
()
=
count
;
bundle
.
GetModifiablePosition
()
=
geo
;
bundle
.
GetModifiableBlack
()
=
black
;
bundle
.
GetModifiableIndex
()
=
pos
;
count
++
;
}
/*
* Samples are placed at regular intervals
*/
...
...
@@ -324,17 +338,9 @@ public:
std
::
vector
<
SampleBundle
>
bundles
=
AllocateSamples
();
unsigned
int
count
=
0
;
auto
lambda
=
[
&
count
,
&
bundles
]
auto
lambda
=
[
this
,
&
count
,
&
bundles
]
(
const
UInt8ImageType
::
IndexType
&
pos
,
const
UInt8ImageType
::
PointType
&
geo
)
{
// Black or white
bool
black
=
((
pos
[
0
]
+
pos
[
1
])
%
2
==
0
);
bundles
[
count
].
GetModifiableSampleID
()
=
count
;
bundles
[
count
].
GetModifiablePosition
()
=
geo
;
bundles
[
count
].
GetModifiableBlack
()
=
black
;
bundles
[
count
].
GetModifiableIndex
()
=
pos
;
count
++
;
SetBlackOrWhiteBundle
(
bundles
[
count
],
count
,
pos
,
geo
);
};
Apply
(
lambda
);
...
...
@@ -364,11 +370,7 @@ public:
if
(
tf
::
UpdateDistributionFromPatch
<
UInt8ImageType
>
(
GetParameterUInt8Image
(
"strategy.balanced.labelimage"
),
geo
,
patchSize
,
bundles
[
count
].
GetModifiableDistribution
()))
{
bundles
[
count
].
GetModifiableSampleID
()
=
count
;
bundles
[
count
].
GetModifiablePosition
()
=
geo
;
bundles
[
count
].
GetModifiableBlack
()
=
((
pos
[
0
]
+
pos
[
1
])
%
2
==
0
);
bundles
[
count
].
GetModifiableIndex
()
=
pos
;
count
++
;
SetBlackOrWhiteBundle
(
bundles
[
count
],
count
,
pos
,
geo
);
}
};
...
...
@@ -530,6 +532,9 @@ public:
void
DoExecute
()
{
otbAppLogINFO
(
"Grid step : "
<<
this
->
GetParameterInt
(
"grid.step"
));
otbAppLogINFO
(
"Patch size : "
<<
this
->
GetParameterInt
(
"grid.psize"
));
// Compute no-data mask
m_NoDataFilter
=
IsNoDataFilterType
::
New
();
...
...
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