その奇妙な問題を示すサンプルプロジェクトをD7で作成しました。ここにあります: http ://speedy.sh/n9Etr/OpenCV-BugTest.zip
私はそのような手順を持っています:
function Rec (image: PIplImage): String;
begin
DLL_CALL;
end;
Recを呼び出すと、DLL_CALLでAVを取得しますが、関数に2番目のパラメーターを追加すると次のようになります。
function Rec (image: PIplImage; Something: String): String;
begin
DLL_CALL;
end;
その後、DLL_CALLは成功します。
変数:「何か」は無関係であり、どこにも取られません...
本当に、何が起こっているのかわかりません...
編集:
openCVライブラリのcvSaveImageを使用しています。
function cvSaveImage(const filename: PAnsiChar; const image: pointer): integer;
cdecl; external CV_HIGH_GUI_DLL;
私のすべてのメソッドは、cdeclparamの呼び出し規約でエクスポートされます。
完全な手順は次のとおりです。
function TCVR.Rec(image: PIplImage): String;
const
THRESH = 50;
var
imgDisorted: PIplImage;
Storage: PCvMemStorage;
Squares: PCvSeq;
begin
imgDisorted := nil;
result := '';
Storage := cvCreateMemStorage(0);
cvSetImageROI(image, cvRect(0, 0, image^.width and -2, image^.height and -2));
PyrDownUp(image);
cvSetImageROI(image, cvRect(0, 0, image^.width and -2, image^.height and -2));
imgDisorted := cvCreateImage(cvSize(image^.width and -2, image^.height and -2), 8, 1);
cvSaveImage('c:\test.jpg', image); <--- AV here only when I have 1 parameter in my Rec.
end;