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
Fast Canvas Library V1.05...
by
backprop
[
Today
at 03:19:31 am]
TurboBird for FireBird 5
by
maurog
[
Today
at 02:28:10 am]
Status of FPC 3.4.0 or FP...
by
Graeme
[
Today
at 01:53:52 am]
TurboBird IBX
by
maurog
[
Today
at 01:53:39 am]
lazarus structure
by
crownfield
[
Today
at 12:28:23 am]
Delphi Magazine issues 1-...
by
simone
[February 16, 2026, 11:49:11 pm]
LazSerial not found
by
CM630
[February 16, 2026, 10:00:08 pm]
Duplicated icon in the Wi...
by
n7800
[February 16, 2026, 09:31:22 pm]
"PPU file isn't found by ...
by
Martin_fr
[February 16, 2026, 09:29:59 pm]
Reporting a Bug? in Strin...
by
Bart
[February 16, 2026, 06:47:13 pm]
[ANN] fpGUI Toolkit v2.0....
by
cdbc
[February 16, 2026, 06:45:05 pm]
Free Pascal for a small e...
by
devEric69
[February 16, 2026, 06:13:48 pm]
Datatype of Fields in sql...
by
Hansvb
[February 16, 2026, 06:10:23 pm]
Onguard Win64
by
AgriMensor
[February 16, 2026, 05:55:41 pm]
We are starting to use La...
by
JuhaManninen
[February 16, 2026, 04:11:47 pm]
Duplicate identifier erro...
by
Martin_fr
[February 16, 2026, 04:03:10 pm]
Frustrating Error When us...
by
TYDQ
[February 16, 2026, 02:50:02 pm]
[AGGPas] Difference betwe...
by
wp
[February 16, 2026, 02:15:23 pm]
[AGGPas] Usage of scale m...
by
Roland57
[February 16, 2026, 11:33:08 am]
makefiles
by
valdir.marcos
[February 16, 2026, 11:24:17 am]
ThorVG - test (lightweigh...
by
valdir.marcos
[February 16, 2026, 11:19:41 am]
Problems in drawing an ar...
by
valdir.marcos
[February 16, 2026, 11:18:39 am]
AI to port DBDesigner For...
by
Graeme
[February 16, 2026, 10:26:15 am]
Select rectangle of the i...
by
valdir.marcos
[February 16, 2026, 10:01:09 am]
DCPcrypt v2.0.6 — Cryptog...
by
valdir.marcos
[February 16, 2026, 09:55:55 am]
« previous
next »
Print
Pages:
1
[
2
]
Author
Topic: TOpenALPR with Lazarus - Issue at call to OpenALPR (Read 5957 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: 18729
To Europe: simply sell USA bonds: dollar collapses
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
If Europe sells their USA bonds the USD will collapse. Europe can affort that given average state debts. The USA can't affort that. Just an advice...
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