opencv中iplimage图像头
答案:1 悬赏:70 手机版
解决时间 2021-02-10 04:08
- 提问者网友:嘚啵嘚啵
- 2021-02-09 06:28
网上尽是一些关于iplimage图像头的结构信息。但我不明白iplimage到底是干嘛用的,有关于它的一些小程序可以给我看一下吗?我不知道怎么用它。
最佳答案
- 五星知识达人网友:一袍清酒付
- 2021-02-09 07:17
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <cv.h>
#include <highgui.h>
int main(int argc, char *argv[])
{
IplImage* img = 0;
int height,width,step,channels;
// load an image
img=cvLoadImage("imagefile.png");
if(!img){
printf("Could not load image file: %s\n",argv[1]);
exit(0);
}
// get the image data
height = img->height;
width = img->width;
step = img->widthStep;
channels = img->nChannels;
data = (uchar *)img->imageData;
printf("Processing a %dx%d image with %d channels\n",height,width,channels);
cvReleaseImage(&img );
return 0;
}
#include <stdio.h>
#include <math.h>
#include <cv.h>
#include <highgui.h>
int main(int argc, char *argv[])
{
IplImage* img = 0;
int height,width,step,channels;
// load an image
img=cvLoadImage("imagefile.png");
if(!img){
printf("Could not load image file: %s\n",argv[1]);
exit(0);
}
// get the image data
height = img->height;
width = img->width;
step = img->widthStep;
channels = img->nChannels;
data = (uchar *)img->imageData;
printf("Processing a %dx%d image with %d channels\n",height,width,channels);
cvReleaseImage(&img );
return 0;
}
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