Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrappings for Orfeo ToolBox applications #30

Open
gpo-geo opened this issue Jul 27, 2018 · 2 comments
Open

Wrappings for Orfeo ToolBox applications #30

gpo-geo opened this issue Jul 27, 2018 · 2 comments

Comments

@gpo-geo
Copy link

gpo-geo commented Jul 27, 2018

This is more a feature request. I propose to integrate a wrapping for Orfeo ToolBox applications. If you have comments about the relevance and feasibility of this feature, feel free to share it.

I have seen that images are handled using Gippy.GeoImage, which wraps GDALRasterBands, so it may not be possible to launch processings using filenames.

@gpo-geo
Copy link
Author

gpo-geo commented Jul 27, 2018

First proof of concept: an edge operator for panchromatic channel.

from satprocess.product import Product
from gippy import GeoImage
import otbApplication as otb

class Edge(Product):
    name = 'edge'
    description = 'Edge extraction'
    dependencies = {'pan': []}

    def process(self, **kwargs):
        super(Edge, self).process(**kwargs)
        if self.geoimg is None:
            geoimgs = self.get_dependencies()
            outputPath = self.filename+".tif"
            appEdge = otb.Registry.CreateApplication("EdgeExtraction")
            appEdge.IN = (geoimgs[0]).filenames()[0]
            appEdge.FILTER = "gradient"
            appEdge.OUT = outputPath
            appEdge.ExecuteAndWriteOutput()
            self.geoimg = GeoImage(outputPath)
        return self.geoimg

A few limitations although, the new product has to use filenames in input and output. It will not work with lambdas from gippy library.

@gpo-geo
Copy link
Author

gpo-geo commented Jul 27, 2018

To do a proper work, it may be necessary to work directly in Gippy library and setup a bridge with OTB...
OTB Applications can use filenames, Numpy arrays, or a swig-wrapping object over the C++ image class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant