ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

How to get started with Python and OpenCV?

<< < (2/2)

Nod5:
I dabble a bit in OpenCV and Python and have had most help from these three resources

1. https://www.pyimagesearch.com/
A great tutorial and project site with detailed, stepwise explainers of the code. The site has in the last year or so turned more and more to advanced machine learning topics, but check older posts for more introductory examples and projects.

Adrian Rosebrock, the pyimagesearch guy, also has a companion book https://www.pyimagesearch.com/practical-python-opencv  that seem useful, though I haven't read it.

2. https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_tutorials.html
Explainers and examples for many basic OpenCV functions in Python.

3. and, of course, https://stackoverflow.com/questions/tagged/opencv+python

One thing to keep in mind: there are some differences between Python 2 and 3 when it comes to using and installing OpenCV. Last time I checked the most up to date release of OpenCV didn't play nice with with Python 3 in Windows 10.

But if you're on Python 3 you can quickly install a more basic version of OpenCV like so

--- ---python -m pip install numpy --upgrade
python -m pip install opencv-python --upgrade
I don't know exactly what that version is missing (the package page is here, https://pypi.org/project/opencv-python/ ) but it has worked well in all my use cases.

Deozaan:
This is one of those cases where I was asking for something specific (OpenCV+Python) when I really should have asked about OCR in general and seen what knowledge people had on the subject.

As mentioned in the OP, I wanted something that would allow me to analyze a screenshot for certain words and values and then make decisions based on that. It didn't necessarily have to be with OpenCV or Python. That was just the only way I knew of that made such an idea possible.

I'm much more familiar with C# and .NET so I decided to look for some sort of OpenCV wrapper that would allow me to program in C#. I found some, but while researching the topic further, I discovered that Microsoft has a Computer Vision library built in to the UWP SDK. So I can just have a line near the top of my code saying:


--- Code: C# ---using Windows.Media.Ocr;
And voila! I've got OCR in my C# code.

Of course, this also means that I need to build/deploy a UWP app, which I'm also not very familiar with, but at least it's using a language and environment I'm familiar with.


All that said, while experimenting with the Windows OCR, my immediate need for this whole project was accidentally fulfilled so I haven't been pursuing it at the moment. But if/when I pick it up again I'll probably start with UWP and if that doesn't work then I may look more into OpenCV again.

Thanks!

hamradio:
This is one of those cases where I was asking for something specific (OpenCV+Python) when I really should have asked about OCR in general and seen what knowledge people had on the subject.

As mentioned in the OP, I wanted something that would allow me to analyze a screenshot for certain words and values and then make decisions based on that. It didn't necessarily have to be with OpenCV or Python. That was just the only way I knew of that made such an idea possible.

I'm much more familiar with C# and .NET so I decided to look for some sort of OpenCV wrapper that would allow me to program in C#. I found some, but while researching the topic further, I discovered that Microsoft has a Computer Vision library built in to the UWP SDK. So I can just have a line near the top of my code saying:


--- Code: C# ---using Windows.Media.Ocr;
And voila! I've got OCR in my C# code.

Of course, this also means that I need to build/deploy a UWP app, which I'm also not very familiar with, but at least it's using a language and environment I'm familiar with.


All that said, while experimenting with the Windows OCR, my immediate need for this whole project was accidentally fulfilled so I haven't been pursuing it at the moment. But if/when I pick it up again I'll probably start with UWP and if that doesn't work then I may look more into OpenCV again.

Thanks!
-Deozaan (May 08, 2018, 04:02 PM)
--- End quote ---

Just saw this topic but...

This OpenCV wrapper I found looks pretty good to me and I might have to make note to use it at some point down the road too: http://www.emgu.com/wiki/index.php/Main_Page

Nod5:
I found some, but while researching the topic further, I discovered that Microsoft has a Computer Vision library built in to the UWP SDK.
-Deozaan (May 08, 2018, 04:02 PM)
--- End quote ---

Whatever works! :Thmbsup:

Navigation

[0] Message Index

[*] Previous page

Go to full version