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

4 visualizzazioni (ultimi 30 giorni)
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.

Risposte (1)

Anand
Anand il 11 Mar 2015
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 Commenti
ADMRifRaf
ADMRifRaf il 12 Mar 2015
I just tried to run the script again after resizing the image to half its original size.
im = im2single(imresize(imread('sub.jpg'),0.5));
I do not run into any problems. However, this won't work for the final submission because we the higher resolution to allow us to print at a higher DPI for the art piece.
Anand
Anand il 12 Mar 2015
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!

Accedi per commentare.

Categorie

Scopri di più su Image Processing Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by