/**
 * vzlogger configuration example for meterOCR
 *
 * use proper encoded JSON with javascript comments
 *
 * take a look at the wiki for detailed information:
 * http://wiki.volkszaehler.org/software/controller/vzlogger#configuration
*/

{
    // ... for general vzlogger settings see vzlogger.conf

    "meters": [
		// example for OCR (image processing/recognizing) "meter"
		{
			"enabled" : false,
			"allowskip": true,
			"protocol": "ocr",
			"impulses": 10000, // (optional, default 0 = no impules but abs. values), >0 impulses per unit
//			"file": "/tmp/image.png", // name of file to be processed
			"v4l2_dev": "/dev/video0", // name of the v4l2 device (optional, if provided file is ignored)
			"generate_debug_image": false, // (optional, default false) set true to help in calibrating and debugging. generates one png named <file>_debug.png
			"rotate": -2.0, // (optional, default 0.0) angle in deg for rotation. pos = clockwise, neg = counterclockwise
			"autofix" : {"range": 20, "x":42, "y":43}, // (optional default none) "auto fix"/move the pic based on some edge located at (x, y) within +/-"range" pixs
			"recognizer": [
//				{ "type": "tesseract", // (optional default tesseract).
//					"gamma": 1.0, // (optional default 1.0) gamma correction to be applied to the image
//					"gamma_min": 50, // (optional default 50) gamma TRC min value (see leptonica pixGammaTRC)
//					"gamma_max": 120, // (optional default 120) gamma TRC max value
//					"boundingboxes": [{ // list of bounding boxes for detection, at least one must be defined
//						"identifier": "1-0:1.8.1", // this reading will be given the Obis-like id (can actually be any string). Multiple boxes can contribute to the same id. E.g. when using scaler one box can be for a single digit
//						"confidence_id": "1-0:0.0.1", // (optional default none) name for identifier returning the min. confidence (0-100 (best)) per processed image. If multiple boundingboxes with same identifier are used this can just be set once (i.e. is assigned to the identifier)!
//						"scaler" : 0, // (optional, default 0) 10^scaler, e.g. 0 = *1, -1 = *0,1, -2 = *0,01, 2 = *100
//						"digit" : false, // (optional default false) a single digit is expected (thus the recognized value can only be within -9..9)
//						"box" : { "x1": -1, "y1": -1, "x2": -1, "y2": -1 }, // (optional default full image) coordinates for this box as {x1=left, y1=top, x2=right (excl), y2=bottom (excl)}
//				}]
//				},
				{ "type": "needle",
				"kernelColorString": "2 -2 -2 0 0 0 0 0 0", // (optional default red channel only) Color conversion 3x3 matrix to be applied before detecting (first line channel red). Needles need to be color red.
				"boundingboxes": [{
					"identifier": "1-0:1.8.1",
					"confidence_id": "1-0:0.0.2",
					"scaler": -1,
					"digit": true,
					"circle": {"cx": 100, "cy": 100, // center pos (x/y) of needle
						"cr": 50, // radius where to scan for the needle
						"offset": 0.0 // optional (default 0) offset of this needle. E.g. if at 5.0 (2nd digit needle at zero) but this needle show ~4.6 enter offset 0.4.
					}
					}]
				}
			],
			"channel": {                    // example channel. multiple channels supported as well
                "uuid": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeee",
                "middleware": "http://127.0.0.1/middleware.php",
                "identifier": "1-0:1.8.1"   // alias for '1-0:1.8.1', see 'vzlogger -h' for list of available aliases
            }

        }
    ]
}
