All Projects → meiqua → Shape_based_matching

meiqua / Shape_based_matching

Licence: bsd-2-clause
try to implement halcon shape based matching, refer to machine vision algorithms and applications, page 317 3.11.5, written by halcon engineers

Projects that are alternatives of or similar to Shape based matching

SkeletonMatching
This repository implements skeleton matching algorithm.
Stars: ✭ 30 (-93.95%)
Mutual labels:  shape, matching
Idmatch
Match faces on id cards with OCR capabilities.
Stars: ✭ 52 (-89.52%)
Mutual labels:  opencv, matching
Deepbacksub
Virtual Video Device for Background Replacement with Deep Semantic Segmentation
Stars: ✭ 426 (-14.11%)
Mutual labels:  opencv
Head Pose Estimation
Real-time head pose estimation built with OpenCV and dlib
Stars: ✭ 467 (-5.85%)
Mutual labels:  opencv
Openpose
OpenPose: Real-time multi-person keypoint detection library for body, face, hands, and foot estimation
Stars: ✭ 22,892 (+4515.32%)
Mutual labels:  opencv
Simple vehicle counting
Vehicle Detection, Tracking and Counting
Stars: ✭ 439 (-11.49%)
Mutual labels:  opencv
Simple Ocr Opencv
A simple python OCR engine using opencv
Stars: ✭ 453 (-8.67%)
Mutual labels:  opencv
Tensorflow Cmake
TensorFlow examples in C, C++, Go and Python without bazel but with cmake and FindTensorFlow.cmake
Stars: ✭ 418 (-15.73%)
Mutual labels:  opencv
Tiler
Tiler is a tool to create an image using all kinds of other smaller images (tiles). It is different from other mosaic tools since it can adapt to tiles with multiple shapes and sizes (i.e. not limited to squares).
Stars: ✭ 4,681 (+843.75%)
Mutual labels:  opencv
Opencv4nodejs
Nodejs bindings to OpenCV 3 and OpenCV 4
Stars: ✭ 4,444 (+795.97%)
Mutual labels:  opencv
Awesome Local Global Descriptor
My personal note about local and global descriptor
Stars: ✭ 466 (-6.05%)
Mutual labels:  matching
Leaflet.freedraw
🌏 FreeDraw allows the free-hand drawing of shapes on your Leaflet.js map layer – providing an intuitive and familiar UX for creating geospatial boundaries similar to Zoopla and others. Included out-of-the-box is the concaving of polygons, polygon merging and simplifying, as well as the ability to add edges and modify existing shapes.
Stars: ✭ 446 (-10.08%)
Mutual labels:  shape
Emotion Detection
Real-time Facial Emotion Detection using deep learning
Stars: ✭ 438 (-11.69%)
Mutual labels:  opencv
Caer
High-performance Vision library in Python. Scale your research, not boilerplate.
Stars: ✭ 452 (-8.87%)
Mutual labels:  opencv
Csi Camera
Simple example of using a CSI-Camera (like the Raspberry Pi Version 2 camera) with the NVIDIA Jetson Nano Developer Kit
Stars: ✭ 433 (-12.7%)
Mutual labels:  opencv
Azure Design
Here you will find my complete Azure Visio Stencil and bonus SVG and PNG versions for all of the Azure Service and configuration items.
Stars: ✭ 470 (-5.24%)
Mutual labels:  shape
Pycair
Content aware image resizing
Stars: ✭ 425 (-14.31%)
Mutual labels:  opencv
Vehicle detection haarcascades
Vehicle Detection by Haar Cascades with OpenCV
Stars: ✭ 445 (-10.28%)
Mutual labels:  opencv
Multi Object Tracker
Multi-object trackers in Python
Stars: ✭ 451 (-9.07%)
Mutual labels:  opencv
Zxing Cpp
ZXing C++ Library
Stars: ✭ 483 (-2.62%)
Mutual labels:  opencv

shape_based_matching

update:
fusion implementation to run faster!
icp is also refined to be faster and easier to use

Transforms in shape-based matching
pose refine with icp branch, 0.1-0.5 degree accuracy
icp + subpixel branch, < 0.1 degree accuracy
icp + subpixel + sim3(previous is so3) branch, deal with scale error

try to implement halcon shape based matching, refer to machine vision algorithms and applications, page 317 3.11.5, written by halcon engineers
We find that shape based matching is the same as linemod. linemod pdf

halcon match solution guide for how to select matching methods(halcon documentation):
match

steps

  1. change test.cpp line 9 prefix to top level folder

  2. in cmakeList line 23, change /opt/ros/kinetic to somewhere opencv3 can be found(if opencv3 is installed in default env then don't need to)

  3. cmake make & run. To learn usage, see different tests in test.cpp. Particularly, scale_test are fully commented.

NOTE: On windows, it's confirmed that visual studio 17 works fine, but there are some problems with MIPP in vs13. You may want old codes without MIPP: old commit

thoughts about the method

The key of shape based matching, or linemod, is using gradient orientation only. Though both edge and orientation are resistant to disturbance, edge have only 1bit info(there is an edge or not), so it's hard to dig wanted shapes out if there are too many edges, but we have to have as many edges as possible if we want to find all the target shapes. It's quite a dilemma.

However, gradient orientation has much more info than edge, so we can easily match shape orientation in the overwhelming img orientation by template matching across the img.

Speed is also important. Thanks to the speeding up magic in linemod, we can handle 1000 templates in 20ms or so.

Chinese blog about the thoughts

improvment

Comparing to opencv linemod src, we improve from 6 aspects:

  1. delete depth modality so we don't need virtual func, this may speed up

  2. opencv linemod can't use more than 63 features. Now wo can have up to 8191

  3. simple codes for rotating and scaling img for training. see test.cpp for examples

  4. nms for accurate edge selection

  5. one channel orientation extraction to save time, slightly faster for gray img

  6. use MIPP for multiple platforms SIMD, for example, x86 SSE AVX, arm neon. To have better performance, we have extended MIPP to uint8_t for some instructions.(Otherwise we can only use half feature points to avoid int8_t overflow)

  7. rotate features directly to speed up template extractions; selectScatteredFeatures more evenly; exautive select all features if not enough rather than abort templates(but features <= 4 will abort)

some test

Example for circle shape

You can imagine how many circles we will find if use edges

circle1 circle1

Not that circular

circle2 circle2

Blur

circle3 circle3

circle template before and after nms

before nms

before

after nms

after

Simple example for arbitary shape

Well, the example is too simple to show the robustness
running time: 1024x1024, 60ms to construct response map, 7ms for 360 templates

test img & templ features
test
templ

noise test

test2

some issues you may want to know

Well, issues are not clearly classified and many questions are discussed in one issue sometimes. For better reference, some typical discussions are pasted here.

object too small?
failure case?
how to run even faster?

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].