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

Function transform_image

dlib/image_transforms/interpolation.h:394–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

392 typename background_type
393 >
394 void transform_image (
395 const image_type1& in_img,
396 image_type2& out_img,
397 const interpolation_type& interp,
398 const point_mapping_type& map_point,
399 const background_type& set_background,
400 const rectangle& area
401 )
402 {
403 // make sure requires clause is not broken
404 DLIB_ASSERT( get_rect(out_img).contains(area) == true &&
405 is_same_object(in_img, out_img) == false ,
406 "\t void transform_image()"
407 << "\n\t Invalid inputs were given to this function."
408 << "\n\t get_rect(out_img).contains(area): " << get_rect(out_img).contains(area)
409 << "\n\t get_rect(out_img): " << get_rect(out_img)
410 << "\n\t area: " << area
411 << "\n\t is_same_object(in_img, out_img): " << is_same_object(in_img, out_img)
412 );
413
414 const_image_view<image_type1> imgv(in_img);
415 image_view<image_type2> out_imgv(out_img);
416
417 for (long r = area.top(); r <= area.bottom(); ++r)
418 {
419 for (long c = area.left(); c <= area.right(); ++c)
420 {
421 if (!interp(imgv, map_point(dpoint(c,r)), out_imgv[r][c]))
422 set_background(out_imgv[r][c]);
423 }
424 }
425 }
426
427// ----------------------------------------------------------------------------------------
428

Callers 6

py_transform_imageFunction · 0.85
rotate_imageFunction · 0.85
resize_imageFunction · 0.85
extract_image_chipsFunction · 0.85
extract_image_4pointsFunction · 0.85
make_scale_spaceMethod · 0.85

Calls 8

get_rectFunction · 0.85
black_backgroundClass · 0.70
is_same_objectFunction · 0.50
containsMethod · 0.45
topMethod · 0.45
bottomMethod · 0.45
leftMethod · 0.45
rightMethod · 0.45

Tested by

no test coverage detected