0

I want to detect edges of shelf only to count number of shelves and count of partitions in shelf. I used OpenCV but it detects edges of all objects in images but I don't want to detect edges of other objects except shelves. Any idea how to do this.

# USAGE import numpy as np import cv2 def auto_canny(image, sigma=0.33): v = np.median(image) lower = int(max(0, (1.0 - sigma) * v)) upper = int(min(255, (1.0 + sigma) * v)) edged = cv2.Canny(image, lower, upper) return edged def main(imagePath): image = cv2.imread(imagePath) gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) blurred = cv2.GaussianBlur(gray, (3, 3), 0) auto = auto_canny(blurred) cv2.imshow("Canny", auto) cv2.waitKey(0) if __name__ == "__main__": main("images/shelf_data1.png") 
7
  • Can you add the code you used, describe what you tried so far, and include a sample image? That will make it a lot of easier to help you. Commented Apr 6, 2020 at 16:19
  • google.com/… Commented Apr 6, 2020 at 17:17
  • This is image, I want to detect edges only of shelves not of items or people. Commented Apr 6, 2020 at 17:17
  • Code written above detects edges of all objects in image. Commented Apr 6, 2020 at 17:21
  • This question might help stackoverflow.com/questions/7227074/… Commented Apr 7, 2020 at 1:56

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.