That was also my thought. I have used OpenCV 10 years ago for some small things, but today I would simply look for any existing neural network on HuggingFace and maybe train some custom classifier on top if I need sth custom. I cannot really think of any possible case where this would not work better than what you have in OpenCV. And if speed is a concern, there are also many small models, or otherwise you can quantize them yourself, or maybe train yourself a small model with knowledge distillation. You can get this as fast and as small as you want, while still probably outperforming everything that OpenCV can offer.
I use OpenCV for blur detection and camera shake detection on mobile devices, to qualify the image before handing it along to an AI model to extract data. I can't think that 2 extra neural networks would be faster at this task than OpenCV is, even if they might be better given how subjective blur is.
ACAP version 4 example applications that provide developers with the tools and knowledge to build their own solutions based on the ACAP Computer Vision SDK.
The open source examples are focused on video analytics applications. Giving AI/ML developers the chance to experience the smooth and smart develop environment that ACAP provide, showing how the powerful capacity of Axis devices provides unlimited possibilities for developers to build new AI/ML applications.
Being one of the most active repositories we have, you can find examples written in C++ and Python performing interesting features that varies from object detection, QR decoder, and image capture, using popular open source ML libraries such as OpenCV.
How does it do the blur detection? I assume it's also just a convolutional kernel applied on the image in some way. So it would do just exactly the same as a tiny neural network with one convolutional layer. Thus, they would be exactly the same speed, if they would use the same underlying native kernels. However, the native kernels in TF/PyTorch/etc are more heavily optimized than OpenCV, thus I assume that OpenCV would actually be slower here. And also more complicated, as you need to mix two big frameworks.
Realistically I think you'll often want both depending on what you're doing. Especially for things like blur detection, what's your acceptable specificity, acceptable/scale of performance, where you're running the algorithm (on device vs cloud).
I'm not an expert at all but most image processing network I've seen generally involve at least a few plus a few other layers. I don't think you can get away with a single convolution, at least not that well.
OpenCV you could use Laplacian variance which looks like it's just a single line of code.
> cv2.Laplacian(image, cv2.CV_64F).var()
Many of the NN implementations look like their finetuned off google's ViT checkpoints. I really can't imagine these are faster (at least not without spending extra on GPU/TPU's) than Laplacian variance but I could be wrong.
And I assume you might be able to get better evaluation performance from a finetuned NN but depending on what you're doing, that's a ton of work compared to opencv.
Yes - not sure how this has been overlooked. For Python/torch I tend to use cv2 with an albumentations augmentation pipeline, which is much faster than PIL/torch transforms.
I’ve worked on plenty of problems where all you need is to find what pixels are a specific color. While I’m sure a NN could be setup for that, why make things harder than they have to be?
Why harder? My point is, by using some DL framework, you would make this simpler. You don't need to have a big NN for that, or even any NN at all, and could still use some DL framework, and I would assume this is still easier and probably faster. E.g. finding what pixels are a specific color, this would be sth like: