简体   繁体   中英

Incompatible types in DELPHI and Opencv

I am trying to find contour into a picture. I implement as follows but i get

Incompatible types: 'ocv.core.types_c.pCvMemStorage' and 'UWaterShedSegment.pCvMemStorage' error.

 type
      pCvMemStorage = ^TCvMemStorage;
      pCvSeq = ^TCvSeq;
    .
    .
    .
    var
      contours :  pCvMemStorage;
      first_contour :   pCvSeq;
    .
    .
    .
    cvFindContours(DistImgEq, contours, first_contour, SizeOf(TCvContour) ,CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE,cvPoint(0,0));

You've redeclared the type pCvMemStorage in your own unit and this is hiding the declared type in the ocv.core.types_c unit that is required by the method signature of cvFindContours .

Remove the type declaration from your unit and, if it is not already there, add the ocv.core.types_c unit to your uses clause.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM