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

Function insert_image_chip

dlib/image_transforms/interpolation.h:2023–2043  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2021 typename interpolation_type
2022 >
2023 void insert_image_chip (
2024 image_type1& image,
2025 const image_type2& chip,
2026 const chip_details& location,
2027 const interpolation_type& interp
2028 )
2029 {
2030 image_view<image_type1> vimg(image);
2031 const_image_view<image_type2> vchip(chip);
2032 DLIB_CASSERT(static_cast<unsigned long>(vchip.nr()) == location.rows &&
2033 static_cast<unsigned long>(vchip.nc()) == location.cols,
2034 "The chip and the location do not have the same size.")
2035 const auto tf = get_mapping_to_chip(location);
2036 for (long r = 0; r < vimg.nr(); ++r)
2037 {
2038 for (long c = 0; c < vimg.nc(); ++c)
2039 {
2040 interp(vchip, tf(dpoint(c, r)), vimg[r][c]);
2041 }
2042 }
2043 }
2044
2045// ----------------------------------------------------------------------------------------
2046

Callers 1

py_insert_image_chipFunction · 0.85

Calls 4

get_mapping_to_chipFunction · 0.85
nrMethod · 0.45
ncMethod · 0.45

Tested by

no test coverage detected