diff --git a/dlib/gui_widgets/base_widgets.h b/dlib/gui_widgets/base_widgets.h index 76619338e..e8c88216c 100644 --- a/dlib/gui_widgets/base_widgets.h +++ b/dlib/gui_widgets/base_widgets.h @@ -410,8 +410,8 @@ namespace dlib auto_mutex M(m); assign_image_scaled(img,new_img); rectangle old(rect); - rect.set_right(rect.left()+img.nc()-1); - rect.set_bottom(rect.top()+img.nr()-1); + rect.set_right(rect.left()+num_columns(img)-1); + rect.set_bottom(rect.top()+num_rows(img)-1); parent.invalidate_rectangle(rect+old); } diff --git a/dlib/gui_widgets/canvas_drawing.h b/dlib/gui_widgets/canvas_drawing.h index 1a077d42e..61f688112 100644 --- a/dlib/gui_widgets/canvas_drawing.h +++ b/dlib/gui_widgets/canvas_drawing.h @@ -681,7 +681,7 @@ namespace dlib { const long x = p.x(); const long y = p.y(); - rectangle rect(x,y,img.nc()+x-1,img.nr()+y-1); + rectangle rect(x,y,num_columns(img)+x-1,num_rows(img)+y-1); rectangle area = c.intersect(rect).intersect(area_); if (area.is_empty()) return; @@ -709,11 +709,11 @@ namespace dlib ) { const rectangle area = c.intersect(rect).intersect(area_); - if (area.is_empty() || img.size() == 0) + if (area.is_empty() || num_columns(img) * num_rows(img) == 0) return; - const matrix x = matrix_cast(round(linspace(0, img.nc()-1, rect.width()))); - const matrix y = matrix_cast(round(linspace(0, img.nr()-1, rect.height()))); + const matrix x = matrix_cast(round(linspace(0, num_columns(img)-1, rect.width()))); + const matrix y = matrix_cast(round(linspace(0, num_rows(img)-1, rect.height()))); for (long row = area.top(); row <= area.bottom(); ++row) { diff --git a/examples/dnn_mmod_find_cars2_ex.cpp b/examples/dnn_mmod_find_cars2_ex.cpp index 65a919e11..b9fffbba0 100644 --- a/examples/dnn_mmod_find_cars2_ex.cpp +++ b/examples/dnn_mmod_find_cars2_ex.cpp @@ -27,7 +27,7 @@ using namespace dlib; -// The rear view vehicle detector network +// The front and rear view vehicle detector network template using con5d = con; template using con5 = con; template using downsampler = relu>>>>>>>>;