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
f021d7ae
Commit
f021d7ae
authored
17 years ago
by
Mathieu Deltorre
Browse files
Options
Downloads
Patches
Plain Diff
*Ajout static cast pour convertir un pixel 1 composante vers 1 pixel 3 composantes (RGB)
parent
dec1c08a
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
Testing/Code/FeatureExtraction/otbImageToSIFTKeyPointSetFilter.cxx
+25
-28
25 additions, 28 deletions
...ode/FeatureExtraction/otbImageToSIFTKeyPointSetFilter.cxx
with
25 additions
and
28 deletions
Testing/Code/FeatureExtraction/otbImageToSIFTKeyPointSetFilter.cxx
+
25
−
28
View file @
f021d7ae
...
@@ -92,39 +92,36 @@ int otbImageToSIFTKeyPointSetFilter(int argc, char * argv[])
...
@@ -92,39 +92,36 @@ int otbImageToSIFTKeyPointSetFilter(int argc, char * argv[])
ImageType
::
IndexType
index
=
iterOutput
.
GetIndex
();
ImageType
::
IndexType
index
=
iterOutput
.
GetIndex
();
ImageType
::
PixelType
grayPix
=
reader
->
GetOutput
()
->
GetPixel
(
index
);
ImageType
::
PixelType
grayPix
=
reader
->
GetOutput
()
->
GetPixel
(
index
);
OutputImageType
::
PixelType
rgbPixel
;
OutputImageType
::
PixelType
rgbPixel
;
rgbPixel
.
SetRed
(
grayPix
);
rgbPixel
.
SetRed
(
static_cast
<
unsigned
char
>
(
grayPix
)
);
rgbPixel
.
SetGreen
(
grayPix
);
rgbPixel
.
SetGreen
(
static_cast
<
unsigned
char
>
(
grayPix
)
);
rgbPixel
.
SetBlue
(
grayPix
);
rgbPixel
.
SetBlue
(
static_cast
<
unsigned
char
>
(
grayPix
)
);
iterOutput
.
Set
(
rgbPixel
);
iterOutput
.
Set
(
rgbPixel
);
}
}
if
(
filter
->
GetOutput
()
->
GetNumberOfPoints
()
>
0
)
PointsIteratorType
pIt
=
filter
->
GetOutput
()
->
GetPoints
()
->
Begin
();
PointDataIteratorType
pdIt
=
filter
->
GetOutput
()
->
GetPointData
()
->
Begin
();
while
(
pIt
!=
filter
->
GetOutput
()
->
GetPoints
()
->
End
()
&&
pdIt
!=
filter
->
GetOutput
()
->
GetPointData
()
->
End
()
)
{
{
PointsIteratorType
pIt
=
filter
->
GetOutput
()
->
GetPoints
()
->
Begin
();
ImageType
::
IndexType
index
;
PointDataIteratorType
pdIt
=
filter
->
GetOutput
()
->
GetPointData
()
->
Begin
();
reader
->
GetOutput
()
->
TransformPhysicalPointToIndex
(
pIt
.
Value
(),
index
);
while
(
pIt
!=
filter
->
GetOutput
()
->
GetPoints
()
->
End
()
&&
outfile
<<
"Point: "
<<
pIt
.
Value
()
<<
", Index: "
<<
index
\
pdIt
!=
filter
->
GetOutput
()
->
GetPointData
()
->
End
()
)
<<
" Octave: "
<<
pdIt
.
Value
()[
0
]
\
{
<<
" Scale: "
<<
pdIt
.
Value
()[
1
]
<<
std
::
endl
;
ImageType
::
IndexType
index
;
reader
->
GetOutput
()
->
TransformPhysicalPointToIndex
(
pIt
.
Value
(),
index
);
OutputImageType
::
PixelType
keyPixel
;
outfile
<<
"Point: "
<<
pIt
.
Value
()
<<
", Index: "
<<
index
\
keyPixel
.
SetRed
(
0
);
<<
" Octave: "
<<
pdIt
.
Value
()[
0
]
\
keyPixel
.
SetGreen
(
255
);
<<
" Scale: "
<<
pdIt
.
Value
()[
1
]
<<
std
::
endl
;
keyPixel
.
SetBlue
(
0
);
OutputImageType
::
PixelType
keyPixel
;
outputImage
->
SetPixel
(
index
,
keyPixel
);
keyPixel
.
SetRed
(
0
);
outputImage
->
SetPixel
(
index
+
t
,
keyPixel
);
keyPixel
.
SetGreen
(
255
);
outputImage
->
SetPixel
(
index
+
b
,
keyPixel
);
keyPixel
.
SetBlue
(
0
);
outputImage
->
SetPixel
(
index
+
l
,
keyPixel
);
outputImage
->
SetPixel
(
index
+
r
,
keyPixel
);
outputImage
->
SetPixel
(
index
,
keyPixel
);
++
pIt
;
outputImage
->
SetPixel
(
index
+
t
,
keyPixel
);
++
pdIt
;
outputImage
->
SetPixel
(
index
+
b
,
keyPixel
);
outputImage
->
SetPixel
(
index
+
l
,
keyPixel
);
outputImage
->
SetPixel
(
index
+
r
,
keyPixel
);
++
pIt
;
++
pdIt
;
}
}
}
outfile
.
close
();
outfile
.
close
();
...
...
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