Kaan Aykut KABAKÇI Kaan Aykut KABAKÇI - 2 months ago 14x
Pascal Question

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.

pCvMemStorage = ^TCvMemStorage;
pCvSeq = ^TCvSeq;
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.