100,000 frame test – Segmentation and Clustering

This is the longest test in some time where the percepts are actually dumped to disk so we can take a look at them. Callgrind indicated that my inline weighting (just using the * operator on cv::Mats) was using 30% of the CPU of the whole program, switching to the addWeighted() function and other optimization got that 7s per frame time down to ~3s, making longer tests more feasible on this machine. The bad news is that the trend to more ephemeral clusters seems to continue, and after 100,000 frames all percepts are unreadable mud:


The idea for the fix is to switch from CIELuv to HSV and threshold masks so they only calculate the mean colour for a small area that corresponds to the most recently clustered mask. Currently, the raw mask is used, and is interpreted as binary, so its likely that most of the image is selected by the mask, increasing muddiness.