imrotate3 gives me just zeros with 'linear'

조회 수: 2 (최근 30일)
Mads
Mads 2022년 6월 7일
편집: DGM 2022년 6월 10일
For imrotate3() the doc says:
"'linear' Trilinear interpolation. Trilinear interpolation is the default method for numeric and logical images."
Now if I have a 3D mask of zeros and ones... let's call it BW and it is of type logical, and I use
BW2 = imrotate3(BW,45,[0 0 1],'linear','crop');
Then BW2 is all zeros.
If I convert to, say, double or single, it works as expected.
Or if I use 'nearest' instead of 'linear', it works with logical.

채택된 답변

Jan
Jan 2022년 6월 7일
편집: Jan 2022년 6월 7일
I cannot confirm this, but it is even stranger:
BW = rand(5, 5, 5) > 0.5;
BW2 = imrotate3(BW, 45, [0, 1, 0], 'linear', 'crop');
BW3 = 5×5×5 logical array
BW3(:,:,1) = 204 160 0 0 158 59 230 0 204 160 127 63 0 59 230 102 0 0 127 63 158 0 0 102 105 BW3(:,:,2) = 179 243 0 0 0 125 191 0 0 240 51 0 0 0 63 219 0 0 0 0 225 0 0 0 0 BW3(:,:,3) = 0 0 0 59 230 0 0 0 127 191 0 0 0 102 0 0 0 0 158 0 0 0 203 160 0 BW3(:,:,4) = 0 206 160 255 64 0 59 230 255 0 0 127 63 255 0 0 102 254 255 0 128 158 255 7 0 BW3(:,:,5) = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
ans =
ans(:,:,1) = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ans(:,:,2) = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ans(:,:,3) = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ans(:,:,4) = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ans(:,:,5) = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
I;
BW2-BW3 assume this is worth to send a bug report to MathWorks. You've found the bug, so do you want to use the "Contact Us" link on the bottom of this page and the "Bug Report" on the following page?
  댓글 수: 3
Mads
Mads 2022년 6월 10일
I reported the bug.
I think it dates back even further.
DGM
DGM 2022년 6월 10일
편집: DGM 2022년 6월 10일
If it was in R2019b, I'm going to guess it was present when imrotate3() was released -- R2017a. The IPT release notes don't mention any changes to it until R2020a, and there are no bug reports. Then again, the release notes aren't comprehensive and there are plenty of significant bugs that never get put in the publicly listed bug reports.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Time Series Objects에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by