2020-06-03 11:33:30 -0600 | received badge | ● Popular Question (source) |
2017-05-05 14:29:28 -0600 | asked a question | How can I use time as my file name and have the save function in a class Hello, I'm trying to use time as my filename header but can't time to get it functioning. and then also want it in class but I couldn't get that working. This is my current code to get it tried using then for saving using a class, I used the following code when writing a file was working. I tried putting the variables in the brackets but it didn't agree with (h, w). I'm also not too sure how to call the function. Thanks in advance! |
2017-05-03 10:03:53 -0600 | commented answer | fps - how to divide count by time function to determine fps Sweet thanks! I changed it for python and got the following results which dont seem correct to me... 11877917107929 1000000000.0 |
2017-05-03 08:03:50 -0600 | asked a question | fps - how to divide count by time function to determine fps Hello, I have a counter working that counts every frame. what I want to do is divide this by time to determine the FPS of my program. But I'm not sure how to perform operations on timing functions within python. I've tried initializing time as Then for calculating the fps, But errors I'm getting are object is not callable or unsupported operand for /: 'int' and 'buildin functions' |
2017-05-02 12:35:54 -0600 | commented question | OpenCV speed tracker logic / formula I was able to get arclength working after some trial and error and could calculate the diameter! now the problem is that the diameter is constantly changing as the video detects the contours. I want to input the first 5 values into a np.array and calculate the mean to use as my object size. But I'm having difficulty setting the array up to only contain 5 values. I've tried putting (5), a data type and also using .shape but having no luck. Also, once the array is filled. will these values be maintained in there or be replaced with new values entering array? @LBerger |
2017-05-02 12:25:54 -0600 | commented answer | camera calibration - tracking object distance the ball in this project will only be traveling up and down in this project so that'll work perfectly. I was able to get arclength working after some trial and error and could calculate the diameter! now the problem is that the diameter is constantly changing as the video detects the contours. I want to input the first 5 values into a np.array and calculate the mean to use as my object size. But I'm having difficulty setting the array up to only contain 5 values. I've tried putting (5), a data type and also using .shape but having no luck. Also, once the array is filled. will these values be maintained in there or be replaced with new values entering array? @Tetragramm |
2017-05-01 09:44:33 -0600 | commented question | OpenCV speed tracker logic / formula Okay, how can I calculate the size of a contour? @LBerger |
2017-04-30 16:54:30 -0600 | asked a question | OpenCV speed tracker logic / formula Hello, My aims are to create a tracker that tracks a coloured ball and outputs its speed. I'm new at programming and can't get my head around the logic or functions needed to calculate the speed. So far I've got my code to:
I want to implement (space in http, as i cant publish links) h ttp://www.pyimagesearch.com/2015/09/21/opencv-track-object-movement/ for the speed detection. in that code it uses the previous coordinates to determine the direction it's travelling in. I want to use the data from the previous points to calc speed. this is a snip of the code storing the coordinates and determining direction I've calibrated my camera and know the px/mm of my pi. So say my ball is 10cm, in the video capture its size is 100px. 10px is 1cm at its current distance from the camera. What I can't figure out what to do is calculate the size of the contour found, I tried using: but from that got: 'is not a numpy array neither a scalar error' , I tried creating an array for cnt and also putting area in where cnt is declared, no luck though. And then the next step, making use of the coordinates to calculate speed. the ball will going up and down but it won't be in a perfectly straight line. If I know the frames per second and use this as my time, say its 20fps, count to 40, 2 seconds then perform the speed formula. Now how would I determine the pixels the tracker has travelled in the 40 frames? Thanks in advance, its really appreciated! |
2017-04-30 10:40:31 -0600 | commented answer | camera calibration - tracking object distance brilliant thanks you! My end goal is to track the speed of the ball. If I determine the size of the ball in pixels can I use that to calculate speed? say the ball is 10cm in real life, in the video stream its 100px meaning that 10px is the equivalent of 1 cm. If I can find the distance moved per frame, can I use this info to calculate speed? I can detect the ball but I'm not sure how to determine the balls pixel size.. @Tetragramm |
2017-04-29 05:13:37 -0600 | asked a question | camera calibration - tracking object distance Hello, I'm trying to calibrate my camera so I can eventually figure how far an object is away from the camera. I've been following this question to detail the equation for figuring distance of an object but don't have enough reputation to comment or enough to publish a link so there's a space in http: h ttp://stackoverflow.com/questions/14038002/opencv-how-to-calculate-distance-between-camera-and-object-using-image there are a couple things I'm unsure about, my matrix after running the calibrate.py with 30 or so photos, ran it another time with a different set of photos and got pretty much the same results. in the other forum, the matrix was built for a iPhone 5S camera, the f_x and f_y results were 2.8036 but written down as: why was it multiplied by 1000? should mine be as followed then?: The further down to calculate pixels in a lower-resolution the object is calculated to be 41 pixels. I've got code working to track a blue ball, shown below. what do I need to do to calculate the size of ball? Thanks for your help!! |
2017-04-26 13:27:56 -0600 | asked a question | How to stop deque / tracker when it reaches heights point I'm new at coding and trying to get an opencv project working but can't get my head around a couple things. My aim is to create a barbell tracker, I want the code to track the barbell or the colour till it reaches the highest point in its journey. Using the distance from start to finish I want to calculate velocity. So far I can get my code
Firstly I would like the deque or tracker to stop when the reaches the height point in its journey. What I can't get my head around is the criteria and logic for it to stop adding to the line/coordinates of the queue being used to track the colour? Any help would be greatly appreciated |
2017-04-05 05:05:33 -0600 | received badge | ● Enthusiast |
2017-04-02 05:03:08 -0600 | commented question | NoneType attribute error, no object shape & omxplayer unable to play video Any idea derak? |
2017-03-31 13:43:13 -0600 | commented question | NoneType attribute error, no object shape & omxplayer unable to play video I'm trying to output the build information as its shown in terminal but I'm not sure how to stop it from grouping? |
2017-03-31 13:02:25 -0600 | received badge | ● Editor (source) |
2017-03-31 11:56:21 -0600 | asked a question | NoneType attribute error, no object shape & omxplayer unable to play video Hello, I'm trying to get the following working Build Information: (more) |