You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-73Lines changed: 1 addition & 73 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,79 +9,7 @@ Once installed, `import MTM`should work.
9
9
Example jupyter notebooks can be downloaded from the tutorial folder of the github repository and executed in the newly configured python environement.
10
10
11
11
# Documentation
12
-
The package MTM contains mostly 2 important functions:
This function searches each template in the image, and return the best N_object location which offer the best scores and which do not overlap above the `maxOverlap` threshold.
18
-
19
-
__Parameters__
20
-
-_listTemplates_:
21
-
list of tuples (LabelString, Grayscale or RGB numpy array) templates to search in each image, associated to a label
22
-
23
-
-_image_ : Grayscale or RGB numpy array
24
-
image in which to perform the search, it should be the same bitDepth and number of channels than the templates
25
-
26
-
-_method_ : int
27
-
one of OpenCV template matching method (0 to 5), default 5=0-mean cross-correlation
28
-
29
-
-_N_object_: int
30
-
expected number of objects in the image
31
-
32
-
- score_threshold: float in range [0,1]
33
-
if N>1, returns local minima/maxima respectively below/above the score_threshold
34
-
35
-
-_maxOverlap_: float in range [0,1]
36
-
This is the maximal value for the ratio of the Intersection Over Union (IoU) area between a pair of bounding boxes.
37
-
If the ratio is over the maxOverlap, the lower score bounding box is discarded.
38
-
39
-
-_searchBox_ : tuple (X, Y, Width, Height) in pixel unit
40
-
optional rectangular search region as a tuple
41
-
42
-
__Returns__
43
-
- Pandas DataFrame with 1 row per hit and column "TemplateName"(string), "BBox":(X, Y, Width, Height), "Score":float
44
-
- if N=1, return the best match independently of the score_threshold
45
-
- if N<inf, returns up to N best matches that passed the score_threshold
46
-
- if N=inf, returns all matches that passed the score_threshold
47
-
48
-
49
-
The function `findMatches` performs the same detection without the Non-Maxima Supression.
50
-
51
-
## drawBoxesOnRGB
52
-
The 2nd important function is `drawBoxesOnRGB` to display the detections as rectangular bounding boxes on the initial image.
53
-
To be able to visualise the detection as colored bounding boxes, the function return a RGB copy of the image if a grayscale image is provided.
54
-
It is also possible to draw the detection bounding boxes on the grayscale image using drawBoxesOnGray (for instance to generate a mask of the detections).
This function returns a copy of the image with predicted template locations as bounding boxes overlaid on the image
58
-
The name of the template can also be displayed on top of the bounding boxes with showLabel=True.
59
-
60
-
__Parameters__
61
-
-_image_ : numpy array
62
-
image in which the search was performed
63
-
64
-
-_hits_ : pandas dataframe
65
-
hits as returned by matchTemplates or findMatches
66
-
67
-
-_boxThickness_: int
68
-
thickness of bounding box contour in pixels. -1 will fill the bounding box (useful for masks).
69
-
70
-
-_boxColor_: (int, int, int)
71
-
RGB color for the bounding box
72
-
73
-
-_showLabel_: Boolean, default True
74
-
Display label of the bounding box (field TemplateName)
75
-
76
-
-_labelColor_: (int, int, int)
77
-
RGB color for the label
78
-
79
-
-_labelScale_: float, default=0.5
80
-
scale for the label sizes
81
-
82
-
__Returns__
83
-
-_outImage_: RGB image
84
-
original image with predicted template locations depicted as bounding boxes
12
+
The [wiki](https://github.com/multi-template-matching/MultiTemplateMatching-Python/wiki) section of the repo contains a mini API documentation with description of the key functions of the package.
85
13
86
14
# Examples
87
15
Check out the [jupyter notebook tutorial](https://github.com/multi-template-matching/MultiTemplateMatching-Python/tree/master/tutorials) for some example of how to use the package.
0 commit comments