查找标志在桌面截图截图、标志、桌面

2023-09-11 04:01:13 作者:飞离远去

我需要开发一个桌面应用程序,将

I need to develop a desktop application which will

1)具有不同的应用标志的列表(背景透明)如IE浏览器,火狐,Chrome,PHOTOSHOP等

1.) have a list of the Different Application logos (Background Transparent) e.g. IE, FIREFOX, CHROME, PHOTOSHOP ETC.

2。)用户将桌面的截图并保存图像。

2.) User will take a screenshot of desktop and save the image.

3)。现在我的应用程序需要搜索所有标识,在屏幕显示图像,并告诉所有徽标是present在哪里。

3.) Now my application need to search all the logos in the screenshot image and tell which all logos are present and where.

4)我用OPENCV,它的工作,但如果用户更改桌面背景和放大器;撷截图,它不工作为标志的透明区域越来越桌面背景内容。

4.) I used OPENCV, it's working, but when user changes the desktop background & captures screenshot, it's not working as the transparent area of logo is getting the desktop background content.

有人可以提供一个解决方案或图书馆的开放源码,商业做好这项工作。

Can somebody provide a solution or libraries open source, commercial to do this job.

推荐答案

这是很容易使用互相关的事情。

This is easy to do using cross-correlation.

请参阅我的回答这个问题。

基本上是:

在开始与台式机的形象和一个模板图像的每个图标 在应用边缘检测(如索贝尔)到桌面的图像和模板图像。 扔掉原来的桌面映像和模板,你会不会因为我们将要使用的边缘检测的图像需要它们了 对于每个模板 请模板匹配,你通常会 阈值的结果的最大值。如果它高于阈值,则有一个匹配,在该位置上。否则,不匹配。 Start with desktop image and one template image for each icon Apply edge detection (e.g. Sobel) to the desktop image and template images. Throw away the original desktop image and templates, you won't need them anymore cause we'll be using the edge-detected images For each template Do template matching as you normally would Threshold the maximum of the result. If it's above the threshold, you have a match at that position. Otherwise, no match.

如果你的图标在桌面上的网格对齐,您可以通过只检查这些特定的网格位置,以加快处理速度。

If your icons are aligned in a grid on the desktop, you may be able to speed up your processing by only checking those specific grid positions.

修改

您还可以通过了解搜索的图标节省了大量的时间。如果你有机会到文件系统,然后就找 *。LNK 文件(或任何其他的扩展,你可能有兴趣),在对应的桌面目录(不记得它到底是什么,但对Windows7的它的东西,像 C:\用户\米莎\桌面)。这将告诉您什么图标都没有在桌面上。这将允许您缩短您的模板候选人名单,然后再去做模板匹配。

You can also save a lot of time by knowing which icons to search for. If you have access to the file system, then just look for *.lnk files (or any other extensions you may be interested in) in the directory that corresponds to the desktop (can't remember exactly what it is, but for Windows7 it's something like c:\users\misha\desktop). That will tell you what icons are there on the desktop. This will allow you to shorten your template candidate list before you go and do the template matching.