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
Roman Koetitz
Roman Koetitz 2022년 2월 9일
sorry didnt read your /dev/shm hint carefully enough first, yes a ramdisk might be an inexpensive compromise, havent used it under windows yet though
AndresVar
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:
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 CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by