I am building a vision system that can count boxes moving on a conveyor belt at a variable speed.
Using open_cv and C ++, I could separate the drops and extract the corresponding centroids.
Now I need to increase the counter if the centroid crosses the cutoff boundary line.
Please view the screenshots for greater clarity (three frames marked with thresholds and centroids):
This is where I am stuck. I tried 2 options.
I tried something like
centroid_prev = centroid_now; centroid_now = posX; if (centroid_now >= xLimit && centroid_prev < xLimit) { count++; }
This works great if there is only one box on the conveyor.
, .
, blob , ?
PS. 50 , , .
, , , , , - . , , - goodFeaturesToTrack calcOpticalFlowPyrLK ., , , , . , , X .
goodFeaturesToTrack
calcOpticalFlowPyrLK
(< 100), , .
? OpenCV . ( , , .)
: 5-10 , .
. , -
for(i=0; i<centroid.length; i++) centroid_prev[i] = centroid[i].posX; for(frame j=0 to ...) { ... recompure centroids for(i=0; i<centroid.length; i++) { centroid_now = centroid[i].posX; if (centroid_now >= xLimit && centroid_prev[i] < xLimit) { count++; } } for(i=0; i<centroid.length; i++) centroid_prev[i] = centroid[i].posX; }// end j
-
( ), , ββ , .
Source: https://habr.com/ru/post/1621932/More articles:Automation of drilling material Chapter 6 Desktop printer is almost ready - pythonUsing SAML statement in XSD - javaDefine in onActivityResult if image from gallery or video is selected - Android - androidAndroid How to determine media type in onActivityResult ()? - androidGoogle API plus iOS API for share preloading data is out of date, which is an alternative - iosFirefox Push API - AbortError: Failed to receive push subscription - web-pushRecyclerView adapter repeats values ββin wrong places - androidWhat does "$ <$ : Release>" mean in cmake? - cmakeRecycler View does not give the correct position after scrolling - androidLinkedList vs ArrayList case study for Android - javaAll Articles