情報詳細Q:3Dセンサーから得られた高さ画像が傾いていたり、歪んでいたりします。HALCONで高さ画像を補正する方法はありますか?A:1次補正:fit_surface_first_orderで傾きの補正。2次補正:fit_surface_second_orderで歪みの補正ができます。弊社製品Gocatorのデータを使ったときのサンプルコードが下記になりますが、該当の箇所はintensity以下になります。===============サンプルソース====================read_image (Image, 'image')Go2GenTL_ParseData (Image, HeightMap, Intensity, frameCount, timestamp, encoderPosition, encoderIndex, inputs, xOffset, xResolution, yOffset, yResolution, zOffset, zResolution, width, height, hasIntensity)convert_image_type (HeightMap, ImageConverted, 'real')scale_image (ImageConverted, ImageScaled, zResolution, zOffset)get_image_size (HeightMap, Width, Height)dev_close_window ()dev_open_window (0, 0, Width*0.25, Height*0.25, 'black', WindowHandle)dev_display(ImageScaled)*Z画像で対象物のある領域を切り出すthreshold (ImageScaled, Regions, -49.43, 100)fill_up (Regions, RegionFillUp1)reduce_domain (ImageScaled, RegionFillUp1, ImageReduced)*対象物のある領域の平均高さを算出intensity (Regions, ImageReduced, Mean, Deviation)reduce_domain (ImageScaled, RegionFillUp1, ImageSub)*平面補正1次 (全体の傾きを補正)fit_surface_first_order (Regions, ImageReduced, 'huber', 5, 3, Alpha1, Beta1, Gamma1)gen_image_surface_first_order (ImageSurface1, 'real', Alpha1, Beta1, Gamma1, Height/2, Width/2, Width, Height)sub_image (ImageReduced, ImageSurface1, ImageSub1, 1, Mean)*平面補正2次 (局所的な勾配を補正)fit_surface_second_order (Regions, ImageSub1, 'huber', 5, 2, Alpha, Beta, Gamma, Delta, Epsilon, Zeta)gen_image_surface_second_order (ImageSurface, 'real', Alpha, Beta, Gamma, Delta, Epsilon, Zeta, Height/2, Width/2, Width, Height)*平面補正の際、平均高さをオフセットとする。sub_image (ImageSub1, ImageSurface, ImageSub, 1, Mean)==========================================添付ファイルタイトルHALCON:Gocatorの高さ画像など、高さ画像の傾きを補正する方法URL 名000004803公開状況公開済み検証状況公開済み