3
$\begingroup$

I have practiced building cnn for image classification with tensorflow, luckily to me they have very good library documentation and tutorials. But i found that tensorflow is too complicated, building graphs for every equation and much more ..

Can i build well formed CNN for image classification task with just OpenCV?

$\endgroup$
  • $\begingroup$ I would request you to try out opencv $\endgroup$ – quintumnia Jul 4 '18 at 17:53
  • $\begingroup$ thats the question $\endgroup$ – guesswho Jul 5 '18 at 12:45
4
$\begingroup$

OpenCV does include 2D filter convolution functions for custom separable and non-separable filters. The latter uses DFT for large filters, which may or may not be faster than the conventional method. It also includes (partial?) support for deep nets with various types of layers. Theoretically, you should be able to stitch everything together into a complete CNN. However, I have not used any of those, and I have no idea about the level of maturity of the implementation.

That said, if you are willing to implement a custom CNN from scratch, you will probably get more control over the implementation using a generic (BLAS / OpenCL / CUDA) matrix library.

$\endgroup$
  • $\begingroup$ yes opencv does have dnn module, but with so poor documentation $\endgroup$ – guesswho Jul 11 '18 at 4:35
  • $\begingroup$ i found that opencv dnn module can only do forward pass(propagation) $\endgroup$ – guesswho Jul 12 '18 at 6:29
2
$\begingroup$

Here is a glimpse for you.

We can't compare or contrast which module is good /complex nor difficult to do image classification,because each of them is being made to suit the developers needs.

Therefore,opencv module contains classical machine learning algorithms for image Classification,it doesn't require huge amounts of training data set(image/video data) unlike the tensorflow.

I would encourage you to have both,whereby you should configure and use python interface and you will have lots of up-to date image recognition algorithms inline with scikit,and you will also be able to use OpenCV and tensorflow in the same time. This will also give you the power to do image processing nor classification effectively.

Lastly, I would also encourage to join up open developer communities,specifically;github and slack both provide communities for computer vision engineers.

Hope this helps.

$\endgroup$
1
$\begingroup$

No , opencv is mostly used for image processing tasks , if you find tensorflow too difficult , there are many other frameworks much simpler to pickup , i suggest keras.

$\endgroup$
  • $\begingroup$ You mean opencv can't do image classification effectively! $\endgroup$ – quintumnia Jul 4 '18 at 18:37
  • $\begingroup$ @quintumnia : that depends on what classifier you build with opencv , on which dataset , even then it is quite tough to compete with a convnet. $\endgroup$ – riemann77 Jul 4 '18 at 18:40
  • $\begingroup$ The op should proceed with open source computer vision. $\endgroup$ – quintumnia Jul 4 '18 at 18:49
1
$\begingroup$

No. I suggest you to use Pytorch. It is much easier to code in it than using only OpenCV or Tensorflow IMHO. You can find the tutorials here. There is also a robust, quick and efficient community support for your problems in using Pytorch.

Also pytorch can calculate gradients automatically for backprop by creating a dynamic graph called 'autograd' which I have not found in other deep learning packages. This makes backprop in complicated LSTM and RNN networks easier.

$\endgroup$
0
$\begingroup$

I found a github with a simple Image Classifier with Tensorflow. If you want learn each detail of "how build a CNN image classifier", maybe this don't help you. But if you wanna a basic image classifier to implement or create other things, yes this works well.

Source: https://github.com/burliEnterprises/tensorflow-image-classifier

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.