Following code stub displays incorrect image of an indexed array if no eval is called on that particular array.
array test = constant(1.0, 128, 128);
test(seq(32, 63, 1), seq(32, 63, 1)) = constant(0.0, 32, 32);
array tmp = test(seq(30, 40, 1), seq(30, 40, 1));
array disp_tmp = tmp/2.0f;
disp_tmp.eval(); // if this line is commented, wnd(1,0) displays incorrect image
Window wnd;
while(!wnd.close()) {
wnd.grid(2, 2);
wnd(0,0).image(test, "image");
wnd(0, 1).image(tmp, "patch");
wnd(1, 0).image(disp_tmp, "match"); // this subview is wrong if we no eval done on disp_tmp
wnd.show();
}
You can also find the whole example code here