1 Star 0 Fork 0

celoran/ParticleTracking

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
detection_absThresh.py 887 Bytes
一键复制 编辑 原始数据 按行查看 历史
celoran 提交于 2019-05-04 11:11 . init commit
import numpy as np # Arrays
import cv2 # OpenCV
class AbsThreshClass(object):
def __init__(self):
pass
############ SPECIFIC FUNCTIONS ###############
def image_treatment(self, frame_gray):
# Thresholding
if self.Vars['thr_BonW']:
thr_type = 'cv2.THRESH_BINARY_INV'
else:
thr_type = 'cv2.THRESH_BINARY'
ret, thresh = cv2.threshold(frame_gray, self.Vars['thr_thresh'], 255,
eval(thr_type)) # Invert so black Janus particles are shown in white
thresh = self.morphology(thresh)
return thresh
def binarization(self, frame, *args):
return self.image_treatment(frame)
if __name__ == '__main__':
import detection_main
detection_main.start_program(trackMethod='auto', mode='absThresh', GUI=False)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/celoran/ParticleTracking.git
git@gitee.com:celoran/ParticleTracking.git
celoran
ParticleTracking
ParticleTracking
master

搜索帮助