Kaan Aykut KABAKÇI Kaan Aykut KABAKÇI - 1 year ago 271
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));

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download