I am running object detection ANPR which prints some vehicle number labels like (text=MH02MH8767)
MH02MH8767
MH02MH8767
MH02MH67
AP03MN7834
AP0N7834
AP03MN7834
One Number at a time. I want to check duplicacy and print Numbers which occur 2 or 3 times.
like:
MH02MH8767
AP03MN7834
and ignore which is print only one time. All this is dynamic.
How can I achieve this?
text variable containing number plate values.
I have used followings:
list1=str(text)
_size = len(list1)
repeated = []
for i in range(_size):
k = i + 1
for j in range(k, _size):
if x[i] == x[j] and x[i] not in repeated:
repeated.append(x[i])
print("repeated",repeated)
and the other one is:
duplicates=[]
for value in list1:
if list1.count(value) > 1:
if value not in duplicates:
duplicates.append(value)
print("duplicates",duplicates)
What problem I'm facing is how to store this dynamic (text) variable in the list and how to check duplicate because every time list will be updating.
The output should be:
like:
MH02MH8767
AP03MN7834