Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
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
David Youssefi
otb
Commits
baeef3ab
Commit
baeef3ab
authored
12 years ago
by
Sebastien Harasse
Browse files
Options
Downloads
Patches
Plain Diff
DOC: mean shift. added comments
parent
32c4770b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/BasicFilters/otbMeanShiftImageFilter2.h
+23
-4
23 additions, 4 deletions
Code/BasicFilters/otbMeanShiftImageFilter2.h
with
23 additions
and
4 deletions
Code/BasicFilters/otbMeanShiftImageFilter2.h
+
23
−
4
View file @
baeef3ab
...
...
@@ -36,7 +36,6 @@ namespace otb
* concatenation of range components and coordinates as a vector. Components are
* scaled by their respective spatial and range bandwidth.
*/
template
<
class
TInputImage
,
class
TOutputJointImage
>
class
SpatialRangeJointDomainTransform
{
...
...
@@ -86,7 +85,6 @@ private:
RealType
m_RangeBandwidth
;
};
class
KernelUniform
{
public:
...
...
@@ -126,8 +124,6 @@ public:
* Iterator for reading pixels over an image region, specialized for faster
* access to pixels in vector images through the method GetPixelPointer
*/
template
<
typename
TImage
>
class
FastImageRegionConstIterator
:
public
itk
::
ImageRegionConstIterator
<
TImage
>
...
...
@@ -161,6 +157,16 @@ public:
};
/** \class BucketImage
*
* This class indexes pixels in a N-dimensional image into a N+1-dimensional
* array of buckets. Each pixel is stored into one bucket depending on its
* position on the lattice (the width of a bucket is given at construction) and
* one spectral component (also given at construction by spectralCoordinate).
*
* The (spatially and spectrally) neighboring buckets of pixels can then be
* obtained by using GetNeighborhoodBucketListIndices().
*/
template
<
class
TImage
>
class
BucketImage
{
...
...
@@ -188,6 +194,14 @@ public:
typedef
std
::
vector
<
BucketType
>
BucketListType
;
BucketImage
()
{}
/** Constructor for the bucket image. It operates on the specified
* region.
* spatialRadius specifies the width of a bucket in pixels.
* rangeRadius is the spectral width for the specified spectral coordinate in
* one bucket.
* spectralCoordinate is the index of the pixel used for classification in buckets.
*/
BucketImage
(
ImageConstPointerType
image
,
const
RegionType
&
region
,
RealType
spatialRadius
,
RealType
rangeRadius
,
unsigned
int
spectralCoordinate
)
{
m_Image
=
image
;
...
...
@@ -282,6 +296,7 @@ public:
~
BucketImage
()
{}
/** Returns the N+1-dimensional bucket index for a given pixel value at the given index */
BucketImageIndexType
GetBucketIndex
(
const
PixelType
&
pixel
,
const
IndexType
&
index
)
{
BucketImageIndexType
bucketIndex
(
ImageDimension
+
1
);
...
...
@@ -293,6 +308,8 @@ public:
return
bucketIndex
;
}
/** Converts a N+1-dimensional bucket index into the 1D list index useable by
GetBucket() */
int
BucketIndexToBucketListIndex
(
const
BucketImageIndexType
&
bucketIndex
)
{
int
bucketListIndex
=
bucketIndex
[
0
];
...
...
@@ -303,6 +320,7 @@ public:
return
bucketListIndex
;
}
/** Retrieves the list of all buckets in the neighborhood of the given bucket */
std
::
vector
<
unsigned
int
>
GetNeighborhoodBucketListIndices
(
int
bucketIndex
)
{
std
::
vector
<
unsigned
int
>
indices
(
m_NeighborhoodOffsetVectorSize
);
...
...
@@ -314,6 +332,7 @@ public:
return
indices
;
}
/* Returns the list of pixels (actually pointer to pixel data) contained in a bucket */
const
BucketType
&
GetBucket
(
unsigned
int
index
)
{
return
m_BucketList
[
index
];
...
...
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