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!