tweak imread+imwrite to work with binary data instead of actual files ("just" skip file reading and writing)
조회 수: 1 (최근 30일)
이전 댓글 표시
dear all, has anybody tried tweaking imread and imwrite to read/write from/to (say uint8) data arrays rather than an actual (say png) file? basically "just" skip the binary file reading and writing in pngreadc (mexfile). background of my question is that i would like to use compressed images in hdf5 files. same applies to mp4 btw. any hint very much appreciated.
i created a very inefficient workaround by using imwrite to tempfile, then read this tempfile as uint8 (to get the data array) and finally delete tempfile.
PS: I contacted MW some time agao and they claimed it cant be done now, but noted feature request
댓글 수: 4
AndresVar
2022년 2월 10일
In the past I used the method someone else made to read frames from an MRAW recording. Basically just uses fopen, fseek and fread. I have not tried for your purpose but seems like you might be able to get some inspiration from these links:
Reader class for Photron .mraw-Files - File Exchange - MATLAB Central (mathworks.com) See the getFrame method
For what is worth eventually I switch to saving recordings as TIF files, because it was a pain to carry around huge single files (difficult to backup). Depends on how you use your data.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!