Commit 63f3f776 authored by Julien Michel's avatar Julien Michel

REFAC: Remove RoadExtraction module

parent 87933f00
<PAMDataset>
<SRS>PROJCS["WGS 84 / UTM zone 32N",
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",9],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","32632"]]</SRS>
<GeoTransform> 4.3913640000000002e+05, 5.9999999999999998e-01, 0.0000000000000000e+00, 5.2737065999999996e+06, 0.0000000000000000e+00, -5.9999999999999998e-01</GeoTransform>
<Metadata domain="IMAGE_STRUCTURE">
<MDI key="INTERLEAVE">PIXEL</MDI>
</Metadata>
<Metadata>
<MDI key="AREA_OR_POINT">Area</MDI>
</Metadata>
</PAMDataset>
<PAMDataset>
<SRS>PROJCS["WGS 84 / UTM zone 32N",
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",9],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","32632"]]</SRS>
<GeoTransform> 4.3913640000000002e+05, 5.9999999999999998e-01, 0.0000000000000000e+00, 5.2737065999999996e+06, 0.0000000000000000e+00, -5.9999999999999998e-01</GeoTransform>
<Metadata>
<MDI key="AREA_OR_POINT">Area</MDI>
</Metadata>
</PAMDataset>
<PAMDataset>
<SRS>PROJCS["WGS 84 / UTM zone 32N",
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",9],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","32632"]]</SRS>
<GeoTransform> 4.3913640000000002e+05, 5.9999999999999998e-01, 0.0000000000000000e+00, 5.2737065999999996e+06, 0.0000000000000000e+00, -5.9999999999999998e-01</GeoTransform>
<Metadata domain="IMAGE_STRUCTURE">
<MDI key="INTERLEAVE">PIXEL</MDI>
</Metadata>
<Metadata>
<MDI key="AREA_OR_POINT">Area</MDI>
</Metadata>
</PAMDataset>
This diff is collapsed.
--------------------------------------------------------------------------
MAX ANGULAR :0.174533(10 deg.)
INPUT list of Path :
Path 1: [1, 1], [5, 1], [7, 1], [11, 1], [21, 1], [31, 1]
Path 2: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11]
Path 3: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11]
Path 4: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11], [58, 11], [70, 11]
Path 5: [1, 11], [5, 11], [7, 11], [11, 11], [21, 1], [31, 1], [41, 1]
Path 6: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 21], [41, 31]
Path 7: [1, 1], [5, 1], [5, 11], [5, 21]
Path 8: [1, 1], [31, 1], [41, 1]
OUTPUT list of Path :
Path 1: [1, 1], [5, 1], [7, 1], [11, 1], [21, 1], [31, 1]
Path 2: [1, 1], [5, 1], [7, 1], [11, 1]
Path 3: [11, 1], [21, 11]
Path 4: [21, 11], [31, 11]
Path 5: [1, 1], [5, 1], [7, 1], [11, 1]
Path 6: [11, 1], [21, 11]
Path 7: [21, 11], [31, 11], [41, 11]
Path 8: [1, 1], [5, 1], [7, 1], [11, 1]
Path 9: [11, 1], [21, 11]
Path 10: [21, 11], [31, 11], [41, 11], [58, 11], [70, 11]
Path 11: [1, 11], [5, 11], [7, 11], [11, 11]
Path 12: [11, 11], [21, 1]
Path 13: [21, 1], [31, 1], [41, 1]
Path 14: [1, 1], [5, 1], [7, 1], [11, 1]
Path 15: [11, 1], [21, 11], [31, 21], [41, 31]
Path 16: [1, 1], [5, 1]
Path 17: [5, 1], [5, 11], [5, 21]
Path 18: [1, 1], [31, 1], [41, 1]
--------------------------------------------------------------------------
MAX ANGULAR :0.349066(20 deg.)
INPUT list of Path :
Path 1: [1, 1], [5, 1], [7, 1], [11, 1], [21, 1], [31, 1]
Path 2: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11]
Path 3: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11]
Path 4: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11], [58, 11], [70, 11]
Path 5: [1, 11], [5, 11], [7, 11], [11, 11], [21, 1], [31, 1], [41, 1]
Path 6: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 21], [41, 31]
Path 7: [1, 1], [5, 1], [5, 11], [5, 21]
Path 8: [1, 1], [31, 1], [41, 1]
OUTPUT list of Path :
Path 1: [1, 1], [5, 1], [7, 1], [11, 1], [21, 1], [31, 1]
Path 2: [1, 1], [5, 1], [7, 1], [11, 1]
Path 3: [11, 1], [21, 11]
Path 4: [21, 11], [31, 11]
Path 5: [1, 1], [5, 1], [7, 1], [11, 1]
Path 6: [11, 1], [21, 11]
Path 7: [21, 11], [31, 11], [41, 11]
Path 8: [1, 1], [5, 1], [7, 1], [11, 1]
Path 9: [11, 1], [21, 11]
Path 10: [21, 11], [31, 11], [41, 11], [58, 11], [70, 11]
Path 11: [1, 11], [5, 11], [7, 11], [11, 11]
Path 12: [11, 11], [21, 1]
Path 13: [21, 1], [31, 1], [41, 1]
Path 14: [1, 1], [5, 1], [7, 1], [11, 1]
Path 15: [11, 1], [21, 11], [31, 21], [41, 31]
Path 16: [1, 1], [5, 1]
Path 17: [5, 1], [5, 11], [5, 21]
Path 18: [1, 1], [31, 1], [41, 1]
--------------------------------------------------------------------------
MAX ANGULAR :0.523599(30 deg.)
INPUT list of Path :
Path 1: [1, 1], [5, 1], [7, 1], [11, 1], [21, 1], [31, 1]
Path 2: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11]
Path 3: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11]
Path 4: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11], [58, 11], [70, 11]
Path 5: [1, 11], [5, 11], [7, 11], [11, 11], [21, 1], [31, 1], [41, 1]
Path 6: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 21], [41, 31]
Path 7: [1, 1], [5, 1], [5, 11], [5, 21]
Path 8: [1, 1], [31, 1], [41, 1]
OUTPUT list of Path :
Path 1: [1, 1], [5, 1], [7, 1], [11, 1], [21, 1], [31, 1]
Path 2: [1, 1], [5, 1], [7, 1], [11, 1]
Path 3: [11, 1], [21, 11]
Path 4: [21, 11], [31, 11]
Path 5: [1, 1], [5, 1], [7, 1], [11, 1]
Path 6: [11, 1], [21, 11]
Path 7: [21, 11], [31, 11], [41, 11]
Path 8: [1, 1], [5, 1], [7, 1], [11, 1]
Path 9: [11, 1], [21, 11]
Path 10: [21, 11], [31, 11], [41, 11], [58, 11], [70, 11]
Path 11: [1, 11], [5, 11], [7, 11], [11, 11]
Path 12: [11, 11], [21, 1]
Path 13: [21, 1], [31, 1], [41, 1]
Path 14: [1, 1], [5, 1], [7, 1], [11, 1]
Path 15: [11, 1], [21, 11], [31, 21], [41, 31]
Path 16: [1, 1], [5, 1]
Path 17: [5, 1], [5, 11], [5, 21]
Path 18: [1, 1], [31, 1], [41, 1]
--------------------------------------------------------------------------
MAX ANGULAR :0.872665(50 deg.)
INPUT list of Path :
Path 1: [1, 1], [5, 1], [7, 1], [11, 1], [21, 1], [31, 1]
Path 2: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11]
Path 3: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11]
Path 4: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11], [58, 11], [70, 11]
Path 5: [1, 11], [5, 11], [7, 11], [11, 11], [21, 1], [31, 1], [41, 1]
Path 6: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 21], [41, 31]
Path 7: [1, 1], [5, 1], [5, 11], [5, 21]
Path 8: [1, 1], [31, 1], [41, 1]
OUTPUT list of Path :
Path 1: [1, 1], [5, 1], [7, 1], [11, 1], [21, 1], [31, 1]
Path 2: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11]
Path 3: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11]
Path 4: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11], [58, 11], [70, 11]
Path 5: [1, 11], [5, 11], [7, 11], [11, 11], [21, 1], [31, 1], [41, 1]
Path 6: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 21], [41, 31]
Path 7: [1, 1], [5, 1]
Path 8: [5, 1], [5, 11], [5, 21]
Path 9: [1, 1], [31, 1], [41, 1]
--------------------------------------------------------------------------
MAX ANGULAR :1.5708(90 deg.)
INPUT list of Path :
Path 1: [1, 1], [5, 1], [7, 1], [11, 1], [21, 1], [31, 1]
Path 2: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11]
Path 3: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11]
Path 4: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11], [58, 11], [70, 11]
Path 5: [1, 11], [5, 11], [7, 11], [11, 11], [21, 1], [31, 1], [41, 1]
Path 6: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 21], [41, 31]
Path 7: [1, 1], [5, 1], [5, 11], [5, 21]
Path 8: [1, 1], [31, 1], [41, 1]
OUTPUT list of Path :
Path 1: [1, 1], [5, 1], [7, 1], [11, 1], [21, 1], [31, 1]
Path 2: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11]
Path 3: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11]
Path 4: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11], [58, 11], [70, 11]
Path 5: [1, 11], [5, 11], [7, 11], [11, 11], [21, 1], [31, 1], [41, 1]
Path 6: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 21], [41, 31]
Path 7: [1, 1], [5, 1], [5, 11], [5, 21]
Path 8: [1, 1], [31, 1], [41, 1]
--------------------------------------------------------------------------
MAX ANGULAR :2.44346(140 deg.)
INPUT list of Path :
Path 1: [1, 1], [5, 1], [7, 1], [11, 1], [21, 1], [31, 1]
Path 2: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11]
Path 3: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11]
Path 4: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11], [58, 11], [70, 11]
Path 5: [1, 11], [5, 11], [7, 11], [11, 11], [21, 1], [31, 1], [41, 1]
Path 6: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 21], [41, 31]
Path 7: [1, 1], [5, 1], [5, 11], [5, 21]
Path 8: [1, 1], [31, 1], [41, 1]
OUTPUT list of Path :
Path 1: [1, 1], [5, 1], [7, 1], [11, 1], [21, 1], [31, 1]
Path 2: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11]
Path 3: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11]
Path 4: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11], [58, 11], [70, 11]
Path 5: [1, 11], [5, 11], [7, 11], [11, 11], [21, 1], [31, 1], [41, 1]
Path 6: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 21], [41, 31]
Path 7: [1, 1], [5, 1], [5, 11], [5, 21]
Path 8: [1, 1], [31, 1], [41, 1]
--------------------------------------------------------------------------
MAX ANGULAR :3.14159(180 deg.)
INPUT list of Path :
Path 1: [1, 1], [5, 1], [7, 1], [11, 1], [21, 1], [31, 1]
Path 2: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11]
Path 3: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11]
Path 4: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11], [58, 11], [70, 11]
Path 5: [1, 11], [5, 11], [7, 11], [11, 11], [21, 1], [31, 1], [41, 1]
Path 6: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 21], [41, 31]
Path 7: [1, 1], [5, 1], [5, 11], [5, 21]
Path 8: [1, 1], [31, 1], [41, 1]
OUTPUT list of Path :
Path 1: [1, 1], [5, 1], [7, 1], [11, 1], [21, 1], [31, 1]
Path 2: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11]
Path 3: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11]
Path 4: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11], [58, 11], [70, 11]
Path 5: [1, 11], [5, 11], [7, 11], [11, 11], [21, 1], [31, 1], [41, 1]
Path 6: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 21], [41, 31]
Path 7: [1, 1], [5, 1], [5, 11], [5, 21]
Path 8: [1, 1], [31, 1], [41, 1]
INPUT list of Path :
Path 1: [157, 335], [204, 376]
Path 2: [21, 305], [35, 308], [77, 354], [85, 358]
Path 3: [73, 160], [126, 173]
OUTPUT list of Path :
Path 1: [157, 335], [204, 376] Value: 4.68584e-07
Path 2: [21, 305], [35, 308], [77, 354], [85, 358] Value: 1.87363e-07
Path 3: [73, 160], [126, 173] Value: 9.76259e-08
Maximum distance threshold: 30 (30)
Maximum angle threshold: 0.698132 (40)
INPUT list of Path :
Path 1: [1, 1], [51, 1]
Path 2: [61, 1], [91, 1]
Path 3: [111, 11], [211, 11]
Path 4: [1, 51], [51, 51]
Path 5: [71, 71], [71, 91]
Path 6: [71, 131], [71, 201]
Path 7: [141, 111], [101, 111]
Path 8: [151, 111], [191, 111]
Path 9: [111, 71], [141, 71]
Path 10: [181, 71], [151, 71]
Path 11: [11, 131], [11, 101]
Path 12: [11, 171], [11, 141]
OUTPUT list of Path :
Path 1: [1, 51], [51, 51]
Path 2: [71, 71], [71, 91]
Path 3: [71, 131], [71, 201]
Path 4: [211, 11], [111, 11], [91, 1], [61, 1], [51, 1], [1, 1]
Path 5: [101, 111], [141, 111], [151, 111], [191, 111]
Path 6: [111, 71], [141, 71], [151, 71], [181, 71]
Path 7: [11, 101], [11, 131], [11, 141], [11, 171]
Minimum Mean Distance: 10 (10)
INPUT list of Path :
Path 1: [1, 1], [1, 11]
Path 2: [1, 1], [5, 1], [7, 1], [11, 1]
Path 3: [1, 1], [7, 7], [21, 21], [31, 31], [41, 41]
Path 4: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11], [58, 11], [70, 11]
OUTPUT list of Path :
Path 1: [1, 1], [7, 7], [21, 21], [31, 31], [41, 41]
TOLERANCE: 1(1)
INPUT list of Path :
Path 1: [1, 1], [5, 1], [7, 1], [11, 1], [21, 1], [31, 1]
Path 2: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11]
Path 3: [1, 1], [5, 5], [7, 7], [11, 11], [21, 21], [31, 31], [41, 41]
Path 4: [1, 1], [5, 1], [7, 1], [11, 1], [21, 11], [31, 11], [41, 11], [58, 11], [70, 11]
OUTPUT list of Path :
Path 1: [1, 1], [31, 1]
Path 2: [1, 1], [11, 1], [21, 11], [31, 11]
Path 3: [1, 1], [41, 41]
Path 4: [1, 1], [11, 1], [21, 11], [70, 11]
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
ENVI
description = {
/home2/julien/ORFEO-TOOLBOX/otb-build/debug/OTB/Testing/Temporary/feTvNeigborhoodScalarProductDirectionOutput}
samples = 1000
lines = 1000
bands = 1
header offset = 0
file type = ENVI Standard
data type = 5
interleave = bsq
byte order = 0
map info = {UTM, 1, 1, 439136.400000, 5273706.600000, 0.600000, 0.600000, 32, North}
band names = {
Band 1}
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
ENVI
description = {
/home2/julien/ORFEO-TOOLBOX/otb-build/debug/OTB/Testing/Temporary/feTvNeigborhoodScalarProductModulusOutput}
samples = 1000
lines = 1000
bands = 1
header offset = 0
file type = ENVI Standard
data type = 5
interleave = bsq
byte order = 0
map info = {UTM, 1, 1, 439136.400000, 5273706.600000, 0.600000, 0.600000, 32, North}
band names = {
Band 1}
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
ENVI
description = {
/home2/julien/ORFEO-TOOLBOX/otb-build/debug/OTB/Testing/Temporary/feTvRemoveIsolatedByDirectionOutput}
samples = 1000
lines = 1000
bands = 1
header offset = 0
file type = ENVI Standard
data type = 5
interleave = bsq
byte order = 0
map info = {UTM, 1, 1, 439136.400000, 5273706.600000, 0.600000, 0.600000, 32, North}
band names = {
Band 1}
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
ENVI
description = {
/home2/julien/ORFEO-TOOLBOX/otb-build/debug/OTB/Testing/Temporary/feTvNonMaxRemovalByDirectionOutput}
samples = 1000
lines = 1000
bands = 1
header offset = 0
file type = ENVI Standard
data type = 5
interleave = bsq
byte order = 0
map info = {UTM, 1, 1, 439136.400000, 5273706.600000, 0.600000, 0.600000, 32, North}
band names = {
Band 1}
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
ENVI
description = {
/home2/julien/ORFEO-TOOLBOX/otb-build/debug/OTB/Testing/Temporary/bfTvSpectralAngleDistanceOutput}
samples = 1000
lines = 1000
bands = 1
header offset = 0
file type = ENVI Standard
data type = 5
interleave = bsq
byte order = 0
map info = {UTM, 1, 1, 439136.400000, 5273706.600000, 0.600000, 0.600000, 32, North}
band names = {
Band 1}
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
ENVI
description = {
/home2/julien/ORFEO-TOOLBOX/otb-build/debug/OTB/Testing/Temporary/feTvRemoveWrongDirectionOutput}
samples = 1000
lines = 1000
bands = 1
header offset = 0
file type = ENVI Standard
data type = 5
interleave = bsq
byte order = 0
map info = {UTM, 1, 1, 439136.400000, 5273706.600000, 0.600000, 0.600000, 32, North}
band names = {
Band 1}
......@@ -38,18 +38,6 @@ target_link_libraries(CorrelationLineDetectorExample ${OTB_LIBRARIES})
add_executable(EdgeDensityExample EdgeDensityExample.cxx)
target_link_libraries(EdgeDensityExample ${OTB_LIBRARIES})
#OTBRoadExtraction depends OTBMathParser. But OTB_USE_MUPARSER is OFF
if(OTBMathParser_LOADED)
add_executable(ExtractRoadByStepsExample ExtractRoadByStepsExample.cxx)
target_link_libraries(ExtractRoadByStepsExample ${OTB_LIBRARIES})
add_executable(ExtractRoadExample ExtractRoadExample.cxx)
target_link_libraries(ExtractRoadExample ${OTB_LIBRARIES})
add_executable(ParallelLineDetectionExample ParallelLineDetectionExample.cxx)
target_link_libraries(ParallelLineDetectionExample ${OTB_LIBRARIES})
endif()
add_executable(FlusserMomentsImageFunctionExample FlusserMomentsImageFunctionExample.cxx)
target_link_libraries(FlusserMomentsImageFunctionExample ${OTB_LIBRARIES})
......
This diff is collapsed.
/*
* Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
*
* This file is part of Orfeo Toolbox
*
* https://www.orfeo-toolbox.org/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* Example usage:
./ParallelLineDetectionExample Output/Lines.png Output/ParallelLines.png 20 2 10
*/
// This example illustrates the details of the \doxygen{otb}{ParallelLinePathListFilter}.
//
#include "itkPolyLineParametricPath.h"
#include "otbDrawPathListFilter.h"
#include "otbParallelLinePathListFilter.h"
#include "otbImage.h"
#include "otbImageFileWriter.h"
int main(int argc, char* argv[])
{
if (argc != 6)
{
std::cerr << "Usage: " << std::endl;
std::cerr << argv[0] << " outputImage ";
std::cerr << " outputParallelLineImage ";
std::cerr << " distThreshParallel angThreshParallel commonDistThreshParallel" << std::endl;
return EXIT_FAILURE;
}
double distThreshParallel = atof(argv[3]);
double angThreshParallel = atof(argv[4]);
double commonDistThreshParallel = atof(argv[5]);
// We start by creating an empty image
const unsigned int Dimension = 2;
typedef unsigned char PixelType;
typedef otb::Image<PixelType, Dimension> ImageType;
ImageType::Pointer image = ImageType::New();
ImageType::IndexType start;
start[0] = 0;
start[1] = 0;
ImageType::SizeType size;
size[0] = 600;
size[1] = 300;
ImageType::RegionType region;
region.SetSize(size);
region.SetIndex(start);
image->SetRegions(region);
image->Allocate();
image->FillBuffer(itk::NumericTraits<PixelType>::Zero);
// We create some lines
typedef itk::PolyLineParametricPath<Dimension> PathType;
typedef otb::ObjectList<PathType> PathListType;
PathListType::Pointer lineList = PathListType::New();
typedef PathType::ContinuousIndexType ContinuousIndexType;
ContinuousIndexType cindex;
/*-----*/
PathType::Pointer aLine = PathType::New();
aLine->Initialize();
cindex[0] = 1;
cindex[1] = 41;
aLine->AddVertex(cindex);
cindex[0] = 175;
cindex[1] = 204;
aLine->AddVertex(cindex);
lineList->PushBack(aLine);
/*-----*/
aLine = PathType::New();
aLine->Initialize();
cindex[0] = 60;
cindex[1] = 18;
aLine->AddVertex(cindex);
cindex[0] = 203;
cindex[1] = 164;
aLine->AddVertex(cindex);
lineList->PushBack(aLine);
/*-----*/
aLine = PathType::New();
aLine->Initialize();
cindex[0] = 174;
cindex[1] = 99;
aLine->AddVertex(cindex);
cindex[0] = 281;
cindex[1] = 1;
aLine->AddVertex(cindex);
lineList->PushBack(aLine);
/*-----*/
aLine = PathType::New();
aLine->Initialize();
cindex[0] = 3;
cindex[1] = 233;
aLine->AddVertex(cindex);
cindex[0] = 191;
cindex[1] = 227;
aLine->AddVertex(cindex);
lineList->PushBack(aLine);
/*-----*/
aLine = PathType::New();
aLine->Initialize();
cindex[0] = 254;
cindex[1] = 279;
aLine->AddVertex(cindex);
cindex[0] = 351;
cindex[1] = 110;
aLine->AddVertex(cindex);
lineList->PushBack(aLine);
/*-----*/
aLine = PathType::New();
aLine->Initialize();
cindex[0] = 270;
cindex[1] = 287;
aLine->AddVertex(cindex);
cindex[0] = 368;
cindex[1] = 120;
aLine->AddVertex(cindex);
lineList->PushBack(aLine);
/*-----*/
aLine = PathType::New();
aLine->Initialize();
cindex[0] = 355;
cindex[1] = 204;
aLine->AddVertex(cindex);
cindex[0] = 528;
cindex[1] = 199;
aLine->AddVertex(cindex);
lineList->PushBack(aLine);
/*-----*/
aLine = PathType::New();
aLine->Initialize();
cindex[0] = 437;
cindex[1] = 243;
aLine->AddVertex(cindex);
cindex[0] = 591;
cindex[1] = 237;
aLine->AddVertex(cindex);
lineList->PushBack(aLine);
// Polylines are drawn on a black
typedef otb::DrawPathListFilter<ImageType, PathType, ImageType> DrawPathType;
DrawPathType::Pointer drawPathListFilter = DrawPathType::New();
drawPathListFilter->SetInput(image);
drawPathListFilter->SetInputPath(lineList);
drawPathListFilter->SetPathValue(itk::NumericTraits<PixelType>::max());
typedef otb::ImageFileWriter<ImageType> WriterType;
WriterType::Pointer writer = WriterType::New();
writer->SetInput(drawPathListFilter->GetOutput());
writer->SetFileName(argv[1]);
writer->Update();
// Parallel lines are detected. A minimum common length, an angular
// threshold and a maximum distance threshold have to specified.
// The input is a pathList of the previously extracted line segments.
typedef otb::ParallelLinePathListFilter<PathType> ParallelLinePathType;
ParallelLinePathType::Pointer parallelLinePathListFilter = ParallelLinePathType::New();
parallelLinePathListFilter->SetDistanceThreshold(distThreshParallel);
parallelLinePathListFilter->SetAngularThreshold(angThreshParallel);
parallelLinePathListFilter->SetCommonDistanceThreshold(commonDistThreshParallel);
parallelLinePathListFilter->SetInput(lineList);
parallelLinePathListFilter->Update();
// A black background image is built to draw the path on.
ImageType::Pointer outputParallel = ImageType::New();
outputParallel->SetRegions(image->GetLargestPossibleRegion());
outputParallel->Allocate();
outputParallel->FillBuffer(itk::NumericTraits<PixelType>::Zero);
// Parallel lines are drawn on a black background image with \doxygen{otb}{DrawPathListFilter}.
// The \code{SetUseIternalValues()} tells the drawing filter to draw the path with its likelihood
// value.