MCPcopy Create free account
hub / github.com/davisking/dlib / centered_rect

Function centered_rect

dlib/geometry/rectangle.h:363–376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361// ----------------------------------------------------------------------------------------
362
363 inline const rectangle centered_rect (
364 long x,
365 long y,
366 unsigned long width,
367 unsigned long height
368 )
369 {
370 rectangle result;
371 result.set_left ( x - static_cast<long>(width) / 2 );
372 result.set_top ( y - static_cast<long>(height) / 2 );
373 result.set_right ( result.left() + width - 1 );
374 result.set_bottom ( result.top() + height - 1 );
375 return result;
376 }
377
378// ----------------------------------------------------------------------------------------
379

Callers 15

resample_datasetFunction · 0.85
bind_rectanglesFunction · 0.85
operator()Method · 0.85
centered_rectsFunction · 0.85
set_rect_areaFunction · 0.85
set_aspect_ratioFunction · 0.85
test_max_poolFunction · 0.85
test_avg_poolFunction · 0.85
test_loss_mmodFunction · 0.85
perform_testMethod · 0.85
run_testFunction · 0.85
geometry_testFunction · 0.85

Calls 8

set_leftMethod · 0.80
set_topMethod · 0.80
set_rightMethod · 0.80
set_bottomMethod · 0.80
leftMethod · 0.45
topMethod · 0.45
rightMethod · 0.45
bottomMethod · 0.45

Tested by 15

test_max_poolFunction · 0.68
test_avg_poolFunction · 0.68
test_loss_mmodFunction · 0.68
perform_testMethod · 0.68
run_testFunction · 0.68
geometry_testFunction · 0.68
test_rect_to_drectFunction · 0.68
run_test1Function · 0.68
run_test2Function · 0.68
run_test3Function · 0.68
test_sum_filterFunction · 0.68
naive_max_filterFunction · 0.68