Getting OpenCV framework installed correctly.

  1. ‹ Older
  2. 9 months ago

    Lennox J

    19 Oct 2017 Jamaica. West Indies
    Edited 9 months ago

    Hi Brian,

    " Library not loaded: @executable_path/../lib/OSX/libopencv_world.3.0.0.dylib"
    What that is saying is that for your program to work it needs libopencv_world.3.0.0.dylib in a location that it could be found.

    Take that and put in in a suitable location, for this discussion let's use Users folder

    So put libopencv_world.3.0.0.dylib in your Users folder

    Now, in your project, you will find in the xTools module, "Constants", add it there and compile your app and all should be well.
    /users/libopencv_world.3.0.0.dylib instead of @executable_path/../lib/OSX/libopencv_world.3.0.0.dylib

    Can anyone provide a project to identify the number of faces, people faces, in an image?

    Lennox

  3. Brian O

    19 Oct 2017 Pre-Release Testers Calgary, AB

    This is the procedure I used a long time ago and yesterday.
    A long time ago it worked today it doesn't.

    Mac: context click on OS X... Add to Build Settings -> Build Step -> Copy Files. This adds CopyFiles1 after Build.
    Then drag the OS X folder (in the Framework folder) into the CopyFiles1 drop area. In the property area change the Destination to Framework Folder. Should now be good to go.

    Somehow I think the answer lies here:

    Dyld Error Message:
      Library not loaded: @executable_path/../lib/OSX/libopencv_world.3.0.0.dylib
      Referenced from: /Users/USER/Desktop/*/HoughLine.app/Contents/MacOS/HoughLine
      Reason: image not found
  4. Lennox J

    19 Oct 2017 Jamaica. West Indies

    Hi Brian,

    I edited my reply and maybe you did not notice

    " Library not loaded: @executable_path/../lib/OSX/libopencv_world.3.0.0.dylib"
    What that is saying is that for your program to work it needs libopencv_world.3.0.0.dylib in a location that it could be found.

    Take that and put in in a suitable location and tell me where it is, for this discussion let's use Users folder

    So put libopencv_world.3.0.0.dylib in your Users folder

    Now, in your project, you will find in the xTools module, "Constants", add it there and compile your app and all should be well.
    Tell the complier to look here...
    /users/libopencv_world.3.0.0.dylib instead of @executable_path/../lib/OSX/libopencv_world.3.0.0.dylib

    Can anyone provide a project to identify the number of faces, people faces, in an image?

    Lennox

  5. 5 months ago

    Lennox J

    Feb 4 Jamaica. West Indies

    Hello,

    I have the "camera" project in the "samples" folder working on Mac but I would like to code a pushbutton to capture a still picture, frame, how can I do that?

    Also, I tried it on PC, it compiles and launches. I have attached a USB camera and would like to capture a snapshot there as well.

    I can select the built in camera but that gives a black output... no image.

    I can also select the USB digitizer that the USB is connected to, but when I click start camera I get a completely blue screen with this message "SYSTEM SERVICE EXCEPTION emBDA64.SYS" and the computer shuts down and restarts. I compiled it with x86 32 bit. The opencv_world300.dll is located here c:\opencv3\build\x86\vc12\bin\opencv_world300.dll
    How can I fix that?

    If I use MBS DirectShow plugin the same USB camera works well, no issues, the USB camera is recognised and the video is displayed correctly.
    I also want to use OpenCV because OpenCV offers some really nifty features.

    Any suggestions?

    Thanks.

    Lennox

  6. 4 months ago

    Brian O

    Mar 9 Pre-Release Testers Calgary, AB

    @François ;Jouen Hi everybody
    Very easy to use: first open OpenCVX with IDE and then just drag and drop to your code requiring opencv functions.

    Can you explain what you mean by, "open OpenCVX with IDE."

  7. Lennox J

    Mar 10 Jamaica. West Indies
    Edited 4 months ago

    Hi Brian,

    This should help...

    Very easy. Just unzip the downloaded file.
    You should get a folder named "OpenCV-Xojo-master".
    Then drag the "OpenCV-Xojo-master" to any project requiring OpenCV image processing.

    or more detailed...

    Very easy. Just unzip the downloaded file.
    You should get a folder named "OpenCV-Xojo-master".
    In that folder there is another folder named "samples".
    Open one of the samples, e.g. "flip"
    In that folder is a file named "flip.xojo_binary_project"
    Launch "flip.xojo_binary_project"
    There is a folder named "OpenCVX"
    Copy or drag the "OpenCVX" to any project requiring OpenCV image processing.

    Regards.

    Lennox

  8. Hello Lennox,

    I have the same problem(s) than Brian.
    There is a file OpenCVX not a folder, no?
    In the file "flip" there is a module "OpenCVX", isn't sufficient?
    For example when I execute that file "flip" a class named "Auto" is not recognized.

    Thank you for your help.

    BB

  9. Lennox J

    Mar 10 Answer Jamaica. West Indies
    Edited 4 months ago

    What Brian asked was "Can you explain what you mean by, "open OpenCVX with IDE."

    The answer to that is

    @Lennox J Very easy. Just unzip the downloaded file.
    You should get a folder named "OpenCV-Xojo-master".
    In that folder there is another folder named "samples".
    Open one of the samples, e.g. "flip"
    In that folder is a file named "flip.xojo_binary_project"
    Launch "flip.xojo_binary_project"
    There is a folder named "OpenCVX"
    Copy or drag the "OpenCVX" to any project requiring OpenCV image processing.

    Now there is another problem which you may have encountered and the answerr to that is ...

    OK

    @Lennox J Hi Brian,

    " Library not loaded: @executable_path/../lib/OSX/libopencv_world.3.0.0.dylib"
    What that is saying is that for your program to work it needs libopencv_world.3.0.0.dylib in a location that it could be found.

    Take that and put in in a suitable location, for this discussion let's use Users folder

    So put libopencv_world.3.0.0.dylib in your Users folder

    Now, in your project, you will find in the xTools module, "Constants", add it there and compile your app and all should be well.
    /users/libopencv_world.3.0.0.dylib instead of @executable_path/../lib/OSX/libopencv_world.3.0.0.dylib

    Can anyone provide a project to identify the number of faces, people faces, in an image?

    Lennox

    If you are still having any issues please let me know.

    Lennox

  10. Markus W

    Mar 10 Pre-Release Testers, Xojo Pro #JeSuisHuman Germany, Heidelb...
    Edited 4 months ago

    @BenoîtBouillon In the file "flip" there is a module "OpenCVX", isn't sufficient?
    For example when I execute that file "flip" a class named "Auto" is not recognized.

    When OpenCV for Xojo was written Auto was not a word used by Xojo itself, so the author was free to use it for a custom class.

    But in newer versions of Xojo Auto exists (it’s a replacement for Variant), so the custom class can no longer be called Auto.

    You will need to replace all occurrences of Auto with something else, like Automatic.

    The other possibility is that the code is newer than I thought and is using Auto in place of Variant, but you are using an old Xojo version that does not have Auto.

    At least that’s my guess.

  11. Brian O

    Mar 10 Pre-Release Testers Calgary, AB

    Finally.... Thank you.

    " Library not loaded: @executable_path/../lib/OSX/libopencv_world.3.0.0.dylib"
    What that is saying is that for your program to work it needs libopencv_world.3.0.0.dylib in a location that it could be found.

    Take that and put in in a suitable location, for this discussion let's use Users folder

    So put libopencv_world.3.0.0.dylib in your Users folder

    Now, in your project, you will find in the xTools module, "Constants", add it there and compile your app and all should be well.
    /users/libopencv_world.3.0.0.dylib instead of @executable_path/../lib/OSX/libopencv_world.3.0.0.dylib

  12. Brian O

    Mar 10 Pre-Release Testers Calgary, AB

    Wow that is fast!

  13. Antonio R

    Mar 11 Pre-Release Testers, Xojo Pro Europe (Italy)

    @Brian OBrien " Library not loaded: @executable_path/../lib/OSX/libopencv_world.3.0.0.dylib"

    You should add a Copy step to a Folder named lib dragging the OS X folder starting from app.

    Maybe better a copy step starting from Frameworks with only libopencv_world.3.0.0.dylib (taken from the OS X folder in lib)
    e use @executable_path/../Frameworks/libopencv_world.3.0.0.dylib

    In this way your app will be portable, otherwise using a reference to /users/libopencv_world.3.0.0.dylib means that you have to copy this dylib to the user "users" folder before

  14. Lennox J

    Mar 12 Jamaica. West Indies

    Hello.

    I have tried the examples and they work but I am not quite familiar with using this framework.

    I can load an image in loadImage3.xojo_binary_project, in the samples/loadImage folder.

    Can anyone provide a snippet of code that will identify the number people faces or some defined object in an image that was loaded?

    That would be a great starting point for me.

    Thanks.

    Lennox

  15. Brian O

    Mar 13 Pre-Release Testers Calgary, AB

    Try the hough transform of an image of a few straight lines.
    Excellent and fast.

  16. Lennox J

    Mar 13 Jamaica. West Indies

    Thanks Brian but that is not what I want.

    What I want is after a picture had been displayed if a button with the appropriate code is clicked a box is drawn enclosing each of the specified objects, e.g. faces of people that are in the picture.

    https://www.google.com/imgres?imgurl=http%3A%2F%2F3.bp.blogspot.com%2F-WG6EDeuKHM8%2FVRKMG98t0WI%2FAAAAAAAABjc%2Fe9h5MKC-xCk%2Fs1600%2Fresult.jpg&imgrefurl=http%3A%2F%2Frpihome.blogspot.com%2F2015%2F03%2Fface-detection-with-raspberry-pi.html&docid=XizHWl69WfGfOM&tbnid=52vTz_aIPhH9PM%3A&vet=10ahUKEwiTvIihgerZAhXGxFkKHd9VCEkQMwhpKCYwJg..i&w=640&h=482&client=safari&bih=973&biw=1895&q=opencv%20detect%20faces&ved=0ahUKEwiTvIihgerZAhXGxFkKHd9VCEkQMwhpKCYwJg&iact=mrc&uact=8

    Any other suggestions?

    Thanks.

    Lennox

  17. Brian O

    Mar 14 Pre-Release Testers Calgary, AB
    Edited 4 months ago

    Why don't we start here and port the example code to Xojo.
    OpenCV Face Detection

  18. Lennox J

    Mar 14 Jamaica. West Indies

    Hi Brian,

    A working knowledge off OpenCV is required, which I do not have, so that functions can be called. I am trying to rectify that.

    Lots of sample code can be found on the Internet but written in Python, so some knowledge in Python is required, not difficult to learn, I'll have to learn that too.

    Python scripts should be able to be called in Xojo.

    So for me, I'll need a "jump-start", then I'll be able to "fiddle around" that is how I have been able to learn Xojo, thanks to this forum, (all all the helpful people here), the "Listarchives", and the "NUG", I don't know if they are still available.

    Lennox

  19. Lennox J

    Mar 14 Jamaica. West Indies
    Edited 4 months ago

    OK, Let's get started...

    In the "samples" folder there is a folder called "loadImage" and in that folder is a project called "loadImage3.xojo_binary_project".

    We can start with that.

    Put "libopencv_world.3.0.0.dylib" in the "Users" folder
    Open loadImage3.xojo_binary_project and configure OS X to "/users/libopencv_world.3.0.0.dylib"

    Between the "Load and Convert Image" pushbutton and "Quit" pushbutton add a new Pushbutton and name it "Analyse Faces" or some other appropriate name to your liking.

    In that Pushbutton "Mouse Down" event add some code to

    1. count number of male faces
    2. count number of femalemale faces
    3. count number of unidentified faces.
    4. Display the information in a message box.

    After the project has been compiled, click the "Load and Convert Image" and navigate to a suitable image. e.g. http://libna.mntl.illinois.edu/images/group_photos_2014.png

    It can be downloaded beforehand.

    Click the "Analyse Faces" pushbutton and get the result in the message box.

    How about that, no conversion from one language to Xojo, just plain Xojo.

    Lennox

  20. Brian O

    Mar 14 Pre-Release Testers Calgary, AB

    I'm sorry I thought you wanted to learn OpenCV under Xojo, not how to run demo apps under Xojo.
    Best of luck,
    B.

  21. Hello and thank you all.
    In fact it was enough to read the instructions but they were at the limit a little too detailed and induced a little confusion in any case for me.
    For Windows users just indicate the path of the dll in the World constant located in the Tools module.
    I thought my installation was not correct but it's actually because my version of Realbasic is maybe too old.
    Some commands were not interpreted by my current version.
    To avoid cluttering this post I may ask these questions in a new post.
    Again thanks to you.

or Sign Up to reply!