Blurred edge detection

I have little knowledge about image processing and recognition. I am trying to detect the main edges / grayscale transitions in an image in grayscale, such as a portrait. The problem is that in some areas the edge is blurry (due to focus). I use a Canny edge detector with multiple thresholds, but I can never detect these edges (chin, clothes, ears, side of the face, ...)

Original Image: Original This is the result that I get: beard, sharp edges Current result This is what interests me: transitions between the main gray areas Required Results

Is edge detection the right tool for this? Thanks!


UPDATE . Using Deriche, filtering and halving the size of the image to detect the edge (using apertureSize = 7), I got it working very close to what I want. Good results

+5
source share
3 answers

Using the canny-deriche filter, you can find: opportunity

Full code here

+5
source

It is almost impossible to detect these edges, since they are so blurry.

Edge detection works by analyzing fast color changes in surrounding pixels. Blur smooths the pixels, making the changes much less intense, and therefore no edges are detected.

You can try applying a strong sharpening filter before edge detection, however I think that for this amount of blurring edge detection will not work as intended.

Even if you raise the edge detection options to also detect these blurry edges, you will get many false positives, making the algorithm useless.

0
source

The only thing I can think of is basically crop the region and apply Fourier (DFT). Then separate the pixels based on the amplitude threshold, hold the pattern and apply it to your main image (or just use the inverse Fourier). Alternatively, you can try and do it exponentially to widen the gap between the value of the pixels corresponding to your background and the values ​​corresponding to the image.

Of course, all of these suggestions would be one-time solutions for one photograph, or a series of photographs taken in the same state (for example, something like an MRI).

I really do not see so many possibilities for this in a completely automatic way.

ANN solutions

If you want to resort to ANN (Artificial Neural Networks) and develop one that, of course, does not guarantee success, but at least in principle it depends on how well it is designed. If you want a better understanding of the use of ANN in complex image processing, read this conference document from IEEE.

T. Kondo, J. Ueno and S. Tacao. Medical recognition of abdominal multi-organs with a hybrid multilayer neural network such as HMDH using a basic regression analysis of the components. At the Second International Symposium on Computing and Networking (CANDAR), pp. 157-163. Institute of Electrical and Electronics Engineers, IEEE, December 2014

Custom filters and math principles

Here are some mathematical principles you might find useful:

It is worth trying a custom filter, for example:

------------- | 1 | 2 | 1 | ------------- | 0 | 0 | 0 | ------------- |-1 |-2 | 1 | ------------- 

Note that this will not filter any (fully) vertical line. You can, however, transfer it, so it will be the other way around. You can also try applying a filter on a binary image (black and white), rather than grayscale.

For such a filter, you can still wish you Fourier to reduce your calculations and optimize the program.

Basically, you can explain linear filtering in terms of convolution as:

 Y = f[X; G] = X ⓧ G_{flip} 

where G is the kernel / mask and G_ {flip} is the flipping mask of the kernel.

Parcel

The convolution definition in 2D will be:

 X ⓧ G = Summation(∞, k=-∞){Summation(∞, l=-∞) x[ik, jl].G[k,l]} 

This is not a complete answer to your question, but I hope this helps you to some extent.

0
source

All Articles