  Context. Filamentary structures appear to be ubiquitous in the interstellar
medium. Being able to detect and characterize them is the first step toward
understanding their origin, their evolution, and their role in the Galactic
cycle of matter. Aims. We present a new method, called FilDReaMS, to detect and
analyze filaments in a given image. This method is meant to be fast,
user-friendly, multi-scale, and suited for statistical studies. Methods. The
input image is scanned with a rectangular model bar, which makes it possible to
uncover structures that can be locally approximated by this bar and to derive
their orientations. The bar width can be varied over a broad range of values to
probe filaments of different widths. Results. We performed several series of
tests to validate the method and to assess its sensitivity to the level of
noise, the filament aspect ratios, and the dynamic range of filament
intensities. We found that the method exhibits very good performance at
recovering the orientation of the filamentary structures, with an accuracy of
0.5{\deg} in nominal conditions, up to 3{\deg} in the worst case scenario with
high level of noise. The filaments width is recovered with uncertainties better
than 0.5 px (pixels) in most of the cases, which could extend up to 3 px in
case of low signal-to-noise ratios. Some attempt to build a correspondence
between Plummer-type filament profiles and outcomes of the method is proposed,
but remains sensitive to the local environment. Conclusions. Our method is
found to be robust and adapted to the identification and the reconstruction of
filamentary structures in various environments, from diffuse to dense medium.
It allows us to explore the hierarchical scales of these filamentary structures
with a high reliability, especially when dealing with their orientation.
