2
$\begingroup$

I’m a beginner in image processing, and was wondering since seperated (decomposed) filters help give faster and more efficient results, when do we even need to use composite filters? All I heard is the advantages of decomposed filters,but what about composite filters?

$\endgroup$
3
  • $\begingroup$ Are you talking in the context of deep learning or in general? $\endgroup$
    – Royi
    Sep 14 at 0:50
  • $\begingroup$ @Royi in general $\endgroup$
    – Simon
    Sep 14 at 17:01
  • $\begingroup$ Have you looked at my answer? $\endgroup$
    – Royi
    Sep 17 at 17:26
2
$\begingroup$

Image Processing Context

In classic Image Processing the filters used are known.
Hence being separable is a property of a given filter which is suitable to the task.
In this context, separability only means we can have a more efficient way to apply the filter computationally while the end result is the same. So, in Image Processing, if you have a filter which is separable, use that.

Deep Learning Context

In deep learning context, where the filters are learned, being separate is a constrained. Namely, it has a model behind it.
The main property of in this context, if only one 1D kernel is used, is separable filters are symmetric. So if you want to learn a symmetric filter (You can chose the axis by rotating) this is the way to go.
For instance, it makes sense in a filter detecting elongated edges.

In case we allow the filter to be built using 2 different 1d filters then the property we enforce is rank 1 filter.

$\endgroup$
4
  • 1
    $\begingroup$ “separable filters are symmetric” this is not true. Separability and symmetry are two different, unrelated properties. It’s easy to compose a 2D filter using two arbitrary non-symmetric 1D filters. This composed filter will obviously be non-symmetric and separable. The first half of the answer is good, though. $\endgroup$ Sep 18 at 19:43
  • $\begingroup$ I updated to be clearer about the assumption for symmetry. $\endgroup$
    – Royi
    Sep 19 at 3:45
  • 1
    $\begingroup$ So if you build a 2D filter by composing identical horizontal and vertical 1D filters, then you can transpose the matrix and get the same filter, so that's a form of symmetry, the answer is technically correct now. But it's not what I first think of when talking about a symmetric filter: mirror symmetry. You can only get that if you restrict the 1D filters to be symmetric. $\endgroup$ Sep 19 at 4:06
  • $\begingroup$ You could always, in the DL implementation, add a rotation matrix so the symmetry would be along any axis. I wrote that. $\endgroup$
    – Royi
    Sep 19 at 5:01
0
$\begingroup$

For any given problem definition, there's a filter that -- if you ignore execution time and hardware expense -- is "best"*. In general, that "best" filter isn't separable. Depending on the problem at hand, the degree to which the optimum degrades if you find the best separable filter will vary.

So -- sometimes a non-separable filter will give "better" results in the absence of considerations of processing expense. Sometimes it'll be so much better that it's just what you need to use (I can't think of any cases off hand, but -- just assume I'm right, for the sake of argument).

Even today, there's a lot of video processing that needs to be optimized for processor effort rather than striving for that theoretical "cost no object" optimum that you'll see a lot of attention paid to easy computational optimization, like using separable filters, or small kernels, or similar.

* I put "best" in quotes because it depends so heavily on the problem definition, and it can be fiendishly difficult to make a formal definition of "best" with what you really need.

$\endgroup$
2
  • $\begingroup$ In quite a few situations, the Gaussian is the optimal low-pass filter. It also happens to be separable. This doesn’t contradict what you’re saying, but hopefully it qualifies the “in general” statement. $\endgroup$ Sep 18 at 19:40
  • $\begingroup$ In what situations is the Gaussian filter optimal? I thought it was ofte chosen because many analytic approaches are easier to calculate using Gaussians, because 2-d Gaussians are separable, and because Gaussians seems to have a reasonable (ad-hoc) compromise between frequency response and space (or time) response for applications where humans are to watch the results? $\endgroup$
    – Knut Inge
    Sep 19 at 7:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.