Otsu thresholding with mask
Hi, It appears that Otsu threshold type in cv::threshold is taking the whole image into account when calculating a threshold value to use. Is there any easy way to get it to only calculate the threshold for the masked (non-black) areas of an image?
Thanks
Otsu algorithm calculates threshold value from histogram data using (getThreshVal_Otsu_8u) You'll have to remove dark pixels from histogram then access Mat pixels directly to be able to threshold while ignoring dark pixels.