Since OpenCV 3.0 has very useful function called connectedComponentsWithStats, I'm interested if there is a way to speed this function up?
I'm working on a project in whitch I have to calculate properties of anomalies. This properties are wery good calculated with connectedComponentsWithStats function, but I need more speed here...
The image that we calculate anomalies from is 8-bit binary image calculated from grayscale image using OpenCV threshold function. I show this binary anomaly image here below:
We can se black area - this is our region of interest (ROI). On the ROI we can se white anomalies (dots, lines, scrathes..). For that anomalies I have to calculate centroids, areas and similar properties that function connectedComponentsWithStats does very ok, but it is not fast enought for my application. My code for calculation of properties is here:
connectedComponentsWithStats(anomalyImg,
OutputImg,
stats,
centroids,
8,
CV_32S
);
The calculation takes me about 55 mili seconds and I want to optimize it to be at least 10 times faster.
Thank you already for all your advices guys!