แสดงบทความที่มีป้ายกำกับ Augmented Reality แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ Augmented Reality แสดงบทความทั้งหมด

วันเสาร์ที่ 27 ธันวาคม พ.ศ. 2557

สอนสร้าง Augmented Reality ด้วย Vuforia Unity



      วิดีโอสอนสร้าง Augmented Reality ด้วย Vuforia Unity 
                                       

อันนี้คือ Link ดูวิธีการสร้าง มีทั้งหมด 4 ตอน
1.Unity + Vuforia 1 :ทำ AR app ขั้นพื้นฐาน [ Android , ios ]
2.Unity + Vuforia 2 :ทำให้ส่องพร้อมกันหลาย marker ได้ [Android , ios ]
3.Unity + Vuforia 3 : ทำ 3d ให้เคลื่อนที่ได้ [ Android , ios ]
4.Unity + Vuforia 4:ทำ virtual button สร้างปุ่มในโลกจริง

เครดิต : Patcharapon Jantana

คู่มือสร้าง Augmented Reality

       
       Augmented Reality หรือ AR เป็นเทคโนโลยีที่ผสมโลกของความจริง (real world) เข้ากับโลกเสมือน (virtual world) โดยใช้วิธีซ้อนภาพสามมิติที่อยู่ในโลกเสมือน ไปอยู่บนภาพที่เห็นจริงๆ ในโลกของความเป็นจริง ผ่านกล้องดิจิตอลของแท็บเล็ต สมาร์ทโฟน หรืออุปกรณ์อื่นๆ และให้ผลการแสดงภาพ ณ เวลาจริง (real time) ซึ่งในอนาคตอันใกล้  AR กำลังจะเข้ามามีบทบาทมากขึ้นในชีวิตประจำวันของสังคมที่จะเต็มไปด้วย สมาร์ทโฟน แท็บเล็ต และ นวัตกรรมทางเทคโนโลยีสารสนเทศเช่น Google Glass เป็นต้น
     เอกสารสอนการสร้าง AR (Augmented Reality) มีดังนี้
1.สื่อเสริมการเรียนรู้ โลกเสมือนผสมโลกจริง (Augmented Reality)
2.การผลิตสื่อการเรียนการสอนยุคใหม่สไตล์ Aurasma
3.เมื่อโลกความจริงผนวกเข้ากับโลกเสมือน" (Augmented Reality)
4.การสร้าง AR โดยแอพลิเคชั่น Aurasma
5.การพัฒนาสื่อการเรียนการสอนบน Tablet ด้วยโปรแกรม Aurasma
6.อาณาจักรสัตว์เสมือนจริง ด้วยเทคโนโลยีAR

วันพฤหัสบดีที่ 25 ธันวาคม พ.ศ. 2557

สอนการสร้าง AR ด้วย Vuforia Unity

    
   Something totally different here today. To help my girlfriend with her study, I needed to create an app that displays an augmented reality world. Although I love working with HTML and technologies around it, something like AR with it is possible, but doesn't reach the level of a native app. During my day job, I'm working with (mobile) C# technologies like Xamarin. I was looking for something that's easy for me to learn and use, in order to create an awesome AR application.
Vuforia
     In this tutorial, I'll be showing you how to create a simple augmented reality world using Vuforia. The reason I choose the framework, was because it looked easy, is free and - most importantly - relies on the same technology Xamarin uses. Let's get started!
Endresult

Prerequisites
    To get this awesome app up and running, you'll need to have the following:
     As you can see, this app is created for iOS (that's why you'll need an Apple Dev account and a device itself as well). Vuforia / Unity is cross-platform, so this should work for Android as well. I haven't tried it yet.

Target manager
    After everything is installed and set up, you'll need to go to the Target Manager from Vuforia. We'll be uploading the target image here. Make sure you'll select an image that has a high feature amount of features. The target manager will help you though.
Create a database, give it a name and add a target. I used the following settings:
Target Manager      After the upload is complete, Vuforia will check how augmentable the image is by giving it a star rating. Your goal will be to use images that have a high star rating, and some image enhancement tricks might help. Select the target in Vuforia and click the "Download Selected Targets"-button.
Package Select Unity Editor in the pop-up that follows, which will allow you to download a .unitypackage file with your target. Save this file on your disk.

Unity: Project start
    The next step is to start up Unity. Create a new (empty) project on a selected location. When the project is loaded, delete the Main Camera in your Hierarchy to start with a clean plate. We now need to import the Vuforia .unitypackage files (both the SDK and the image target).
Import After your import is done, your Project should look like this.
Import done      To complete this step, it's useful to directly load the model that we want to show in our augmented reality world. In my opinion, this is the easiest way:
  • Right-click the Assets-folder in the Project
  • Select "Reveal in Finder" (Probably "Reveal in Explorer" on a Windows machine)
  • Open the Assets-folder
  • Create a new folder named Models (or any other, logical name)
  • Place the model (incl. all the textures etc.) inside thie folder
  • Go back to Unity
     Unity will detect the changes you've made to the Assets-folder, and will update itself with the latest information.
