Can I do this in opencv for label inspection? - opencv

I'm currently having a project for label inspection. I'm studying the template matching of opencv if I can use it for my project. Do you have any suggestion that I can apply on my project? or other option aside from opencv.
I expect to output this.
enter image description here

Related

Training Tesseract ocr using jTessBoxEdit

Hi i want to generate tesseract OCR training data file(tessdata). I'm using jTessBoxEditor tool(On Mac Os) for achieving this, but i have no idea how can i use this tool.And further i use the tessdata file in my ios application.
I'm also searching for this i share the links with you
http://vietocr.sourceforge.net/training.html
http://code.google.com/p/tesseract-ocr/wiki/TrainingTesseract3
but i have no luck :( . So please share the links which provide detail/steep by by steep implementation of training file(teasdata file).
Here is the download for the tess files
http://code.google.com/p/tesseract-ocr/downloads/detail?name=tesseract-ocr-setup-3.02.02.exe&can=2&q=
I'm on the same page as you with getting this to work. Here is the tut im using.
http://www.resolveradiologic.com/blog/2013/01/15/training-tesseract/
I have learned that you need a .tif file with a .box file in the same folder to load the boxes.
For Example
testdata.tif
testdata.box
anotherExample.eng.tif
anotherExmaple.eng.box
To create box files easily if you don't know how do this after you download and install the tesseract files.
->Open command prompt and CD to your tesseract file, which is usually in your programfiles/Tesseract-ocr folder
-> Run Box creator tesseract C:\location of the tif file\thetiffile.tif C:\location of the tif file\thetiffile.tif
batch.nochop makebox
and that should spit out the box file you need.
I'm in the process of going through and discovering. I will keep you updated. If you have any other issues let me know and maybe I can help.
You'll have to build or install all the Tesseract training executables first. Then inside jTessBoxEditor, set the appropriate Tesseract Executable location.

Trying to adapt mergevec to work with the new OpenCV (2.4.5)

So like the title says I've been following this tutorial which seems to be the go to tutorial for how to handle haar feature training using the OpenCV.
Mergevec is a utility that merged together vec files so that you could generate a large number of samples from relatively few images. Anyway, he has an exe but it appears to be for 32-bit OpenCV 2.4.3 while I have 64-bit version 2.4.5. Any help would be appreciated!
My version is built using cmake and Visual Studio 10 as the compiler
Figured it out! Hopefully others can make use of this too!
Basically you want to:
First add mergevec.cpp to the folder \opencv\apps\haartraining then add the following to CMakeLists.txt
# -----------------------------------------------------------
# mergevec
# -----------------------------------------------------------
add_executable(opencv_mergevec mergevec.cpp)
set_target_properties(opencv_performance PROPERTIES
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
OUTPUT_NAME "opencv_mergevec")

How can I find opencv functions source code?

I am new to opencv and I am using opencv for windows. How can I see the source code for a specific function of an opencv library ? I just one want to get an idea of how that specific machine vision algorithm is implemented.
You can get the OpenCV source code from https://github.com/opencv. An easy way to find the header for a function is to open an explorer window in OPENCV_HOME\build\include (where is the location where you chose to install OpenCV) and use the search box to find the header file that contains your function - this will help you know what module it is in. Then you can search in OPENCV_HOME\modules\MODULE_NAME\src to find the source of the the function. This is even easier if you install a search tool like grepWin.
Looking at the source is almost essential for finding out why those pesky OpenCV exceptions are thrown. It also means that you can answer most things about OpenCV yourself without having to ask here.
Here is a direct link to an excellent source code search, courtesy of Github. This is a very straightforward way to find the implementation and internal usages of a function or type.
All the source is now on github:
https://github.com/opencv/opencv and you can use it's search functionalities as well.
I found the answer by Drew Noakes to be the most helpful, especially given the fact that repository structures keep changing over time.
To search in the code or in other places inside a repository using a keyword, the instructions here can be followed.
What would be even easier for first-timers however, would be to simply search for a key word in the github search bar. Then the appropriate advanced search option would generate the tags described in the the earlier linked tutorial.

Where is the source code of 'cvextern.dll' of Emgu OpenCV?

Where can I find the source code for 'cvextern.dll' of Emgu OpenCV?
Thank you.
If you get the full source, it's there.
Follow the instructions here : http://www.emgu.com/wiki/index.php/GIT
Afterwards, the cvtextern source should be in the root folder named Emgu.CV.Extern
I ran Dependency Walker on the file cvextern.dll in my EmguCV installation (for me it was in the directory C:\Emgu\emgucv-windows-universal-cuda 2.9.0.1922\bin\x64) and cvextern.dll appears to be a packaging of all the OpenCV DLLs and a few other ones:
The source code for OpenCV is available here: https://github.com/Itseez/opencv

Is there a way to teach tesseract for iOS a new font?

Im currently using tesseract for iOS using Nolan Brown's example. It works ok, but I need it to start picking up a new font (which I have in .tff format) which will always be numbers.
I have found questions on StackOverflow about tesseract learning fonts which all point to the google guides on how to teach Tesseract a new font using command line. But I'm already using a compiled copy of the lib from Nolan's example.
How can I teach tesseract a new font? Will I need to recompile the lib for iOS? How do I do this?
You might try training a new "traineddata" file using these instructions.

Resources