MatthiasPeters
Members-
Content Count
6 -
Joined
-
Last visited
Community Reputation
1 NeutralRecent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
Thank you so much for providing this Update for the latest Halcon Version 24.11! In the meantime, I started writing a wrapper class that allows me to keep my old Halcon Com-Interface based code more or less as it is and internally call the C-functions. Example: procedure THalconOperators.DoOcrSingleClassMlp(CharacterRegion, CharacterImage: HObject; OCRHandle, OleNum: OleVariant; var OleClass, OleConfidence: OleVariant); var TupHandle: HTuple; TupNum: HTuple; TupClass: HTuple; TupConfidence: HTuple; begin OleVariant2HTuple(OCRHandle, @TupHandle, True); OleVariant2HTuple(OleNum, @TupNum); T_do_ocr_single_class_mlp(CharacterRegion, CharacterImage, TupHandle, TupNum, @TupClass, @TupConfidence); OleClass := HTuple2OleVariant(TupClass); OleConfidence := HTuple2OleVariant(TupConfidence); F_destroy_tuple(@TupHandle); F_destroy_tuple(@TupNum); F_destroy_tuple(@TupClass); F_destroy_tuple(@TupConfidence); end; So the idea is: convert all "OleVariant" varibales into "HTuple" (with my self-written procedure "OleVariant2HTuple") , call the C-function and convert the returned tuples into "OleVariant" variables again (with my function "HTuple2OleVariant"). With this it was relatively simple to convert an entire project from using the COM interface to using the C-library. Now I tried to compile my project with the latest "Halcon2411.pas" that you provided and I runt into a problem: the structure of the record "HTuple" (aka "HCTuple") has changed and is now: Hctuple = record val: Hcpar; num: INT4_8; capacity: INT4_8; flags: Integer; elem: Hcelem; end; before it was HTUPLE = record val: Hpar; &type: HINT; pad: array [0..3] of UTF8Char; num: INT4_8; capacity: INT4_8; free: HINT; elem: Hcelem; end; so we don't have the field "&type" any more? Why is that? I find it so confusing that all of a sudden one of the most important structures of this library (the TUPLE) is changed. Another issue that I have is that I didn't manage to use the "CHET" programme for creating the *.PAS File out of the halcon *.h files like you did it. It would be really helpful if you could provide me with more detailed info on what *.h files you copied into one directory and what changes you needed to do to them to successfully create a *.pas file out of this. In any case I am really greatful for the fantastic job that you did, showing that it is possible to use even the latest HALCON versions with Delphi.
-
I know that my .net approach was a different thing. Still it is about the same goal: using the latest Halcon versions with Delphi. We were about to give up and start rewriting a very big software project in C# or C++ because we thought there would be no clean way to continue with Delphi. I'm so glad you proved me wrong. I hope I'll find the time in the next days to work with your sample projects a little. What I'd like to test is for example if the "draw" procedures (like " T_draw_rectangle1 " for example) work as well. We need those so that the user can define a ROI (Region Of Interest). You wrote: <quote> I used that tool, but to use it i had modified the include file (.h) of Halcon and after that i had manually adjust the pas file results of Chet. </quote> can you tell me more about what kind of adjustements were necessary in the created pas file? Thanks!
-
Have you created some bigger projects with this yet? No problem with memory leaks so far? A while ago I made an attempt with this tool: https://www.crystalnet-tech.com/RuntimeLibrary/RuntimeLibrary4Delphi to get the .net assembly working in Delphi. It worked somehow but there were big problems with memory holes. There have been some updates to that software in the meantime but I could not find the time yet to make another try.
-
Wow, that is really impressive. Thank you so much for sharing this with me. I hope we can use this to upgrade our software to Halcon 22.11 steady. One more question: did you create the HalconC_2011.pas and HalconC_2211.pas fully automatically with this tool https://github.com/neslib/Chet or did you make some manual adjustments to the file? Btw: indeed the com interface for Halcon 20.11 was not made public officially but MVTec generously created a special version for us - however they said it would be the last one....
-
Thank you very much for that quick reply on my call for help regarding using Halcon with Delphi. Are you using this method yourself? I see that it seems to be easy to use the calls to the Halcon C-library. The only thing I wonder about is how to create some output of images and regions? Or how about drawing regions? I am using Halcon 20.11 steady now, which is the last Halcon Version that had (inofficial) support for the COM interface and we had a component named HWinXCtrl for that.
-
I know this thing is more than 4 years old but it is really interesting for me. It seems this is about using the Halcon image library by MVTec with Delphi. If anyone has a solution how to use the latest halcon version with Delphi please contact me. Thank you!