find_apriltags_3d_pose怎么矫正degrees(tag.y_rotation()输出的角度呢?
-
-
-
-
我测试数据是正常的。
请提供你的图片。# AprilTags Example # # This example shows the power of the OpenMV Cam to detect April Tags # on the OpenMV Cam M7. The M4 versions cannot detect April Tags. import sensor, image, time, math sensor.reset() sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QQVGA) # we run out of memory if the resolution is much bigger... sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must turn this off to prevent image washout... sensor.set_auto_whitebal(False) # must turn this off to prevent image washout... clock = time.clock() # Note! Unlike find_qrcodes the find_apriltags method does not need lens correction on the image to work. # What's the difference between tag families? Well, for example, the TAG16H5 family is effectively # a 4x4 square tag. So, this means it can be seen at a longer distance than a TAG36H11 tag which # is a 6x6 square tag. However, the lower H value (H5 versus H11) means that the false positve # rate for the 4x4 tag is much, much, much, higher than the 6x6 tag. So, unless you have a # reason to use the other tags families just use TAG36H11 which is the default family. # The AprilTags library outputs the pose information for tags. This is the x/y/z translation and # x/y/z rotation. The x/y/z rotation is in radians and can be converted to degrees. As for # translation the units are dimensionless and you must apply a conversion function. # f_x is the x focal length of the camera. It should be equal to the lens focal length in mm # divided by the x sensor size in mm times the number of pixels in the image. # The below values are for the OV7725 camera with a 2.8 mm lens. # f_y is the y focal length of the camera. It should be equal to the lens focal length in mm # divided by the y sensor size in mm times the number of pixels in the image. # The below values are for the OV7725 camera with a 2.8 mm lens. # c_x is the image x center position in pixels. # c_y is the image y center position in pixels. f_x = (2.8 / 3.984) * 160 # find_apriltags defaults to this if not set f_y = (2.8 / 2.952) * 120 # find_apriltags defaults to this if not set c_x = 160 * 0.5 # find_apriltags defaults to this if not set (the image.w * 0.5) c_y = 120 * 0.5 # find_apriltags defaults to this if not set (the image.h * 0.5) def degrees(radians): return (180 * radians) / math.pi while(True): clock.tick() img = sensor.snapshot() for tag in img.find_apriltags(fx=f_x, fy=f_y, cx=c_x, cy=c_y): # defaults to TAG36H11 img.draw_rectangle(tag.rect(), color = (255, 0, 0)) img.draw_cross(tag.cx(), tag.cy(), color = (0, 255, 0)) # Translation units are unknown. Rotation units are in degrees. img.draw_string(0,0,"Rx %f" % degrees(tag.x_rotation())) img.draw_string(0,10,"Ry %f" % degrees(tag.y_rotation())) img.draw_string(0,20,"Rz %f" % degrees(tag.z_rotation())) img.draw_string(0,90,"Rx %f" % tag.x_translation()) img.draw_string(0,100,"Ry %f" % tag.y_translation()) img.draw_string(0,110,"Rz %f" % tag.z_translation()) #print("Rx %f, Ry %f, Rz %f" % print_args) #print(clock.fps())
-
-
@kidswong999
我在Ry方向间隔10度变化一次,测得的Ry变化角度不对,请教该怎么调呢
-
Ry哪里不对??
-
三张图片里Ry的实际值分别应该是360.10.20左右,但测得的是360,15,30左右,就是说,第一张图片里Ry应该是20左右,第二张图片里应该是10左右才对
-
我怎么觉得这属于仪器的精度。
比如OpenMV的水平精度。apriltag的位置精度,角度你是用的什么仪器摆放的?
-
仪器精度误差没这么大,openmv固定还算准,Apriltag摆放角度是拿量角器量的,误差都没这么大。
你测得是准的嘛,你用的程序是上面那个吗,我试了试更离谱,难道我用的镜头不适用这俩程序?