Properly extending GIL to support multispectral imagery #757
Replies: 2 comments 2 replies
-
Briefly, yet simply, don't fear from 'injecting' your extension into You can also consider contributing your extension to GIL codebase. |
Beta Was this translation helpful? Give feedback.
-
Remember that the code was first released in the pre-c++11 area and while we try to modernize it, there is a lot of room for improvement. Like the one the AI suggested: make the template parameters variadic for a number of class, especially the one that handle planar representation. So a PR in this direction will be very much appreciated. About the declaration of the typedefs for you plannar types specialization, you can take inspiration from the macros in I am a bit worried about the large number of types that you will need for your application and the potential code bloat associated and compile time performance. Is there any advantage of having the number of channels encoded in the type? Will you be using the dynamic_extension too? About "partially resident image views", do you have in mind loading partial images in memory and process them by block? I know that some I/O drivers support that (e.g. tiif/geotiff), so the framework supports reading a sub-part of an image. |
Beta Was this translation helpful? Give feedback.
-
I am working to create extensions to GIL to support multispectral and hyperspectral imagery, and I might be misunderstanding the GIL extension pattern.
My first project is WorldView 2 and 3. These imagers product 1, 3, 4, 8 and 12 channel imagery at a variety of wavelengths and processing levels. It is important for me to distinguish the specific channels and bit-depths (ie, 8-channel visual and near-infrared data is different from the 8-channel short-wave infrared). It looks like I need to define a nearly identical homogeneous_color_base with each possible number of channels (8, 12 and lots, lots more when I get to the imagers from MODIS and others). While tedious, this can be done in my own source file and injected into the boost::gil::detail namespace. However, it also seems like I need to modify the actual definition of planar_pixel_iterator to have a constructor that takes 8 or 12, etc. different channels. When I go in and make changes inside the GIL codebase, I can get it to work nicely, but this seems to really break the encapsulation of the library. I failed to fork GIL itself, and so I'm struggling to go in and make those changes again after I pulled the latest GIL.
Here is my custom color space
Any guidance on this is appreciated.
Beta Was this translation helpful? Give feedback.
All reactions