Date: Jan 13, 2013 8:59 AM
Author: Matt J
Subject: Re: gradient of edge map

"simran" wrote in message <kcu4mg$hho$1@newscl01ah.mathworks.com>...
> I have sparse matrix(edge map) of image with size 4456 x 2956 .I want to calculate gradient of this edge map. Built-in function gradient() is taking very much time. are there any alternatives?
=================

Can't imagine why it would be unexpectedly slow, but you could use this

http://www.mathworks.com/matlabcentral/fileexchange/26292-regular-control-point-interpolation-matrix-with-boundary-conditions

to implement the calculation as a matrix multiplication method

A=interpMatrix([-.5 0 5],2,4456,1,'rep');
B=interpMatrix([-.5 0 5],2,2956,1,'rep');

gradI=A*edgemap;
gradJ=edgemap*B.';