使用PHP进行霍夫变换 [英] Hough Transform with PHP

查看:136
本文介绍了使用PHP进行霍夫变换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在图上检测x轴和y轴。 PHP的现有库无法检测行,因为此过程需要Hough变换方法(如果我错了请纠正我)有没有办法使用PHP检测带有/不带Hough变换的轴。

I need to detect the x-axis and y-axis on a diagram. Existing libraries for PHP cannot detect the lines as this process requires Hough Transform method (please correct me if I am wrong) Is there any way to detect the axises with/without Hough Transform using PHP.

图表示例:

an example to the diagram:

推荐答案

我认为如果目标只是轴的检测,一种更简单的方法就是使用形态学操作(使用霍夫变换可能真的在计算上要求很高,可能不会用这么多噪音)。我宁愿使用 GNU octave 进行图像处理操作,通过php前端提供结果。

I think if the goal is the detection of the axis only, an easier approach would be using morphological operations (using hough transform could be really computationally demanding, and possibly wouldn't work with so much "noise"). I would rather use GNU octave to do the image processing operations, than serve the results through a php frontend.

启动的可能代码可能是(例如检测原点和最大值 - 过滤最小x,最大x,最小y,最大的y来获得角落):

Possible code for starting could be (e.g. to detect origin and maximum values - filter for minimal x, maximal x, minimal y, maximal y to get the corners):

I = rgb2gray(imread('iEth9.jpg'));
I = I < 11;
A = imopen(I, ones(1,100)');
B = imopen(I, ones(1,100));
imagesc(I);hold on;
[y,x] = find(A&B);
plot(x,y,'ro');

这篇关于使用PHP进行霍夫变换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