I am writing a code in order to generate a 3d view of a painting from a single image of the painting. For that, i have to generate the 3d views of all the planes present in the image using projective homography transformations. I am using imwarp in order to warp the image. But after warping the output image size is [295,524569] while the input image is only[892,1152]. Can anybody please tell me where am i going wrong?

댓글 수: 2

Silja Heilmann
Silja Heilmann 2015년 9월 7일
편집: Walter Roberson 2015년 9월 8일
I can not provide an answer but I think I may have a related problem. While using imwarp on an 777x3161 image I get the following error:
Error using ippgeotrans
Requested 50995x174010 (33.1GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and
cause MATLAB to become unresponsive. See array size limit or preference panel for more information.
Error in imwarp>ippWarpAffine (line 566)
outputImage = ippgeotrans(single(inputImage),double(T),Rout.ImageSize,interp,single(fillVal));
Error in imwarp>remapPointsAndResample (line 223)
outputImage = ippWarpAffine(inputImage,R_A,tform,outputRef,method,fillValues);
Error in imwarp (line 210)
outputImage = remapPointsAndResample(parsedInputs.InputImage,R_A,tform,outputRef,method,fillValues);
I use imwarp inside a loop and the error only occurs for one particular image. For the other images imwarp returns an image with the expected size (777x3161)
There is no documentation on ippgeotrans so I have no idea why it is requesting an array of this astronomical size...
Walter Roberson
Walter Roberson 2015년 9월 8일
I responded in the Question you posted about this.

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

 채택된 답변

Walter Roberson
Walter Roberson 2015년 8월 18일

0 개 추천

You probably used something like
[numrows, numcols] = size(YourImage)
when YourImage was an RGB image. RGB images are 3 dimensional, and when you use size() with only two outputs for a 3D matrix, the second output is set to the product of the number of columns and the length of the third dimension. For example,
[numrows, numcols] = size(zeros(25, 31, 3))
would return numrows of 25 and numcols of 31*3
When you take size() of a 3D matrix, either only use one output or else use at least 3 outputs.

추가 답변 (0개)

질문:

2015년 8월 18일

댓글:

2015년 9월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by