Face Detection - where to start

Yes, you must first have OpenCV 3.0 installed (see the website for installation instructions for your machine). Alternatively, and especially since Python is faster than Xojo, you could create Python scripts to do everything and connect to them using Asynchronous Shell (see Shell in the docs) to pull the data into Xojo and work from there. That is the method I use with Raspberry Pi for robotics and facial/object recognition. There are a number of options available. But the library from GitHub is pretty efficient, and the speed difference is negligible unless you’re comparing thousands of faces, otherwise I’d recommend the latter option using Python. I have a class from about 2 years ago, that can ID objects by using Googles vast neural network…I will see if I can find it and send it your way…It requires no API keys and you pass it a Picture object, and it will identify objects in the image. :slight_smile:

The class from about 2 years ago, that can ID objects by using Googles vast neural network would be great, Thanks.

OK, I have seen how to “macOS: Install OpenCV 3 and Python 3.5” here https://www.pyimagesearch.com/2016/12/05/macos-install-opencv-3-and-python-3-5/

Should I use that?

Thanks.

Lennox

[quote=353643:@Lennox Jacob]The class from about 2 years ago, that can ID objects by using Googles vast neural network would be great, Thanks.

OK, I have seen how to “macOS: Install OpenCV 3 and Python 3.5” here macOS: Install OpenCV 3 and Python 3.5 - PyImageSearch

Should I use that?

Thanks.

Lennox[/quote]
I haven’t stumbled across the source code yet, but will continue looking tomorrow. In the meantime, I setup an intermediary script between my web app used for robotics, so you can give it a test. Obviously you can identify images by Picture Objects from the Xojo-side, but in the web, I have the script setup to download the image specified by URL, then load it into the web app…process and spit back the data. The full return is in JSON and identifies many aspects of an image. The script is setup to show the first “most defining quality.” To supply your own test images, just replace everything after the “url=”. I will leave this script in place long enough to find the source for you to look over.

Locate and Identify a Place:

Identify a Country by Place:

Identify a landmark and disclose its location:

Identify a structure:

Identify a place in the world by image:

Analyze a license plate and determine it’s origin:

Recognize basic egyptian hieroglyphs and translate them (see my previous works on egyptian heiroglyphs):

Identify an object and give its classification:

Sometimes though…it can misinterpret blurry images to think they represent things that they actually don’t… the next one thinks the freeway and construction site are areas of “flood”

Hi Matthew,

Im using macOS Sierra 10.12.6

I am not able to install OpenCV with Python on my machine, I’ve tried several links from the Internet, e.g. https://www.pyimagesearch.com/2016/12/05/macos-install-opencv-3-and-python-3-5/
It installs but when I start terminal it gets error /usr/bin/python instead of /usr/local/bin/python
after several tries I now give up on that.

I’ve been trying the examples in the"samples" folder from
https://github.com/ldci/OpenCV-Xojo

I am using Architecture x86 64 bit, x86 32 bit apparently will not work on my machine.

In the colorspace example after selecting the picture folderitem. I get this from the stack…

RuntimeRaiseFunctionNotFoundException
Window1.Window1.btnLoad_Action%%o<Window1.Window1>o
Delegate.IM_Invoke%%o
AddHandler.Stub.15%%
_os_activity_initiate_impl
-[NSApplication(NSResponder) sendAction:to:from:]
-[NSControl sendAction:to:]
__26-[NSCell _sendActionFrom:]_block_invoke
_os_activity_initiate_impl
-[NSCell _sendActionFrom:]
-[NSButtonCell _sendActionFrom:]
_os_activity_initiate_impl
-[NSCell trackMouse:inRect:ofView:untilMouseUp:]
-[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:]
-[NSControl mouseDown:]
XojoFramework$1353
-[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:]
-[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:]
-[NSWindow(NSEventRouting) sendEvent:]
XojoFramework$1704
-[NSApplication(NSEvent) sendEvent:]
XojoFramework$1253
Delegate.Invoke%%
Application._CallFunctionWithExceptionHandling%%op
XojoFramework$9625
XojoFramework$1253
-[NSApplication run]
RuntimeRun
REALbasic._RuntimeRun
_Main
main
start

How can I fix that?

Thanks.

Lennox

Hi Matthew,

I’ve been trying but I don’t quite understand "To supply your own test images, just replace everything after the “url=”

I deleted everything after the “url=”" and dropped a picture there but all see is the image that I just dropped being displayed and the location of it on my hard drive in the url box.

Am I doing it correctly?

lennox

Hi Lennox!

Since your last post, I have started converting The OpenCV functions from C++ into Xojo Code where performance will not be an issue, and have had some pretty good results. No OpenCV, No External Dependencies, Just Pure Code! I have uploaded a demo of basic photo recognition at the website for testing, and am still revising the face recognition methods. While there will be a number of overloaded functions to handle a variety of comparissons, identifications, learning, and tasks… I have reduced the complexities of OpenCV as seen on the developer’s side. I do not intend to directly convert every OpenCV function, rather provide reusable methods to recognize, identify, and classify images and objects within them without the developer needing to know the hows and why it all works. :slight_smile: If there’s particular features you’d like to see, just suggest them and I’ll see what we can do! OpenCV takes 0.19 MS to perform the same demo included. Xojo takes 0.22 MS…really not that noticeable of a difference.

The “Pre”-Demo release can be obtained from: https://www./download/xdscomputervision-class/

Thanks for let the community see and test your work. VERY NICE JOB !!!
If you have any news that you want to share we will all appreciate.
Thanks again

Over the past week, we’ve had a family emergency (everything is going to be alright), so, unfortunately, I have been away from the community, coding, and XDS (Xojo Developer’s Spot xojodevspot.com). This week is “catch-up” time! :slight_smile: I have a few clients, and customers to catch up with and implement some code and demos for over the next 2 days, but then I should have a neat demo available showing how to find similar images across your entire computer, tag people & places in images (wouldn’t it be great to search a huge library for all pictures that contain one specific person, place, or thing?) Have an image of a loved one that has passed away, and the image is somewhere on your computer but you don’t know where it is or what format it is, or what the filename is? Sure you could do a search for .png;.gif;*.jpg;etc…but then you manually have to sift through every image. :slight_smile: Eventually, I’ll show how to add filters like “find all people” with conditions like “wearing glasses”, “brown hair” etc, which would return every photo in the selected path that has people wearing glasses that have brown hair(sometimes black…lighting is tricky with CV sometimes). :slight_smile: Lots to do, never enough hours in the day…thank the heavens Xojo saves countless hours of programming :slight_smile: Will keep you posted.

Thanks @Mariano Poli !

Matthew… Family must be always first.
Thanks for everything you had done for the community.