Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save PLY point clouds in all capture samples #8

Open
SatjaSivcev opened this issue Mar 17, 2020 · 0 comments
Open

Save PLY point clouds in all capture samples #8

SatjaSivcev opened this issue Mar 17, 2020 · 0 comments

Comments

@SatjaSivcev
Copy link
Contributor

SatjaSivcev commented Mar 17, 2020

For C++, C#, Python, all capture samples save to ZDF, which is not possible for Halcon (HDevelop). Then, we instead should save to PLY by default.

A function (Halcon procedure) to save ply is to be made that can be reused for conversion to simplify the code. Use the code from the CaptureSavePLY. The function should include the following lines:

<c>* Extracting the following images: X, Y, Z, SNR, and RGB</c>
<l>select_obj (Image, X, 1)</l>
<l>select_obj (Image, Y, 2)</l>
<l>select_obj (Image, Z, 3)</l>
<l>select_obj (Image, Confidence, 4)</l>
<l>select_obj (Image, RGB, 5)</l>
<c></c>
<c>* Transforming 3D points from X, Y, Z images to a HALCON 3D object model</c>
<l>xyz_to_object_model_3d (X, Y, Z, ObjectModel3D)</l>
<c></c>
<c>* Adding RGB data to the 3D point cloud</c>
<l>decompose3 (RGB, R, G, B)</l>
<c></c>
<l>get_domain (R, Domain)</l>
<l>get_region_points (Domain, Rows, Columns)</l>
<l>get_grayval (R, Rows, Columns, GrayvalR)</l>
<l>set_object_model_3d_attrib_mod (ObjectModel3D, 'red', 'points', GrayvalR)</l>
<c></c>
<l>get_domain (G, Domain)</l>
<l>get_region_points (Domain, Rows, Columns)</l>
<l>get_grayval (G, Rows, Columns, GrayvalG)</l>
<l>set_object_model_3d_attrib_mod (ObjectModel3D, 'green', 'points', GrayvalG)</l>
<c></c>
<l>get_domain (B, Domain)</l>
<l>get_region_points (Domain, Rows, Columns)</l>
<l>get_grayval (B, Rows, Columns, GrayvalB)</l>
<l>set_object_model_3d_attrib_mod (ObjectModel3D, 'blue', 'points', GrayvalB)</l>
<c></c>
<c>* Displaying 3D color point cloud, press the button to continue</c>
<l>dev_set_window (Window3D)</l>
<l>Instructions[0] := 'Rotate: Left button'</l>
<l>Instructions[1] := 'Zoom: Shift + left button'</l>
<l>Instructions[2] := 'Move: Ctrl + left button'</l>
<l>visualize_object_model_3d (Window3D, ObjectModel3D, [], [], ['red_channel_attrib','green_channel_attrib','blue_channel_attrib'], ['red','green','blue'], '', [], '', PoseOut)</l>
<c></c>
<c>* Writing a 3D object model in a PLY file format</c>
<l>write_object_model_3d (ObjectModel3D, 'ply', 'Zivid3DPLY.ply', ['invert_normals'], ['true'])</l>
with one exception: visualization should not be included.

That function is to be included in samples with capture (same ones in cpp that save to zdf), so Capture.hdev, CaptureHDR.hdev, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant