필터 지우기
필터 지우기

resize image on read

조회 수: 5 (최근 30일)
Nathan Jessurun
Nathan Jessurun 2019년 10월 20일
편집: Nathan Jessurun 2019년 10월 20일
I am working with very high-resolution images, where reading in the image takes most of the processing time. Is there a more efficient method of reading a resized version of the image than X = imresize(imread('img.png'), ratio)?
The documentation for imread mentions a 'ReductionLevel' parameter, but it isn't present for my images. Moreover, it doesn't provide the same level of flexibility as imresize.
Note: I can't save a resized version of the image, since the resizing ratio changes depending on the algorithm and storage becomes an issue.
Thanks for the help!
  댓글 수: 2
KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 10월 20일
.....very high-resolution images....
Sizes?
Nathan Jessurun
Nathan Jessurun 2019년 10월 20일
편집: Nathan Jessurun 2019년 10월 20일
The initial resolutions are 6000x8000x3 (rgb color)

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2019년 10월 20일
ReductionLevel is only an option for JPG images, not PNG images. 6000x8000 is not really that huge. How long does it ake to read in? You might look into the memmapfile() function.
  댓글 수: 1
Nathan Jessurun
Nathan Jessurun 2019년 10월 20일
편집: Nathan Jessurun 2019년 10월 20일
True, the images are not that large, but the profiler indicates reading images (specifically 'pngreadc') constitutes about 15% of my total runtime (the program mainly consists of morphological operations). This proportion is drastically reduced when I use smaller images.
Thank you for the memmap suggestion! I will see if I can use it to read downsampled data from the image.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by