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
fc846aef
Commit
fc846aef
authored
19 years ago
by
Caroline Ruffel
Browse files
Options
Downloads
Patches
Plain Diff
nomsg
parent
9a668649
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/otbTupinEdgeDetector.h
+3
-0
3 additions, 0 deletions
Code/FeatureExtraction/otbTupinEdgeDetector.h
Code/FeatureExtraction/otbTupinEdgeDetector.txx
+35
-15
35 additions, 15 deletions
Code/FeatureExtraction/otbTupinEdgeDetector.txx
with
38 additions
and
15 deletions
Code/FeatureExtraction/otbTupinEdgeDetector.h
+
3
−
0
View file @
fc846aef
...
...
@@ -150,6 +150,9 @@ private:
/** Radius of the region*/
SizeType
m_Radius
;
/** Size of the facelist*/
SizeType
m_FaceList
;
InterpolatorPointer
m_Interpolator
;
};
...
...
This diff is collapsed.
Click to expand it.
Code/FeatureExtraction/otbTupinEdgeDetector.txx
+
35
−
15
View file @
fc846aef
...
...
@@ -110,17 +110,30 @@ void TupinEdgeDetector< TInputImage, TOutputImage, InterpolatorType>
typename itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<InputImageType>::FaceListType faceList;
typename itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<InputImageType>::FaceListType::iterator fit;
// Define the size of the region by the radius
m_Radius[0] = static_cast<unsigned int>(0.5*( (3*m_WidthLine + 2) - 1 ));
m_Radius[1] = static_cast<unsigned int>(0.5*(m_LengthLine-1));
//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] = sqrt((m_Radius[0]*m_Radius[0])+ (m_Radius[1]*m_Radius[1]));
m_FaceList[1] = m_FaceList[0];
itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<InputImageType> bC;
faceList = bC(input, outputRegionForThread, m_
Radius
);
faceList = bC(input, outputRegionForThread, m_
FaceList
);
// support progress methods/callbacks
itk::ProgressReporter progress(this, threadId, outputRegionForThread.GetNumberOfPixels());
typename TInputImage::IndexType bitIndex;
typename InterpolatorType::ContinuousIndexType Index;
//
Initialisations
// ---------------
//
--------------------------------------------------------------------------
// Number of direction
const int NB_DIR = 4;
// Number of zone
...
...
@@ -136,12 +149,6 @@ void TupinEdgeDetector< TInputImage, TOutputImage, InterpolatorType>
// Number of the zone
int zone;
// Size of the region defined by the radius
m_Radius[0] = static_cast<unsigned int>(0.5*( (3*m_WidthLine + 2) - 1 ));
m_Radius[1] = static_cast<unsigned int>(0.5*m_LengthLine);
std::cout <<"Radius " << m_Radius[0] << " " << m_Radius[1] << std::endl;
// Contains for the 4 directions the sum of the pixels belonging to each zone
double Sum[NB_DIR][NB_ZONE];
// Mean of zone 1, 2 and 3
...
...
@@ -169,6 +176,8 @@ std::cout <<"Radius " << m_Radius[0] << " " << m_Radius[1] << std::endl;
// location of the pixel central between zone 1 and 2 and between zone 1 and 3
int Xc12, Xc13;
//---------------------------------------------------------------------------
// Process each of the boundary faces. These are N-d regions which border
// the edge of the buffer.
...
...
@@ -187,7 +196,7 @@ std::cout <<"Radius " << m_Radius[0] << " " << m_Radius[1] << std::endl;
while ( ! bit.IsAtEnd() )
{
std::cout << bit.GetIndex() << std::endl;
std::cout <<
"Xc,Yc " <<
bit.GetIndex() << std::endl;
// Initialisations
for (int dir=0; dir<NB_DIR; dir++)
...
...
@@ -195,6 +204,7 @@ std::cout << bit.GetIndex() << std::endl;
for (int z=0; z<NB_ZONE; z++)
Sum[dir][z] = 0.;
}
// Location of the central pixel of the region
bitIndex = bit.GetIndex();
...
...
@@ -211,7 +221,8 @@ std::cout << bit.GetIndex() << std::endl;
// Loop on the region
for (i = 0; i < neighborhoodSize; ++i)
{
//std::cout << "---"<< i <<" "<< bit.GetIndex(i)<< std::endl;
std::cout << "---"<< i <<" "<< bit.GetIndex(i)<< std::endl;
std::cout << "val(X,Y) "<< static_cast<double>(bit.GetPixel(i)) << " " << std::endl;
bitIndex = bit.GetIndex(i);
X = bitIndex[0];
...
...
@@ -235,10 +246,19 @@ std::cout << bit.GetIndex() << std::endl;
{
ROTATION( (X-Xc), (Y-Yc), Theta[dir], xout, yout);
point[0] = double(xout + Xc);
point[1] = double(yout + Yc);
Sum[dir][zone] += static_cast<double>(m_Interpolator->Evaluate( point ));
// point[0] = double(xout + Xc);
// point[1] = double(yout + Yc);
Index[0] = static_cast<float>(xout + Xc);
Index[1] = static_cast<float>(yout + Yc);
std::cout << "X' Y' "<< (xout + Xc) << " " << (yout + Yc) << std::endl;
std::cout << "val(X',Y') "<< static_cast<double>(m_Interpolator->Evaluate( point )) << std::endl;
// Sum[dir][zone] += static_cast<double>(m_Interpolator->Evaluate( point ));
Sum[dir][zone] += static_cast<double>(m_Interpolator->EvaluateAtContinuousIndex( Index ));
}
} // end of the loop on the pixels of the region
...
...
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