当前位置:网站首页>Halcon knowledge: an attempt of 3D reconstruction
Halcon knowledge: an attempt of 3D reconstruction
2022-07-02 00:03:00 【Mr anhydrous】
summary
Try a three-dimensional reconstruction method , It's not mature yet , But as a long-term research topic , It is necessary to record the process truthfully , For memo . Or continue to study on this cornerstone in the future .
One 、 Generate grayscale slope
- gen_image_surface_first_order( : ImageSurface : Type, Alpha, Beta, Gamma, Row, Column, Width, Height : )
operator gen_image_surface_first_order According to the following equation , Create an oblique grayscale surface :
ImageSurface(r,c) = Alpha(r - Row) + Beta(c - Column) + Gamma
The size of the image depends on the width and height . Parameters Row and Column Defines the reference point of the gray surface created . The type of gray value is Type( A detailed description of the pixel type , Please see the gen_image_const). The gray value outside the effective area is trimmed .
Such as : The following code
gen_image_surface_first_order(Surface,'uint2',0.3, 0.7, 10, 100, 100,512,512 )
In the picture above , On the left is the generated slope image , On the right is the gray plane equation .
Two 、 Block cutting of image
- crop_rectangle1(Image : ImagePart : Row1, Column1, Row2, Column2 : )
Operator crop_rectangle1 Cut one or more rectangular areas from each input image . These areas are represented by rectangles , Rectangles are defined by the coordinates of their upper left and lower right corners . The upper left corner must be within the image . On the right and bottom , The rectangle may extend beyond the image , But the field of the output image is set to contain only the part that can be exported from the input image . If the rectangular area falls within the image , Then each generated image has the size of its corresponding rectangle .
3、 ... and 、 Convert the data type of the image
- convert_image_type (ZMap, ImageMeasureReal, 'real')
The image ZMap Data type changes , Generate ImageMeasureReal Images .
Four 、 Power function of tuples
- tuple_pow( : : T1, T2 : Pow)
tuple_pow Calculate input tuples T1^{T2} The power function of . If two tuples have the same length , Then the power function will be applied to the corresponding elements of two tuples . otherwise ,T1 or T2 The length of must be 1. under these circumstances , Perform a power function on each element of a longer tuple and a single element of another tuple . The result is always a floating point number . Power functions of strings are not allowed .
5、 ... and 、 Image gray linear transformation
- scale_image(Image : ImageScaled : Mult, Add : )
Operator scale_image Scale the input image by the following transformation (Image):
g' := g * mult + add
If overflow or underflow occurs , Values will be clipped . Please note that , Cycle and direction images are not the case .
for example , You can apply this operator to the gray value of the image ( That's the interval [GMin,GMax]) Map to the maximum range [0:255]. So , The parameter selection is as follows :
6、 ... and 、 3D image generation
- xyz_to_object_model_3d(X, Y, Z : : : ObjectModel3D)
Operator xyz_to_object_model_3d Will include 3D Dot X、Y and Z The image triples of coordinates are converted to 3D The object model . Use only points in the intersection domain of all three images . stay ObjectModel3D Returns the created 3D Handle to the object model . Created 3D The object model contains the coordinates of the points , And include each 3D Mapping attributes of the original row and column of the point . One of the coordinates is infinite or “ The digital ”(NaN) Points of will be ignored and will not be added to 3D In the object model .
Please note that , If it is no longer needed or should be covered 3D The object model , You must first call the operator clear_object_model_3d Free memory .
Create an oblique gray surface using first-order polynomials .
7、 ... and 、 Sample code
read_image (Image, 'E:/Image/257.png')
get_image_size (Image, Width, Height)
threshold (Image, Regions, 30058, 39762)
reduce_domain (Image, Regions, ImageReduced1)
NumberOfZILCaptured :=1000 // Set the number of acquisition rows to 1000
ZILLatRes :=0.056
ZILVerRes :=0.0085
TransportRate := 0.1
* select XYZ Noodles
* Create a X Noodles
gen_image_surface_first_order (PointCloudX, 'real', TransportRate, 0, 0, NumberOfZILCaptured / 2, Width / 2, Width, NumberOfZILCaptured)
* Create a Y Noodles
gen_image_surface_first_order (PointCloudY, 'real', 0, ZILLatRes, 0, NumberOfZILCaptured / 2, Width / 2, Width, NumberOfZILCaptured)
* Convert image to area
crop_rectangle1 (ImageReduced1, ZMap, 0, 0, NumberOfZILCaptured - 1, Width-1) // Cut out one or more rectangular image areas
convert_image_type (ZMap, ImageMeasureReal, 'real') // Convert image type
get_image_size (ImageMeasureReal, zMap_Width, zMap_Height)
gen_image_const (ImageGray, 'real', zMap_Width, zMap_Height) // Create an image with a constant gray value
threshold (ImageMeasureReal, Region_Valid, 1, 9999999)
tuple_pow (2, 15, hv_offset)
scale_image (ImageMeasureReal, ImageGray, ZILVerRes, -hv_offset * ZILVerRes) // Scale grayscale values
* select Z Noodles
reduce_domain (ImageGray, Region_Valid, PointCloudZ)
* X、Y、Z Facet composition Object object
xyz_to_object_model_3d (PointCloudX, PointCloudY, PointCloudZ, ObjectModel3D)
GenParaName:=[ 'lut', 'color_attrib', 'alpha', 'disp_pose']
GenParaValue:=['color1', 'coord_z', 0.5, 'true']
visualize_object_model_3d (WindowHandle, ObjectModel3D, [], [], GenParaName, GenParaValue, [], [], [], PoseOut)
边栏推荐
- SecurityUtils.getSubject().getPrincipal()为null的问题怎么解决
- Windows 7 install MySQL error: 1067
- 2021 robocom world robot developer competition - preliminary competition of undergraduate group
- Use the htaccess file to prohibit the script execution permission in the directory
- Is it safe to buy funds on Great Wall Securities?
- cookie、session、tooken
- Windows installation WSL (II)
- mysql之B tree 以及 B+tree
- 【ES实战】ES上的安全性运行方式
- MySQL Replication中并行复制怎么实现
猜你喜欢
随机推荐
华为HMS Core携手超图为三维GIS注入新动能
Soft exam information system project manager_ Compiled abbreviations of the top ten management processes to help memory recitation - -- software test advanced information system project manager 054
Download the online video m3u8 tutorial
- Oui. Env. Fichier XXX, avec constante, mais non spécifié
SecurityUtils. getSubject(). How to solve the problem that getprincipal() is null
USB-IF协会与各种接口的由来
Leetcode96 different binary search trees
Kubernetes resource object introduction and common commands (III)
JPA handwritten SQL, received with user-defined entity classes
Selectively inhibiting learning bias for active sampling
牛客-练习赛101-推理小丑
ADO. Net SqlDataAdapter object
RPA tutorial 01: Excel automation from introduction to practice
在长城证券上买基金安全吗?
Shell process control
TS initial use, TS type
PWN attack and defense world cgpwn2
Windows 7 安装MYSQL 错误:1067
回顾数据脱敏系统
LDR6035智能蓝牙音响可对手机设备持续充放电方案