MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / drawRectangle

Function drawRectangle

examples/computer_vision/matching.cpp:23–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23void drawRectangle(array& out, unsigned x, unsigned y, unsigned dim0,
24 unsigned dim1) {
25 printf("\nMatching patch origin = (%u, %u)\n\n", x, y);
26 seq col_span(x, x + dim0, 1);
27 seq row_span(y, y + dim1, 1);
28 // edge on left
29 out(col_span, y, 0) = 0.f;
30 out(col_span, y, 1) = 0.f;
31 out(col_span, y, 2) = 1.f;
32 // edge on right
33 out(col_span, y + dim1, 0) = 0.f;
34 out(col_span, y + dim1, 1) = 0.f;
35 out(col_span, y + dim1, 2) = 1.f;
36 // edge on top
37 out(x, row_span, 0) = 0.f;
38 out(x, row_span, 1) = 0.f;
39 out(x, row_span, 2) = 1.f;
40 // edge on bottom
41 out(x + dim0, row_span, 0) = 0.f;
42 out(x + dim0, row_span, 1) = 0.f;
43 out(x + dim0, row_span, 2) = 1.f;
44}
45
46static void templateMatchingDemo(bool console) {
47 // Load image

Callers 1

templateMatchingDemoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected