現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
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.
Walter Roberson
2021 年 10 月 24 日
Which version of ShearLab did you install? Where did you get it from?
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/777158/image.png)
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/777608/image.png)
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/780493/image.png)
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
linou landini
2021 年 10 月 27 日
@Walter Roberson what is the solution? but may computur is windows 64
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!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の 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 (한국어)