Coder Social home page Coder Social logo

libmatcher's Introduction

libmatcher

library to match visual information, like areas and text, from images. Matching results include location data that can be used for example user-interaction testing.

Building from source and testing

Ubuntu 14.04:

sudo apt-get install build-essential cmake libopencv-dev libboost-dev libtesseract-dev tesseract-ocr-eng
cmake .
make
export LD_LIBRARY_PATH=$PWD/lib
cd test/cpp
cmake .
make
./example_*
cd ../python
python test_matcher.py

libmatcher requires OpenCV 2.4. For earlier Ubuntu versions please install OpenCV from source.

Basic usage

Given an image from an Android device homescreen

Basic text recognition:

from MatcherWrapper import Matcher

m = Matcher()
r = m.match('test/img/homescreen.png', "Tampere", threshold=100, method="OCR")

produces result image

Simple usage with fMBT and Android

import fmbtandroid
from MatcherWrapper import Matcher

# assuming device unlocked, homescreen with Camera-icon
d = fmbtandroid.Device()
s = d.refreshScreenshot()

m = Matcher()
# match camera icon with optical character recognition
r = m.match(s.filename(), "Camera", threshold=100, method="OCR")
assert r.result[0] == 100, "Camera-icon not in homescreen"
# match camera icon (in file "icon_camera.png") with feature-matching
r = m.match(s.filename(), "icon_camera.png", 100, method="FEATURE")
assert r.result[0] == 100, "Camera-icon not in homescreen"
d.tap((r.center[0].x, r.center[0].y))

See test/ for more examples

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.