Secondly, we programmed an application which used the *BlackWhiteSensor.java*<<<<<<indsætreferencetilkodenher>>>>>> class to classify colors as either white or black. This application can be seen <<<<<indsætkodeellerreferencetilgitmedkode>>>>>>.
Secondly, we programmed an application which used the *BlackWhiteSensor.java*<<<<<<indsætreferencetilkodenher>>>>>> class to classify colors as either white or black. This application can be seen <<<<<indsætkodeellerreferencetilgitmedkode>>>>>>. We used this application to analyse the effectiveness of application calibration.
The *BlackWhiteSensor.java* class also prints light values to the display as a percentage <<<<indsætreferencetilhvordetteerkendtfra>>>>>. We noted these below.
The *BlackWhiteSensor.java* class prints light values to the display as a percentage <<<<indsætreferencetilhvordetteerkendtfra>>>>>. We noted these in table <<<<<tableref>>>>>.
White | Black
--- | ---
51 | 33
**White** | **Black**
**White** | **Black**
--- | ---
--- | ---
51 | 33
51 | 33
// The threshold is calculated as the median between
We noticed that the application was very effective at classifying the differences between black and white. It does this by calculating the median between the black and white readings and setting this value as the threshold between the two colors.
// the two readings over the two types of surfaces
Because of this, it was interesting to test the sensor on a greyscale. Starting at white, we moved the robot (and thus the sensor) towards black until the classification changed. This happened around the middle of the scale which makes sense. The exact point at which the application changed from white to black can be in <<<<<indsætreftilbillede>>>>>>.
- Lavede et testprogram til at undersøge effektiviteten af kalibreringen.
- Indsæt kode!
- Var meget effektiv til sort hvid.
- Da det givne program laver en blackwhite threshold ved at tage medianen af den sorte og hvide værdi var det interessant at teste på en gråskala om den virkeligt passede med threshold. Vi fik maskinen lidt over midten på gråskalaen, hvilket stemmer overens med det antagede.