Another LB API Demo :-) Automatic object placement

Over the years, the following use case was raised every once in a while: detecting objects in the camera overview and place objects automatically. Other software allows this already, and using the API, it was just a few hours of talking to AI to finish a first prototype: :slight_smile:
It’s a small Python app that loads the camera overly, searches for shapes; the user can choose an SVG file, select the desired shapes, and the tool sends the SVG scaled and rotated back to LB.
Of course—much detailed work would be required to make it really usable, but I was already happy with it.

Here is a video showing it in action:

I actually have a pretty similar version of this sort of tool already handed off to the dev team to review internally :slight_smile:

Is this something we can test and play with?

Yes, it’s a quite obvious function that I think makes sense to have directly integrated into LB :slight_smile:

Sure, though it’s currently just a bare script with a German user interface, I will enhance it a bit to make it usable for everyone :slight_smile:

@misken With all the anticipated enthusiasm that we have about the REST-API feature set we’ve got a new section open.

I’m moving this thread there. All the links are expected to remain working.

:slight_smile:

Really enjoy the creativity with this @misken. Thank you friend. :slight_smile:

Try this download: https://diode-laser-wiki.com/wp-content/uploads/2026/10/align-cam.zip It just contains one python file and some documentation. I might upload it to GitHub as well, I don’t have it structured very well yet.

Edit: you might need to install some python libraries, then you can just start the tool by typing “python align-cam.py”

Thanks Melvin, I’m looking forward to looking at it tomorrow.

Hi Melvin, I couldn’t get it to work. It has nothing to do with your program, it’s just been too long since I’ve worked with Thonny/scripts and I wasn’t very good at it either :wink:
But I’ve read your description of the script and understand how it’s supposed to work.

I’ve also been to your HP to see if there’s any additional information. Even though I couldn’t find anything about your last project, I’m very impressed by your fine work within diode laser machines and their peripherals, you can find many gems in the different sections.

I think/believe that LB will and must integrate tools like the one you’re working with, not least to maintain its leading position within laser control programs.

regards bernd.dk

Are you using Windows? Then I guess you need to install Python first (Download Python | Python.org). Afterward, extract the zip to a folder and open the windows command line and jump into that folder. Then you might need to run the first command once (installing the libraries) and then you can run the tools with the simple command.
Though I don’t know if I have installed some other stuff over the years of development :slight_smile:

No, I’m on a Mac and have Python installed along with a little bit of other stuff for Arduino programming, but I use it far too little.