Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
gradient of edge map

Subject: gradient of edge map

From: simran

Date: 13 Jan, 2013 11:10:08

Message: 1 of 2

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?

Subject: gradient of edge map

From: Matt J

Date: 13 Jan, 2013 13:59:07

Message: 2 of 2

"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.';

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us