| 36 | } |
| 37 | |
| 38 | int 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 | } |
nothing calls this directly
no test coverage detected