Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to filter mask results in python cv2

#This should probably help

contour, _ = cv2.findContours(mask, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
    
  for c in contour:
        area = cv2.contourArea(c)

        if area > 400:
            x, y, w, h = cv2.boundingRect(c)
            cv2.rectangle(frame, (x, y), (x + w, y + h), (255, 0, 0), 2)
            cv2.drawContours(frame, c, -1, (255, 0, 0), 2)
Comment

PREVIOUS NEXT
Code Example
Python :: python test if string is int 
Python :: colored text python 
Python :: chrome selenium python 
Python :: cmd python -m 
Python :: django foreign key error Cannot assign must be a instance 
Python :: how to move your cursor using python 
Python :: python in line conditional statement 
Python :: Pandas groupby max multiple columns in pandas 
Python :: python string exclude non alphabetical characters 
Python :: start new app in django 
Python :: mongodb check if substring in string 
Python :: telnet via jump host using python 
Python :: fstring number format python 
Python :: flask api response code 
Python :: max of 2d array python 
Python :: python loop through array backwards 
Python :: read tsv file column 
Python :: pandas scatter plot with different colors 
Python :: python game over screen 
Python :: how to change the column order in pandas dataframe 
Python :: with python how to check alomost similar words 
Python :: python compare if 2 files are equal 
Python :: pandas fill missing values with average 
Python :: convert birth date to age pandas 
Python :: knn classifier python example 
Python :: pythom datetime now 
Python :: align columns to left pandas python 
Python :: how to sort a column with mixed text number 
Python :: sns legend outside 
Python :: convert torch to numpy 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =