python图像计数,使用python中的图像处理对粒子进行计数

本文探讨了在变化的背景亮度下如何使用Python进行粒子计数。尝试了多种方法,包括Otsu阈值、局部最大滤波器以及自适应对比度增强。最终解决方案采用OpenCV的自适应阈值技术,成功识别并计数了图像中的粒子。
摘要由CSDN通过智能技术生成

Is there any good algorithm for detecting particles on a changing background intensity?

For example, if I have the following image:

9f08c269234a7c1979c3de1edf17d437.png

Is there a way to count the small white particles, even with the clearly different background that appears towards the lower left?

To be a little more clear, I would like to label the image and count the particles with an algorithm that finds these particles to be significant:

6ZmuYQS.jpg

I have tried many things with the PIL, cv , scipy , numpy , etc. modules.

I got some hints from this very similar SO question, and it appears at first glance that you could take a simple threshold like so:

im = mahotas.imread('particles.jpg')

T = mahotas.thresholding.otsu(im)

labeled, nr_objects = ndimage.label(im>T)

print nr_objects

pylab.imshow(labeled)

but because of the changing background you get this:

Gh1GtpX.jpg

I have also tried other ideas, such as a technique I found for measuring paws, which I implemented in this way:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值