Discussion:
[otb-users] python Homologous point
sadewizzpro
2018-09-06 04:34:20 UTC
Permalink
Hi everybody,

I try to use otb library in python for orthorectify Pleiades images. With
the following command line everything works fine on OTB 6.4.0:

*otbcli_HomologousPointsExtraction* -in1 %PANSHARP% -in2 %IMGREF%
-algorithm sift -mode geobins -mode.geobins.binstep 512
-mode.geobins.binsize 512 -mfilter 1 -precision 20 -2wgs84 1 -threshold 0.6
-out %OUT%\HOMOLOGOUS_POINTS_SIFT.txt -outvector
%OUT%\HOMOLOGOUS_POINTS_SIFT.shp -elev.dem %DEM% -elev.geoid %GEOID%

But with python, tie points output and vector output are both empty.
No errors messages are generated.
My slave image refer to a vrt.
There is my python function:

def homologuespoints(bundleinput, imgref, algo, outpts_txt, outpts_shp,
dem, geoid):

HomologousPointsExtraction =
otbApplication.Registry.CreateApplication("HomologousPointsExtraction")
HomologousPointsExtraction.SetParameterString("in1", bundleinput)
HomologousPointsExtraction.SetParameterString("in2", imgref)
HomologousPointsExtraction.SetParameterString("algorithm", algo)
HomologousPointsExtraction.SetParameterString("mode", 'geobins')
HomologousPointsExtraction.SetParameterInt("mode.geobins.binstep", 512)
HomologousPointsExtraction.SetParameterInt("mode.geobins.binsize", 512)
HomologousPointsExtraction.SetParameterFloat("threshold", 0.6)
HomologousPointsExtraction.SetParameterString("2wgs84", '1')
HomologousPointsExtraction.SetParameterString("mfilter", '1')
HomologousPointsExtraction.SetParameterString("out", outpts_txt)
HomologousPointsExtraction.SetParameterString("outvector", outpts_shp)
HomologousPointsExtraction.SetParameterString("elev.geoid", geoid)
HomologousPointsExtraction.SetParameterString("elev.dem", dem)


Also, i faces with antoher problem with OTB 6.6.0. The previous command
line (*otbcli_HomologousPointsExtraction*) dosen't works on this latest
version. Again, no error are detected but my output image don't want to
open in QGIS and her size is way less bigger than expected: 12 000 ko
rather than 2 Go expected.

If Anyone encounter the same issue.
Thank you for you help.

Sade
--
--
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html

You received this message because you are subscribed to the Google
Groups "otb-users" group.
To post to this group, send email to otb-***@googlegroups.com
To unsubscribe from this group, send email to
otb-users+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
---
You received this message because you are subscribed to the Google Groups "otb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to otb-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
SadeWizz
2018-09-07 03:18:11 UTC
Permalink
UPDATE:

My bad, for my first request, i forgotted to put the *precision *parameter...
Now my code works fine.

