ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 IEVison Error: Unable to load CascadeClassifier
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

harry stahl

Germany
62 Posts

Posted - Jun 05 2017 :  10:35:00  Show Profile  Reply
Hi, while the downloadable demo "FaceRecognizer" works, it is not whith the self compiled demo.

I get then at start the message "Unable to load CascaseClassifier".

What can I do?

HS

xequte

38615 Posts

Posted - Jun 05 2017 :  18:17:31  Show Profile  Reply
Hi

I just tested the FaceRecognizer demo at:

https://www.imageen.com/demos/

And did not encounter an error. Are you sure you unzipped the whole zip to a folder?



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

harry stahl

Germany
62 Posts

Posted - Jun 05 2017 :  18:38:19  Show Profile  Reply
Yes, the whole zip was extracted. A Little bit strange is, that e.g. the "GetFaces" Demo runs, when I click there to add Classifiers, it works.

In Getfaces:

procedure TMainForm.CheckListBox1ClickCheck(Sender: TObject);
var
  objName:AnsiString;
  i:integer;
begin
  for i := 0 to CheckListBox1.Items.Count-1 do
  begin
    objName := AnsiString( CheckListBox1.Items[i] );
    // if selected and not already inserted (then add object)
    if (CheckListBox1.Checked[i]) and (not m_objectsFinder.classifierExists(PAnsiChar(objName))) then
      m_objectsFinder.addClassifier(PAnsiChar(objName), IEVisionLib.createCascadeClassifier(PAnsiChar(objName)))
    // if not selected but already inserted (then remove object)
    else if (not CheckListBox1.Checked[i]) and (m_objectsFinder.classifierExists(PAnsiChar(objName))) then
      m_objectsFinder.removeClassifier(PAnsiChar(objName));
  end;
end;

OK.

In FaceRecognizer:

m_objectsFinder := IEVisionLib().createObjectsFinder();

  for i := 0 to High(CLASSIFIERS) do
    m_objectsFinder.addClassifier(PAnsiChar(CLASSIFIERS[i]), IEVisionLib.createCascadeClassifier(PAnsiChar(CLASSIFIERS[i])));

is NOT OK




HS
Go to Top of Page

harry stahl

Germany
62 Posts

Posted - Jun 05 2017 :  19:01:19  Show Profile  Reply
The PAnsichar (Classifier[i]) gives back only a ":" so it will not work.

I've modfied it, now it runs:

var
classifier: AnsiString;
begin

...

for i := 0 to High(CLASSIFIERS) do
begin
classifier := CLASSIFIERS[i];
m_objectsFinder.addClassifier(PAnsiChar (CLASSIFIER), IEVisionLib.createCascadeClassifier(PAnsiChar (CLASSIFIER)));
end;

HS
Go to Top of Page

xequte

38615 Posts

Posted - Jun 05 2017 :  19:24:48  Show Profile  Reply
Hi Harry

That looks like a quirk in Delphi. What version are you using?

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

harry stahl

Germany
62 Posts

Posted - Jun 05 2017 :  19:55:12  Show Profile  Reply
It was the same problem in XE7 and Delphi 10.1 Berlin

HS
Go to Top of Page

xequte

38615 Posts

Posted - Jun 06 2017 :  17:54:14  Show Profile  Reply
I cannot reproduce that in Delphi 10.1 Berlin.

However I have implemented the changes.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: