- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在使用 opencv 中的 simpleblobdetector 和 python 来识别图像中的 Blob 。
我能够让简单的 Blob 检测器工作,并为我提供已识别 Blob 的位置。但是我也可以得到已识别 Blob 的惯性/凸性/圆度/等属性吗?
img = cv2.imread('image.png', cv2.IMREAD_GRAYSCALE)
# set up blob detector params
detector_params = cv2.SimpleBlobDetector_Params()
detector_params.filterByInertia = True
detector_params.minInertiaRatio = 0.001
detector_params.filterByArea = True
detector_params.maxArea = 10000000
detector_params.minArea = 1000
detector_params.filterByCircularity = True
detector_params.minCircularity = 0.0001
detector_params.filterByConvexity = True
detector_params.minConvexity = 0.01
detector = cv2.SimpleBlobDetector_create(detector_params)
# Detect blobs.
keypoints = detector.detect(img)
# print properties of identified blobs
for p in keypoints:
print(p.pt) # locations of blobs
# circularity???
# inertia???
# area???
# convexity???
# etc...
谢谢
最佳答案
根据 opencv.org,检测器返回的关键点不包含有关找到它们的算法的任何信息:
cv::KeyPoint: Data structure for salient point detectors.
The class instance stores a keypoint, i.e. a point feature found byone of many available keypoint detectors, such as Harris cornerdetector, cv::FAST, cv::StarDetector, cv::SURF, cv::SIFT,cv::LDetector etc.
The keypoint is characterized by the 2D position, scale (proportionalto the diameter of the neighborhood that needs to be taken intoaccount), orientation and some other parameters.
您可以绘制关键点,显示大小和旋转:
img = cv2.drawKeypoints(img, keypoints, None, color=(0,255,0), flags=cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)
关于python - opencv simpleblobdetector - 获取已识别 blob 的 blob 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41032639/
我想检测一些 Blob ,但只有一定大小 - 在最小和最大区域之间。 当我这样设置参数时: cv::SimpleBlobDetector::Params params; params.filterBy
我正在尝试编写用于 Blob 检测的代码,并且我正在按照此处的教程进行操作 https://www.learnopencv.com/blob-detection-using-opencv-python
我正在使用具有以下指定参数的 SimpleBlobDetector: # Parameters params = cv2.SimpleBlobDetector_Params() params.filt
我是 OpenCV 新手,我使用 this repo将 OpenCV Java 导入我的项目。 我在那里导入了最新版本4.3.0我想尝试 Blob 检测功能但不能。 我发现 SimpleBlobDet
我输入的mask是一维灰度图像: detector = cv2.SimpleBlobDetector() print('mask.shape', mask.shape) # print('mask.d
我正在尝试使用 opencv SimpleBlobDetector。 我当前的程序是一个简单的测试程序,如下所示: import cv2 import numpy as np; im = cv2.im
如何确定在 Python 2.7 中使用 SimpleBlobDetector 找到的 Blob 数?我有示例代码在我的图像中查找和标记 Blob ,但还需要知道有多少 Blob 与我的参数匹配。 #
我正在使用 SimpleBlobDetector 来定位小数点和其他类型的标点符号,如下图所示,有时检测器会从文本的实心区域中拾取 Blob (中间 9 的底部),我正在寻找一种方法来通过 Simpl
我不明白 filterByInertia 是什么意思...我也不明白文档的小描述: 通过最小惯量与最大惯量之比。提取的 Blob 将具有 minInertiaRatio(含)和 maxInertiaR
我如何使用 cv::SimpleBlobDetector 类及其函数 detectblobs() 而不是任何额外的 blob 检测库? 最佳答案 Python:读取图像 blob.jpg 并使用不同的
我正在使用 OpenCV 3.1 使用 SimpleBlobDetector 进行一些 blob 检测,但我没有运气,也没有教程能够解决这个问题。我的环境是 x64 上的 XCode。 我从这张图片开
什么是SimpleBlobDetector实际上呢? 它返回一些点给我,但这些点是什么? Blob 检测器是否找到具有相似属性(包括颜色)的图像区域? 我可以检索找到的 Blob 的轮廓吗?我在网络上
我正在尝试检测图像中的 Blob ,如下图所示: 然而,没有检测到 Blob 。我检查了一些测试图像,下面的代码工作正常。我也尝试调整参数,但没有成功。知道我做错了什么吗? 这是我使用的代码: pro
我已仔细阅读此网站以寻求解释,但无济于事...希望有人知道答案。 我正在使用 simpleBlobDetector 来跟踪一些 Blob 。我想通过检测方法指定一个 mask ,但由于某种原因, ma
@robot_sherrick 回答了我 this question ,这是他回答的后续问题。Opencv 2.4 中的 cv::SimpleBlobDetector 看起来非常令人兴奋,但我不确定我
我有一个简单的 OpenCV SimpleBlobDetector 任务 cv::SimpleBlobDetector::Params params; cv::Ptr detector = cv::S
我对将 OpenCV 与 C++ 结合使用还很陌生,目前我正在使用它通过 blob 检测来计算托盘中的对象数量。 当我使用 SimpleBlobDetector 时,我不断得到一个特定的关键点,该关键
在OpenCV的SimpleBlobDetector中有一个minRepeatability参数。这个参数有什么用。如果我将它从 1 变为 20,它会如何影响 blob 检测? 最佳答案 相关代码在b
我正在尝试使用一些简单的代码来运行 blob 检测: img = cv2.imread(args["image"]) height, width, channels = img.shape param
我正在使用 opencv 中的 simpleblobdetector 和 python 来识别图像中的 Blob 。 我能够让简单的 Blob 检测器工作,并为我提供已识别 Blob 的位置。但是我也
我是一名优秀的程序员,十分优秀!