“线程:TDA4”中讨论的其它部件
您好,
当我测试640x480输入和640x480输出时,双耳隔振 的结果 是639/640 colulmn 和479/480行始终异常。 LUT 偏移量为零,在最右/最底部的列/行中,分次也为零。
添加两行/列填充(输入642x482,输出640x480)后 ,我可以获得正确的输出。
这是否意味着土发公司需要填充? 或者我错过 了被 LUT 访问两个最右/最底部的列/行的请求?
此致,
威尔逊。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
您好,
当我测试640x480输入和640x480输出时,双耳隔振 的结果 是639/640 colulmn 和479/480行始终异常。 LUT 偏移量为零,在最右/最底部的列/行中,分次也为零。
添加两行/列填充(输入642x482,输出640x480)后 ,我可以获得正确的输出。
这是否意味着土发公司需要填充? 或者我错过 了被 LUT 访问两个最右/最底部的列/行的请求?
此致,
威尔逊。
您好,威尔逊,
您的 LUT 的大小应为“ceil (W/2^m +1)”x“ceil (H/2^m +1)”,并且应在边界处保持连续。
从某种意义上讲,我们对 LUT 而非输入图像进行了分页。
如果您有更多详细信息,请参阅《TDA4 LDC 常见问题解答》 :e2e.ti.com/.../faq-tda4vm-how-to-create-a-ldc-mesh-lut-for-fisheye-distortion-correction-on-tda4
最佳
耙串
你好,Gang,
边界值仍然异常。 可以查看我的代码吗?
//mesh param
tivx_vpac_ldc_mesh_params_init(&mesh_param_);
mesh_param_.mesh_frame_width = output_info_.width;
mesh_param_.mesh_frame_height = output_info_.height;
mesh_param_.subsample_factor = 0; //no sub sampling.
//mesh image creation
uint32_t lut_w = (uint32_t)ceil(mesh_param_.mesh_frame_width/pow(2.0, mesh_param_.subsample_factor)) + 1u;
uint32_t lut_h = (uint32_t)ceil(mesh_param_.mesh_frame_height/pow(2.0, mesh_param_.subsample_factor)) + 1u;
mesh_ = vxCreateImage(context_, lut_w, lut_h, VX_DF_IMAGE_U32);
//LUT copy
uint32_t w, h;
w = output_info_.width;
h = output_info_.height;
/* Mesh copy*/
vx_rectangle_t rect;
rect.start_x = 0;
rect.start_y = 0;
rect.end_x = w;
rect.end_y = h;
vx_imagepatch_addressing_t image_addr;
image_addr.dim_x = w;
image_addr.dim_y = h;
image_addr.step_x = 1;
image_addr.step_y = 1;
image_addr.stride_x = 4u;
image_addr.stride_y = w*4u;
int32_t status;
status = vxCopyImagePatch(mesh_, &rect, 0, &image_addr,
(uint8_t*)mesh_table_.get(),
VX_WRITE_ONLY, VX_MEMORY_TYPE_HOST);
此致,
威尔逊。
你好,Gang,
感谢您的澄清。
我 还有一个问题。
我可以使用以下 Y 平面代码获得一些精确结果。
inline uint8_t bilinear_Q_3(uint8_t p00, uint8_t p10, uint8_t p01, uint8_t p11, uint8_t x_frac, uint8_t y_frac) {
uint32_t p00_q6 = p00*(8u-x_frac)*(8u-y_frac);
uint32_t p10_q6 = p10*( x_frac)*(8u-y_frac);
uint32_t p01_q6 = p01*(8u-x_frac)*( y_frac);
uint32_t p11_q6 = p11*( x_frac)*( y_frac);
return (uint8_t)((p00_q6+p10_q6+p01_q6+p11_q6+0x20u) >> 6u);
}
但它不能用于紫外线面,我发现下面的代码可以产生一些精确的结果。 您能否指导 LDC 为何对 Y/UV 使用不同的内插?
inline uint8_t bilinear_uv(uint8_t p00, uint8_t p10, uint8_t p01, uint8_t p11, uint8_t x_frac, uint8_t y_frac) {
uint32_t p00_q6 = p00*(16u-x_frac)*(16u-y_frac);
uint32_t p10_q6 = p10*( x_frac)*(16u-y_frac);
uint32_t p01_q6 = p01*(16u-x_frac)*( y_frac);
uint32_t p11_q6 = p11*( x_frac)*( y_frac);
return (uint8_t)((p00_q6+p10_q6+p01_q6+p11_q6+0x80u) >> 8u);
}
此致,
威尔逊。