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

Function main

examples/image_processing/confidence_connected_components.cpp:38–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38int main(int argc, char* argv[]) {
39 try {
40 unsigned radius = 3;
41 unsigned multiplier = 2;
42 int iter = 3;
43
44 array input =
45 loadImage(ASSETS_DIR "/examples/images/depression.jpg", false);
46 array normIn = normalize01(input);
47
48 unsigned seedx = 162;
49 unsigned seedy = 126;
50 array blob = confidenceCC(input, 1, &seedx, &seedy, radius, multiplier,
51 iter, 255);
52
53 array colorIn = colorSpace(normIn, AF_RGB, AF_GRAY);
54 array colorOut = colorSpace(blob, AF_RGB, AF_GRAY);
55
56 markCrossHair(colorIn, seedx, seedy, 1);
57 markCrossHair(colorOut, seedx, seedy, 255);
58
59 af::Window wnd("Confidence Connected Components Demo");
60 while (!wnd.close()) {
61 wnd.grid(1, 2);
62 wnd(0, 0).image(colorIn, "Input Brain Scan");
63 wnd(0, 1).image(colorOut, "Region connected to Seed(162, 126)");
64 wnd.show();
65 }
66 } catch (af::exception& e) {
67 fprintf(stderr, "%s\n", e.what());
68 throw;
69 }
70
71 return 0;
72}

Callers

nothing calls this directly

Calls 9

loadImageFunction · 0.85
normalize01Function · 0.85
confidenceCCFunction · 0.85
colorSpaceFunction · 0.85
markCrossHairFunction · 0.85
closeMethod · 0.80
gridMethod · 0.80
imageMethod · 0.80
showMethod · 0.80

Tested by

no test coverage detected