Hi, I'm converting an old delphi app that uses ImageEN to a new c# app that currently uses OpenCV via a wrapper called Emgu. I want to use IEvolution to replicate what's happening in the delphi app because that app is largely debugged and the processes are well tested.
I have the following code working but I'm not sure its the best way to move images between emgu and iev. Also, the ieviewer (called Img in the snippet) doesn't update after swapping in the new image even after calling invalidate and update.
Image<Bgr, byte> Original = new Image<Bgr, byte>(new Bitmap(Img.Image.GetNetImage())); Image<Hsv, Byte> imgHSV = Original.Convert<Hsv, Byte>(); Image<Gray, Byte>[] channels = imgHSV.Split(); channels[2] += 55; CvInvoke.Merge(new VectorOfMat(channels[0].Mat, channels[1].Mat, channels[2].Mat), imgHSV); pbCamera.Image = imgHSV.Convert<Bgr, Byte>(); Img.Image.CopyFromMemory(imgHSV.Convert<Bgr, Byte>().MIplImage.ImageData, imgHSV.Width, imgHSV.Height, HiComponents.IEvolution.IEImage.PixelFormat.ie24RGB, HiComponents.IEvolution.IEImage.BitmapOrigin.TOPLEFT, imgHSV.MIplImage.WidthStep); Img.Invalidate(true); Img.Update();
So.... A) is that the best way to move images back and forth? in ImageEN I had a bitmap available in IEBitmap but I can't find the equivalent in iev. B) why doesn't the view update? if i click on it or zoom it will update so i know its getting the image correctly.
I'm also looking for the equivalent of TImageEn.Proc Is there any information you can provide that will make it easier for me to move from TImageEN to IEvolution? It seems both familiar and completely new. maybe just some architectural overview would help
Thanks! Scott
|