HarryFilm said:
---
I ain't no mere beginner in this...Here is how to do SIMPLE AND EFFECTIVE EDGE DETECTION from MY OWN CODE i designed all by myself from scratch which WILL run on ARM, Intel/AMD, MIPS, IBM Power, SuperSPARC and various DSP processors
INCLUDING the Canon DIGIC series:
COPY this code to a Landscape-mode using 10 point narrow font in a word processing document to see the entire RATHER NICELY DOCUMENTED code segment.
THIS BELOW CODE SEGMENT IS FULLY GNU GPL 3.0 OPEN SOURCE LICENCE FOR YOU programmers: Have at it for modification but REMEMBER to keep your work and modifications to this code to the GNU GPL 3.0 licence terms!
[...]
Your posted code is mainly an implementation of convolution kernel.
A simple intro:
http://setosa.io/ev/image-kernels/
Convolutional kernel is a fundamental operation for image processing, isn't it? There are thousands of implementation of it in image processing textbooks. But your code implements it in the most primitive form, to the extent I understand.
I appreciate your effort for posting it. But there are a number of issues.
First the filter size:
For a 4x4 filter there will be 16+16 reads (get pixel from input and filter) for every write (to output)
For larger filters such as 16x16, 256+256 reads for every write. You see where I am going?
Second, using your filter: say using a small 4x4 filter to process a 4K UHD image:
A single 3840x2160 image (UHD size) with a 4x4 kernel would need 3840 x 2160 x 4 x 4 = 132,710,400 look-ups! How you are going to manage it with this code?
Can you recommend any optimization mechanism?
And finally memory management:
Could you explain how you are going to manage the available memory bandwidth?
That is quite a challenging task, for small CPU and memory of a camera, isn't it?
I don't want to discourage you, but there will be a lot ahead to catch up first and then try to improve it.
I appreciate your effort, but realistically speaking, the CODEC you promise, is way way way beyond this point.