Home > Net >  C # the Bitmap or the Image object. How to convert Emgu CV. Mat type
C # the Bitmap or the Image object. How to convert Emgu CV. Mat type

Time:11-22

Could you tell me how to c # Bitmap or the Image object into Emgu. CV. Mat type, thank you! (QQ: 18700104)

CodePudding user response:

//convert resource view to emgu. Cn. Mat type
Image img=Properties. Resources. Form3_PIC_00;//only system. Drawing. The image can be read, Mat and emgu image won't read
Bitmap bmpImage=new Bitmap (img);//this is the key, the foreign web site to see
Emgu. CV. Image CurrentFrame=new Emgu. CV. Image (bmpImage);//only so

Mat invert=new Mat ();
CvInvoke. BitwiseAnd (currentFrame currentFrame, invert);//this is the method of official website, general, did not see offer direct conversion of other methods,

This code will benefit many people, foreign websites also find this translation, ha ha, created emgu. CV. Image to emgu. Cn. Transformation of mat, mat is very common around the image,
3.0 introduced a Mat, is no longer recommended image, however, some time, you also need to turn on the Mat from C # types, such as the C example, must be with a BitMap conversion,

CodePudding user response:

CvInvoke. BitwiseAnd (currentFrame currentFrame, invert);//this is the method of official website, general, did not see offer direct conversion of other methods,
Found its properties in a usage, Mat Get the Mat header that represent this CvArr
(Inherited from CvArray ),

Invert=currentFrame, Mat, efficiency should be a little bit higher, directly to the memory structure of the head of a change,

CodePudding user response:

Can't turn Bitmap

CodePudding user response:

  •  Tags:  
  • C#
  • Related