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

Method load_image

tools/imglab/src/metadata_editor.cpp:553–586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

551// ----------------------------------------------------------------------------------------
552
553void metadata_editor::
554load_image(
555 unsigned long idx
556)
557{
558 if (idx >= metadata.images.size())
559 return;
560
561 if (image_pos != idx)
562 {
563 clear_undo_history();
564 }
565
566 image_pos = idx;
567
568 array2d<rgb_pixel> img;
569 display.clear_overlay();
570 try
571 {
572 dlib::load_image(img, metadata.images[idx].filename);
573 metadata.images[idx].width = img.nc();
574 metadata.images[idx].height = img.nr();
575 set_title(metadata.name + " #"+cast_to_string(idx)+": " +metadata.images[idx].filename);
576 }
577 catch (exception& e)
578 {
579 message_box("Error loading image", e.what());
580 }
581
582 if (display_equialized_image)
583 equalize_histogram(img);
584 display.set_image(img);
585 display.add_overlay(get_overlays(metadata.images[idx], string_to_color));
586}
587
588// ----------------------------------------------------------------------------------------
589

Callers

nothing calls this directly

Calls 12

cast_to_stringFunction · 0.85
message_boxFunction · 0.85
equalize_histogramFunction · 0.85
get_overlaysFunction · 0.85
clear_overlayMethod · 0.80
load_imageFunction · 0.50
sizeMethod · 0.45
ncMethod · 0.45
nrMethod · 0.45
whatMethod · 0.45
set_imageMethod · 0.45
add_overlayMethod · 0.45

Tested by

no test coverage detected