why does imwrite change the image's pixel size?
이전 댓글 표시
I know it's odd, but imwrite command happens to change my image's pixel size. Does anyone have a proper explanation for this? Thank you
댓글 수: 6
Safa Ridene
2018년 10월 6일
Rik
2018년 10월 6일
I suspect that some metadata is not written the same way as it is stored in the original file. If you give more information about the file and show the code you're using we might be able to give you some guidance on how to add the metadata correctly.
If you simply want to copy the file (with or without renaming it), you can use the copyfile function.
Safa Ridene
2018년 10월 7일
Walter Roberson
2018년 10월 7일
You should probably not be using imwrite for ArcGIS.
MATLAB has no default for pixel scale. Only a small number of image formats accept scale information for imwrite and if it is not provided by the user then imwrite does not emit it into the image. imwrite is rather restricted in the metadata it can write.
답변 (1개)
JESUS MARTINEZ
2020년 4월 1일
0 개 추천
Hi, Sorry to bump into this thread but I have similar issue.
I am using some filters and I am feeding with an image of 50x50 pixels aprox, but the imwrite outputs a much larger file of 400x400 pixels aprox or so.
ITs frustrating cause I am trying to measure specific areas (in pixels) in both images but due to the resize...Its not apples to apples any longer.
Any help? thanks
댓글 수: 6
Walter Roberson
2020년 4월 1일
What filtering are you doing?
For example, conv2() will create a larger result unless you use 'same'
JESUS MARTINEZ
2020년 4월 1일
Hello Thanks,
I am using threshold, sobel, canny, histeq adn a few more.
thanks
Walter Roberson
2020년 4월 2일
I think we will need to see your code.
JESUS MARTINEZ
2020년 4월 3일
HI thanks. resolved.
Ishtiaque Ahmed khan
2020년 8월 30일
@Jesus Martinez
Hello,
May I please know how you resolved the problem?
I am having same issue.
Please help.
Image Analyst
2020년 8월 31일
Start your own question and attach your image and code.
카테고리
도움말 센터 및 File Exchange에서 Images에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!