Import model       Now that we have everything complete in Unity, we can start building our world!
Unity: Build the augmented reality world
      On to the most fun part of this tutorial - actually creating your AR world! First, we'll need to do the following: In your Project windows, open the Assets/Qualcomm Augmented Reality/Prefabs-folder. In here, you'll find the ARCamera. Drag it into your Scene. With the ARCamera still selected, scroll down in the Inspector and make sure you Load the Data Set with your Database (the Image Target), and set it to Active as well.
AR Camera       From that same Prefabs-folder, drag an Image Target to the scene. With the Image Target still selected, scroll down in the Inspector and set your Data Set (Database name) as well as your Image Target. Your Image Target should now be visible (you might need to scroll in order to zoom in/out).
Image target      Now, we'll need to add the model to the Image Target. Simply drag the model that you added in your Assets-folder to the scene. In your Hierarchy, make sure the model is under the Image Target. You might want to change the position of the model, change the values of the Scale / Rotation (inside the inspector) to get it into the right place. This might need some experience with the program, but once you got the hang of it, it's pretty simple.
Model      From here on, it actually is your own creativity that can do all the work! Add more models to the scene (trees for example) to get an even cooler world. Just some tips:
  • Add some light to your models by going to GameObject > Create Other > Directional Light. This way, you can create a light source to light up your model.
  • Make sure the models are placed under the Target Image in the Hierarchy.
  • When using multiple image targets, make sure you set the correct amount of image targets inside the ARCamera (Inspector > Max Simultaneous Image Targets).
Don't forget to Save your Scene before Deployment.

Deployment
      Now to get this thing into your iPad. I assume that you already have some knowledge about iOS development (since you already got your license), you'll need to know your App Identifier (since that will be used as your Bundle ID). Inside Unity, go to File > Build Settings. If your scene isn't in the current build, press the "Add Current"-button. Now select iOS as Platform, and go to Player Settings...
     The inspector will show up, and you can leave most of the settings to it's default value (for now). The only thing you'll need to change is the Bundle Identifier (found under Other Settings). Set this to the one you've created in the Apple Developer Center, and you're done!
     Connect your iOS device and press Build and Run. Wait a while; Unity will now kick up XCode and deploy the application to your device. When it's loaded, it should start automatically and you're ready to scan your printed image target. Have fun!

Conclusion
     When I first tried Vuforia, I went ahead and started using the native iOS SDK. The learning curve was way to steep for me, since I'm not an Objective-C programmer, but especially have since I have no knowledge about OpenGL ES (that allows the 3d rendering). With the help of their awesome Unity plugin, it allows a low entry level into the world of Augmented Reality.
This tutorial was a pretty basic tutorial, just to get you up and running. If you want, you can also get more details in the official Getting Started guide. Using Unity, we can also script some awesome things inside the game, which I might be able to show you next time. So, what about you? Are you going to try this sometime? Or do you have any other insights? Let me know.

Augmented Reality (AR)

 Augmented Reality (AR)
ถ้าแปลให้ตรงตัวแบบสไตล์ผู้เขียน ก็คือ “ความจริงส่วนขยาย” หมายถึงเทคโนโลยี ในการเพิ่มข้อมูลที่มีความหมายให้กับสิ่งของ หรือสถานที่จริงๆ โดยเริ่มด้วยการเปิดรับข้อมูลอ้างอิงทางด้านภาพ เสียง หรือการบอกตำแหน่งด้วยระบบ GPS และอื่นๆ จากที่นั้น แล้วระบบก็จะทำการสร้างข้อมูลเพิ่มเติมให้วัตถุจริงที่มีอยู่เดิม ทั้งในรูปแบบภาพ เสียง และข้อมูลอื่นๆ ที่ทำให้ผู้ใช้มีข้อมูลเชิงลึกเพิ่มขึ้น หรือสามารถตอบโต้ได้   ซึ่งทำให้ได้ประสบการณ์และมีการรับรู้เพิ่มเติมจากสิ่งของหรือสภาพแวดล้อม จริงๆ ที่อยู่ตรงหน้านั่นเอง
“โดยสรุปง่ายๆ ก็คือว่า VR ทำโลกตรงหน้า จากไม่มีอะไร ให้เหมือนมีจริงขึ้นมา แต่ว่า  AR จะทำของจริงตรงหน้าให้มีข้อมูลเพิ่มเติมขึ้นมานั่นเอง”

