Alternatively, ConnectImage
could be used:
import otbApplication
# Pipeline creation
app1 = otbApplication.Registry.CreateApplication("ManageNoData")
app1.SetParameterString("mode", "changevalue")
app1.SetParameterString("in", "input.tif")
app1.SetParameterString("out", "output_1.tif")
app2 = otbApplication.Registry.CreateApplication("BandMath")
app2.SetParameterString("exp", "im1b1")
app2.SetParameterString("out", "output_2.tif")
app2.ConnectImage("il", app1, "out")
app2.PropagateConnectMode(False)
app2.ExecuteAndWriteOutput()
It is another way to connect the output of an application to the input of another application, then, depending of the value of PropagateConnectMode, all intermediate output will be written on disk (False) or kept in memory (True)
See https://www.orfeo-toolbox.org/CookBook-develop/PythonAPI.html#mixed-in-memory-on-disk-connection
sarParam.gcpTimes["0"] = time;
unless you have a good reason to use to_string
here
You also need to update the md5
There is also Data/Input/lena512color.jp2
, which is the original image in JPEG 2000 format.
There are no reason to use this specific image, and it could be replaced by any other image. However I think it is the only JPEG 2000 image in the OTB test data. Generating another image, with gdal_translate or otb, shouldn't be a problem.
Cédric Traizet (536baab1) at 20 Jan 16:33
Cédric Traizet (192788fc) at 18 Jan 15:08
Cédric Traizet (e2ebaf82) at 18 Jan 15:07
Cédric Traizet (fd2c3bb1) at 18 Jan 07:19
BUG: prevent the use of a raster as geoid if it has no projection
... and 6 more commits
This was indeed a bug of the cmake script, See !886 (merged)
Cédric Traizet (52af559f) at 11 Jan 09:30
Cédric Traizet (6277e4b5) at 10 Jan 17:48
Closes #2233
Add a section about QGIS plugin activation in QGIS>3.22
The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.
Check before merging:
git diff develop... -U0 --no-color | clang-format-diff.py -p1 -i
on latest changes and commitCédric Traizet (3b6043d5) at 10 Jan 17:48
Merge branch '2233_doc_qgis_3_22' into 'release-8.0'
... and 3 more commits
the FindNumpy.cmake file packaged in OTB is broken when used with cmake 3.12 because te name of the Python executable variable has changed in CMake form PYTHON_EXECUTABLE
to Python_EXECUTABLE
. As a result, the script recompiling the Python bindings was not able to find Numpy (for example in Ubuntu 20 where the default is cmake 3.13.3)
This MR fixes this script to handle both cmake <3.12 and cmake >= 3.12
bug reported on this note
TODO; test the generated packages on Ubuntu 18 (cmake 3.10) and Ubuntu 20 (cmake 3.16)
The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.
Check before merging:
git diff develop... -U0 --no-color | clang-format-diff.py -p1 -i
on latest changes and commitCédric Traizet (192788fc) at 10 Jan 17:41
BUG: fix findNumpy.cmake by taking into account the name change of ...
... and 26 more commits
Cédric Traizet (7a690130) at 10 Jan 16:33
REFAC: add warning messages when geoid or dem cannot be opened and ...
... and 7 more commits
Yep, I also noticed that warning on Ubuntu 20.04, but the numpy wrappers seems to be generated correctly anyway. it does not show on Ubuntu 18.04.
I will look into the problem and come back to you.
New application to filter binary masks (water masks, cloud masks, etc).
The application will be based on the BinaryShapeOpeningImageFilter class of ITK and more generally on the Label object representation and manipulation framework (see http://www.insight-journal.org/browse/publication/176).
An attribute is computed for each object in the binary mask, where we define an object as a set of connected pixels in the mask. This attribute can be for example the number of pixels in the image.
If the value of the attribute of an object is lower (or higher, depending on a parameter) than a threshold (parameter), the object is then removed by the filter.
For example if the attribute is the number of pixels, the application will remove all the small objects. But other attributes could be used (see Alternatives for implementations)
The connectivity of the pixels (4-connectivity or 8-connectivity) is a parameter of the application.
This application would be complementary to the BinaryMorphologicalOperation application of the OTB to do image processing on binary images.
The choice of the attribute could be a parameter of the application, Other attributes that could be used
We could also use the BinaryStatisticsOpeningImageFilter class of the ITK : in addition to the mask we provide a feature image (which is the grayscale image to be masked), and the attributes of the objects are computed using the information of the feature image. Possible attributes are :
Instead of removing all objects whose attribute is inferior to a threshold, it is also possible to keep only the N objects with the highest (or lowest) attribute value. I'm not sure if this feature would be useful in remote sensing.
CS
Closing, we gave up the implementation of this application (!37 (closed)) because it was too complex, in particular because of streaming issues with segmentation task.