Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
General
»
TOpenALPR with Lazarus - Issue at call to OpenALPR
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
FastCGI vs. CGI
by
Thaddy
[
Today
at 10:56:40 am]
GTK3 is now the default w...
by
Thaddy
[
Today
at 10:22:34 am]
authentiacte through goog...
by
Thaddy
[
Today
at 09:12:56 am]
[SOLVED] Stopped compilin...
by
CM630
[
Today
at 08:41:58 am]
Putting a new file on a w...
by
paweld
[
Today
at 08:30:32 am]
[CLOSED] Seeking performa...
by
Xenno
[
Today
at 08:11:26 am]
Slow app start on M5 MacB...
by
Thaddy
[
Today
at 08:08:00 am]
Testing Antropic
by
Thaddy
[
Today
at 07:06:58 am]
Lazarus Main not building...
by
Thaddy
[
Today
at 06:31:42 am]
Setting the CURSOR for th...
by
jamie
[
Today
at 02:16:55 am]
Windows 2026_7 update and...
by
jamie
[
Today
at 01:45:40 am]
TPeriodicTable
by
wp
[
Today
at 12:19:25 am]
FPC Unleashed (async/awai...
by
Fibonacci
[July 17, 2026, 08:26:50 pm]
I have made some progress...
by
onionmixer
[July 17, 2026, 08:08:34 pm]
How to connect to MariaDb...
by
jcmontherock
[July 17, 2026, 06:23:38 pm]
This week in OPM!
by
Tomxe
[July 17, 2026, 05:47:11 pm]
Accessing VRAM memory wit...
by
LemonParty
[July 17, 2026, 04:45:30 pm]
KOL4 Beta available.
by
Thaddy
[July 17, 2026, 04:45:13 pm]
docking IDE
by
Martin_fr
[July 17, 2026, 02:13:28 pm]
Engineering Software from...
by
jamie
[July 17, 2026, 12:51:57 pm]
[SOLVED] BitBtn Oddity
by
Petrus Vorster
[July 17, 2026, 09:05:55 am]
Difference between @ and ...
by
paule32
[July 17, 2026, 08:18:43 am]
Lazarus Bugfix Release 4....
by
papillon33
[July 17, 2026, 08:15:45 am]
Many recent books on Laza...
by
Khrys
[July 17, 2026, 06:35:48 am]
Isn’t this funny?
by
n7800
[July 16, 2026, 11:57:09 pm]
« previous
next »
Print
Pages:
1
[
2
]
Author
Topic: TOpenALPR with Lazarus - Issue at call to OpenALPR (Read 6273 times)
engkin
Hero Member
Posts: 3112
Re: TOpenALPR with Lazarus - Issue at call to OpenALPR
«
Reply #15 on:
July 09, 2019, 08:07:31 pm »
I agree, if it works Delphi with cdecl, then forget about calling convention.
Logged
af0815
Hero Member
Posts: 1409
Re: TOpenALPR with Lazarus - Issue at call to OpenALPR
«
Reply #16 on:
July 09, 2019, 08:33:17 pm »
I have compiled all the samples with the actual community compiler of Delphi first. After i see it working with the (patched/recompiled) libraries, i do the try with Lazarus.
In the published libs of the OpenALPR Project the 'flattend' interface is complete missing. I have looked with CFF-Explorer. So the guy from TOpenALPR have recompiled it with the flattend interface.
I can send the compiled projects of Delphi if needed. PM
Logged
regards
Andreas
engkin
Hero Member
Posts: 3112
Re: TOpenALPR with Lazarus - Issue at call to OpenALPR
«
Reply #17 on:
July 10, 2019, 02:49:33 am »
I did the smallest test using the straight function calls, and it works after masking FPU exceptions. Does not, using the class. Obviously the problem is in the Pascal code.
I'll work on it some more later when I get a chance.
Logged
af0815
Hero Member
Posts: 1409
Re: TOpenALPR with Lazarus - Issue at call to OpenALPR
«
Reply #18 on:
July 10, 2019, 06:40:23 am »
Interesting news, i will work on this too. I have setup a working chain with VS to rebuild the complete libraries. Tesseract and OpenCV libraries are rebuild correct, but in OpenALPR are some issue, prohibit the full recompile.
Logged
regards
Andreas
engkin
Hero Member
Posts: 3112
Re: TOpenALPR with Lazarus - Issue at call to OpenALPR
«
Reply #19 on:
July 10, 2019, 07:02:41 am »
For testing I just tried with Delphi_console:
1-Add Math to your uses section
2-Disable all FPU exceptions before calling RecognizeFile:
Code: Pascal
[Select]
[+]
[-]
Math
.
SetExceptionMask
(
[
exInvalidOp
,
exDenormalized
,
exZeroDivide
,
exOverflow
,
exUnderflow
,
exPrecision
]
)
;
alprResult
:
=
vOpenAlpr
.
RecognizeFile
(
'samples\eu-3.jpg'
)
;
Seems to work. Just make sure to rebuild your code, and notice that the example is not finished. It does not parse the JSON result.
You can see the result if you add WriteLn(pJSON):
Code: Pascal
[Select]
[+]
[-]
function
TOpenALPR
.
RecognizeFile
(
AFileName
:
String
;
AROI
:
PAlprCRegionOfInterest
=
nil
)
:
TOpenALPRResult
;
...
pJSON
:
=
openalpr_recognize_encodedimage
(
FOpenALPRInstance
,
msEncodedImage
.
Memory
,
msEncodedImage
.
Size
,
roi
)
;
WriteLn
(
pJSON
)
Logged
af0815
Hero Member
Posts: 1409
Re: TOpenALPR with Lazarus - Issue at call to OpenALPR
«
Reply #20 on:
July 10, 2019, 07:56:06 am »
It looks indeed working now, with the math.SetExceptionmask.
The next step is, to proceed with the JSON-Part.
THX to engkin and thaddy.
Logged
regards
Andreas
Thaddy
Hero Member
Posts: 19447
Glad to be alive.
Re: TOpenALPR with Lazarus - Issue at call to OpenALPR
«
Reply #21 on:
July 10, 2019, 08:37:09 am »
It seems there are several differently compiled dll's: the one I found was definitely compiled with stdcall. I have seen that before with open source software.
Glad that masking out the exceptions at least helps. This is a very important issue on Windows. And well known.
I will also test to get the JSON stuff working, but I have little time the next two days.
Note that Windows uses winapi instead of stdcall or cdecl. winapi is an alias, depending on platform.
Logged
Any "programmer" that knows only one programming language is not a programmer
af0815
Hero Member
Posts: 1409
Re: TOpenALPR with Lazarus - Issue at call to OpenALPR
«
Reply #22 on:
July 10, 2019, 09:30:10 am »
Ok, now the TOpenALPR im my repro is working (actual in branch Lazarus). I have also fixed the JSON Part.
Logged
regards
Andreas
Print
Pages:
1
[
2
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
General
»
TOpenALPR with Lazarus - Issue at call to OpenALPR
TinyPortal
© 2005-2018