이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
Out of memory. The likely cause is an infinite recursion within the program. Error in resample1 (line 6) y = resample1(x, type, shift, extmod);
조회 수: 1 (최근 30일)
이전 댓글 표시
%
img = double(imread('barbara.jpg','jpg'));
%end
[row col] = size(img);
ndir = [2 2 1 1 0];
for j = 1:5
for k = -2^(ndir(j)):2^(ndir(j))
coeff_h{j}(:,:,k+(2^(ndir(j))+1)) = obtain_shear_coeff(img,[3 3 4 4 5],ndir(j),'hor',j,k);
%Keep only the highest magnitude
ind=coeff_h{j}(:,:,k+(2^(ndir(j))+1))<0;
coeff_h{j}(:,:,ind)=0;
coeff_v{j}(:,:,k+(2^(ndir(j))+1)) = obtain_shear_coeff(img,[3 3 4 4 5],ndir(j),'ver',j,k);
end
end
% Display original image
colormap gray;
subplot(1,1,1), imagesc( img, [0 255] ) ;
title( sprintf('Original Image' )) ;
% Display shearlet coeff for horizontal cone
figure; clf;
colormap gray;
tmp1 = []; tmp2 = []; tmp3 = []; tmp4 = []; tmp5 = [];
for k = 1:9
if k < 9
tmp1 = [ tmp1; coeff_h{1}(:,:,k); 255*ones(5,col/2) ];
else
tmp1 = [ tmp1; coeff_h{1}(:,:,k)];
end
end
for k = 1:9
if k < 9
tmp2 = [ tmp2; coeff_h{2}(:,:,k); 255*ones(5,col/4) ];
else
tmp2 = [ tmp2; coeff_h{2}(:,:,k)];
end
end
for k = 1:5
if k < 5
tmp3 = [ tmp3; coeff_h{3}(:,:,k); 255*ones(5,col/8) ];
else
tmp3 = [ tmp3; coeff_h{3}(:,:,k)];
end
end
for k = 1:5
if k < 5
tmp4 = [ tmp4; coeff_h{4}(:,:,k); 255*ones(5,col/16) ];
else
tmp4 = [ tmp4; coeff_h{4}(:,:,k)];
end
end
for k = 1:3
if k < 3
tmp5 = [ tmp5; coeff_h{5}(:,:,k); 255*ones(5,col/32) ];
else
tmp5 = [ tmp5; coeff_h{5}(:,:,k)];
end
end
subplot(1,5,1), imagesc( tmp1 ) ;
subplot(1,5,2), imagesc( tmp2 ) ;
subplot(1,5,3), imagesc( tmp3 ) ;
title( sprintf('Shearlet Coefficients for horizontal cone' )) ;
subplot(1,5,4), imagesc( tmp4 ) ;
subplot(1,5,5), imagesc( tmp5 ) ;
% Display shearlet coeff for vertical cone
figure; clf;
colormap gray;
tmp1 = []; tmp2 = []; tmp3 = []; tmp4 = []; tmp5 = [];
for k = 1:9
if k < 9
tmp1 = [ tmp1 coeff_v{1}(:,:,k) 255*ones(row/2,5) ];
else
tmp1 = [ tmp1 coeff_v{1}(:,:,k)];
end
end
for k = 1:9
if k < 9
tmp2 = [ tmp2 coeff_v{2}(:,:,k) 255*ones(row/4,5) ];
else
tmp2 = [ tmp2 coeff_v{2}(:,:,k)];
end
end
for k = 1:5
if k < 5
tmp3 = [ tmp3 coeff_v{3}(:,:,k) 255*ones(row/8,5) ];
else
tmp3 = [ tmp3 coeff_v{3}(:,:,k)];
end
end
for k = 1:5
if k < 5
tmp4 = [ tmp4 coeff_v{4}(:,:,k) 255*ones(row/16,5) ];
else
tmp4 = [ tmp4 coeff_v{4}(:,:,k)];
end
end
for k = 1:3
if k < 3
tmp5 = [ tmp5 coeff_v{5}(:,:,k) 255*ones(row/32,5) ];
else
tmp5 = [ tmp5 coeff_v{5}(:,:,k)];
end
end
subplot(5,1,1), imagesc( tmp1 ) ;
title( sprintf('Shearlet Coefficients for vertical cone' )) ;
subplot(5,1,2), imagesc( tmp2 ) ;
subplot(5,1,3), imagesc( tmp3 ) ;
subplot(5,1,4), imagesc( tmp4 ) ;
subplot(5,1,5), imagesc( tmp5 ) ;
댓글 수: 8
Steven Lord
2021년 10월 24일
Nowhere in this code does a call to resample1 appear. Nor is resample1 a function in MATLAB.
which -all resample1
'resample1' not found.
Show us the definition of the resample1 function. Based on the error message it calls itself and because you're receiving an error if it is intended to be recursive it's missing the base case condition (that returns an answer without making a recursive call.)
Image Analyst
2021년 10월 24일
In addition to what Steve said above (click Show comments), attach barbara.jpg, obtain_shear_coeff.m, and resample1.m so we can run your code.
Your m-file is not called resample1.m and you're calling resample1.m inside of it are you?
linou landini
2021년 10월 24일
% This routine is copied from Contourlet Toolbox.
function y = resample1(x, type, shift, extmod)
y = resample1(x, type, shift, extmod);
% Resampling according to shear matrix [1 s ; 0 1]
% See source code resample1.c
Image Analyst
2021년 10월 24일
@linou landini okay . . . you're partially helping us help you but not completely.
- What happened when you did what Steve said?
- And you didn't attach the ''barbara.jpg' I asked for.
- Finally, the Contourlet Toolbox is not a Mathworks product. We don't have it and you didn't give a link to it. Maybe since it's some third party function you should ask that third party.
Help us to help you. Right now we can't.
답변 (1개)
Steven Lord
2021년 10월 24일
I'm not familiar with this third-party Contourlet Toolbox (you may need to talk to the author of that toolbox for help) but this comment in resample1.m (which is NOT going to work as written) makes me wonder if resample1.m was a "backup" for a MEX-file and was never intended to be executed.
% See source code resample1.c
Did the installation instructions for this toolbox instruct you to run a command to build MEX-files?
댓글 수: 40
linou landini
2021년 10월 24일
@Steven Lord No , just I run this code that I transmitted to you , but the error is displayed : Out of memory. The likely cause is an infinite recursion within the program.
linou landini
2021년 10월 24일
@Walter Roberson version 1.10 . I didn't install, but just put the code and ran shearlab 1.1 .m. here is execution:

