![]() This script will consist of passing info back and forth between managed C# and native C++ code.This article describes how to carry out development projects in OpenCV on Mac OS X, try the development tools Xcode (version 4.6.1) and Eclipse, OpenCV version is 2.4.6. Now we create new c# controller.cs script in Debug folder. (Assets → Scripts → Debug and Assets → Scripts → Native) Under this Scripts folder you can create Debug and Native folders respectively. ( or go to Xcode editor and right click OpenCVPlugin.bundle and select show in folder. You can simply drag and drop directly from Xcode's Products folder to Unity. Insert "UnityPlugin.bundle" that you had created in earlier steps into Osx folder. Go to your project window and create a "Plugins" folder under the Asset.Ĭreate Osx folder under assets → Plugins folder. you are now few minutes away from your final test. If you have reached this stage, Congratulations !!. Select "Product" → "Build" from the menu bar and build the project, UnityPlugin.bundle will be created in the Products folder. I can share more details on how to write these functions in my separate thread. Please feel free to add your opencv image operation features as per your need. Note - For simplicity I have just added TestFunction here to show how PlugIn functions. ![]() Validate this with following command on terminal window ![]() These are all the linked libraries of opencv. ![]() Go to "Build Settings" → "Other Linker Flags" field, enter “ -lopencv_dnn -lopencv_ml -lopencv_objdetect -lopencv_shape -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_video -lopencv_photo -lopencv_imgproc -lopencv_flann -lopencv_core”. Go to "Build Settings" → "Library Search Path" field (enter the details without collapsing the “Header Search Paths”) and enter " /usr/local/lib" (the opencv *opencv*.dyib files are stored here as part of build that we performed in earlier step) Go to "Build Settings" → "Header Search Path" field (enter the details without collapsing the “Header Search Paths”) and enter " /usr/local/include" (the opencv header files are stored here as part of build that we performed in earlier step) Select UnityPlugin in the navigation view "Product Name" is set to "UnityPlugin".Ĭhange bundle identifier to “” Now we will create a native Plugin for Mac to be used in Unity as Plugin.Ĭhoose MacOS> Framework & Library> Bundle. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |