111,092
社区成员




void ColorToGray2(IplImage *pIn, IplImage *pOut, int width, int height, int DibWidth, short channels)
{
//IplImage* src = cvLoadImage(pIn);
//IplImage* dst = cvCreateImage(cvSize(src->width,src->height),8,3);
cvCvtColor(pIn,pOut,CV_RGB2GRAY);
width=pIn->width;
height=pIn->height;
DibWidth=pIn->widthStep;
channels=pIn->nChannels;
}
C#:void ResizeImage(byte[] pIn, byte[] pOut, int width, int height, int DibWidth, short nChannel, double fScale)
[DllImport(@"ConApp.dll", EntryPoint = "show_mat", CallingConvention = CallingConvention.Cdecl)]
public static extern void show_mat(IntPtr img);
Mat SCr = new Mat(@"C:\Users\admin\Desktop\F548431971010910.jpg", Emgu.CV.CvEnum.LoadImageType.AnyColor);
Image<Bgr, byte> img = SCr.ToImage<Bgr, byte>();
AllClass.show_mat(img.Ptr);
__declspec(dllexport) void __stdcall show_mat(IplImage* src){
Mat M(src, true);
imshow("传入的参数", M);}