如何用php检测图像中的形状? [英] how to detect shape in a image with php?

查看:122
本文介绍了如何用php检测图像中的形状?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须使用php检测图像中的星形形状。此时星星不固定,下次可能处于其他位置。我不能使用任何外部软件或库。我尝试过所有方法,如边缘检测和灰度,但都是徒劳的。这是图像:

I have to detect 'star' like shape in a image with php.Also the star is not fixed and may be at other position next time.I cannot use any external software or library.I have tried all methods like edge detection and grayscaling but all in vain.this is the image:

主要问题是我无法清除背景。如果图像背景被清除,我可以读取所有像素颜色行以及列和检测。请帮助我。这是在brightness_filter和边缘检测之后的图像。

the main problem is I cannot clear the background. if image background is cleared than i can read all pixels color row wise as well as column wise and detect.please help me.this is the image after brightness_filter and edge detection.

推荐答案

对于这个特定的图像,建议执行少量的低通滤波(高斯模糊)来衰减这些线。这应该有效,因为细线在其转换时具有高频率。然后你可以尝试增加对比度和亮度。

For this particular image would suggest to perform a low amount of lowpass filtering (Gaussian blur) to attenuate those lines. That should work because thin lines have high frequencies at their transistions. And then you can try increasing the contrast and the brightness.

我刚做了一个快速测试,结果是那样的

I just did a quick test and the result is something like that

然后只计算生成的图像与不同图像的互相关性明星。

Then just calculate the cross-correlation of your resulting image with images of different stars.

这篇关于如何用php检测图像中的形状?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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