필터 지우기
필터 지우기

A method to convert .tif files to .csv files for rapidly accessing pixel values.

조회 수: 17 (최근 30일)
Robert
Robert 2014년 8월 13일
댓글: dpb 2014년 8월 13일
I am proceesing data from 35,000 tif files, 96 at a time. Reading 96 .tif files into RAM (650 1500 pixels each) is very slow, and quickly bogs down (memory leak?). A simpler way to go seems to be to extract the pixel values individually from the files (using csvread(filename,row,column,range)), which avoids cramming the files into memory. Is there a quick way to convert .tif to .csv files? Alternatively, is there a simple way to acess specific pixels from a tif without reading the file inot memory?
  댓글 수: 4
per isakson
per isakson 2014년 8월 13일
편집: per isakson 2014년 8월 13일
  • How do you read the tiff-files?
  • Do you use the Tiff class?
  • How much RAM?
dpb
dpb 2014년 8월 13일
Well, 96 images are almost 90 MB if they're 8-bit or less; otherwise multiply by the number of bytes required/pixel (3 for 24-bit, for example).
Storing a 16-bit ASCII representation of a 24-bit number will expand that to being 8-bytes/pixel to represent all values--hardly a memory tradeoff.
And, what is "extract the pixel values individually from the files.." other than reading into memory? How are you going to do anything with the files other than reading them into memory?
There is the special syntax in imread for TIFF files of
Parameter name Value
-------------- -----
....
'PixelRegion' {ROWS, COLS}. imread returns the sub-image
specified by the boundaries in ROWS and COLS. ROWS
and COLS must be either two- or three-element
vectors. If two elements are provided, they denote
the 1-based indices [START STOP]. If three elements
are provided, the indices [START INCREMENT STOP]
allow image downsampling.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Text Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by