ความเป็นมาของ  AR
เทคโนโลยีนี้ได้ถูกพัฒนามาตั้งแต่ปี ค.ศ. 2004 จัดเป็น แขนงหนึ่งของงานวิจัยด้านวิทยาการคอมพิวเตอร์ ว่าด้วยการเพิ่มภาพเสมือนของโมเดลสามมิติที่สร้างจากคอมพิวเตอร์ลงไปในภาพ ที่ ถ่ายมาจากกล้องวิดีโอ เว็บแคม หรือกล้องในโทรศัพท์มือถือ แบบเฟรมต่อเฟรม ด้วยเทคนิคทางด้านคอมพิวเตอร์กราฟิก แต่ด้วยข้อจำกัดทางเทคโนโลยีจึงมีการใช้ไม่แพร่หลายเท่าไหร่  แต่ปัจจุบันเทคโนโลยีมือถือ และการสื่อสารข้อมูลไร้สาย รวมทั้งการประมวลต่างๆ มีความรวดเร็วขึ้นและมีราคาถูก จึงทำให้อุปกรณ์สมาร์ทโฟน และแทบเล็ต ทำให้เทคโนโลยีที่อยู่แต่ในห้องทดลอง กลับกลายมาเป็นแอพที่สามารถดาวน์โหลดมาใช้งานกันง่ายๆ ไปแล้ว  โดยในช่วง 2-3 ปีมานี้ AR เป็นเรื่องที่ถูกกล่าวถึงอยู่เป็นระยะ แม้จะไม่ฮอตฮิตเหมือนแอพตัวอื่นๆ ก็ตาม  แต่อนาคตยังไปได้อีกไกล  ทั้ง VR และ AR สามารถนำมาประยุกต์ใช้งานได้กว้างขวางหลากหลาย ทั้งด้าน อุตสาหกรรม การทหาร การแพทย์ การตลาด การบันเทิง การสื่อสาร และ การศึกษา

หลักการทำงานของระบบ  AR
เป็นการนำเทคโนโลยีมาผสานระหว่างโลกแห่งความเป็นจริงและความเสมือนจริง เข้าด้วยกัน ด้วยการใช้ระบบซอฟต์แวร์และอุปกรณ์เชื่อมต่อต่างๆเช่นเว็บแคมคอมพิวเตอร์ หรืออุปกรณ์อื่นที่เกี่ยวข้องโดยองค์ประกอบของระบบ AR มีดังนี้
1. ตัว Marker (หรือMarkup) ซึ่งเป็นเครื่องหมายหรือสัญลักษณ์ หรือรูปภาพที่กำหนดไว้เป็นตัวเปรียบเทียบ กับสิ่งที่เก็บไว้ในฐานข้อมูล (Marker Database)
2. กล้องวิดีโอ กล้องเว็บแคม กล้องโทรศัพท์มือถือ หรือตัวจับ Sensor อื่นๆ เพื่อทำการการวิเคราะห์ภาพ
(Image Analysis) และวิเคราะห์จาก marker ประเภทอื่นๆ ที่กำหนดไว้  โดยระบบจะทำการคำนวณค่าตำแหน่งเชิง 3 มิติ (Pose Estimation) ของ Marker เทียบกับกล้อง
3. ส่วนแสดงผล อาจเป็นจอภาพคอมพิวเตอร์ หรือจอภาพโทรศัพท์มือถือ หรืออื่นๆ
4. ซอฟต์แวร์หรือส่วนประมวลผลเพื่อสร้างภาพหรือวัตถุแบบสามมิติ กระบวนการสร้างภาพสองมิติจากโมเดล 3 มิติ
(3D Rendering) เป็นการเพิ่มข้อมูลเข้าไปในภาพโดยใช้ค่าตำแหน่งเชิง 3 มิติที่คำนวณได้จนได้ภาพหรือข้อมูลซ้อนทับไปบนภาพจริง

ตัวอย่างแอพ  AR ในการใช้งานจริง
ผู้เชี่ยวชาญทันใจ
แอพชื่อว่า Aurasma  (http://www.aurasma.com/) พัฒนาโดยบริษัท  Autonomy  ผู้คิดค้นแพลตฟอร์ม AR ซึ่งเพิ่งถูกซื้อโดยบริษัท HP ด้วยมูลค่า 7 พันล้านเหรียญ  โดยแอพนี้ประยุกต์ใช้งานได้หลากหลาย ตัวอย่างเช่น การแสดงคำแนะนำการติดตั้ง TV แบบติดผนัง แบบเรียลไทม์สดๆ กันเลย


 อีกต้วอย่างของผู้เชี่ยวชาญทันใจก็คือ Metaio ซึ่งเป็นแอพ  AR อีกตัวที่ช่วยแนะนำการเปลี่ยนตลับหมึก โดยเพียงแค่เปิดกล้องส่องไปที่เครื่องพริ้นเตอร์เป้าหมายเท่านั้น