在java

时间:2015-10-05 01:36:03

标签: java image search video

我一直在寻找,我无法找到任何可行的东西,所以我会问, 基本上我正在尝试让java浏览视频并找到某个图像,比如徽标或其他东西但是现在我只是在视频之前处理其他图像部分中的查找图像。我正在使用此Thread中的eclipse和代码,  但我不能让它工作,总是得到错误:

  

SLF4J:无法加载“org.slf4j.impl.StaticLoggerBinder”类。
  SLF4J:默认为无操作(NOP)记录器实现SLF4J:
  有关详细信息,请参阅http://www.slf4j.org/codes.html#StaticLoggerBinder   细节。线程“main”中的异常java.lang.NullPointerException at   org.sikuli.api.visual.Canvas.addLabel(Canvas.java:230)at at   Search.main(Search.java:39)

继承我的代码:

import java.net.MalformedURLException;
import java.net.URL;

import org.sikuli.api.*;
import org.sikuli.api.robot.Mouse;
import org.sikuli.api.robot.desktop.DesktopMouse;
import org.sikuli.api.visual.Canvas;
import org.sikuli.api.visual.DesktopCanvas;

import static org.sikuli.api.API.*;

public class Search {

    public static void main(String[] args) throws MalformedURLException {

            // Open the main page of Google Code in the default web browser
            browse(newURL("http://zelda.wikia.com/wiki/File:Wii_U_(logo).png"));
            // Create a screen region object that corresponds to the default monitor in full screen 
            ScreenRegion s = new DesktopScreenRegion();

            // Specify an image as the target to find on the screen
            URL imageURL = new URL("http://vignette1.wikia.nocookie.net/zelda/images/1/17/Wii_U_%28logo%29.png/revision/latest?cb=20110609012932");                
            Target imageTarget = new ImageTarget(imageURL);

            // Wait for the target to become visible on the screen for at most 5 seconds
            // Once the target is visible, it returns a screen region object corresponding
            // to the region occupied by this target
            ScreenRegion r = s.wait(imageTarget,5000);

            // Display "Hello World" next to the found target for 3 seconds
            Canvas canvas = new DesktopCanvas();
            canvas.addLabel(r, "Hello World").display(3);

            // Click the center of the found target
            Mouse mouse = new DesktopMouse();
            mouse.click(r.getCenter());
    }

}

0 个答案:

没有答案