-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Open
Labels
Description
OE-XX Support I/O functionality through std::istream/ostream
- Status: Draft
Introduction and Rationale
OpenCV library includes functionality for I/O. Currently it is file-name based.
Current approach has several issues:
- lack of cross-platform Unicode symbols support (only UTF-8 file paths may work)
- it requires files (no direct access to Java packed resources from .JAR/.AAR) or has workarounds like
imdecode()
Proposed solutions
Extend functionality of existed I/O functions and their internal backends:
- imread/imwrite
- FileStorage
- DNN's network reader
Expected changes (in case of data reading):
- C++: add overload which accepts
std::istream - Python: add wrapper/implementation over
std::istreamfor Python-based file/stream handles (like open() calls) - Java: add wrapper/implementation over
std::istreamfor Java InputStream / ByteBuffer / etc
Handling of Unicode files paths responsibility would be moved on the side of C++ standard library (through robust std::wstring or std::filesystem::path).
Similar idea is for Python/Java code.
Extra: Python/Java may support network(HTTP) input streams.
In-memory handling would be improved too (through std::istream wrapper).
Possible issues
Not all image readers backends may support new feature (depends on 3rdparty).
Impact on existing code, compatibility
No impact is expected on existing C++ code.
References
Reactions are currently unavailable