Smart trichoscopy application with a hardware case
Custom mobile app development aiding a global healthtech company in medical diagnostics
ABOUT
the project
Client:
Location:

Poland
|
Germany
Company Size:
Industry:
Solution:
Services:
The trichoscopy application is designed to assist physicians in the comprehensive evaluation of scalp and hair conditions. The app transforms a standard smartphone into a digital trichoscope. Thanks to using a proprietary computer vision algorithm, the software automatically calculates key hair parameters, including measured area, hair count, density, average length, anagen-telogen ratio, and the number and density of vellus and terminal hairs. Thanks to quick analyses of photos, the app significantly improves the efficiency and accuracy of doctors’ work.
A key challenge of this project was the fact that the specialized hardware case existed as a single prototype. As a result, our development process was guided solely by the client’s documentation without direct access to the physical hardware. This limitation required precision and flexibility during development to meet the project’s technical requirements. And we made it with flying colors.

Customer
Our customer is a global healthtech company specializing in innovative hair research and diagnostics solutions. They offer patented technology that delivers precise and objective trichoscopy measurements, helping to improve the diagnosis of hair-related diseases and treatment monitoring.
Business Challenge
Our customer wanted to develop a mobile iOS and Android application that would work with a company’s proprietary computer vision algorithm and analyze patients’ hair photos taken with the help of a smartphone on its own or paired with a special hardware case.
Why Leobit
Our customer was referred to Leobit through their collaboration with another healthtech company, for whom we successfully developed an AI-based digital dermoscopy application. The customer was impressed by the quality of our work, our adherence to project timelines, and our ability to solve technical challenges, such as distortion issues when using additional photo lenses for image capture. Given that the trichoscopy application posed similar challenges, the customer was confident that Leobit was the right partner to bring their innovative solution to life.

Project
in detail
Leobit was tasked with developing a cross-platform mobile application on Flutter that would communicate seamlessly with a customer’s computer vision algorithms via an API.


Architecture Development
To ensure fast and efficient app performance, Leobit developed a three-layer architecture based on the BLoC architecture pattern. This setup ensures that all interactions with the interface are sent to the BLoC layer, which handles requests to the infrastructure. Similarly, responses to requests are processed by the BLoC layer before being displayed in the UI. This design ensured smooth and organized communication between different components of the app.

Image processing
One significant challenge was dealing with image distortion caused by the external hardware case and its additional lenses, resulting in a “fish-eye” effect. Such distorted images are unsuitable for analysis, so we calibrated each image to correct the distortion, transforming it into a format compatible with the algorithm. If this process had been handled in Flutter alone, the performance would have dropped from 30fps to around 2fps. This would make application slow and unusable.
So, every picture is captured through Flutter, but the actual image processing occurs in C++ using the OpenCV framework. This process allows for fast and efficient image modification, calibration, and transfer back to Flutter.

Extending Flutter functionality with C++
Flutter was primarily used for the app’s interface, but it couldn’t meet all of the performance requirements. For more complex tasks, our developer suggested supplementing Flutter with Kotlin for Android and Swift for iOS, using the native Android and iOS APIs. Since the image analysis algorithms were written in C++, we forced Flutter to call these C++ functions for optimization purposes using Dart FFI. As a result, we were able to reduce image processing time from 2 minutes to less than 10 seconds.

Setting up hardware
Our customer developed a one-of-a-kind hardware case, which is supposed to enhance the quality of the patient’s scalp photos. The first time the hardware case is connected, calibration is required to ensure accurate image recognition. The customer provides a special calibration board to help with this process.
We used C++, OpenCV, and Dart FFI to ensure the images were calibrated correctly for analysis. In addition to macro lenses, the case also includes lights, allowing users to illuminate the photography area with standard, polarized, or UV light. Using a serial protocol, the app detects the hardware case’s connection and provides control over the lighting—allowing doctors to choose the light type or switch it on or off.
The Journey
Behind Our Success
Technology Solutions
- A three-layer architecture based on the BLoC architecture pattern
- Extended Flutter functionality with C++ through Darf FFI
- IoT hardware case calibration using C++, OpenCV, and Dart FFI
- Modification of the camera’s native API to allow users to manually select the specific lens
- Fish-eye distortion elimination thanks to using Darf FFi and OpenCV library
Value Delivered
- Seamless communication between IoT hardware case and mobile application
- Reduced image processing time from 2 minutes to less than 10 seconds by using Darf FFI to force Flutter to call C++ functions for optimization purposes
- Enhanced camera capabilities