public void Laplacian3x3FilterTestOutputPicture() { //Substitute for ManagerEdge InterfaceEdge edgeInterface = Substitute.For <ManagerEdge>(); Bitmap originalBitmap = RetrieveImage.RetrieveOriginalPicture(); Bitmap bitmapForVerification = RetrieveImage.RetrieveImageFromPath("Laplacian3x3.jpg"); Bitmap filteredBitmap = edgeInterface.Lalpacian3x3(new Bitmap(originalBitmap)); Assert.IsTrue(RetrieveImage.Equals(bitmapForVerification, filteredBitmap)); }
//Edges only if filters applied before //Apply laplacian 3x3 edge detection private void Laplacian3x3Button_Click(object sender, EventArgs e) { if (!filterIsApplied) { DisplayCannotDoEdgeBeforeFiltering(); } else { //calls manager for Laplacian 3x3 edge putImageBackToAfterFilter(); resultBitmap = edge.Lalpacian3x3(new Bitmap(resultBitmap)); PreviewPictureBox.Image = resultBitmap; edgeIsApplied = true; } }