当前位置:网站首页>About widthstep of images in opencv

About widthstep of images in opencv

2022-07-01 09:51:00 Full stack programmer webmaster

Hello everyone , I meet you again , I'm your friend, Quan Jun .

stay OpenCV Of IplImage In pointer structure , There is a member widthStep, How to determine this value , I've had a headache for a long time recently , Finally, I want to understand , Now?

Take it out and talk to you , Don't know if my idea is right , At least there was no error in my verification .

widthStep It should be equal to width*3, But because of 4 Byte alignment problem , Sometimes you need to fill in at the end of a line 1-3 Bytes , Now widthStep>width*3.

therefore , widthStep There are two ways to calculate the value of :

1. When (width*3)%4=0, At this time width*3=widthStep;

2. When (width*3)%4 !=0, here widthStep=(width/4+1)*3.

Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/131768.html Link to the original text :https://javaforall.cn

原网站

版权声明
本文为[Full stack programmer webmaster]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/182/202207010939143399.html