Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def find_rectangles_that_match_dict(rectangles, match_dict):
- matching_rectangles = []
- for r in rectangles:
- x,y,w,h = r
- x_start, x_end = match_dict['x']
- y_start, y_end = match_dict['y']
- w_start, w_end = match_dict['w']
- h_start, h_end = match_dict['h']
- if is_between(x, x_start, x_end) and \
- is_between(y, y_start, y_end) and \
- is_between(w, w_start, w_end) and \
- is_between(h, h_start, h_end):
- matching_rectangles.append(r)
- return matching_rectangles
- def letter_dict():
- return {'x': [0, 200],
- 'y': [0, 500],
- 'w': [50, 175],
- 'h': [20, 40]}
- def date_dict():
- return {'x': [1200, 1400],
- 'y': [0, 500],
- 'w': [75, 175],
- 'h': [20, 40]}
- def name_dict():
- return {'x': [1500, 4000],
- 'y': [0, 500],
- 'w': [800, 1400],
- 'h': [50, 4000]}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement