aar+halcon示例程序演示了如何通过连接指纹线的断开部分来使用一致性增强差异(coherence_enhancing_diff)来增强指纹图像
By
admin
at 2019-03-10 • 0人收藏 • 2678人看过
本贴halcon源程序位于
C:\Program Files\MVTec\HALCON-13.0\examples\hdevelop\Filters\Enhancement\coherence_enhancing_diff.hdev
原图:
增强之后效果:
移植到aardio中代码如下:
import win.ui; /*DSG{{*/ mainForm = win.form(text="aardio form";right=928;bottom=554) mainForm.add( button={cls="button";text="增强差异";left=794;top=28;right=928;bottom=98;z=1}; picturebox={cls="picturebox";left=0;top=-241;right=789;bottom=555;z=2} ) /*}}*/ import console console.open() //import com.activeX; import com.lite; import com; HOperatorSetX = com.CreateObject("{6ebd90e2-d219-11d2-ade5-0000c00f4ef9}") var WindowHandle; var Image; Image = HOperatorSetX.ReadImage( "C:\Users\popdes\Desktop\halcon1\res\fingerprint.png" ); var Width , Height = HOperatorSetX.GetImageSize( Image ); WindowHandle = HOperatorSetX.OpenWindow( 0 , 0 , mainForm.picturebox.width , mainForm.picturebox.height , mainForm.picturebox.hwnd,"transparent",""); HOperatorSetX.DispObj( Image , WindowHandle ); mainForm.button.oncommand = function(id,event){ var ImageCED = HOperatorSetX.CoherenceEnhancingDiff( Image , 0.5 , 4 , 0.5 , 50 ); HOperatorSetX.DispObj( ImageCED , WindowHandle ); } mainForm.enableDpiScaling(); mainForm.show(); return win.loopMessage();
原型如下:
void HOperatorSetX.CoherenceEnhancingDiff(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX** ImageCED, [in] VARIANT Sigma, [in] VARIANT Rho, [in] VARIANT Theta, [in] VARIANT Iterations)
该函数的功能:实现图像的相干增强扩散(多尺度纹理增强)
coherence_enhancing_diff 执行对输入图像的各向异性扩散过程来增加图像所包含的图像结构的连贯性。特别是,不连续的图像边缘连接的扩散,不平滑的垂直于其主导方向
上面的sigma,rho都与平滑和模糊图像有关,并且这两个参数影响纹理是否连接不间断,是否纹理较光滑Theta是迭代步长
Iterations 是迭代次数
登录后方可回帖