After many experiments, I found that reading color jpg file in C++ (OpenCV):
auto temp(cv::imread("xxx.jpg");
is different from reading the same file using C# bitmap :
var temp=new bitmap("xxx.jpg");
the results are diffrent. There is notable diffrence if I applied some algorithm on them both like GoodFeatureToTrack.
The question is: How can adoapt the way of C# bitmap loading in the OpenCV. So, I got the same result if I load my image directly in the native part or from the C# Wrapper.
Thanks
EDIT:
This code is a c++ function that take some struct that contain an image that was loaded in a manged program (c#) and then load the same image in opencv and compare them.. there is a different!
extern "C" _declspec (dllexport) void test_diff(authenticator_reference_structure* referecnces){
auto image(cv::imread("white.jpg"));
cv::imshow("opencv", image);
auto wrpped(referecnces->references->images->image.getMat());
cv::imshow("C#", wrapped);
cv::Mat ss;
cv::absdiff(image, wrapped, ss);
cv::threshold(ss, ss, 1, 255, CV_THRESH_BINARY);
cv::imshow("Diff", ss);
cv::waitKey();
}