/* When scale == 2, image is reduced by 2 */ /* When scale == 1, full resolution image is used */ unsigned scale = 2; /* Variable used to determine how many images are being processed * Command : ls 'input_str' | wc -l' * can tell you have files match the expression passed to the reader plugin */ unsigned number_of_images = 1; /* When dump_ring_to_image == 1, data is written to an image * When dump_ring_to_image == 0, data is written in a text file as * coordinates with the first line being the number of rings and all * subsequent lines the "x y r" coordinates. */ unsigned dump_ring_to_image = 0; char *input_str = "data/Image0.tif"; g_object_set (G_OBJECT (global_reader), "path", input_str, NULL); g_object_set (G_OBJECT (piv.writer), "filename", "res%i.tif", NULL); g_object_set (G_OBJECT (piv.ringwriter), "filename", "results", NULL); /* Define matrix_size to determines the number of surrounding pixels to * be compared with, ideally make this number uneven * Being twice the size of the actual ring thickness tends to be good */ g_object_set (G_OBJECT (piv.denoise), "matrix_size", 26 / scale, NULL); /* Boolean to say whether or not to romve high intensity pixels */ g_object_set (G_OBJECT (piv.contrast), "remove_high", 0, NULL); /* Giving ring radius, when using reduce plugin divide them by 2 */ unsigned ring_start = 10 / scale; unsigned ring_end = 130 / scale; unsigned ring_step = 2 / scale; g_object_set (G_OBJECT (piv.ring_pattern), "ring_start", ring_start, NULL); g_object_set (G_OBJECT (piv.ring_pattern), "ring_end", ring_end, NULL); g_object_set (G_OBJECT (piv.ring_pattern), "ring_step", ring_step, NULL); /* Should be the same dimension as input image */ /* When using reduce plugin divide it by 2 */ g_object_set (G_OBJECT (piv.ring_pattern), "width", 1080 / scale, NULL); g_object_set (G_OBJECT (piv.ring_pattern), "height", 1280 / scale, NULL); /* Giving thickness of rpiv.ing * NOTE if rings raddi apiv.nd thickness are too big, you will get errors from * the gpu * saying CL_piv.INVALID_WORK_GROUP_SIZE */ g_object_set (G_OBJECT (piv.ring_pattern), "ring_thickness", 6 / scale, NULL); /* Set the maximum number of rings that should detected per ring pattern, if * the number of found rings is greater than max_count, then the output is * ignored */ g_object_set (G_OBJECT (piv.concatenate_result), "max_count", 100, NULL); /* When images maximum is less than min ignore output. Min is the * likelyness value for a pixel to be the center of a ring and ranges from 0 * to 1 */ g_object_set (G_OBJECT (piv.filter_particle), "min", 0.125, NULL); /* Consider only pixels that are above 0.8 * max when searching for clusters * of pixels. Where max, is the highest intensity in the image */ g_object_set (G_OBJECT (piv.filter_particle), "threshold", 0.8, NULL); /* Set minumum distance between rings, and how close two different radius * are considerend to be same ring */ g_object_set (G_OBJECT (piv.get_dup_circ), "threshold", 8. / scale, NULL); /* Up to what radii difference is a ring considered an inner or outer ring * of two intersecting rings */ g_object_set (G_OBJECT (piv.remove_circle), "threshold", 4. / scale, NULL); /* Vary up from -radii_range to randii_range the radius to find the * polynomial that corresponds to the rings contrast */ g_object_set (G_OBJECT (piv.multi_search), "radii_range", 6 / scale, NULL); /* Set the minimum contrast a ring should have to be considered a ring */ g_object_set (G_OBJECT (piv.multi_search), "threshold", 0.01, NULL); /* By how much may the ring center be displaced to find it's actual center and * it's actual radius */ g_object_set (G_OBJECT (piv.multi_search), "displacement", 1, NULL);