AI with OpenCV

asked 2017-12-08 10:08:34 -0600

cjacquel gravatar image

Hello, I am new in AI. Is is possible to make AI ( Artificial intelligence ) applications with Opencv Thx cjacquel

edit retag flag offensive close merge delete

Comments

Here is an example of a feed-forward back-propagation artificial neural network using OpenCV:

https://github.com/sjhalayka/opencv_xor

I found this code at:

https://stackoverflow.com/questions/3...

The network is trained to perform the XOR operation.

sjhalayka gravatar imagesjhalayka ( 2017-12-08 10:17:56 -0600 )edit

what do you mean, like a chess engine ? please be more specific.

berak gravatar imageberak ( 2017-12-08 10:21:01 -0600 )edit

I forgot to mention that the OpenCV artificial neural network, when using the SIGMOID_SYM activation function, has output in [-1.7159, 1.7159]. In case you're wondering, this means that the XOR operation network can be trained to output either 0 or 1, unlike my own network/activation function code, which has output like 0.1 or 0.9. Pretty cool eh?

The XOR operation is the AI equivalent of Hello World. If you're having doubts about how to use OpenCV's neural networks, try my own network code in C++ as a reference: https://github.com/sjhalayka/ann_xor

Another common operation is image classification. You show noisy versions of the input images to the neural network. If there’s n different images, you need ln(n)/ln(2) output neurons. I have my own code for this too, if you'd like.

sjhalayka gravatar imagesjhalayka ( 2017-12-08 11:03:30 -0600 )edit

My own image classification network code in C++ is at: https://github.com/sjhalayka/ann_imag...

And don't forget to check out the book Learning OpenCV 3 -- Computer vision in C++ with the OpenCV library. It gives you some ideas on how to train AIs (or use pre-trained AIs) to perform classification. Also check out the OpenCV tutorials on: https://www.learnopencv.com

sjhalayka gravatar imagesjhalayka ( 2017-12-08 18:49:53 -0600 )edit