/* Vehicle-road segmetnation tools */ /* Last edited on 2016-04-09 11:02:39 by stolfilocal */ #ifndef dsm_segment_H #define dsm_segment_H /* Background/vehicle segmentation. */ /* Version of Jan/2016 */ #include /*Tries to segment the (reduced) image {img} into foreground and background, given the (reduced) reference background image {bg} and blurred versions {img_blur}, {bg_blur} of them. Stores into the weight image {classw} the fuzzy classification of each pixel, as background (255) or foreground (0). All images must have the same dimensions. The parameter {lambda} should be the standard deviation of the discrepancy between pixels that are background in {img}. */ void dsm_segment_identify_background ( dsm_image_t *img, dsm_image_t *img_blur, dsm_image_t *bg, dsm_image_t *bg_blur, double lambda, dsm_image_t *classw ); /*Compares image {img} and {bg} at the pixel row {y} column {x} trying to eliminate the effect of lighting by comparing the blurred versions {img_blur} and {bg_blur}. Returns in {*d} the discrepancy measure and in {*w} the realibity weight of that measure. If {d = 1} it means that the image pixel is twice as bright as the background pixel, taking into account the local brightness ratio. Assumes that all images have {nx} cols and by {ny} rows. */ void dsm_segment_compute_mismatch ( uint8_t *img, uint8_t *img_blur, uint8_t *bg, uint8_t *bg_blur, int nx, int ny, int x, int y, double *d, double *w ); #endif