Why does my computer crash when running image processing script files?

3 ビュー (過去 30 日間)
ADMRifRaf
ADMRifRaf 2015 年 3 月 11 日
コメント済み: Anand 2015 年 3 月 12 日
I am currently running R2014a x64 on my custom built Windows desktop. I have been using MATLAB on this desktop for about 10 months now without any problems. I've created a script for a project in my Computer Vision course, but every time I run it, my computer completely shuts off and does a hard reset. I'm working with a large color image about 10MP in size (~2000x4000x3). Going through my script line by line, I believe the problem is with the 'imfilter' function. I am trying to apply a basic averaging filter of size 15x15. Decreasing the filter size to 9x9 does not cause the hard reset, but larger structuring elements do.
Does anyone know of a potential fix to my problem? I cannot decrease the size of the image because we are creating a poster that is about 15x11 inches that will be hung as part of the 'art project.' I don't think that computer specs are the issue, as I am running an i7-4790k and have 16GB of RAM. Thanks for the help.

回答 (1 件)

Anand
Anand 2015 年 3 月 11 日
This looks like a bug in imfilter, but I'll need a little more information to help you with this:
  • What data type image are you working with? You can find this information using class(im)? Please also provide me with the exact call to imfilter in your code, along with the image and filter used.
  • Please run the following command in MATLAB and give me the result of A and B
[A,B] = ippl
  3 件のコメント
Anand
Anand 2015 年 3 月 12 日
I have the same kind of processor architecture, but I'm not able to reproduce this. There may be something about you're custom-built windows that's causing this, it's hard to say.
Please try one of the following workarounds:
  • Convert to double-precision instead of single precision. There are a couple of associated bugs with the use of single-precision in imfilter on certain processors. Note that this will be slower than using single-precision.
im = imread('http://www.navy.mil/management/photodb/photos/120220-N-ZK869-163.jpg');
h = fspecial('average',15);
im2 = imfilter(im2double(im),h);
  • If you have access to R2015a, consider upgrading. The bugs I mentioned above are fixed in R2015a, so its possible that the cause of your crash is also fixed.
  • Use conv2 instead of imfilter. Since you are using the default padding option (zero-padding), you could use conv2. ALso, your filter kernel is an average filter and so the filter kernel need not be rotated for correlation. Note that this may be slower as well.
im = imread('http://www.navy.mil/management/photodb/photos/120220-N-ZK869-163.jpg');
h = fspecial('average',15);
ims = im2single(im);
im2 = cat(3, conv2(ims(:,:,1),h,'same'),conv2(ims(:,:,2),h,'same'),conv2(ims(:,:,3),h,'same'));
If these workarounds don't help, please contact MathWorks Technical Support and report to them everything you tried.
Hope this helps!

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by