Hi! My Code is:
Mat temp = imread(f_name, 1);
cout << temp.channels() << "chanels in image" << endl ;
getch()
;
img = CImg<unsigned char>(temp.cols, temp.rows, 1, 4);
width = img.width();
high = img.height();
static int ii = 0;
cout << "Image readed nr " << ii << endl;
// Rewrite from opencv to CImg
for(int l = 0 ; l < width ; l++){
for(int ll = 0 ; ll < high ; ll++){
img (l,ll, 0 , 0) = temp.at<cv::Vec4b>(ll,l)[0];
img (l,ll, 0 , 1) = temp.at<cv::Vec4b>(ll,l)[1];
img (l,ll, 0 , 2) = temp.at<cv::Vec4b>(ll,l)[2];
img (l,ll, 0 , 3) = temp.at<cv::Vec4b>(ll,l)[3]; // aplha chanell
}
}
It compile well, but in runtime there is assertion failed with mat.hpp in line 537. If i commented loops everything works without result ok.
Please Do Yiou have some ideas, please ?
Best Regards, Szymsztein