3月 152013
 

Your ads will be inserted here by

Easy AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

这里的程序是参考别人的C语言程序移植过来的,没怎么学过java,玩CV顺便学下java吧

参考http://wenku.baidu.com/view/2b6fb9eb856a561252d36f4f.html

import static com.googlecode.javacv.cpp.opencv_core.*; 
import static com.googlecode.javacv.cpp.opencv_imgproc.*; 
import static com.googlecode.javacv.cpp.opencv_highgui.*;

public class test { 
   public static void main(String args[]){ 
      IplImage image = cvLoadImage("D:\\car.bmp"); 
      if (null == image)//如果读入失败,退出程序 
          System.exit(1); 
      //创建一个窗口,标题为Example 
      cvNamedWindow("Example",CV_WINDOW_AUTOSIZE); 
      //在窗口Example中显示图片
      cvShowImage("Example",image); 
      //暂停程序,等待用户触发一个按键
      cvWaitKey(0); 
      //释放图像所分配的内存 
      cvReleaseImage(image); 
      //销毁窗口 
      cvDestroyWindow("Example"); 
    } 
}
编译运行,这样就可以显示图片了,话说wordpress怎么上传图片呐- -

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)