|
"Bluebird " <wlouis@ryerson.ca> wrote in message <i55nbn$aeo$1@fred.mathworks.com>...
> Hello,
>
> I have a stack of images where each image is of size 20x20. The stack has 30,000 images. I want to convolve each of these images with matrix
> sx=[ 1 0 -1
> 2 0 -2
> 1 0 -1] ( i.e. sobel operator)
>
> The way that i am doing it is as the follwoing :
>
> StackImagesX=zeros(20,20,size(30,000,3)); % To allocate the space
> % looping over all images in one by way and do conv2 with the matrix
> for i=1:size(StackImages,3)
> StackImageX(:,:,i)=conv2(double(StackImages(:,:,i)),double(sx),'same');
> end
>
> Where StackImages are the 20x20x30,000 original images.
>
> Doing this is time consuming, is there a way of avoiding this for loop?
>
> Regards
Hi,
if you have access to the image processing toolbox just use imfilter
hth
kinor
|