Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NORMLIM_sigma0
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
s1-tiling
NORMLIM_sigma0
Commits
5ed90b5b
Commit
5ed90b5b
authored
2 years ago
by
Luc Hermitte
Browse files
Options
Downloads
Patches
Plain Diff
ENH: complete VLVPointIterator
parent
1ace9d99
No related branches found
No related tags found
1 merge request
!1
Resolve "Adapt DiapOTB SARCartesianMeanEstimation to keep shadows"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/otbSARDEMPolygonsAnalysisImageFilter2.hxx
+13
-56
13 additions, 56 deletions
include/otbSARDEMPolygonsAnalysisImageFilter2.hxx
include/otbVLVPointIterator.h
+2
-0
2 additions, 0 deletions
include/otbVLVPointIterator.h
with
15 additions
and
56 deletions
include/otbSARDEMPolygonsAnalysisImageFilter2.hxx
+
13
−
56
View file @
5ed90b5b
...
...
@@ -862,13 +862,6 @@ SARDEMPolygonsAnalysisImageFilter< TImageIn, TImageOut, TImageDEM, TImageSAR, TF
auto
const
*
input
=
this
->
GetInput
();
auto
const
nBands
=
input
->
GetNumberOfComponentsPerPixel
();
InputIterator
InIt_UL
(
input
,
inputRegionForThread
);
InputIterator
InIt_UR
(
input
,
inputRegionForThread
);
InputIterator
InIt_LR
(
input
,
inputRegionForThread
);
InputIterator
InIt_LL
(
input
,
inputRegionForThread
);
InputIterator
*
tabInIt
[]
=
{
&
InIt_UL
,
&
InIt_UR
,
&
InIt_LR
,
&
InIt_LL
};
auto
const
&
in_size
=
inputRegionForThread
.
GetSize
();
auto
const
&
in_index
=
inputRegionForThread
.
GetIndex
();
auto
const
in_sizeX
=
in_size
[
0
];
...
...
@@ -919,15 +912,6 @@ SARDEMPolygonsAnalysisImageFilter< TImageIn, TImageOut, TImageDEM, TImageSAR, TF
ImageInSubPixelType
const
lo_margin
=
ind_Line_Into_SARGeo
-
margin
;
ImageInSubPixelType
const
hi_margin
=
ind_Line_Into_SARGeo
+
margin
;
///////////////////////////// Polygon Construction and Check intersection /////////////////////////
InIt_UL
.
GoToBegin
();
InIt_UR
.
GoToBegin
();
InIt_LR
.
GoToBegin
();
InIt_LL
.
GoToBegin
();
// Put each Iterator to this start line
// +1 line for LL and for LR
InIt_LL
.
NextLine
();
InIt_LR
.
NextLine
();
int
countDEMLine
=
0
;
...
...
@@ -938,21 +922,12 @@ SARDEMPolygonsAnalysisImageFilter< TImageIn, TImageOut, TImageDEM, TImageSAR, TF
return
VLVPointIterator
<
ImageInSubPixelType
const
>
(
in_data
+
nBands
*
dx
+
dy
*
in_line_off
,
nBands
);
};
InIt_UR
.
GoToBeginOfLine
();
InIt_UL
.
GoToBeginOfLine
();
InIt_LR
.
GoToBeginOfLine
();
InIt_LL
.
GoToBeginOfLine
();
// Put each Iterator to this start colunm
// +1 colunm for UR and LR
++
InIt_UR
;
++
InIt_LR
;
// For each column
for
(
unsigned
dx
=
0
;
dx
<
in_sizeX
-
1
;
++
dx
)
{
auto
pt_UL
=
point
(
dx
,
dy
);
auto
const
UL_line
=
InI
t_UL
.
Get
()
[
1
];
auto
const
UL_line
=
p
t_UL
[
1
];
// Protect Memory access and input access
static_assert
(
std
::
is_same
<
decltype
(
UL_line
),
decltype
(
lo_margin
)
>::
value
,
"no convertion!!!"
);
...
...
@@ -961,28 +936,21 @@ SARDEMPolygonsAnalysisImageFilter< TImageIn, TImageOut, TImageDEM, TImageSAR, TF
auto
const
pt_UR
=
point
(
dx
+
1
,
dy
);
auto
const
pt_LL
=
point
(
dx
,
dy
+
1
);
auto
const
pt_LR
=
point
(
dx
+
1
,
dy
+
1
);
VLVPointIterator
<
ImageInSubPixelType
const
>
tabInPt
[]
=
{
pt_UL
,
pt_UR
,
pt_LR
,
pt_LL
};
assert
(
&
InIt_UR
.
Get
()[
0
]
==
in_data
+
nBands
*
(
dx
+
1
)
+
dy
*
in_line_off
);
assert
(
&
InIt_LR
.
Get
()[
0
]
==
in_data
+
nBands
*
(
dx
+
1
)
+
(
dy
+
1
)
*
in_line_off
);
assert
(
&
InIt_LL
.
Get
()[
0
]
==
in_data
+
nBands
*
dx
+
(
dy
+
1
)
*
in_line_off
);
assert
(
&
pt_UR
[
0
]
==
&
InIt_UR
.
Get
()[
0
]);
assert
(
&
pt_LL
[
0
]
==
&
InIt_LL
.
Get
()[
0
]);
assert
(
&
pt_LR
[
0
]
==
&
InIt_LR
.
Get
()[
0
]);
auto
const
UL_col
=
InIt_UL
.
Get
()[
0
];
auto
const
UR_col
=
InIt_UR
.
Get
()[
0
];
auto
const
LR_col
=
InIt_LR
.
Get
()[
0
];
auto
const
LL_col
=
InIt_LL
.
Get
()[
0
];
auto
const
UL_col
=
pt_UL
[
0
];
auto
const
UR_col
=
pt_UR
[
0
];
auto
const
LR_col
=
pt_LR
[
0
];
auto
const
LL_col
=
pt_LL
[
0
];
// Check if No Data
if
(
!
(
UL_col
==
nodata
||
UR_col
==
nodata
||
LR_col
==
nodata
||
LL_col
==
nodata
))
{
// Determine if intersection
auto
const
UR_line
=
InI
t_UR
.
Get
()
[
1
];
auto
const
LR_line
=
InI
t_LR
.
Get
()
[
1
];
auto
const
LL_line
=
InI
t_LL
.
Get
()
[
1
];
auto
const
UR_line
=
p
t_UR
[
1
];
auto
const
LR_line
=
p
t_LR
[
1
];
auto
const
LL_line
=
p
t_LL
[
1
];
// Pixel of otb::VectorImage (input) : 4 Components : C, L, Z and Y
int
i_InSideUp
,
i_InSideDown
,
i_OutSideUp
,
i_OutSideDown
;
...
...
@@ -1004,19 +972,14 @@ SARDEMPolygonsAnalysisImageFilter< TImageIn, TImageOut, TImageDEM, TImageSAR, TF
if
(
hasIntersection
)
{
// Store the polygons
Polygon_SideInUp_VecLine
[
countDEMLine
].
push_back
(
tabIn
I
t
[
i_InSideUp
]
->
Get
()
);
Polygon_SideInDown_VecLine
[
countDEMLine
].
push_back
(
tabIn
I
t
[
i_InSideDown
]
->
Get
()
);
Polygon_SideOutUp_VecLine
[
countDEMLine
].
push_back
(
tabIn
I
t
[
i_OutSideUp
]
->
Get
()
);
Polygon_SideOutDown_VecLine
[
countDEMLine
].
push_back
(
tabIn
I
t
[
i_OutSideDown
]
->
Get
()
);
Polygon_SideInUp_VecLine
[
countDEMLine
].
push_back
(
*
tabIn
P
t
[
i_InSideUp
]);
Polygon_SideInDown_VecLine
[
countDEMLine
].
push_back
(
*
tabIn
P
t
[
i_InSideDown
]);
Polygon_SideOutUp_VecLine
[
countDEMLine
].
push_back
(
*
tabIn
P
t
[
i_OutSideUp
]);
Polygon_SideOutDown_VecLine
[
countDEMLine
].
push_back
(
*
tabIn
P
t
[
i_OutSideDown
]);
}
}
}
// Next Column For input
++
InIt_UL
;
++
InIt_UR
;
++
InIt_LR
;
++
InIt_LL
;
}
// End colunms (input)
...
...
@@ -1033,12 +996,6 @@ SARDEMPolygonsAnalysisImageFilter< TImageIn, TImageOut, TImageDEM, TImageSAR, TF
++
countDEMLine
;
// Next Line For input
InIt_UL
.
NextLine
();
InIt_UR
.
NextLine
();
InIt_LR
.
NextLine
();
InIt_LL
.
NextLine
();
}
// End of lines (input)
///////////////////////////// Scan of all selected polygons to extract wanted data //////////////
...
...
This diff is collapsed.
Click to expand it.
include/otbVLVPointIterator.h
+
2
−
0
View file @
5ed90b5b
...
...
@@ -98,6 +98,8 @@ struct VLVPointIterator
return
itk
::
VariableLengthVector
<
typename
std
::
remove_cv
<
T
>::
type
>
(
m_p
,
m_nb_bands
);
}
decltype
(
auto
)
data
()
const
noexcept
{
return
m_p
;
}
// itk::VariableLengthVector<typename std::remove_cv<T>::type> operator*() noexcept {
// return itk::VariableLengthVector<T>(m_p, m_nb_bands);
// }
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment