Compose used to be just a smooth way of writing Android Applications in Kotlin. Now JetBrains has ported Compose to the Desktop, and it’s now easier than ever to prototype UI in real-time.

Of course, you can write a web app-based UI or a single-page application, but sometimes, especially in the IoT world, and a small cluster of Raspberry Pis, the easiest way is to have actually a small Desktop UI.

A few months back, for a fast-paced PoC, I had to set up a lot of AWS EC2 instances, lambdas, Docker instances and had to monitor them; I actually reverted back to write a quick Desktop UI in Compose just for that. And. it. works. great.

Today’s article is about plugging in Compose with my de-facto Imaging/AI library, Origami, the only proper OpenCV wrapper for the JVM.

The article will focus on the ease of use of Compose and will leave apart an advanced thing that can be with Origami, so we will focus on writing a UI with a drag and drop area to accept an image, and when the image is shown, two sliders will accept a range of values for threshold 1 and threshold 2 of the OpenCV Canny function.

#kotlin

Write Your Own Imaging Processing UI in 15 Minutes
1.55 GEEK