0

I want to get a binary image using threshold. In my histogram below 50 and above 150 want to set 0 and 50-150 range set as 255. how to do in python?

  • You'll have to show us the code you have so far to get any kind of meaningful answer. – mypetlion Jan 21 '19 at 21:13
  • Welcome to stackoverflow. SO is not a coding service. Try to give some of your code and explain clearly what are your problem. Probably you have seen how to access a table in python and this can be a starting point. – Alain Merigot Jan 21 '19 at 22:48
  • ret,thresh2 = cv2.threshold(g,50,255,cv2.THRESH_BINARY_INV) only give below the 50 are white and above 50 are black also ret,thresh1 = cv2.threshold(g,150,255,cv2.THRESH_BINARY ) give above 150 values are white and below 150 values black , but i want 50-150 range is white and others are black. – Dushan Tharaka Jan 22 '19 at 06:21

0 Answers0