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
9d9daf41
Commit
9d9daf41
authored
19 years ago
by
Caroline Ruffel
Browse files
Options
Downloads
Patches
Plain Diff
nomsg
parent
a57b7396
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/FeatureExtraction/otbLineRatioDetector.txx
+13
-13
13 additions, 13 deletions
Code/FeatureExtraction/otbLineRatioDetector.txx
with
13 additions
and
13 deletions
Code/FeatureExtraction/otbLineRatioDetector.txx
+
13
−
13
View file @
9d9daf41
...
@@ -61,6 +61,14 @@ void LineRatioDetector<TInputImage, TOutputImage, InterpolatorType>::GenerateInp
...
@@ -61,6 +61,14 @@ void LineRatioDetector<TInputImage, TOutputImage, InterpolatorType>::GenerateInp
typename TInputImage::RegionType inputRequestedRegion;
typename TInputImage::RegionType inputRequestedRegion;
inputRequestedRegion = inputPtr->GetRequestedRegion();
inputRequestedRegion = inputPtr->GetRequestedRegion();
// Define the size of the region by the radius
m_Radius[0] = static_cast<unsigned int>(3*m_WidthLine + 2);
m_Radius[1] = m_LengthLine ;
// Define the size of the facelist by taking into account the rotation of the region
m_FaceList[0] = static_cast<unsigned int>( sqrt((m_Radius[0]*m_Radius[0])+ (m_Radius[1]*m_Radius[1]))+1 );
m_FaceList[1] = m_FaceList[0];
// pad the input requested region by the operator radius
// pad the input requested region by the operator radius
inputRequestedRegion.PadByRadius( m_Radius );
inputRequestedRegion.PadByRadius( m_Radius );
...
@@ -113,16 +121,6 @@ void LineRatioDetector< TInputImage, TOutputImage, InterpolatorType>
...
@@ -113,16 +121,6 @@ void LineRatioDetector< TInputImage, TOutputImage, InterpolatorType>
typename itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<InputImageType>::FaceListType faceList;
typename itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<InputImageType>::FaceListType faceList;
typename itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<InputImageType>::FaceListType::iterator fit;
typename itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<InputImageType>::FaceListType::iterator fit;
// Define the size of the region by the radius
m_Radius[0] = static_cast<unsigned int>(3*m_WidthLine + 2);
m_Radius[1] = m_LengthLine ;
//std::cout <<"Radius " << m_Radius[0] << " " << m_Radius[1] << std::endl;
// Define the size of the facelist by taking into account the rotation of the region
m_FaceList[0] = static_cast<unsigned int>( sqrt((m_Radius[0]*m_Radius[0])+ (m_Radius[1]*m_Radius[1]))+1 );
m_FaceList[1] = m_FaceList[0];
itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<InputImageType> bC;
itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<InputImageType> bC;
faceList = bC(input, outputRegionForThread, m_FaceList);
faceList = bC(input, outputRegionForThread, m_FaceList);
...
@@ -154,6 +152,8 @@ void LineRatioDetector< TInputImage, TOutputImage, InterpolatorType>
...
@@ -154,6 +152,8 @@ void LineRatioDetector< TInputImage, TOutputImage, InterpolatorType>
// Pixel number in each zone
// Pixel number in each zone
const int NbPixelZone = (2*m_WidthLine+1)*(2*m_LengthLine+1);
const int NbPixelZone = (2*m_WidthLine+1)*(2*m_LengthLine+1);
double InvNbPixelZone = static_cast<double>(1. / NbPixelZone);
// Contains for the 4 directions the sum of the pixels belonging to each zone
// Contains for the 4 directions the sum of the pixels belonging to each zone
double Sum[NB_DIR][NB_ZONE];
double Sum[NB_DIR][NB_ZONE];
...
@@ -269,9 +269,9 @@ void LineRatioDetector< TInputImage, TOutputImage, InterpolatorType>
...
@@ -269,9 +269,9 @@ void LineRatioDetector< TInputImage, TOutputImage, InterpolatorType>
{
{
// Calculation of the mean for the 3 zones
// Calculation of the mean for the 3 zones
M1 = Sum[dir][0]
/ static_cast<double>(
NbPixelZone
)
;
M1 = Sum[dir][0]
* Inv
NbPixelZone;
M2 = Sum[dir][1]
/ static_cast<double>(
NbPixelZone
)
;
M2 = Sum[dir][1]
* Inv
NbPixelZone;
M3 = Sum[dir][2]
/ static_cast<double>(
NbPixelZone
)
;
M3 = Sum[dir][2]
* Inv
NbPixelZone;
// Calculation of the intensity of detection
// Calculation of the intensity of detection
if (( M1 != 0 ) && (M2 != 0))
if (( M1 != 0 ) && (M2 != 0))
...
...
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