def wholeShebang(alone): if alone: if not empty(cfg.userHits): pltGeneral(cfg.userHits) pltLocations(cfg.userHits) # check if matrices are empty. if theyre not, just have to make the images if not empty(cfg.userHeights): pltHeights(cfg.userHeights) elif os.path.isfile(os.path.join(cfg.userPath, cfg.userFolder, "sideView.avi")): img.sideProcess(os.path.join(cfg.userPath, cfg.userFolder, "sideView.avi")) pltHeights(cfg.userHeights) if not empty(cfg.userAngles): pltAngles(cfg.userAngles) elif os.path.isfile(os.path.join(cfg.userPath, cfg.userFolder, "overheadView.avi")): img.ohProcess(os.path.join(cfg.userPath, cfg.userFolder, "overheadView.avi")) pltAngles(cfg.userAngles) else: if not empty(cfg.groundTruth) and not empty(cfg.userHits): cfg.error, cfg.extra = perf.gradeRef(cfg.groundTruth, cfg.userHits) pltGeneral(cfg.userHits, cfg.groundTruth) pltLocations(cfg.userHits, cfg.groundTruth) if not empty(cfg.gtHeights) and not empty(cfg.userHeights): pltHeights(cfg.userHeights, cfg.gtHeights) elif os.path.isfile(os.path.join(cfg.userPath, cfg.userFolder, "sideView.avi")) and not empty(cfg.gtHeights): img.sideProcess(os.path.join(cfg.userPath, cfg.userFolder, "sideView.avi")) pltHeights(cfg.userHeights, cfg.gtHeights) if not empty(cfg.gtAngles, cfg.userAngles): pltAngles(cfg.userAngles, cfg.gtAngles) elif os.path.isfile(os.path.join(cfg.userPath, cfg.userFolder, "overheadView.avi")) and not empty(cfg.gtAngles): img.ohProcess(os.path.join(cfg.userPath, cfg.userFolder, "overheadView.avi")) pltAngles(cfg.userAngles, cfg.gtAngles)
def continueProcess0(): # TODO: check option choice, and based on that decide to process alone or correlate with ground truth if os.path.isfile(sidePath.get()) and os.path.isfile(ohpath.get()): cfg.userHeights = img.sideProcess(sidePath.get()) cfg.userAngles = img.ohProcess(ohPath.get()) shutil.copy2(sidePath.get(), os.path.join(cfg.userPath, cfg.userFolder, "sideView.avi")) shutil.copy2(ohPath.get(), os.path.join(cfg.userPath, cfg.userFolder, "overheadView.avi")) # shutil.copy2(frontPath.get(), os.path.join(cfg.userPath, cfg.userFolder, 'frontView.avi')) # create analysis images, and go to screen to present them- maybe have message box saying where everything is saved perf.wholeShebang(alone=True) # move onto window that nicely shows images showResults() else: tkMessageBox.showinfo("ERROR", "Invalid files, try again") return