NITF with JPEG2000
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 159
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
Describe the question.
I’m interested in using the python API to decode a NITF file containing a very large image encoded with JPEG2000. A NITF is a container format, encapsulating a header and one or more images. When using JPEG2000 compression, image data is effectively a .jp2 file encapsulated within a larger NITF file.
I’m currently able to discover the extents of the encapsulated image data through other means, read the complete (very large) encoded image to a python variable as bytes, form a code stream from those encoded bytes, and then decode a numpy array for the small ROI I’m interested in. Unfortunately this is relatively inefficient as I have to read and store the complete encoded image just to decode a small portion.
One useful possibility would be a new code stream constructor that takes a file name, byte offset, and byte length. This would let me form a code stream from just the relevant JP2 portion of the encapsulating NITF without reading all bytes into memory.
Would such a constructor be possible? Or is there some other way to achieve decoding for a container format like NITF without reading the entire byte stream to memory?
Thanks in advance for any help!
Check for duplicates
- I have searched the open bugs/issues and have found no duplicates for this bug report
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Python API's current code-stream constructor and the path that decodes a NumPy ROI from encoded bytes. Investigate whether it can read a bounded byte range from an NITF container without loading the full JPEG2000 payload; done means a documented, working approach for decoding the small ROI with bounded input memory.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- computer-vision
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100