现在的位置: 首页 > 综合 > 正文

opencv–转换图像大小

2013年02月20日 ⁄ 综合 ⁄ 共 405字 ⁄ 字号 评论关闭
Code:
  1. const double scale = 0.6;      
  2.      
  3. IplImage* ResizeImage(IplImage *src)      
  4. {      
  5.     // allocate memory for the dsc       
  6. IplImage* dsc = cvCreateImage(cvSize(src->width*scale, src->height*scale),       
  7.         src->depth, src->nChannels);      
  8.      
  9.     // resizes Image(input array is resized to fit the output array )      
  10.     cvResize(src, dsc, CV_INTER_LINEAR);      
  11.     return dsc;      
  12.           
  13. }    

 

抱歉!评论已关闭.