Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

template matching several bounding boxes outputted need only one

img_rgb = cv2.imread('obsvu.jpg')
img_rgb = cv2.medianBlur(img_rgb, 7)

img_gray = cv2.cvtColor(img_rgb, cv2.COLOR_BGR2GRAY)

template_image = cv2.imread('template.jpg',0)
template_image = cv2.medianBlur(template_image, 5)
width, height = template_image.shape[::-1]

res = cv2.matchTemplate(img_gray, template_image, cv2.TM_CCOEFF_NORMED)

threshold =  0.6

locations = np.where(res >= threshold)

new_locations = group_locations(np.array(locations).T, 50).T

for position_tuple in zip(*new_locations.astype(int)[::-1]):
        cv2.rectangle(img_rgb, position_tuple, (position_tuple[0] + width, position_tuple[1] + height), (0,255,0), 5)
Comment

PREVIOUS NEXT
Code Example
Typescript :: set in typescript 
Typescript :: how to get pastebin contents c# 
Typescript :: Array.prototype.map() expects a return value from arrow function array-callback-return 
Typescript :: dto typescript 
Typescript :: access dict elements with dot 
Typescript :: (Html.DevExtreme().FileUploader() dialogtrigger example 
Typescript :: Summation with limits in MATLAB 
Typescript :: typescript override 
Typescript :: typescript generic object not array 
Typescript :: remove dots from image python 
Typescript :: how many energy levels are there 
Typescript :: The marking menu shortcuts to context-sensitive commands and tools. Marking menu accessed for objects: 
Typescript :: vba check if two sheets are the same 
Typescript :: how to send events data to branch from server 
Typescript :: netsuite suitescript to upload and rename a file 
Typescript :: nestjs called once method 
Typescript :: how to disable piecelabel on certian charts and keep on other chartjs 
Typescript :: install djs typescript 
Typescript :: convert angle to 0-360 godot 
Typescript :: in what phaseof meiosisof prophase1 homologous chrosomes gets close to each other 
Typescript :: react conditional classname typescript 
Typescript :: Restrict users to see only his own contacts odoo 
Typescript :: check if all elements in array can be divided by python 
Typescript :: python fancy way to get arguments from the command line 
Typescript :: function call in Angular using typescript creates infinite loop 
Typescript :: typescript reset class properties to default 
Typescript :: java objects cannot change? 
Typescript :: why are my fonts and logo not appearing before I sign in asp.net 
Typescript :: typescript style guide 
Typescript :: reflect-metadata 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =