??????????????????????
???????????? ???????[ 2015/1/22 14:22:52 ] ?????????????????? ??????
????* This programm shows the extraction of surface scratches via
????* local thresholding(???????? and morphological post-processing??????????
????*????????
????dev_update_off ()
????dev_close_window ()
????*
????* Step 1: Acquire image
????*
????* read_image (Image?? 'surface_scratch')
????*Good
????* read_image (Image?? 'C:/Users/Administrator/Desktop/????????/7_[0]_ORIGIN_201310 4 112551.jpg')
????*????????????????????С??
????* read_image (Image?? 'C:/Users/Administrator/Desktop/????????/13.10.4?????????-?????????/?????/187_[110]_INIT_ORIGIN_201310 4 1129 5.jpg')
????* read_image (Image?? 'C:/Users/Administrator/Desktop/????????/13.10.4?????????-?????????/??????/9_[8]_INIT_ORIGIN_201310 4 112554.jpg')
????* Image Acquisition 01: Code generated by Image Acquisition 01
????*??????????
????ImageFiles := []
????ImageFiles[0] := 'C:/Users/Administrator/Desktop/????????/1 (2).jpg'
????ImageFiles[1] := 'C:/Users/Administrator/Desktop/????????/1 (3).jpg'
????ImageFiles[2] := 'C:/Users/Administrator/Desktop/????????/1.jpg'
????ImageFiles[3] := 'C:/Users/Administrator/Desktop/????????/2 (2).jpg'
????for Index := 0 to |ImageFiles| - 1 by 1
????* stop ()
????read_image (Image?? ImageFiles[Index])
????* Image Acquisition 01: Do something
????get_image_size (Image?? Width?? Height)
????*??????????С??????
????dev_open_window_fit_image (Image?? 0?? 0?? Width?? Width?? WindowID)
????set_display_font (WindowID?? 16?? 'mono'?? 'true'?? 'false')
????*?????????????????
????dev_set_draw ('margin')
????dev_set_line_width (4)
????dev_display (Image)
????*??????????????
????*????????=
????Message := 'This program shows the extraction of'
????Message[1] := 'surface scratches via local thresholding'
????Message[2] := 'and morphological post-processing'
????disp_message (WindowID?? Message?? 'window'?? 12?? 12?? 'black'?? 'true')
????*??????????“Press Run to continue"
????disp_continue_message (WindowID?? 'black'?? 'true')
????* stop ()
????*
????* Step 2: Segment image
????*
????* Using a local threshold
????*???????????Image????15*15??????Ч?????
????mean_image (Image?? ImageMean?? 15?? 15)
????*???????????ImageMean???????Image???????????????????????4??????
????dyn_threshold (Image?? ImageMean?? DifPixels?? 4?? 'not_equal')
????* dyn_threshold (Image?? ImageMean?? LightPixels?? 5?? 'light')
????*???????????
????* union2 (DarkPixels?? LightPixels?? RegionUnion1)
????* Extract connected components
????connection (DifPixels?? ConnectedRegions)
????*?????????????12??
????dev_set_colored (3)
????dev_display (Image)
????dev_display (ConnectedRegions)
????Message := 'Connected components after image segmentation'
????Message[1] := 'using a local threshold.'
????disp_message (WindowID?? Message?? 'window'?? 12?? 12?? 'black'?? 'true')
????disp_continue_message (WindowID?? 'black'?? 'true')
????* stop ()
????*
????* Step 3: Process regions
????*
????* Select large regions
????*??ConnectedRegions?е?????????5С??1000??????SelectedRegions.??????????????????????????
????select_shape (ConnectedRegions?? SelectedRegions?? 'area'?? 'and'?? 5?? 99999)
????dev_display (Image)
????dev_display (SelectedRegions)
????disp_message (WindowID?? 'Large Regions'?? 'window'?? 12?? 12?? 'black'?? 'true')
????disp_continue_message (WindowID?? 'black'?? 'true')
????* stop ()
????*
????* Visualize fractioned scratch
????*?????????????RowROI1??RowROI1??RowROI2??ColROI2?????????????????????F7??????????????
????*???????round(width/2)
????* open_zoom_window (0?? 0?? 2?? 303?? 137?? 496?? 3?? WindowHandleZoom)
????* dev_set_color ('blue')
????* dev_display (Image)
????* dev_display (SelectedRegions)
????* set_display_font (WindowHandleZoom?? 16?? 'mono'?? 'true'?? 'false')
????* disp_message (WindowHandleZoom?? 'Fractioned scratches'?? 'window'?? 12?? 12?? 'black'?? 'true')
????* disp_continue_message (WindowHandleZoom?? 'black'?? 'true')
????* stop ()
????*
????* Merge fractioned scratches via morphology
????*???SelectedRegions???????RegionUnion
????union1 (SelectedRegions?? RegionUnion)
????*??3.5????????????????????RegionUnion??????RegionDilation
????dilation_circle (RegionUnion?? RegionDilation?? 3.5)
????dev_display (Image)
????dev_display (RegionDilation)
????Message := 'Region of the scratches after dilation'
????disp_message (WindowID?? Message?? 'window'?? 12?? 12?? 'black'?? 'true')
????disp_continue_message (WindowID?? 'black'?? 'true')
????* stop ()
????*??RegionDilation???????Skeleton
????skeleton (RegionDilation?? Skeleton)
????connection (Skeleton?? Errors)
????dev_set_colored (12)
????dev_display (Image)
????dev_display (Errors)
????Message := 'Fractioned scratches merged via morphology'
????disp_message (WindowID?? Message?? 'window'?? 12?? 12?? 'black'?? 'true')
????disp_continue_message (WindowID?? 'black'?? 'true')
????* stop ()
????*
????* Distinguish small and large scratches
????* close_zoom_window (WindowHandleZoom?? Width?? Height)
????select_shape (Errors?? Scratches?? 'area'?? 'and'?? 50?? 10000)
????select_shape (Errors?? Dots?? 'area'?? 'and'?? 1?? 50)
????dev_display (Image)
????dev_set_color ('red')
????dev_display (Scratches)
????dev_set_color ('blue')
????dev_display (Dots)
????Message := 'Extracted surface scratches'
????Message[1] := 'Not categorized as scratches'
????*???????????????ò?????
????* disp_message (WindowID?? Message?? 'image'?? 440?? 310?? ['red'??'blue']?? 'true')
????*???洰?????????
????dump_window_image (Image?? WindowID)
????*??????????????
????write_image (Image?? 'jpeg 60'?? 0?? ('C:/Users/Administrator/Desktop/?????/Defect'+Index)+'.jpg')
????*?????????????????????
????dev_close_window ()
????stop()
????endfor
|
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
??????????????????Bug???????????????????????γ?????????????????????????????????????????????ж??????????????????????????????????????????Щ????ν??????????????????е???????????????????Ч????????????????????????ALM(??????????????)???????-??????????ALM(??????????????)???????-???????????ALM(??????????????)???????-?????????á????????ALM(??????????????)???????-????????????Bug????????????????????????????????????????????????JIRA??????????????????????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????