diff --git a/OpenCV/Form1.Designer.cs b/OpenCV/Form1.Designer.cs index 5395342..654bfad 100644 --- a/OpenCV/Form1.Designer.cs +++ b/OpenCV/Form1.Designer.cs @@ -40,7 +40,6 @@ namespace OpenCV this.pictureBoxIpl1.Location = new System.Drawing.Point(12, 12); this.pictureBoxIpl1.Name = "pictureBoxIpl1"; this.pictureBoxIpl1.Size = new System.Drawing.Size(640, 480); - this.pictureBoxIpl1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBoxIpl1.TabIndex = 0; this.pictureBoxIpl1.TabStop = false; // @@ -49,7 +48,6 @@ namespace OpenCV this.pictureBoxIpl2.Location = new System.Drawing.Point(658, 11); this.pictureBoxIpl2.Name = "pictureBoxIpl2"; this.pictureBoxIpl2.Size = new System.Drawing.Size(640, 480); - this.pictureBoxIpl2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBoxIpl2.TabIndex = 1; this.pictureBoxIpl2.TabStop = false; // diff --git a/OpenCV/Form1.cs b/OpenCV/Form1.cs index 03fd1f7..b95648f 100644 --- a/OpenCV/Form1.cs +++ b/OpenCV/Form1.cs @@ -39,7 +39,8 @@ namespace OpenCV OpenCVClass Converter = new OpenCVClass(); pictureBoxIpl1.ImageIpl = src; - pictureBoxIpl2.ImageIpl = Converter.Blur(src); + //pictureBoxIpl2.ImageIpl = Converter.ZoomIn(src); + pictureBoxIpl2.ImageIpl = Converter.ZoomOut(src); } catch (Exception ex) { diff --git a/OpenCV/OpenCVClass.cs b/OpenCV/OpenCVClass.cs index c60cddb..30f9309 100644 --- a/OpenCV/OpenCVClass.cs +++ b/OpenCV/OpenCVClass.cs @@ -9,6 +9,8 @@ namespace OpenCV IplImage inversion; IplImage bin; IplImage blur; + IplImage zoomin; + IplImage zoomout; public IplImage GrayScale(IplImage src) { @@ -38,6 +40,20 @@ namespace OpenCV return blur; } + public IplImage ZoomIn(IplImage src) + { + zoomin = new IplImage(new CvSize(src.Width * 2, src.Height * 2) , BitDepth.U8, 3); + Cv.PyrUp(src, zoomin, CvFilter.Gaussian5x5); + return zoomin; + } + + public IplImage ZoomOut(IplImage src) + { + zoomout = new IplImage(new CvSize(src.Width / 2, src.Height / 2), BitDepth.U8, 3); + Cv.PyrDown(src, zoomout, CvFilter.Gaussian5x5); + return zoomout; + } + public void Dispose() { if (gray != null) @@ -48,6 +64,10 @@ namespace OpenCV Cv.ReleaseImage(bin); if (blur != null) Cv.ReleaseImage(blur); + if (zoomin != null) + Cv.ReleaseImage(zoomin); + if (zoomout != null) + Cv.ReleaseImage(zoomout); } } }