For my second issue, i didn't mean *otbcli_HomologousPointsExtraction *but
*otbcli_OrthoRectification*.
This is my code bellow that i run on OTB 6.4.0 (and it's fine) and then OTB
6.6.0 (size of image is way less bigger than expected):

otbcli_OrthoRectification -io.in
%PANSHARP%"?&skipcarto=true&geom=%OUTGCP%\PANSHARP_2516342101_REFINE.geom"
-io.out
%OUT%\PANSHARP_ORTHO_2516342101.tif"?&gdal:co:COMPRESS=LZW&gdal:co:TILED=YES&gdal:co:PREDICTOR=2&gdal:co:BIGTIFF=YES&gdal:of:GTiff"
uint16 -outputs.default 0 -elev.dem %DEM% -elev.geoid %GEOID% -map epsg
-map.epsg.code %EPSG% -opt.gridspacing 20 -outputs.spacingx 0.5
-outputs.spacingy -0.5 -opt.ram 3000

There is a bug reported for this issue ?
Post by sadewizzpro
Hi everybody,
I try to use otb library in python for orthorectify Pleiades images. With
*otbcli_HomologousPointsExtraction* -in1 %PANSHARP% -in2 %IMGREF%
-algorithm sift -mode geobins -mode.geobins.binstep 512
-mode.geobins.binsize 512 -mfilter 1 -precision 20 -2wgs84 1 -threshold 0.6
-out %OUT%\HOMOLOGOUS_POINTS_SIFT.txt -outvector
%OUT%\HOMOLOGOUS_POINTS_SIFT.shp -elev.dem %DEM% -elev.geoid %GEOID%
But with python, tie points output and vector output are both empty.
No errors messages are generated.
My slave image refer to a vrt.
def homologuespoints(bundleinput, imgref, algo, outpts_txt, outpts_shp,
HomologousPointsExtraction =
otbApplication.Registry.CreateApplication("HomologousPointsExtraction")
HomologousPointsExtraction.SetParameterString("in1", bundleinput)
HomologousPointsExtraction.SetParameterString("in2", imgref)
HomologousPointsExtraction.SetParameterString("algorithm", algo)
HomologousPointsExtraction.SetParameterString("mode", 'geobins')
HomologousPointsExtraction.SetParameterInt("mode.geobins.binstep", 512)
HomologousPointsExtraction.SetParameterInt("mode.geobins.binsize", 512)
HomologousPointsExtraction.SetParameterFloat("threshold", 0.6)
HomologousPointsExtraction.SetParameterString("2wgs84", '1')
HomologousPointsExtraction.SetParameterString("mfilter", '1')
HomologousPointsExtraction.SetParameterString("out", outpts_txt)
HomologousPointsExtraction.SetParameterString("outvector", outpts_shp)
HomologousPointsExtraction.SetParameterString("elev.geoid", geoid)
HomologousPointsExtraction.SetParameterString("elev.dem", dem)
Also, i faces with antoher problem with OTB 6.6.0. The previous command
line (*otbcli_HomologousPointsExtraction*) dosen't works on this latest
version. Again, no error are detected but my output image don't want to
open in QGIS and her size is way less bigger than expected: 12 000 ko
rather than 2 Go expected.
If Anyone encounter the same issue.
Thank you for you help.
Sade
--
--
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html

You received this message because you are subscribed to the Google
Groups "otb-users" group.
To post to this group, send email to otb-***@googlegroups.com
To unsubscribe from this group, send email to
otb-users+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
---
You received this message because you are subscribed to the Google Groups "otb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to otb-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Manuel Grizonnet
2018-09-10 08:11:53 UTC
Permalink
Hi Sade,

I don't think that this issue was reported. It would be great if you can
open a ticket and describe it in OTB gitlab bug tracker:

<goog_788912623>
https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/issues

Can you confirm that the same command with the same input data (image and
refine geom file) works with otb 6.4?

It would be great also if you can share the data to try to reproduce the
issue (it could be done in a private message with the person who will
investigate the issue).

Thanks in advance,

Manuel
Post by SadeWizz
My bad, for my first request, i forgotted to put the *precision *parameter...
Now my code works fine.
For my second issue, i didn't mean *otbcli_HomologousPointsExtraction *but
*otbcli_OrthoRectification*.
This is my code bellow that i run on OTB 6.4.0 (and it's fine) and then
otbcli_OrthoRectification -io.in
%PANSHARP%"?&skipcarto=true&geom=%OUTGCP%\PANSHARP_2516342101_REFINE.geom"
-io.out
%OUT%\PANSHARP_ORTHO_2516342101.tif"?&gdal:co:COMPRESS=LZW&gdal:co:TILED=YES&gdal:co:PREDICTOR=2&gdal:co:BIGTIFF=YES&gdal:of:GTiff"
uint16 -outputs.default 0 -elev.dem %DEM% -elev.geoid %GEOID% -map epsg
-map.epsg.code %EPSG% -opt.gridspacing 20 -outputs.spacingx 0.5
-outputs.spacingy -0.5 -opt.ram 3000
There is a bug reported for this issue ?
Post by sadewizzpro
Hi everybody,
I try to use otb library in python for orthorectify Pleiades images. With
*otbcli_HomologousPointsExtraction* -in1 %PANSHARP% -in2 %IMGREF%
-algorithm sift -mode geobins -mode.geobins.binstep 512
-mode.geobins.binsize 512 -mfilter 1 -precision 20 -2wgs84 1 -threshold 0.6
-out %OUT%\HOMOLOGOUS_POINTS_SIFT.txt -outvector
%OUT%\HOMOLOGOUS_POINTS_SIFT.shp -elev.dem %DEM% -elev.geoid %GEOID%
But with python, tie points output and vector output are both empty.
No errors messages are generated.
My slave image refer to a vrt.
def homologuespoints(bundleinput, imgref, algo, outpts_txt, outpts_shp,
HomologousPointsExtraction =
otbApplication.Registry.CreateApplication("HomologousPointsExtraction")
HomologousPointsExtraction.SetParameterString("in1", bundleinput)
HomologousPointsExtraction.SetParameterString("in2", imgref)
HomologousPointsExtraction.SetParameterString("algorithm", algo)
HomologousPointsExtraction.SetParameterString("mode", 'geobins')
HomologousPointsExtraction.SetParameterInt("mode.geobins.binstep", 512)
HomologousPointsExtraction.SetParameterInt("mode.geobins.binsize", 512)
HomologousPointsExtraction.SetParameterFloat("threshold", 0.6)
HomologousPointsExtraction.SetParameterString("2wgs84", '1')
HomologousPointsExtraction.SetParameterString("mfilter", '1')
HomologousPointsExtraction.SetParameterString("out", outpts_txt)
HomologousPointsExtraction.SetParameterString("outvector", outpts_shp)
HomologousPointsExtraction.SetParameterString("elev.geoid", geoid)
HomologousPointsExtraction.SetParameterString("elev.dem", dem)
Also, i faces with antoher problem with OTB 6.6.0. The previous command
line (*otbcli_HomologousPointsExtraction*) dosen't works on this latest
version. Again, no error are detected but my output image don't want to
open in QGIS and her size is way less bigger than expected: 12 000 ko
rather than 2 Go expected.
If Anyone encounter the same issue.
Thank you for you help.
Sade
--
--
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html
You received this message because you are subscribed to the Google
Groups "otb-users" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
---
You received this message because you are subscribed to the Google Groups
"otb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
Manuel Grizonnet
--
--
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html

You received this message because you are subscribed to the Google
Groups "otb-users" group.
To post to this group, send email to otb-***@googlegroups.com
To unsubscribe from this group, send email to
otb-users+***@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
---
You received this message because you are subscribed to the Google Groups "otb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to otb-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...