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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
680 Views
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;
};

Labels (1)
0 Kudos
1 Solution
573 Views
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.

View solution in original post

0 Kudos
2 Replies
573 Views
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 Kudos
574 Views
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 Kudos