1
A
回答
2
基于众所周知的图像处理技术,您可以编写自己的处理工具:
img = imread('Mlj6r.jpg'); % read the image
imgGray = rgb2gray(img); % convert to grayscale
sigma = 1;
imgGray = imgaussfilt(imgGray, sigma); % filter the image (we will take derivatives, which are sensitive to noise)
imshow(imgGray) % show the image
[gx, gy] = gradient(double(imgGray)); % take the first derivative
[gxx, gxy] = gradient(gx); % take the second derivatives
[gxy, gyy] = gradient(gy); % take the second derivatives
k = 0.04; %0.04-0.15 (see wikipedia)
blob = (gxx.*gyy - gxy.*gxy - k*(gxx + gyy).^2); % Harris corner detector (high second derivatives in two perpendicular directions)
blob = blob .* (gxx < 0 & gyy < 0); % select the top of the corner (i.e. positive second derivative)
figure
imshow(blob) % show the blobs
blobThresshold = 1;
circles = imregionalmax(blob) & blob > blobThresshold; % find local maxima and apply a thresshold
figure
imshow(imgGray) % show the original image
hold on
[X, Y] = find(circles); % find the position of the circles
plot(Y, X, 'w.'); % plot the circle positions on top of the original figure
nCircles = length(X)
此代码计数2710圈,这也许是一个轻微的(但不是那么糟糕)高估。
下图显示了圆圈位置以白点表示的原始图像。在对象的边界处进行了一些错误的检测。您可以尝试对常量sigma
,k
和blobThresshold
进行一些调整以获得更好的结果。特别是,更高的k
可能是有益的。有关Harris角点检测器的更多信息,请参见wikipedia。
相关问题
- 1. 如何计算要用于圆形的SVG图像的区域
- 2. 计算图像中的对象
- 3. 计算图像中对象的数量
- 4. Matlab图像分割和圆形识别
- 5. 使用MATLAB计算并平均图像中的某些像素
- 6. 如何使用python来计算图像中的对象?
- 7. 圆形图像?
- 8. 如何使用MATLAB计算图像中的人数?
- 9. 使用javascript的圆形图像流
- 10. 如何免除Matlab绘图极限计算中的对象
- 11. 用asp.net圆形图像
- 12. Css圆形图像
- 13. 计算在3D中以圆形运动移动的对象的位置
- 14. 用圆角矩形计算外线
- 15. 检测图像中的圆形图案
- 16. 使用MATLAB来计算连续图像之间的偏移量
- 17. 使用Matlab计算BW图像的平均强度值
- 18. div内的圆形图像
- 19. JavaFX的圆形图像
- 20. 如何计算MATLAB中棋盘图像中的多边形面积?
- 21. 使用pdfbox计算pdf中的图像
- 22. 对象检测使用MATLAB计算机视觉工具箱
- 23. 圆弧的矩形框计算
- 24. 计算椭圆形的半径
- 25. 计算opencart的圆形零售价格
- 26. 隐藏图中某些图形对象的MATLAB图例条目
- 27. Android:环形内部的圆形图像
- 28. 使用Bresenham的圆形算法在Java中生成椭圆
- 29. 如何计算图像轮廓的“圆度形状特征”的值?
- 30. Qt中的圆形图像Qml