关于灰度图输入格式问题
Created by: sosky-yty
我对图片做如下处理: `int imageSize = 227;
float dist[imageSize*imageSize] = {0};
Mat data = imread("data.jpg",CV_32FC1);
Mat dest(227,227,CV_32FC1);
resize(data,dest,Size(227,227));
for(int m = 0;m< dest.rows;m++){
for(int n = 0;n<dest.cols;n++ ){
dist[(m*dest.cols)+n] = dest.at<float>(m,n);
}
}
float *ptr = dist;`
调用result = net->predict(ptr); 程序报错:Segmentation fault 图片信息:data.jpg 180*640灰度图 网络信息:caffe AlexNet input_param{shape:{dim:10 dim:1 dim:227 dim:227}}