Same Algorithm works very slow in windows and very fast in Ubuntu.
I have a same algorithm working in two computer. One with Ubuntu and other with windows.
In Ubuntu, the algorithm takes a input images through a framework called ADTF. Here the algorithm works in 70fps. Everything is perfect.
In windows, the algorithm takes input images from a video stream without using any framework (visual studio 2012 as an IDE). Here the algorithm works in 2fps.
When I checked for the computation time, I see a function in my algorithm which takes 0.4seconds in windows and 0.011seconds in Ubuntu. And this function has been called 'n' number of times in the process. This function uses only cv::Mat in its argument and some float. I don't think so the data type float is responsible for this big time variation.
I checked the every single line of the c++ codes in my files. Its exactly same in both cases. But only the computation time has been decreased more than 30 times. I have no idea what's happening. Can anyone help me?
Note:: Both the computer have exactly the same configuration.
Intensity getIntensity (Grids &inputGrids, Mat inputImage)// groups of 2d grids {
type allGridIntensity;
for()//takes single grid
{
type singleGridIntensity;
for()//takes single point
{
double intensity = inputImage.at<uchar>(yPose, xPose);
singleGridIntensity.push_back(intensity);
}
allGridIntensity.push_back(singleGridIntensity);
}
return allGridIntensity; }
First of all, it is impossible to have exactly the same configuration ... there can be differences in compiler settings. Secondly, did you build both openCV configurations with TBB support? Thirdly, without any idea of what algorithm is going slow or what function is working slower, we cannot help you, so more info is required. Can you provide this? Also are you sure you aren't mixing up debug and release configurations? These make a HUGE difference. Fourthly, you are using two different capturing techniques. Can you take a universal capturing technique for comparing that works on both OS?
you probably want to show the offending piece of code
@StevenPuttemans. I meant the hardware configuration(just 2 laptops with same model).. I dont know what is TBB support (so I ll answer this later). I have uploaded the function which consumes time (see updated edit). No, I am not mixing up the debug and release. I using only the release configs.
@berak and @StevenPuttemans I have uploaded the piece of a code. This takes a group of grid and a cv::Mat as argument. Each grid is defined by group of points. I defined this point with type float. This function just takes the instensity value for each point (x, y) in all the grid.
@StevenPuttemans. In my windows PC, I use it with TBB support. And no idea about Ubutu PC. Because I cannot use the Ubuntu PC anymore. (And that is the reason for this question)