当前位置:网站首页>Halcon knowledge: gray_ Tophat transform and bottom cap transform

Halcon knowledge: gray_ Tophat transform and bottom cap transform

2022-07-06 12:43:00 Mr anhydrous

One 、 Basic concepts

         For the situation that the light change of the image is large , There are problems in binarization ; This effect can be eliminated by using the top hat principle and then binarized , It can eliminate this light effect .

         The principle is as follows :

         Region open operation , It only produces complex results at places with many edges or lines . In the open area, the data remains unchanged . therefore , Subtract from the original , Can eliminate the gray scale of open areas , Uneven illumination will offset each other .

        The remaining subtraction retains information , It can be almost in the background 0 Under the condition of , Perform binary segmentation .

Two 、 Introduction to parameters and operators

gray_tophat Have structural elements for SE The input image of Image Apply gray value top hat transformation .

Structural elements SE The image type of must be the same as the input image Image Match the image type of .

Have structural elements s Image i The gray value top hat transformation of is defined as :

                tophat(i,s)=i-(ios) 

That is, the difference between images and s The open operation of ( See gray_opening). About the generation of structural elements , Please see the read_gray_se. Top hat transformation is particularly fast for planar structural elements , That is, the structural element with constant gray level in its domain .

  • gray_opening( Image, SE : ImageOpening : :  )
  • gen_disc_se (SE, 'real', 30, 30, 0)

3、 ... and 、 Reference code

read_image (MreutDem, 'mreut_dgm_2.0')
gen_disc_se (SE, 'real', 30, 30, 0)
gray_tophat (MreutDem, SE, ImageTopHat)
threshold (ImageTopHat, High, 4, 1000)
zoom_region (High, HighZoomed, 8, 8)
move_region (HighZoomed, HighZoomedMoved, -250, -600)
clip_region (HighZoomedMoved, HighAreas, 0, 0, 511, 511)
dev_display (Mreut)
dev_display (HighAreas)
disp_continue_message (WindowHandle, 'black', 'true')
stop ()

Four 、 Experimental results

 

 

 

原网站

版权声明
本文为[Mr anhydrous]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131513513436.html