2019-11-29 06:53:18 -0600 | asked a question | Setting codec parameters with FFMPEG backend Setting codec parameters with FFMPEG backend I am using OpenCV's VideoWriter to record videos with FFMPEG. I am using th |
2015-08-14 05:43:25 -0600 | commented answer | Creating a sub array of a Mat throws assertion error You see, my problem is, that if you have the following code for example: Then you are accessing pixels using (row, column) not (column, row). UPDATE: I have just done some simple drawings, which resulted in exactly what you said, the origin is at the top left corner, and coordinates can be accessed using (column, row). Considering this, you see, why it is confusing, in my code, you can access pixels using (row, column) |
2015-08-13 13:23:32 -0600 | commented answer | Creating a sub array of a Mat throws assertion error What I don't understand is, that OpenCV has the (0,0) coordinate at the upper left corner, the first coordinate is for the row, the second is for the column, and the Rect function asks for an x coordinate first, then a y, so it should ask for the row first. Yet, it works only, when I provide the column first. Or am I missing out on something? |
2015-08-13 10:56:12 -0600 | commented answer | Creating a sub array of a Mat throws assertion error You are right, now I just don't understand why they would mark the y coordinate with x and vice versa... |
2015-08-13 10:39:12 -0600 | commented answer | Creating a sub array of a Mat throws assertion error Thank you, but unfortunately this does not solve my problem. |
2015-08-13 10:03:47 -0600 | asked a question | Creating a sub array of a Mat throws assertion error Hey there, In my program, I am looping through a 2D Mat, using a rectangle with width 5 and height 1, and checking float point values in this sub array. My code goes as follow: My original picture has size 640*363. When the first loop reached the value i = 359, I get an assertion error:
As far as I can tell, the problem is, that when i = 359, roi.x = 359, roi. width = 5 and so roi.x + roi.width = 364, and m.cols = 363 and so 364 <= 363 is false. My first question is, am I doing something wrong here? My second question, why the hell would the number of rows matter when it comes to deciding if the number of columns in the sub array is not greater, than the number of columns in the original image. Thank you for your help. Also, sorry if I have left something important out. |