\section{Introduction} \label{sec:intro} Straight lines are commonly used as visual features for many image analysis processes. For instance in computer vision, they are used to estimate the vanishing points associated to main directions of the 3D world, thus allowing to compute camera orientation. They are also used to detect structured features for 3D reconstruction. Therefore, straight line detection is always an active research topic centered on the quest of still faster, more accurate or more robust-to-noise methods \cite{AkinlarTopal12,GioiAl10,LuAl15,MatasAl00}. Most of the times, they rely on the extraction of an edge map based on gradient magnitude. Gradient orientation is often used to discriminate candidates and thus provide better efficiency. However, they seldom provide an exploitable measure of the output line quality, based on intrinsic properties such as sharpness, connectivity or scattering. This information could be useful to get some confidence level and help to classify these features for further exploitation. In computer vision applications, it could also be a base for uncertainty propagation within 3D interpretation tools, in order to dispose of complementary measures to reprojection errors for local accuracy evaluation. %Some information may sometimes be drawn from their specific context, %for example through an analysis of the peak in a Hough transform accumulator. In digital geometry, new mathematical definitions of classical geometric objects, such as lines or circles, have been developed to better fit to the discrete nature of most of today's data to process. In particular, the notion of blurred segment \cite{Buzer07,DebledAl05} was introduced to cope with the image noise or other sources of imperfections from the real world using a width\footnote{We use equivalently the terms width and thickness in this work.} parameter. Efficient algorithms have already been designed to recognize these digital objects in binary images \cite{DebledAl06}. Blurred segments seem well suited to reflect the required line quality information. %Its preimage, %i.e. the space of geometric entities which numerization matches this %blurred segment, may be used to compute some confidence level in the delivered %3D interpretations, as a promising extension of former works %on discrete epipolar geometry \cite{NatsumiAl08}. The present work aims at designing a flexible tool to detect blurred segments with optimal width and orientation in gray-level images for as well supervised as unsupervised contexts. User-friendly solutions are sought, with ideally no parameter to set, or at least quite few values with intuitive meaning. A first attempt was already made in a previous work \cite{KerautretEven09} but the segment width was initially fixed by the user and not estimated, leading to erroneous orientations of the detected lines. In the present work, the limitations of this first detector were solved by the introduction of two new concepts: (i) {\bf adaptive directional scan} designed to get some compliance to the unpredictable orientation problem; (ii) {\bf control of the assigned width} to the blurred segment recognition algorithm, intended to derive more reliable information on the line orientation and quality. As a side effect, these two major evolutions also led to a noticeable improvement of the time performance of the detector. They are also put forward within a global line extraction algorithm which can be evaluated through an online demonstration at : \href{http://ipol-geometry.loria.fr/~kerautre/ipol_demo/FBSD_IPOLDemo}{ \small{\url{http://ipol-geometry.loria.fr/~kerautre/ipol_demo/FBSD_IPOLDemo}}} In the next section, the main theoretical notions used in this work are introduced. The new detector workflow, the adaptive directional scan, the control of the assigned width and their integration into both supervised and unsupervised contexts are then presented in \RefSec{sec:method}. Experiments led to assess the achieved performance of this new detector are decribed in \RefSec{sec:expe}. Finally, \RefSec{sec:conclusion} gives a short conclusion followed by some open perspectives for future works.