public void Laplacian5x5FilterTestOutputPicture() { //Substitute for ManagerEdge InterfaceEdge edgeInterface = Substitute.For <ManagerEdge>(); Bitmap originalBitmap = RetrieveImage.RetrieveOriginalPicture(); Bitmap bitmapForVerification = RetrieveImage.RetrieveImageFromPath("Laplacian5x5.jpg"); Bitmap filteredBitmap = edgeInterface.Lalpacian5x5(new Bitmap(originalBitmap)); Assert.IsTrue(RetrieveImage.Equals(bitmapForVerification, filteredBitmap)); }
//Apply laplacian 5x5 edge detection private void Laplacian5x5Button_Click(object sender, EventArgs e) { if (!filterIsApplied) { DisplayCannotDoEdgeBeforeFiltering(); } else { //calls manager for Laplacian 5x5 edge putImageBackToAfterFilter(); resultBitmap = edge.Lalpacian5x5(new Bitmap(resultBitmap)); PreviewPictureBox.Image = resultBitmap; edgeIsApplied = true; } }