A method for learning parameters of a convolutional neural network, CNN, capable of detecting one or more regions of interest, ROIs, determined based on one or more bottom lines of one or more nearest obstacles in at least one input image, the method being performed by a learning device that comprises a processor, and the method comprising the steps of: (a) instructing a first convolutional layer of the CNN to an n-th convolutional layer of the CNN to respectively and sequentially generate a first encoded feature map to an n-th encoded feature map from the at least one input image; (b) instructing an n-th deconvolutional layer of the CNN to a first deconvolutional layer of the CNN to sequentially generate an n-th decoded feature map to a first decoded feature map from the n-th encoded feature map; (c) supposing that each cell of a grid with a plurality of rows and a plurality of columns is generated by dividing at least one specific decoded feature map, among the n-th decoded feature map to the first decoded feature map, with respect to a first direction and a second direction, wherein the first direction is in a direction of the rows of the specific decoded feature map and the second direction is in a direction of the columns thereof, generating (S06, S81) at least one obstacle segmentation result representing each of specific rows for each of the columns, by referring to at least one feature of at least part of the n-th decoded feature map to the first decoded feature map, the specific rows being the rows where each of the bottom lines of each of the nearest obstacles is estimated as being located; (d) determining each anchor among pixels in each of anchoring rows, wherein each of the anchoring rows per each of the columns is positioned within each of first distances in the second direction from each of the specific rows per each of the columns and each of second distances in a direction opposite to the second direction from each of the specific rows per each of the columns, therewith determining each anchor as each basis for generating anchor boxes to be used for detecting each of the ROIs, (e) instructing a region proposal network, RPN to generate (i) at least one ROI bounding box, the ROI bounding box being a specific anchor box having a high probability of being estimated as including a specific object, among the anchor boxes, and (ii) one or more first losses by referring to the ROI bounding box and its corresponding at least one first ground truth, GT, wherein the first GT represents a bounding box truly including the specific object in the at least one input image; and (f) backpropagating the first losses, to thereby learn the parameters of the CNN. (a) instructing a first convolutional layer of the CNN to an n-th convolutional layer of the CNN to respectively and sequentially generate a first encoded feature map to an n-th encoded feature map from the at least one input image; (b) instructing an n-th deconvolutional layer of the CNN to a first deconvolutional layer of the CNN to sequentially generate an n-th decoded feature map to a first decoded feature map from the n-th encoded feature map; (c) supposing that each cell of a grid with a plurality of rows and a plurality of columns is generated by dividing at least one specific decoded feature map, among the n-th decoded feature map to the first decoded feature map, with respect to a first direction and a second direction, wherein the first direction is in a direction of the rows of the specific decoded feature map and the second direction is in a direction of the columns thereof, generating (S06, S81) at least one obstacle segmentation result representing each of specific rows for each of the columns, by referring to at least one feature of at least part of the n-th decoded feature map to the first decoded feature map, the specific rows being the rows where each of the bottom lines of each of the nearest obstacles is estimated as being located; (d) determining each anchor among pixels in each of anchoring rows, wherein each of the anchoring rows per each of the columns is positioned within each of first distances in the second direction from each of the specific rows per each of the columns and each of second distances in a direction opposite to the second direction from each of the specific rows per each of the columns, therewith determining each anchor as each basis for generating anchor boxes to be used for detecting each of the ROIs, (e) instructing a region proposal network, RPN to generate (i) at least one ROI bounding box, the ROI bounding box being a specific anchor box having a high probability of being estimated as including a specific object, among the anchor boxes, and (ii) one or more first losses by referring to the ROI bounding box and its corresponding at least one first ground truth, GT, wherein the first GT represents a bounding box truly including the specific object in the at least one input image; and (f) backpropagating the first losses, to thereby learn the parameters of the CNN.