Closed ertankucukoglu closed 7 years ago
hi,
try to compile using Delphi XE6 and later,
What exact version you have now?
My version is Delphi 10.2 Tokyo.
If you see below definition. That recursively points TKeyPoint
and I couldn't solve problem with my knowledge.
procedure convert(const keypoints: TKeyPointArray; Var points2f: TArrayOfcvPoint2f); overload;
Hello,
at-least you should try compiling it with Delphi Tokyo below, well see if Tokyo has the problem, not the Structure of the codes.
Blaise
I believe, features2d port is not complete, yet. I read it in another issue post here.
Below code is compiling. It should be compiled in Delphi 2010, too. Learned from a forum that advanced types support nested parts in it.
I do not know how to commit any change using Git. I appreciate if someone else can do it, please. File modification made is: ocv.cls.features2d.pas
pKeyPoint = ^TKeyPoint;
TKeyPoint = record
public type
TKeyPointArray = TArray<TKeyPoint>;
TKeyPointArrayOfArray = TArray<TKeyPointArray>;
public
pt: TcvPoint2f; // !< coordinates of the keypoints
size: Float; // !< diameter of the meaningful keypoint neighborhood
angle: Float; // !< computed orientation of the keypoint (-1 if not applicable);
// !< it's in [0,360) degrees and measured relative to
// !< image coordinate system, ie in clockwise.
response: Float; // !< the response by which the most strong keypoints have been selected. Can be used for the further sorting or subsampling
octave: Integer; // !< octave (pyramid layer) from which the keypoint has been extracted
class_id: Integer; // !< object class (if the keypoints need to be clustered by an object they belong to)
procedure KeyPoint(_pt: TcvPoint2f; _size: Float; _angle: Float = -1; _response: Float = 0; _octave: Integer = 0;
_class_id: Integer = -1); overload;
procedure KeyPoint(x: Float; y: Float; _size: Float; _angle: Float = -1; _response: Float = 0; _octave: Integer = 0;
_class_id: Integer = -1); overload;
function hash: size_t;
procedure convert(const keypoints: TKeyPointArray; Var points2f: TArrayOfcvPoint2f); overload;
procedure convert(const points2f: TArrayOfcvPoint2f; Var keypoints: TKeyPointArray); overload;
function overlap(const kp1, kp2: TKeyPoint): Float;
end;
TKeyPointArray = TKeyPoint.TKeyPointArray;
TKeyPointArrayOfArray = TKeyPoint.TKeyPointArrayOfArray;
Suggestion, Try to comment the functions or procedure not involved from your codes, if it's really needed then put empty body on it.
Blaise
Actually, I already shared working code above. I tested it and application EXE file also works.
BTW, I still need ability to save/read these keypoints extracted from a picture into a disk file (XML, YAML, JSON). This is not implemented, yet in current state of the Delphi-OpenCV.
I am willing to work with someone to complete that part anyway.
May I know where did you put the link of your shared working code above or the application project?
I might try it, Blaise
My last code post above is the working code.
Hello,
I am getting below error when trying to compile the project.
[dcc32 Error] ocv.cls.features2d.pas(46): E2003 Undeclared identifier: 'TKeyPoint'
Related lines are as follows:
It seems like a recursive call to TKeyPoint at some point. But this maybe me lacking Delphi knowledge.