I'm trying to make a function to detect opaque and/or partially opaque pixels which are in a specific range (1..9) of fully transparent pixel(s).
In other words: to detect the border/contour of a shape in a transparent image.
I have made some progress, a function with 4 cycles, but it's very slow.
I was wondering if I could use some functions from your library to make it faster. Maybe the ContourDetector function?
Could be used for this?
Thank you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If I had to solve simular task I would try to do something like this:
1) Extract alpha channel (for example see SimdDeinterleaveBgra).
2) Optional: boost contrast (see SimdBinarization or SimdAbsGradientSaturatedSum).
3) ContourDetector
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Using the contour detector function would give the border pixels (of 1 pixel thick). For the 2..9 I would have to use my function again (searching for neighbour pixels).
On average it would be a speed improvement, but not that big...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm trying to make a function to detect opaque and/or partially opaque pixels which are in a specific range (1..9) of fully transparent pixel(s).
In other words: to detect the border/contour of a shape in a transparent image.
I have made some progress, a function with 4 cycles, but it's very slow.
I was wondering if I could use some functions from your library to make it faster. Maybe the ContourDetector function?
Could be used for this?
Thank you.
If I had to solve simular task I would try to do something like this:
1) Extract alpha channel (for example see SimdDeinterleaveBgra).
2) Optional: boost contrast (see SimdBinarization or SimdAbsGradientSaturatedSum).
3) ContourDetector
Thank you.
The alpha channel is already extracted.
Using the contour detector function would give the border pixels (of 1 pixel thick). For the 2..9 I would have to use my function again (searching for neighbour pixels).
On average it would be a speed improvement, but not that big...