After many experiments, I found that reading a jpg file in C ++ format (OpenCV):
auto temp(cv::imread("xxx.jpg");
different than reading the same file using C # bitmap:
var temp=new bitmap("xxx.jpg");
The results are different. There is a noticeable difference if I apply some kind of algorithm to them like GoodFeatureToTrack.
Question: How can I adapt the method of loading raster C # in OpenCV. So, I got the same result if I upload my image directly in the native part or from C # Wrapper.
thanks
EDIT:
This code is C ++ - a function that takes some structure containing an image that has been loaded into a managed program (C #), and then loads the same image into opencv and compares them. There is another!
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(); }

source share