Best function to analyze 2D mosquito position
Hi guys,
I've been findcontours on my webcam to map a 2-D position of mosquitoes in a chamber but the results are marginal.
Here's a snippet:
for (int i = 0; i < contours.size(); i++){
vector<Point> contour_poly;
approxPolyDP(Mat(contours[i]), contour_poly, 3, true);
//Simplifying the whole "contours[i].at(0)" thing
int x = contours[i].at(0).x, y = contours[i].at(0).y;
circle(current_frame, Point(x, y), 3, Scalar(0, 255, 0), 1, 8, 0);
}
Any other suggestions on more suitable functions out there?
Thanks. Vizier87
any image ?
Can you reliably binarize the image so only the mosquitoes are white and everything else is black?
pklab: Here's the picture: https://postimg.org/image/bm9uwhviv/
Sorry the quality is poor. This is a demo on using low-resolution cameras for low-cost projects.
Tetragramm: Yes I can use the threshold function but then the image is so occluded that I land into getting a lot of false points or getting nothing.
Umm. Which ones are the mosquitoes? I'm assuming they move? Try using the background subtractors. They should help you remove the background, so long as it's mostly stationary.
Thanks for the suggestion man.. They sometimes move, but most of the time they're stationary.
But the video feed is always like "noisy".. I don't know how to describe it.
Lemme play around with this function for a while.
you could get the background at start up and detect successive changes. BTW try to post 2 or 3 frames without scaling