-1

I've setup a camera in a squash club and want it to tell me if the squash court is occupied or empty. I trained it with a few hundred images of occupied and empty courts and the results are good.

Now the catch is sometimes the club closes early and the lights get turned off. So I basically have almost black images. I tried adding a few of these images to my "empty" squash court training set. I re-ran the image training but the new model does not predict these dark images as empty. It thinks they are occupied.

I next tried creating a new class called "court_closed". I put five of these dark images there and re-trained. Now the model thinks dark images are "empty". That is technically an improvement over thinking they are occupied. But why is it not predicting them as "court_closed"? Do I need to add hundreds of nearly identical dark/black images?

Here's an example image:

enter image description here

Faraz H
  • 161
  • 10
  • 1
    I think your going to need more 'court_closed' images. I usually try to have an equal amount of images in each category of my train data. – Jacob Philpott Feb 02 '21 at 05:31
  • 1
    I think that some preprocessing would be very much needed here. There aren't any features that a NN can learn from a black image. Perhaps try converting it to HSV color space, applying some GaussianBlur and Binary Threshold. – yudhiesh Feb 02 '21 at 05:32
  • Do you have a code posted some more where also? Might be helpful to take a look at it also. – Jacob Philpott Feb 02 '21 at 05:34
  • Thanks. I will try with more court_closed images. Can I just make copies of the same five I have? Or do they need to be unique? They are all pretty much black. – Faraz H Feb 02 '21 at 05:40
  • @FarazH check the answer to this [question](https://stackoverflow.com/questions/42779400/how-can-i-get-a-black-and-white-image-for-the-following-picture). – yudhiesh Feb 02 '21 at 05:41
  • In preprocessing step reducing the black intensity of an image can be an option. – Innat Feb 02 '21 at 05:50

1 Answers1

0

Think I figured it out by just using Imagemagick command line. I can convert the image to HSI or LAB and get the brightness (Intensity or Luminosity) from the average of the I or L channel.

convert court1.jpg -colorspace HSI -channel b -separate +channel -scale 1x1 -format "%[fx:100*u]\n" info:

The result will be between 0 and 100% with 0 being black and 100 white

Faraz H
  • 161
  • 10