1TP311.52UDC2004-6-42()_______________________________________________VisualC++2004.3.152004.6.15()___________________________________________________________________3()_______________________________________________________________________________________3.15–4.54.6–5.255.26-6.104(1.200112.VisualC++2002121.2.3.()()50002()1.VisualC++95200464623()4()()()()5()7---------------------------------------------------------------------------------------------1---------------------------------------------------------------21.1------------------------------------------------------------31.2---------------------------------------------------------------------------31.3---------------------------------------------------------------------------41.4---------------------------------------------------------------------41.5DIB------------------------------------------------------------------7VisualC++---------------------------------------------------------92.1---------------------------------------------------------------------------92.2---------------------------------------------------------------------------92.3--------------------------------------------------------------------------------112.4/------------------------------------------------------------------122.5-----------------------------------------------------------------------------13--------------------------------153.1--------------------------------------------------------------------------------153.2--------------------------------------------------------------173.3--------------------------------------------------------------------------------193.4--------------------------------------------------------------203.5--------------------------------------------------------------------------------213.6--------------------------------------------------------------22-------------------------------------------------------------------23----------------------------------------------------------------------24---------------------------------------------------------------------------------------------26--------------------------------------------------------------------------------------27---------------------------------------------------------------------------------------------288VisualC++9Abstract:Intheimageanalysisandprocessing,theresearchandapplicationofmorphologyhaseverdeveloped.Thecommonmorphologyincludeserosion,dilation,thinningandsoon.Wecanobserveandprocessimagesbythebasicmorphologicaloperationandachievethegoalofenhancingthequalityofimages.Onthebasisofextensivelyreadingandassimilatingmaterialsconcerningimageprocessingandanalysis,Irealizedthebinaryimageerosion,dilationandthinningprocessingbyvirtueofVisualC++.Iattainedbettereffectoferosion,dilationandthinningbyreasonablyselectingstructuralelements.Inthemeantime,thepassagealsoexhibitsanoutlineofmorphologicalprocessingofgrayimagesandcompletestheinterfacedesignofasmallsizedimageprocessingsystem.KeywordsMorphologyErosionDilationThining10DigitalImageProcessing1.2.X1111(CPU)(scanner)1(imageinputdevice)(imageacquisition)(videocamera)(scanner)(imagegrabber)VCDDVDIEEE1394USBUSBUSBIEEE1394IEEE1394IEEE1394IEEE13942framememory,.82416772562565125126404803(display)6404802561600120024truecolor4CPU(centralprocessingunit)CPU5imagestoragedevice121.2RGB0255256RGB256256256=16,777,216(full-colorimage)(true-colorimage).RGB640480RGB6404803=921,60064048016RGB1MB1616palette,lookuptableLUTRGBRGB2550001646404800.5=153,600WindowsRGB16416=6416153,600+64=153,6641/6RGB,RGB(bitmap).BMP,TIFF13JPEG1.3RGBR=G=B=YmonochromeimageY:YminYYmax(1)Y[Ymin,Ymax](grayscalegraylevel)[0255]Y=0Y=255256(2)Y=0.299R+0.578G+0.114B(2)1.4BMP1.11.1WindowsBITMAPFILEHEADERtypedefstructtagBITMAPFILEHEADER{14WORDbfType;DWORDbfSize;WORDbfReserved1;WORDbfReserved2;DWORDbfOffBits;}BITMAPFILEHEADER;14WORD16DWORD32bfType0x424DBM.bmpBMbfSize14bfReserved1bfReserved2bfOffBits3BITMAPINFOHEADERtypedefstructtagBITMAPINFOHEADER{DWORDbiSize;LONGbiWidth;LONGbiHeight;WORDbiPlanes;WORDbiBitCount;DWORDbiCompression;DWORDbiSizeImage;LONGbiXPelsPerMeter;LONGbiYPelsPerMeter;DWORDbiClrUsed;DWORDbiClrImportant;}BITMAPINFOHEADER;40WORD16DWORD32,LONG32biSize4015biWidthbiHeightbiPlanes1biBitCount1,416,8256,24.bmp32biCompressionBI_RGBBI_RLE8BI_RLE4BI_BITFIELDSWindowsBiSizeImagebiSizeImage=biWidth'*biHeightbiWidth'4biWidthbiWidth'biWidth4biWidth=240biWidth'=240biWidth=241biWidth'=244biCompressionBI_RGBbiXPelsPerMeterbiYPelsPerMeterbiClrUsed2biBitCountbiClrImportant(Palette)BITMAPINFOHEADERbiClrUsed2biBitCountRGBQUAD4typedefstructtagRGBQUAD{BYTErgbBlue;//16BYTErgbGreen;//BYTErgbRed;//BYTErgbReserved;//}RGBQUAD;R,G,B216256210181642256111.5DIBDIBWin32SDKDIBDIBDIBDIBDIBAPI.h//DIBDECLEAR_HANDLE(HDIB);//DIB#definePALVERSION0x300//Win3.0DIB#defineIS_WIN30_DIB(lpbi)(*(LPDWORD)(lpbi)==sizeof(BITMAPINFOHEADER))//#defineRECTWIDTH(lpRect)((lpRect)-right-(lpRect)-left)//#defineRECHEIGHT(lpRect)((lpRect)-bottom-(lpRect)-top)17//#defineWIDTHBYTES(bits)(((bits)+31)/32*4)//DIBBOOLWINAPIPaintDIB(HDC,