Walter Roberson
2021년 10월 24일
ShearLab-1.1 arrives with .mexw32 files, suitable only for use with MATLAB 32 bit R2015b or earlier.
You need to use mex to build each of the .mex files for your system.
Look in the directories for .mexw32 files. You will need to generate code for each of them. For example, possibly
mex reshape1.c
linou landini
2021년 10월 24일
편집: linou landini
2021년 10월 24일
@Walter Roberson I found files called mdwt.mexw32
But how do i perform this step "You will need to generate code for each of them" ?
Image Analyst
2021년 10월 24일
The "mex" command will regenerate the mex file, if it's not already included in your installation package from the third party Toolbox publisher.
Sorry, but many of us don't want to go to the trouble of downloading (and possibly buying) some third party toolbox just to help you. Maybe the publisher has a support forum, or you can call them.
Walter Roberson
2021년 10월 25일
http://shearlab.math.lmu.de/software#shearlab11 has download links for 64 bit MATLAB
linou landini
2021년 10월 25일
편집: linou landini
2021년 10월 25일
@Image Analyst @Walter Roberson Yes I download the shearlab11 but when I run the shearlab this error is displayed.
Error using mex
Access denied; check that you have permissions to access 'C:\Program
Files\MATLAB\R2016a\toolbox\ShearLab-1.1\MEX'.
and it's the same when i run in my office C:\Users\TOSHIBA\Desktop\ShearLab-1.1
linou landini
2021년 10월 25일
편집: linou landini
2021년 10월 25일
@Steven Lord @Walter Roberson I followed their steps https://www.youtube.com/watch?v=12XRTUqG94Y but the same error

