필터 지우기
필터 지우기

How I co-relate imfinto.FileSize to Image size (kb)

조회 수: 6 (최근 30일)
Nimit Jain
Nimit Jain 2016년 7월 5일
댓글: Image Analyst 2018년 7월 13일
My image size is 101 kb. How I will get the size in kb using matlab. I tried imfinfo.FileSize which returns me 103222. How I will co-relate this.

채택된 답변

Jan
Jan 2016년 7월 5일
You can use dir also:
FileInfo = dir(FileName);
FileInfo.bytes
Note that "kB" does not mean 1000 bytes, but 1024. Now divide 103222 by 1024 and you get 100.802, which is displayed as 101kB.

추가 답변 (2개)

Image Analyst
Image Analyst 2016년 7월 5일
Depends on what you mean by "image size". The size of the file on disk is the file of the file on disk but not the size of the image once it's been read into MATLAB. The file size on disk may be smaller if you've used compression, like saved it in a PNG or (hopefully not) JPG. Plus the file size on disk also probably includes some bytes for the header. To determine the size of the image in MATLAB, you'll have to determine the number of elements with numel() and then multiply by the number of bytes for that image class - 1 for uint8 and 2 for uint16.
So now you know how to use imfinfo, and you know how to calculate the number of bytes in MATLAB, so the only question now is what does "co-relate" mean with regards to those two image sizes. You'd have to define that for us.

Tushar Bhaskarwar
Tushar Bhaskarwar 2018년 7월 13일
How can I save my file in eps from mat figure. In my size in 1000 kb.
  댓글 수: 1
Image Analyst
Image Analyst 2018년 7월 13일
This is NOT an answer to nimit's question at the top of the page - it has nothing at all to do with it.
I think you mistakenly posted an "Answer" here instead of posting a new question. Please try again.

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

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by