how to set CSI module parameter if want to crop the image captured from sensor

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

how to set CSI module parameter if want to crop the image captured from sensor

跳至解决方案
2,718 次查看
zhshuangp
Contributor II

Hi guys,

I am using the csi module to capture video, but the image outputted from sensor is special, the first 24 rows are invalid, we need to skip it, please see the image attached, so we just want to config the corresponding registers of CSI module to work around it, such as IPUx_CSI0_SENS_CONF, IPUx_CSI0_SENS_FRM_SIZE, IPUx_CSI0_ACT_FRM_SIZE, IPUx_CSI0_OUT_FRM_CTRL and so on. but we do not know how to set those registers in detail, can you help us ?

for example, if the actual image size we want to captured is 1280x720, should we set the sensor frame size is 1280x744 ?

in the csi driver code you provided, we found the following three variables, why three necessary ?

/* crop */
struct v4l2_rect crop_bounds;
struct v4l2_rect crop_defrect;
struct v4l2_rect crop_current;

because the v4l2 standard structure only have two variables, what the difference btw them ?
/*
* I N P U T I M A G E C R O P P I N G
*/
struct v4l2_cropcap {
__u32 type; /* enum v4l2_buf_type */
struct v4l2_rect bounds;
struct v4l2_rect defrect;
struct v4l2_fract pixelaspect;
};

标签 (1)
0 项奖励
回复
1 解答
2,611 次查看
zhshuangp
Contributor II

Thanks for your replay.

we have get the answer, just change the csi driver as follow.

for example, the unmodified image size is 1280x(720+24), the output image is 1280x720, just config the register like this.

CSI_SENS_FRM_SIZE, 1280x744;

CSI_ACT_FRM_SIZE, 1280x720

CSI_OUT_FRM_CTRL, left = 0, top = 24.

在原帖中查看解决方案

0 项奖励
回复
2 回复数
2,611 次查看
igorpadykov
NXP Employee
NXP Employee

Hi

please check crop_ex1 example on

https://community.freescale.com/docs/DOC-94961

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
2,612 次查看
zhshuangp
Contributor II

Thanks for your replay.

we have get the answer, just change the csi driver as follow.

for example, the unmodified image size is 1280x(720+24), the output image is 1280x720, just config the register like this.

CSI_SENS_FRM_SIZE, 1280x744;

CSI_ACT_FRM_SIZE, 1280x720

CSI_OUT_FRM_CTRL, left = 0, top = 24.

0 项奖励
回复