Steven Lord
2021년 10월 25일
As that message suggests, please consult your system administrator (someone in your IT department) for help in determining why you don't have permissions to access the file in your installation.
linou landini
2021년 10월 25일
@Steven Lord can i work Mex in window 64? yet I installed it using video youtube
Walter Roberson
2021년 10월 25일
You should never install a third-party software package under the MATLAB installation directory.
Also, you will need to install a third-party compiler. The ones that will work on your R2016a are listed at https://www.mathworks.com/content/dam/mathworks/mathworks-dot-com/support/sysreq/files/SystemRequirements-Release2016a_SupportedCompilers.pdf
Note that all of the Visual Studio versions that it lists are "Professional" editions. In your release, the "Express" and "Community" editions will not work.
Walter Roberson
2021년 10월 26일
You cannot upgrade mexw32 to mexw64. If you have source code you can recompile.
However, I do not understand why you would do that. I posted a link earlier to the place that has windows 64 executables.
linou landini
2021년 10월 26일
편집: linou landini
2021년 10월 26일
@Walter RobersonI did not find any link that runs the code in 64bit, can you give me plz
I downloaded shearlab1.1(64 bit window) in the site http://shearlab.math.lmu.de/software but the same error
Walter Roberson
2021년 10월 26일
I repeat, "You should never install a third-party software package under the MATLAB installation directory."
The Shearlab files should not be placed under C:\Program Files . Put them in one of your own directories.
Walter Roberson
2021년 10월 26일
Please show the current error message.
I have no idea about inverse shearlet.
linou landini
2021년 10월 27일
@Walter Roberson hi, when I run the shearlab file '' Pathnames Successfully Set "but when i tested the code the same error

Walter Roberson
2021년 10월 27일
Please show the output of
which -all resample1
which -all demo_shear_coeff
demoloc = which('demo_shear_coeff');
demodir = fileparts(demoloc);
ls( fullfile(demodir, '*.mex*') )
linou landini
2021년 10월 27일
@Walter Roberson I put the MinGW folder on the folder in C:\Program Files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin
Walter Roberson
2021년 10월 27일
I had a closer look at the installation files.
Sorry, but ShearLabs-1.1 is not suitable for installation on Windows Vista or later.
It is also not suitable for installation on any Intel or ARM based Mac -- only for the PowerPC Mac running OS 9.
It might be possible to adapt the installation files to work on later versions, but the installation files that come with it are old
Walter Roberson
2021년 10월 28일
The solution is for someone to take the time to write new installation code and new installation instructions.
Walter Roberson
2021년 10월 29일
Someone would have to redesign the installation code. The installation instructions would depend upon how they decided to redesign it.
Steven Lord
2021년 10월 29일
At this point, I think probably you'd be better served contacting the author and/or maintainer of ShearLab and asking for help getting it installed and working on your system. Then that person or group of people may want to revise their installation code and/or instructions.
Walter Roberson
2021년 11월 9일
linou landini
2021년 11월 9일
@Walter Roberson thank you but the email address is not functional of maintainer of shearlab!
Walter Roberson
2021년 11월 9일
linou landini
2021년 11월 10일
@Walter Roberson it's the same thing, the email of each personal is not functional!
Melika Azmoun
2022년 5월 27일
hi, linou landini.
Was the problem solved?
Can you guide me too?
Because I also have the same problem.
참고 항목
카테고리
Help Center 및 File Exchange에서 Downloads에 대해 자세히 알아보기
태그
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)