Code Monkey home page Code Monkey logo

authlabs's Introduction

✦ 제출자

  • SeSAC AI를 활용한 iOS 앱개발 과정 하업서

✦ 과제명

  • AR활용 이미지 인식·검출·추적·증강 및 ChatGPT API 활용 이미지 검색·결과 출력 기능 개발

✦ 활용기술

  • UIKit
  • ARKit
  • RealityKit
  • Combine
  • CoreImage
  • Vision
  • ChatGPT Vision API
  • Google Custome Search API

✦ 결과화면 및 구현 사항

Screenshot 2024-04-30 at 9 30 25 PM Screenshot 2024-04-30 at 9 30 32 PM Screenshot 2024-04-30 at 9 02 08 PM

✦ 상세 기능 구현 설명

  1. 마커 등록 asset에 ARResourc를 통해서 등록했습니다.

  2. 이미지 인식 및 앵커 생성

       func session(_ session: ARSession, didAdd anchors: [ARAnchor]) {
        for anchor in anchors {
            guard let imageAnchor = anchor as? ARImageAnchor else { return }
            handleImageAnchor(imageAnchor)
        }
    }
  1. 이미지 트래킹
  func resetTracking() {
        guard let referenceImages = ARReferenceImage.referenceImages(inGroupNamed: "AR Resources", bundle: nil) else { return }
        arConfiguration.trackingImages = referenceImages
        arView.session.run(arConfiguration, options: [.resetTracking, .removeExistingAnchors])
    }
  1. 이미지 추출 - 이미지 모서리 꼭지점 계산
guard let topLeft = arView.project(imageAnchorPosition + SIMD3<Float>(-referenceImageWidth/2, referenceImageHeight/2, 0)),
              let bottomLeft = arView.project(imageAnchorPosition + SIMD3<Float>(-referenceImageWidth/2, -referenceImageHeight/2, 0)),
              let topRight = arView.project(imageAnchorPosition + SIMD3<Float>(referenceImageWidth/2, referenceImageHeight/2, 0)),
              let bottomRight = arView.project(imageAnchorPosition + SIMD3<Float>(referenceImageWidth/2, -referenceImageHeight/2, 0)) else { return }
  1. 이미지 왜곡 보정 - CIImage
    private func cropImageForPoints(image: CIImage, topLeft: CGPoint, topRight: CGPoint, bottomLeft: CGPoint, bottomRight: CGPoint) -> CIImage? {
        let perspectiveTransformFilter = CIFilter.perspectiveCorrection()
        perspectiveTransformFilter.inputImage = image
        perspectiveTransformFilter.topLeft = CGPoint(x: topLeft.x - 10, y: image.extent.size.height - topLeft.y + 40)
        perspectiveTransformFilter.topRight = CGPoint(x: topRight.x - 35, y: image.extent.size.height - topRight.y + 40)
        perspectiveTransformFilter.bottomLeft = CGPoint(x: bottomLeft.x - 10, y: image.extent.size.height - bottomLeft.y + 30)
        perspectiveTransformFilter.bottomRight = CGPoint(x: bottomRight.x - 35, y: image.extent.size.height - bottomRight.y + 30)
    
        return perspectiveTransformFilter.outputImage!
    }
  1. 네트워크 통신 클린 아키텍처와 Combine을 결합하여 통신을 구현했습니다. Data Layer내부 파일들을 확인 바랍니다.

  2. 유사도 측정 ImageSimilarityAnalyzer에서 애플 Vision 프레임워크를 활용해서 이미지 간의 유사도 거리를 측정합니다.

✦ 확인방법

  1. 동봉된 Marker를 Asset ARResource에 등록하여 활용 (기본 printed 이미지 마커 등록되어 있음)

✦ 구동화면

IMB_NC3mTu

authlabs's People

Contributors

hemil0102 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.