def preprocess(image, addr, extras): log = cap.logger(extras, image) image = cap.doResize(image, factor, cv.CV_INTER_CUBIC) log.log(image) image = undistort(image) log.log(image) cv.Threshold(image, image, 200, 255, cv.CV_THRESH_BINARY) log.log(image) image = cap.repaintCCs(image, doRepaint=lambda comp, col: comp[0] <= 10 and col <= 128) log.log(image) cap.processExtras(log.steps, addr, extras, cap.CAP_STAGE_PREPROCESS) return image
def preprocess(image, addr, extras): log = cap.logger(extras, image) image = cap.doResize(image, factor, cv.CV_INTER_CUBIC) log.log(image) image = undistort(image) log.log(image) cv.Threshold(image, image, 200, 255, cv.CV_THRESH_BINARY) log.log(image) image = cap.repaintCCs( image, doRepaint=lambda comp, col: comp[0] <= 10 and col <= 128) log.log(image) cap.processExtras(log.steps, addr, extras, cap.CAP_STAGE_PREPROCESS) return image
def preprocess(image, addr, extras): log = cap.logger(extras, image) image = removeLightColors(image) log.log(image) image = remapColors(image) log.log(image) image = smoothNoise2(image) log.log(image) image = cap.smoothNoise1(image) log.log(image) mask = getNoiseMask(image, 15, 4) cv.Or(mask, findColor(image, myunkn), mask) log.log(mask) image = doInpaint(image, mask) log.log(image) image = sharpenColors(image) log.log(image) image = cap.repaintCCs(image, doRepaint=lambda comp, col: comp[0] <= 5 or comp[2][2] <= 2 or comp[2][3] <= 2) log.log(image) cap.processExtras(log.steps, addr, extras, cap.CAP_STAGE_PREPROCESS) return image
def preprocess(image, addr, extras): log = cap.logger(extras, image) image = removeLightColors(image) log.log(image) image = remapColors(image) log.log(image) image = smoothNoise2(image) log.log(image) image = cap.smoothNoise1(image) log.log(image) mask = getNoiseMask(image, 15, 4) cv.Or(mask, findColor(image, myunkn), mask) log.log(mask) image = doInpaint(image, mask) log.log(image) image = sharpenColors(image) log.log(image) image = cap.repaintCCs(image, doRepaint=lambda comp, col: comp[0] <= 5 or comp[2][ 2] <= 2 or comp[2][3] <= 2) log.log(image) cap.processExtras(log.steps, addr, extras, cap.CAP_STAGE_PREPROCESS) return image