///////////////////////////////////////////////////////////////////////////// // // Image class for personale functions // // Copyright © 1998 // // IMM, Department of Mathematical Modelling // Technical University of Denmark, Building 321 // DK-2800 Lyngby, Denmark // http://www.imm.dtu.dk // // author: Rune Fisker // // Disclaimer: // // No guarantees of performance accompany this software, // nor is any responsibility assumed on the part of the author(s). // The software has been tested extensively and every effort has been // made to insure its reliability. // // This software is provided by IMM and the contributor(s) ``as is'' and // any express or implied warranties, including, but not limited to, the // implied warranties of merchantability and fitness for a particular purpose // are disclaimed. In no event shall IMM or the contributor(s) be liable // for any direct, indirect, incidental, special, exemplary, or consequential // damages (including, but not limited to, procurement of substitute goods // or services; loss of use, data, or profits; or business interruption) // however caused and on any theory of liability, whether in contract, strict // liability, or tort (including negligence or otherwise) arising in any way // out of the use of this software, even if advised of the possibility of // such damage. // // This software is partly based on the Microsoft Vision Software Developers Kit VisSDK // ///////////////////////////////////////////////////////////////////////////// //#include "stdafx.h" ///////////////////////////////////////////////////////////////////////////// // Performs Mathematical Erotion on image using a flat structure element (gray scale only). // // author: Søren Falch 14/1-99 template void CDImageMorphology::Erode(DWORD dwSize) { CDImageMorphology Tmp(MemoryShape()); Tmp.SetRect(Rect()); for (int s=0; s void CDImageMorphology::Dilate(DWORD dwSize) { CDImageMorphology Tmp(MemoryShape()); Tmp.SetRect(Rect()); for (int s=0; s void CDImageMorphology::Open(DWORD dwSize) { Erode(dwSize); Dilate(dwSize); CString Msg; Msg.Format("DIVA: Opening with %dx%d square",dwSize,dwSize); AddToHistory(Msg); } ///////////////////////////////////////////////////////////////////////////// // Performs Mathematical Closing on image using a flat structure element (gray scale only). // // author: Søren Falch 14/1-99 template void CDImageMorphology::Close(DWORD dwSize) { Dilate(dwSize); Erode(dwSize); CString Msg; Msg.Format("DIVA: Closeing with %dx%d square",dwSize,dwSize); AddToHistory(Msg); }