<?xml version="1.0" encoding="UTF-8"?>
|
<hdevelop file_version="1.1" halcon_version="12.0">
|
<procedure name="Go2GenTL_ParseData">
|
<interface>
|
<io>
|
<par name="Image" base_type="iconic" dimension="0"/>
|
</io>
|
<oo>
|
<par name="HeightMap" base_type="iconic" dimension="0"/>
|
<par name="Intensity" base_type="iconic" dimension="0"/>
|
</oo>
|
<ic>
|
<par name="Index" base_type="ctrl" dimension="0"/>
|
</ic>
|
<oc>
|
<par name="FrameCount" base_type="ctrl" dimension="0"/>
|
<par name="Timestamp" base_type="ctrl" dimension="0"/>
|
<par name="EncoderPosition" base_type="ctrl" dimension="0"/>
|
<par name="EncoderIndex" base_type="ctrl" dimension="0"/>
|
<par name="Inputs" base_type="ctrl" dimension="0"/>
|
<par name="xOffset" base_type="ctrl" dimension="0"/>
|
<par name="xResolution" base_type="ctrl" dimension="0"/>
|
<par name="yOffset" base_type="ctrl" dimension="0"/>
|
<par name="yResolution" base_type="ctrl" dimension="0"/>
|
<par name="zOffset" base_type="ctrl" dimension="0"/>
|
<par name="zResolution" base_type="ctrl" dimension="0"/>
|
<par name="Width" base_type="ctrl" dimension="0"/>
|
<par name="Length" base_type="ctrl" dimension="0"/>
|
<par name="HasIntensity" base_type="ctrl" dimension="0"/>
|
<par name="NumScans" base_type="ctrl" dimension="0"/>
|
</oc>
|
</interface>
|
<body>
|
<l>count_channels (Image, channelCount)</l>
|
<c>* </c>
|
<l>if (channelCount = 1)</l>
|
<c> * </c>
|
<l> get_image_size (Image, monoImageWidth, monoImageHeight)</l>
|
<l> crop_rectangle1 (Image, Stamps, monoImageHeight - 1, 0, monoImageHeight-1, monoImageWidth)</l>
|
<c> * </c>
|
<l> Go2GenTLStamp (Stamps, 1, FrameCount)</l>
|
<l> Go2GenTLStamp (Stamps, 2, Timestamp)</l>
|
<l> Go2GenTLStamp (Stamps, 3, EncoderPosition)</l>
|
<l> Go2GenTLStamp (Stamps, 4, EncoderIndex)</l>
|
<l> Go2GenTLStamp (Stamps, 5, Inputs)</l>
|
<l> Go2GenTLStamp (Stamps, 6, xOffset)</l>
|
<l> Go2GenTLStamp (Stamps, 7, xResolution)</l>
|
<l> Go2GenTLStamp (Stamps, 8, yOffset)</l>
|
<l> Go2GenTLStamp (Stamps, 9, yResolution)</l>
|
<l> Go2GenTLStamp (Stamps, 10, zOffset)</l>
|
<l> Go2GenTLStamp (Stamps, 11, zResolution)</l>
|
<l> Go2GenTLStamp (Stamps, 12, Width)</l>
|
<l> Go2GenTLStamp (Stamps, 13, Length)</l>
|
<l> Go2GenTLStamp (Stamps, 14, HasIntensity)</l>
|
<l> Go2GenTLStamp (Stamps, 15, NumScans)</l>
|
<c> * </c>
|
<c> * * Mono output does not support multiple heightmaps, assuming index is 0</c>
|
<l> crop_rectangle1 (Image, HeightMap, 0, 0, Length - 1, Width)</l>
|
<l> if (HasIntensity = 1)</l>
|
<l> IntensityPosition := (monoImageHeight - 1)/2</l>
|
<l> crop_rectangle1 (Image, Intensity, IntensityPosition, 0, IntensityPosition + Length - 1, Width)</l>
|
<l> else</l>
|
<l> gen_image_const (Intensity, 'byte', Width, Length)</l>
|
<l> endif</l>
|
<c> * </c>
|
<l>elseif (channelCount = 3)</l>
|
<c> * </c>
|
<l> decompose3 (Image, HeightMap, Intensity, Stamps)</l>
|
<c> * </c>
|
<l> Go2GenTLStamp (Stamps, 1, FrameCount)</l>
|
<l> Go2GenTLStamp (Stamps, 2, Timestamp)</l>
|
<l> Go2GenTLStamp (Stamps, 3, EncoderPosition)</l>
|
<l> Go2GenTLStamp (Stamps, 4, EncoderIndex)</l>
|
<l> Go2GenTLStamp (Stamps, 5, Inputs)</l>
|
<l> Go2GenTLStamp (Stamps, 6, xOffset)</l>
|
<l> Go2GenTLStamp (Stamps, 7, xResolution)</l>
|
<l> Go2GenTLStamp (Stamps, 8, yOffset)</l>
|
<l> Go2GenTLStamp (Stamps, 9, yResolution)</l>
|
<l> Go2GenTLStamp (Stamps, 10, zOffset)</l>
|
<l> Go2GenTLStamp (Stamps, 11, zResolution)</l>
|
<l> Go2GenTLStamp (Stamps, 12, Width)</l>
|
<l> Go2GenTLStamp (Stamps, 13, Length)</l>
|
<l> Go2GenTLStamp (Stamps, 14, HasIntensity)</l>
|
<l> Go2GenTLStamp (Stamps, 15, NumScans)</l>
|
<c> * </c>
|
<c> * * Split Height Map</c>
|
<l> start := Index * (Length)</l>
|
<l> end := (Index+1) * (Length)</l>
|
<c> * </c>
|
<l> if (NumScans > Index)</l>
|
<l> crop_rectangle1 (HeightMap, HeightMap, start, 0, end, Width)</l>
|
<l> if (HasIntensity = 1)</l>
|
<l> crop_rectangle1 (Intensity, Intensity, start, 0, end, Width)</l>
|
<l> endif</l>
|
<l> endif</l>
|
<c> * </c>
|
<l>endif</l>
|
<c>* </c>
|
<c>* * Change Offset and resolution back to floating point and described in mm</c>
|
<l>xOffset := xOffset / 1000000.0</l>
|
<l>yOffset := yOffset / 1000000.0</l>
|
<l>zOffset := zOffset / 1000000.0</l>
|
<l>xResolution := xResolution / 1000000.0</l>
|
<l>yResolution := yResolution / 1000000.0</l>
|
<l>zResolution := zResolution / 1000000.0</l>
|
<c>* </c>
|
<l>return ()</l>
|
</body>
|
<docu id="Go2GenTL_ParseData">
|
<parameters>
|
<parameter id="EncoderIndex"/>
|
<parameter id="EncoderPosition"/>
|
<parameter id="FrameCount"/>
|
<parameter id="HasIntensity"/>
|
<parameter id="HeightMap"/>
|
<parameter id="Image"/>
|
<parameter id="Index"/>
|
<parameter id="Inputs"/>
|
<parameter id="Intensity"/>
|
<parameter id="Length"/>
|
<parameter id="NumScans"/>
|
<parameter id="Timestamp"/>
|
<parameter id="Width"/>
|
<parameter id="xOffset"/>
|
<parameter id="xResolution"/>
|
<parameter id="yOffset"/>
|
<parameter id="yResolution"/>
|
<parameter id="zOffset"/>
|
<parameter id="zResolution"/>
|
</parameters>
|
</docu>
|
</procedure>
|
</hdevelop>
|