Skip to content
Snippets Groups Projects
Commit 9817f179 authored by Ties de Kock's avatar Ties de Kock
Browse files

apply earlier fixes to second control flow

parent 86fa0faf
No related branches found
No related tags found
No related merge requests found
...@@ -120,7 +120,7 @@ class Localizer(_flandmark.Localizer): ...@@ -120,7 +120,7 @@ class Localizer(_flandmark.Localizer):
return super(Localizer, self).__call__(gray, b_y, b_x, b_height, b_width) return super(Localizer, self).__call__(gray, b_y, b_x, b_height, b_width)
elif image.ndim == 2: elif image.ndim == 2:
return super(Localizer, self).__call__(gray, b_y, b_x, b_height, b_width) return super(Localizer, self).__call__(image, b_y, b_x, b_height, b_width)
else: else:
raise TypeError, "Localizer accepts images as numpy.ndarray objects with either 2 or 3 dimensions" raise TypeError, "Localizer accepts images as numpy.ndarray objects with either 2 or 3 dimensions"
...@@ -139,16 +139,19 @@ class Localizer { ...@@ -139,16 +139,19 @@ class Localizer {
ipl_image->imageData = (char*)input.bz<uint8_t,2>().data(); ipl_image->imageData = (char*)input.bz<uint8_t,2>().data();
int bbox[4] = {b_x, b_y, b_x + b_width, b_y + b_height}; int bbox[4] = {b_x, b_y, b_x + b_width, b_y + b_height};
int flandmark_result;
{ {
bob::python::no_gil unlock; bob::python::no_gil unlock;
flandmark_detect(ipl_image.get(), bbox, m_flandmark.get(), flandmark_result = flandmark_detect(ipl_image.get(), bbox, m_flandmark.get(),
m_landmarks.get()); m_landmarks.get());
} }
list lmlist; ///< landmark list list lmlist; ///< landmark list
for (int i = 0; i < (2*m_flandmark->data.options.M); i += 2) { if (flandmark_result == NO_ERR) {
lmlist.append(make_tuple(m_landmarks[i], m_landmarks[i+1])); for (int i = 0; i < (2*m_flandmark->data.options.M); i += 2) {
lmlist.append(make_tuple(m_landmarks[i], m_landmarks[i+1]));
}
} }
return object(lmlist); return object(lmlist);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment