ROI for flandmark

15 views
Skip to first unread message

uli.sc...@gmail.com

unread,
Nov 2, 2016, 3:31:04 AM11/2/16
to bob-devel
Hi André,

we recently met in Gjovik and you recommended me to use flandmark for eye detection. Thanks, it works quite stable.
In my database I have pre-cropped faces, so no previous face detection is needed. flandmark.locate() requires a ROI. When I set it to the size of the image the following error occurs:
RuntimeError: bob.ip.flandmark.Flandmark - locate: C++ exception caught: 'Bounding box exceeds image resolution'
I have to reduce the ROI size to ~90% of the image size to get it work. Why? And how can I avoid it?

Cheers
Ulrich

André Anjos

unread,
Nov 2, 2016, 12:12:35 PM11/2/16
to bob-...@googlegroups.com

On Wed, Nov 2, 2016 at 8:31 AM, <uli.sc...@gmail.com> wrote:
RuntimeError: bob.ip.flandmark.Flandmark - locate: C++ exception caught: 'Bounding box exceeds image resolution'

Hello Ulrich,

If I look at the C++ code that generates this exception:


This looks like a bug on that line in your limit case where the image size equals the bounding-box size. The test should read ">" and "<" instead of ">=" and "<=", but I'll let Manuel comment on that since he introduced this code on this commit:


Manuel - could you please check and confirm this issue?

@Ulrich - as a mitigation for the time being, just enter the bounding-box size to be 1 pixel smaller in both directions. In this way you don't loose 10% of the image, just one pixe in each direction. For example, if your image is 60x60, make sure that the bounding box is (0, 0, 59, 59).

Best, Andre

--
Dr. André Anjos
Idiap Research Institute
Centre du Parc - rue Marconi 19
CH-1920 Martigny, Suisse
Phone: +41 27 721 7763
Fax: +41 27 721 7712
http://andreanjos.org

Manuel Günther

unread,
Nov 2, 2016, 12:29:08 PM11/2/16
to bob-devel
Dear Ulrich,

Indeed, this looks like a bug. I will investigate on this. Thank you for reporting.

Currently, you should be able to use the full image resolution, except that you need to subtract 1 for both `height` and `width`.

@Andre: At the end, we can have default values for the ROI, so that -- if not given -- the full image resolution would be considered. Do you think this is a good idea to implement?

Cheers, Manuel

André Anjos

unread,
Nov 2, 2016, 12:33:37 PM11/2/16
to bob-...@googlegroups.com

On Wed, Nov 2, 2016 at 5:29 PM, 'Manuel Günther' via bob-devel <bob-...@googlegroups.com> wrote:
@Andre: At the end, we can have default values for the ROI, so that -- if not given -- the full image resolution would be considered. Do you think this is a good idea to implement?

Should be good, yes. A

Manuel Günther

unread,
Nov 2, 2016, 1:20:54 PM11/2/16
to bob-devel
Ulrich,

my last comment on using image resolution -1 does not seem to be accurate, see: https://gitlab.idiap.ch/bob/bob.ip.flandmark/issues/7

I will work on that. In the mean-time, you'd need to reduce the image ROI as you have done it to be able to use the full image.

Cheers
Manuel

uli.sc...@gmail.com

unread,
Nov 3, 2016, 5:50:38 AM11/3/16
to bob-devel
Hi,

thank you for the fast response.
A default ROI for the whole image size would be great.

Cheers
Ulrich
Reply all
Reply to author
Forward
0 new messages