AI object measurement by photo in mobile app

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
AI object measurement by photo in mobile app
Complex
~1-2 weeks
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    761
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    649
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1071
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    884
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    466

AI-Based Object Measurement from Photos in Mobile Apps

Measuring cabinet width without leaving your chair sounds like marketing hyperbole. Behind it lies non-trivial geometry: camera calibration, depth estimation, reference object detection. Measurement accuracy without special acquisition conditions is 5–15%, with proper methodology it reaches 2–5%.

Two Fundamentally Different Approaches

ARKit/ARCore (LiDAR or SLAM) — precise but requires device support. iPhone 12 Pro and newer with LiDAR achieve 1–3 cm accuracy at distances up to 5 meters. ARCore on Android without LiDAR performs worse, with 3–8 cm error.

Monocular depth estimation — works on any device without LiDAR, using CNN to estimate depth from a single frame. MiDaS, DPT, Depth Anything V2 are current models. Accuracy is notably lower than LiDAR approaches, but sufficient for many applications.

// iOS: method selection based on device capabilities
func selectMeasurementMethod() -> MeasurementMethod {
    if ARWorldTrackingConfiguration.supportsSceneReconstruction(.mesh) {
        return .lidarARKit          // iPhone 12 Pro+, iPad Pro
    } else if ARWorldTrackingConfiguration.isSupported {
        return .slamARKit           // ARKit without LiDAR
    } else {
        return .monocularDepth      // fallback to CoreML model
    }
}

Implementation via ARKit

// Measuring distance between two points in AR
class ARMeasurementSession: NSObject, ARSessionDelegate {

    var arView: ARSCNView!
    private var startAnchor: ARAnchor?
    private var endAnchor: ARAnchor?

    func placePoint(at screenPoint: CGPoint) -> MeasurementPoint? {
        // Raycast from screen into 3D world space
        guard let query = arView.raycastQuery(
            from: screenPoint,
            allowing: .estimatedPlane,
            alignment: .any
        ) else { return nil }

        guard let result = arView.session.raycast(query).first else { return nil }

        let worldPosition = result.worldTransform.columns.3  // position in meters
        return MeasurementPoint(
            position: SIMD3(worldPosition.x, worldPosition.y, worldPosition.z),
            confidence: result.targetAlignment == .horizontal ? .high : .medium
        )
    }

    func calculateDistance(from start: MeasurementPoint, to end: MeasurementPoint) -> Measurement<UnitLength> {
        let diff = end.position - start.position
        let distanceMeters = Double(simd_length(diff))
        return Measurement(value: distanceMeters, unit: .meters)
    }
}

A common mistake is not accounting for the fact that raycast performs better on well-textured surfaces. A white wall produces poor SLAM tracking results, causing AR markers to drift.

Displaying Measurements in AR

func addMeasurementLine(from start: SIMD3<Float>, to end: SIMD3<Float>,
                         distance: String) {
    let midpoint = (start + end) / 2

    // Line between points
    let lineNode = SCNNode(geometry: createCylinder(from: start, to: end))

    // Label with distance at midpoint
    let labelNode = SCNNode(geometry: SCNText(string: distance, extrusionDepth: 0.001))
    labelNode.position = SCNVector3(midpoint.x, midpoint.y + 0.02, midpoint.z)
    labelNode.scale = SCNVector3(0.005, 0.005, 0.005)
    labelNode.constraints = [SCNBillboardConstraint()]  // always face camera

    sceneRoot.addChildNode(lineNode)
    sceneRoot.addChildNode(labelNode)
}

Reference Object Approach for Photo-Based Measurement

Without AR, a known-size object in the frame is required. A bank card (85.6 × 53.98 mm) serves as a convenient reference:

// Android: measurement via reference object
class ReferenceObjectMeasurer {

    fun measureWithCard(bitmap: Bitmap, cardBoundingBox: RectF,
                        objectBoundingBox: RectF): MeasurementResult {
        // Real card dimensions
        val cardRealWidth = 85.6f  // mm
        val cardRealHeight = 53.98f

        // Pixels → mm
        val pixelsPerMmHorizontal = cardBoundingBox.width() / cardRealWidth
        val pixelsPerMmVertical = cardBoundingBox.height() / cardRealHeight

        // Perspective distortion correction (simplified)
        val correctionFactor = estimatePerspectiveCorrection(
            cardBoundingBox, imageDimensions = bitmap.width to bitmap.height
        )

        return MeasurementResult(
            widthMm = (objectBoundingBox.width() / pixelsPerMmHorizontal) * correctionFactor,
            heightMm = (objectBoundingBox.height() / pixelsPerMmVertical) * correctionFactor,
            accuracy = MeasurementAccuracy.MODERATE  // ±5-10% without calibration
        )
    }
}

Card detection in the frame uses ML Kit Object Detection or a custom YOLOv8 model (straightforward to train on 500 card images in various conditions).

Timeline Estimates

ARKit/ARCore measurement with basic UI (two points, distance) on a single platform takes 3–5 days. Complete implementation—LiDAR + SLAM fallback + monocular depth for older devices, area and perimeter measurement, measurement history, export, iOS + Android—requires 1–2 weeks.