D
D
Daddy_Cool2019-04-11 10:37:14
Image processing
Daddy_Cool, 2019-04-11 10:37:14

How to calculate the area of ​​a figure (close to a circle) in a video or individual frames?

Good day everyone!
There is a video, you can make a storyboard.
There is a certain pulsating, clearly visible round luminous object in the video.
We need to calculate the area of ​​this video on each frame in order to know how this area changes depending on time.
Apparently, somehow the border should be selected, and then the pixels inside are counted.
If there is any software for this - please recommend, or if there is no ready-made one - maybe there is a library where there are functions for highlighting the border in the photo, calculating the area, etc. ... Then we will write our bike.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Skusnov, 2019-04-11
@AlexSku

Regionprops function in Matlab (Image Processeng Toolbox).

D
Denis, 2019-04-11
@D3Nd3R

I recommend using the Python + openCV bundle .
Since there are no examples of the image, I can’t help with the selection of the object.
The algorithm is as follows:
1. Select your object. (make images binary: 0 - background, 1 - object). For example, if your object is lighter than the background, then you can select cv2.threshold(img,127,255,cv2.THRESH_BINARY)
2a. If your object selection algorithm only selected the object, then just calculate the sum of the pixels.
2b. If there are false detections, then at the first stage you can pass the median filter (cv2.medianBlur(img,5)) or morphological discovery. These operations will help to get rid of small false detections.
3. Find contours cv2.findContours(...).
4. Filter out contours if there are false detections.
5. For the contour that matches your object, find the area. cv2.contourArea

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question