config.h 3.6 KB

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