0

i have a list of images which are in greyscale 8 bit resolution. i have a python script which successfully detects objects in colored images. Now i want to use this script to detect objects (people) in these 8 bit images. However, when i try to read an image through imread , i see a black window. How can i read this type of image in opencv and see the details inside it? Here is my code for reading an image:

for imagePath in imagePaths:
    # load the image and resize it to (1) reduce detection time
    # and (2) improve detection accuracy
    image = cv2.imread(imagePath)
    image = imutils.resize(image, width=min(400, image.shape[1]))
rehan
  • 143
  • 3
  • 17
  • Why do you use `-cv2.IMREAD_ANYDEPTH` (- in flag)? Use `cv2.IMREAD_UNCHANGED` or `cv2.IMREAD_GRAYSCALE` instead. See [documentation](https://docs.opencv.org/master/d4/da8/group__imgcodecs.html#ga61d9b0126a3e57d9277ac48327799c80) for details. – sebasth Nov 25 '19 at 13:36
  • @sebasth that was an error. i was trying the flags . but none of them are working. – rehan Nov 25 '19 at 13:42

0 Answers0