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
1a32c5a5
Commit
1a32c5a5
authored
18 years ago
by
Thomas Feuvrier
Browse files
Options
Downloads
Patches
Plain Diff
nomsg
parent
16b8b2cb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/FeatureExtraction/otbFlst.h
+0
-191
0 additions, 191 deletions
Code/FeatureExtraction/otbFlst.h
Code/FeatureExtraction/otbFlst.txx
+0
-1004
0 additions, 1004 deletions
Code/FeatureExtraction/otbFlst.txx
with
0 additions
and
1195 deletions
Code/FeatureExtraction/otbFlst.h
deleted
100644 → 0
+
0
−
191
View file @
16b8b2cb
/*=========================================================================
Programme : OTB (ORFEO ToolBox)
Auteurs : CS - P.Imbo
Language : C++
Date : 24 janvier 2006
Role :
$Id$
=========================================================================*/
#ifndef __otbFlst_h
#define __otbFlst_h
#include
"itkImage.h"
#include
"otbImageToTreeFilter.h"
#include
"otbTreeNeighborhood.h"
#include
"otbShape.h"
#include
"itkPolyLineParametricPath.h"
#include
"itkTreeContainer.h"
namespace
otb
{
/** \class Flst
* \brief Algorithme de Fast Level Sets Transform of an image
*
*/
template
<
class
TInputImage
,
class
TOutputTree
=
itk
::
PolyLineParametricPath
<
2
>
>
class
ITK_EXPORT
Flst
:
public
ImageToTreeFilter
<
TInputImage
,
TOutputTree
>
{
public:
typedef
itk
::
PolyLineParametricPath
<
2
>
PathType
;
typedef
typename
PathType
::
Pointer
PathPointer
;
typedef
itk
::
TreeContainer
<
PathPointer
>
TreeType
;
typedef
typename
TreeType
::
Pointer
TreePointer
;
/** Standard class typedefs. */
typedef
Flst
Self
;
typedef
ImageToTreeFilter
<
TInputImage
,
TOutputTree
>
Superclass
;
typedef
itk
::
SmartPointer
<
Self
>
Pointer
;
typedef
itk
::
SmartPointer
<
const
Self
>
ConstPointer
;
/** Methode pour la gestion "object factory". */
itkNewMacro
(
Self
);
/** Retourne le nom de la classe. */
itkTypeMacro
(
Flst
,
ImageToTreeFilter
);
itkStaticConstMacro
(
InputImageDimension
,
unsigned
int
,
TInputImage
::
ImageDimension
);
/** "typedef" pour simplifier la dfinition et la dclaration de variables. */
typedef
typename
Superclass
::
InputImageType
InputImageType
;
typedef
typename
Superclass
::
InputImagePointer
InputImagePointer
;
typedef
typename
Superclass
::
InputImageRegionType
InputImageRegionType
;
typedef
typename
Superclass
::
InputImagePixelType
InputImagePixelType
;
typedef
typename
Superclass
::
InputImageSizeType
InputImageSizeType
;
typedef
typename
Superclass
::
InputImageValueType
InputImageValueType
;
typedef
typename
Superclass
::
InputImageIndexType
InputImageIndexType
;
typedef
typename
Superclass
::
OutputTreeType
OutputTreeType
;
typedef
typename
Superclass
::
OutputTreePointer
OutputTreePointer
;
typedef
typename
Superclass
::
OutputTreeConstPointer
OutputTreeConstPointer
;
typedef
itk
::
Image
<
int
,
2
>
IntImageType
;
typedef
typename
IntImageType
::
Pointer
IntImagePointer
;
typedef
typename
IntImageType
::
ConstPointer
IntImageConstPointer
;
typedef
typename
IntImageType
::
IndexType
IntImageIndexType
;
typedef
typename
IntImageType
::
PixelType
IntImagePixelType
;
typedef
itk
::
Image
<
float
,
2
>
RealImageType
;
typedef
typename
RealImageType
::
Pointer
RealImagePointer
;
typedef
typename
RealImageType
::
ConstPointer
RealImageConstPointer
;
typedef
typename
RealImageType
::
IndexType
RealImageIndexType
;
protected:
Flst
();
virtual
~
Flst
();
virtual
void
GenerateData
();
void
PrintSelf
(
std
::
ostream
&
os
,
itk
::
Indent
indent
)
const
;
/* Optimization parameters. Probably should depend on image size, but these
values seem good for most images. */
static
const
int
INIT_MAX_AREA
;
static
const
int
STEP_MAX_AREA
;
/* A 'local configuration' of the pixel is the logical 'or' of these values,
stored in one byte. Corresponding bit is set if the neighbor is in region */
static
const
int
EAST
;
static
const
int
NORTH_EAST
;
static
const
int
NORTH
;
static
const
int
NORTH_WEST
;
static
const
int
WEST
;
static
const
int
SOUTH_WEST
;
static
const
int
SOUTH
;
static
const
int
SOUTH_EAST
;
/* Gives for each configuration of the neighborhood around the pixel the number
of new cc's of the complement created (sometimes negative, since
cc's can be deleted), when the pixel is appended to the region.
Configurations are stored on one byte.
tabPatterns[0]: set in 4-connectedness and complement in 8-connectedness.
tabPatterns[1]: set in 8-connectedness and complement in 4-connectedness. */
static
const
char
tabPatterns
[
2
][
256
];
void
init_image_of_visited_pixels
(
int
***
ptabtabVisitedPixels
);
void
free_image_of_visited_pixels
(
int
**
tabtabVisitedPixels
);
void
init_region
(
int
iMaxArea
);
void
free_region
();
void
init_output_image
(
const
InputImageType
*
image
,
float
***
ptabtabPixelsOutput
);
void
free_output_image
(
float
**
tabtabPixelsOutput
);
void
add_neighbor
(
Neighborhood
*
pNeighborhood
,
short
int
x
,
short
int
y
,
float
value
);
void
remove_neighbor
(
Neighborhood
*
pNeighborhood
);
char
is_local_min
(
float
**
ou
,
short
int
x
,
short
int
y
,
char
b8Connected
);
char
is_local_max
(
float
**
ou
,
short
int
x
,
short
int
y
,
char
b8Connected
);
void
levelize
(
float
**
tabtabPixelsOutput
,
Point_plane
*
tabPoints
,
int
iNbPoints
,
float
newGray
);
unsigned
char
configuration
(
int
**
tabtabVisitedPixels
,
short
int
x
,
short
int
y
);
Shape
*
new_shape
(
int
iCurrentArea
,
float
currentGrayLevel
,
char
bOfInferiorType
,
Shape
*
pChild
);
void
update_smallest_shapes
(
Point_plane
*
tabPoints
,
int
iNbPoints
);
void
connect
(
Point_plane
*
tabPoints
,
int
iNbPoints
,
Connection
*
tabConnections
,
Shape
*
pSmallestShape
);
void
new_connection
(
Point_plane
*
pPoint
,
float
level
,
Connection
*
tabConnections
);
/* Is the neighbor pixel already stored for this exploration? */
int
NEIGHBOR_NOT_STORED
(
short
int
x
,
short
int
y
)
{
return
(
tabtabVisitedNeighbors
[
y
][
x
]
<
iExploration
);
};
void
store_4neighbors
(
float
**
ou
,
short
int
x
,
short
int
y
,
Neighborhood
*
pNeighborhood
);
void
store_8neighbors
(
float
**
ou
,
short
int
x
,
short
int
y
,
Neighborhood
*
pNeighborhood
);
char
add_iso_level
(
Point_plane
*
tabPointsInShape
,
int
*
pCurrentArea
,
float
currentGrayLevel
,
Neighborhood
*
pNeighborhood
,
float
**
ou
,
int
**
tabtabVisitedPixels
,
char
*
p8Connected
,
char
*
pIgnoreHoles
);
void
find_terminal_branch
(
float
**
ou
,
int
**
tabtabVisitedPixels
,
short
int
x
,
short
int
y
,
char
b8Connected
,
Neighborhood
*
pNeighborhood
,
Connection
*
tabConnections
);
void
scan
(
float
**
tabtabPixelsOutput
,
int
**
tabtabVisitedPixels
,
Neighborhood
*
pNeighborhood
,
Connection
*
tabConnections
);
void
PrintTree
(
Shapes
*
pTree
);
void
print_PointsInShape
();
void
print_visited_pixels
(
int
**
ptabtabVisitedPixels
);
void
PrintPixelOutput
(
float
**
tabtabPixelsOutput
);
void
insert_children
(
Shape
*
pParent
,
Shape
*
pNewChildToInsert
);
// itkSetMacro(MinArea, int);
// itkGetConstReferenceMacro(MinArea, int);
private
:
Flst
(
const
Self
&
);
//purposely not implemented
void
operator
=
(
const
Self
&
);
//purposely not implemented
int
iWidth
;
int
iHeight
;
int
iMinArea
;
int
iMaxArea
;
int
iAreaImage
;
int
iHalfAreaImage
;
int
iPerimeterImage
;
int
iExploration
;
/* Used to avoid reinitializing images */
Point_plane
*
tabPointsInShape
;
int
**
tabtabVisitedNeighbors
;
/* Exterior boundary */
Shapes
*
pGlobalTree
;
int
iAtBorder
;
/* #points meeting at border of image */
};
}
// end namespace otb
#ifndef OTB_MANUAL_INSTANTIATION
#include
"otbFlst.txx"
#endif
#endif
This diff is collapsed.
Click to expand it.
Code/FeatureExtraction/otbFlst.txx
deleted
100644 → 0
+
0
−
1004
View file @
16b8b2cb
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