Python Forum
Detecting multiple markers based on bright spots detection on raspberry pi 3
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Detecting multiple markers based on bright spots detection on raspberry pi 3
#1
We are doing a study end project, we're not used in programming so we're kinda stuck. Our project is based on real time markers detection (open cv) which reflects light (image tresholding). After three markers are detected using picamera, centroids of contours should be connected and after that, angle between such made lines should be measured. Here comes the question- is there any solution to attribute id's to markers given as contours so they won't be mistaken after changing mutual position (now, found contours are always numbered from left to right)  ?? Please help Undecided
Reply
#2
I can't give an answer to you question, possibly because you are asking the wrong question :)

How can you tell markers have changed positions? In other words if you have markers A,B,C in the first image and X,Y,Z in the second, how can you tell that A,B,C have become X,Y,Z and not Z,X,Y?
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Reply
#3
Here is link to our code https://github.com/malinowydyplom/DYPLOM...eaded/1.py.
We were building our program using http://www.pyimagesearch.com/ blogs and tutorials from the start. In one, about detecting multiple bright spots in the image, he used contours sorting from left to right- same as you can see in our source code. Everything is ok as long as mutual orientation of markers stays as seen of no1. below. Then with no2. they sort again and we have problem - markers change they x,y coordinates and we're not able to measure proper angle between two lines.

[Image: CCF28112016_00000.jpg?raw=true]
We need some kind of identyfication, to attribute known id to, for example, middle marker so that the rest contours could follow him.
Reply
#4
I don't think you can go that route... attribute an id based on what? (hint: this criteria would need to be valid in both images). What you can do is measure the distance between the markers of the first image and those of the second, and see if some markers have remained within some distance of their original position, or in a more general case consider that the combo of markers in the 2nd image that minimizes the sum of the distances with the markers on the first image image is the new sequence of markers. In your example you would likely discover that M1, M2, M3 are now M2, M1, M3.
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Reply
#5
Is there any identifying features of the markers that make them unique?
Would it be possible to identify by specific color, size, etc. or as i suspect,
does that change as well?
Reply
#6
We should use, as told from our project supervisor, 3 identical reflective markers from one of type below (square, circle or spherical)

[Image: 15300701_938603056270465_647485002_n.jpg?raw=true][Image: 15240042_938602822937155_237154649_n.jpg?raw=true]
Reply
#7
Ok, here's an example of how to differentiate between a circle and square, http://stackoverflow.com/questions/31952...age-python
but, alas that won't help since they must be identical
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  iterating and detecting the last Skaperen 3 1,029 Oct-01-2022, 05:23 AM
Last Post: Gribouillis
  Detecting float or int in a string Clunk_Head 15 4,284 May-26-2022, 11:39 PM
Last Post: Pedroski55
  How to conditionally specify markers in matplotlib graph Mark17 3 3,126 Mar-03-2022, 07:42 PM
Last Post: Mark17
  module detecting if imported vs not Skaperen 1 1,638 Nov-19-2021, 07:43 AM
Last Post: Yoriz
  How to map two data frames based on multiple condition SriRajesh 0 1,448 Oct-27-2021, 02:43 PM
Last Post: SriRajesh
  detecting a generstor passed to a funtion Skaperen 9 3,468 Sep-23-2021, 01:29 AM
Last Post: Skaperen
  Python BLE Scanner not detecting device alexanderDennisEnviro500 0 1,973 Aug-01-2021, 02:29 AM
Last Post: alexanderDennisEnviro500
  Xlsxwriter: Create Multiple Sheets Based on Dataframe's Sorted Values KMV 2 3,442 Mar-09-2021, 12:24 PM
Last Post: KMV
  Detecting power plug Narayan 2 2,673 Aug-01-2020, 04:29 AM
Last Post: bowlofred
  How to print out multiple drinks instead of just one based on the input? jayfre 4 4,119 Jul-01-2020, 06:53 PM
Last Post: menator01

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020