Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
Matt J
Posts:
4,976
Registered:
11/28/09
|
|
Re: gradient of edge map
Posted:
Jan 13, 2013 8:59 AM
|
|
"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.';
|
|
|
|