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
Container Registry
Model registry
Operate
Environments
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
Antoine Belvire
otb
Commits
b7709d86
Commit
b7709d86
authored
18 years ago
by
Jordi Inglada
Browse files
Options
Downloads
Patches
Plain Diff
Mise en commentaire dans PixelSuppression
parent
9dd9785a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/FeatureExtraction/otbLocalHoughFilter.txx
+1
-1
1 addition, 1 deletion
Code/FeatureExtraction/otbLocalHoughFilter.txx
Code/FeatureExtraction/otbPixelSuppressionByDirectionImageFilter.txx
+73
-63
73 additions, 63 deletions
...eExtraction/otbPixelSuppressionByDirectionImageFilter.txx
with
74 additions
and
64 deletions
Code/FeatureExtraction/otbLocalHoughFilter.txx
+
1
−
1
View file @
b7709d86
...
...
@@ -231,7 +231,7 @@ LocalHoughFilter<TInputImage>
m_HoughFilter->SetNumberOfLines( m_NumberOfLines );
m_HoughFilter->SetVariance( m_Variance );
m_HoughFilter->SetDiscRadius( m_DiscRadius );
//
m_HoughFilter->SetThreshold( m_Threshold );
m_HoughFilter->SetThreshold( m_Threshold );
m_HoughFilter->Modified();
...
...
This diff is collapsed.
Click to expand it.
Code/FeatureExtraction/otbPixelSuppressionByDirectionImageFilter.txx
+
73
−
63
View file @
b7709d86
...
...
@@ -43,48 +43,48 @@ PixelSuppressionByDirectionImageFilter<TInputImage, TOutputImage>::PixelSuppress
template <class TInputImage, class TOutputImage>
void
PixelSuppressionByDirectionImageFilter<TInputImage, TOutputImage>
::SetInputImage(const InputImageType *input)
PixelSuppressionByDirectionImageFilter<TInputImage, TOutputImage>
::SetInputImage(const InputImageType *input)
{
this->SetInput(0,input);
}
}
template <class TInputImage, class TOutputImage>
void
PixelSuppressionByDirectionImageFilter<TInputImage, TOutputImage>
::SetInputImageDirection(const InputImageType *input)
PixelSuppressionByDirectionImageFilter<TInputImage, TOutputImage>
::SetInputImageDirection(const InputImageType *input)
{
this->SetInput(1,input);
}
template <class TInputImage, class TOutputImage>
template <class TInputImage, class TOutputImage>
const
typename PixelSuppressionByDirectionImageFilter<TInputImage, TOutputImage>::InputImageType *
PixelSuppressionByDirectionImageFilter<TInputImage, TOutputImage>
::GetInputImage(void)
{
if (this->GetNumberOfInputs() < 1)
{
return 0;
}
return static_cast<const TInputImage * >
(this->GetInput(0) );
}
template <class TInputImage, class TOutputImage>
typename PixelSuppressionByDirectionImageFilter<TInputImage, TOutputImage>::InputImageType *
PixelSuppressionByDirectionImageFilter<TInputImage, TOutputImage>
::GetInputImage(void)
{
if (this->GetNumberOfInputs() < 1)
{
return 0;
}
return static_cast<const TInputImage * >
(this->GetInput(0) );
}
template <class TInputImage, class TOutputImage>
const
typename PixelSuppressionByDirectionImageFilter<TInputImage, TOutputImage>::InputImageType *
PixelSuppressionByDirectionImageFilter<TInputImage, TOutputImage>
::GetInputImageDirection(void)
{
if (this->GetNumberOfInputs() < 1)
{
return 0;
}
return static_cast<const TInputImage * >
(this->GetInput(1) );
typename PixelSuppressionByDirectionImageFilter<TInputImage, TOutputImage>::InputImageType *
PixelSuppressionByDirectionImageFilter<TInputImage, TOutputImage>
::GetInputImageDirection(void)
{
if (this->GetNumberOfInputs() < 1)
{
return 0;
}
return static_cast<const TInputImage * >
(this->GetInput(1) );
}
template <class TInputImage, class TOutputImage>
...
...
@@ -244,49 +244,59 @@ void PixelSuppressionByDirectionImageFilter< TInputImage, TOutputImage>::Threade
continue;
// Distance between pixel (x,y) and central pixel
DistanceXY = static_cast<double>(sqrt(x*x+y*y));
//
DistanceXY = static_cast<double>(sqrt(x*x+y*y));
// If the pixel (x,y) is inside the circle of radius m_Radius
if ( DistanceXY <= m_Radius[0] )
{
//
if ( DistanceXY <= m_Radius[0] )
//
{
// Rotation of the system axis in the direction of the central pixel (thetaXcYc)
// (x,y) -> (xt,yt)
TRANSITION_MATRIX( x, y, ThetaXcYc, xt, yt );
// // Rotation of the system axis in the direction of the central pixel (thetaXcYc)
// // (x,y) -> (xt,yt)
// TRANSITION_MATRIX( x, y, ThetaXcYc, xt, yt );
// The absolute value of yt/xt is used to bring back the pixel (xt,yt)
// in positive co-ordinates
// => thetaxtyt is included in the interval [0;PI/2]
if ( xt != 0. )
Thetaxtyt = atan( fabs(yt/xt) );
else
Thetaxtyt = M_PI/2.;
//
// The absolute value of yt/xt is used to bring back the pixel (xt,yt)
//
// in positive co-ordinates
//
// => thetaxtyt is included in the interval [0;PI/2]
//
if ( xt != 0. )
//
Thetaxtyt = atan( fabs(yt/xt) );
//
else
//
Thetaxtyt = M_PI/2.;
// Then, we test if the pixel is included in the interval [0;m_AngularBeam]
if ( (0. <= Thetaxtyt) and
(Thetaxtyt <= m_AngularBeam) )
{
// The pixel is located in the direction of the central pixel
// Get the direction of the pixel (X,Y) in the image of diretions
ThetaXY = static_cast<double>(bit.GetPixel(i));
//
// Then, we test if the pixel is included in the interval [0;m_AngularBeam]
//
if ( (0. <= Thetaxtyt) and
//
(Thetaxtyt <= m_AngularBeam) )
//
{
//
// The pixel is located in the direction of the central pixel
//
// Get the direction of the pixel (X,Y) in the image of diretions
//
ThetaXY = static_cast<double>(bit.GetPixel(i));
// Angular tolerance on the direction of the central pixel
MinThetaXcYc = ThetaXcYc - m_AngularBeam;
MaxThetaXcYc = ThetaXcYc + m_AngularBeam;
//
// Angular tolerance on the direction of the central pixel
//
MinThetaXcYc = ThetaXcYc - m_AngularBeam;
//
MaxThetaXcYc = ThetaXcYc + m_AngularBeam;
// Test if the pixel belongs to a line
if ( (MinThetaXcYc <= ThetaXY)
and
(ThetaXY <= MaxThetaXcYc ) )
//
// Test if the pixel belongs to a line
//
if ( (MinThetaXcYc <= ThetaXY)
&&
//
(ThetaXY <= MaxThetaXcYc ) )
IsLine = true;
}
// IsLine = true;
// }
Thetaxtyt = atan2(y,x) - M_PI/2.0;
if(Thetaxtyt < 0)
Thetaxtyt = M_PI + Thetaxtyt;
// std::cout << sin(Thetaxtyt) << " " << sin(ThetaXcYc) << " " << sin(bit.GetPixel(i)) << std::endl;
if( (fabs(sin(Thetaxtyt-ThetaXcYc)) <= sin(m_AngularBeam)) && (fabs(sin(bit.GetPixel(i)-ThetaXcYc)) <= sin(m_AngularBeam)) )
IsLine = true;
// }
}
}
}
// end of the loop on the pixels of the region
// end of the loop on the pixels of the region
// Assignment of this value to the output pixel
...
...
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