Ask Your Question

Implementing edge detector on SAM3x8e ( Arduino Due )

asked 2016-11-05 15:14:52 -0500

Vaclav gravatar image

I am looking for minimal porting of OpenCV into SAM3x8e hardware. (.5GB ). Is there a "sample code" somewhere? I can go thru all the core includes step by step but would prefer not to reinvent the wheel. I do not need any GUI related classes, just want to be able to calculate edges. Thanks

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-11-07 02:44:17 -0500

kbarni gravatar image

OpenCV won't work on any microcontrollers (arduinos or similar); it needs Linux and a lots of libraries.

Fortunately, the edge detector is simple enough to implement yourself. The simplest filter uses the following matrices:

fy = |-1 |  and fx = [ -1 1 ]
     | 1 |

Here is the code (considering that the image is in a width*height linear array). You might adapt it to your needs:

for(pos=0; pos<width*(height-1);pos++){

To get the amplitude and the angle:


The Sobel filter is a little bit more complicated (it uses two 3x3 matrices) but it gives far better results.

edit flag offensive delete link more


Yes, I know that. i WAS asking about minimal OpenCV. I am well aware of limitations of my hardware also. Let's call this closed OK?

Vaclav gravatar imageVaclav ( 2016-11-08 16:08:30 -0500 )edit

Question Tools

1 follower


Asked: 2016-11-05 15:14:52 -0500

Seen: 149 times

Last updated: Nov 07 '16