from PyQt5.QtWidgets import QApplication import numpy as np import cv2 import matplotlib.pyplot as plt import grid as gd from .gridGUI import * import shapefile import numpy as np import pandas as pd import rasterio import rasterio.mask os.getcwd() app = QApplication(sys.argv) grid = gd.GRID() grid.loadData( pathImg="/Users/jameschen/Dropbox/photo_grid/test/map_match/demo.jpg", pathMap="/Users/jameschen/Dropbox/photo_grid/test/map_match/demo.csv") grid.binarizeImg(k=3, lsSelect=[0, 1], valShad=0, valSmth=0) grid.findPlots(nRow=4, nCol=3) g = GRID_GUI(grid, 4) # 0:input, 1:crop, 2:kmean, 3:anchor, 4:output app.exec_() # ========= 20200801 multi seasons ========= # import os, sys # sys.path # sys.path.remove("/Users/jameschen/Dropbox/photo_grid/grid")
import os, sys sys.path sys.path.remove("/Users/jameschen/Dropbox/photo_grid/grid") from PyQt5.QtWidgets import QApplication import numpy as np import cv2 import matplotlib.pyplot as plt os.chdir("/Users/jameschen/Dropbox/photo_grid/") import grid as gd import shapefile import numpy as np import pandas as pd import rasterio grid = gd.GRID() os.chdir("/Users/jameschen/Dropbox/photo_grid/test/zhou") grid.loadData( pathImg="/Users/jameschen/Dropbox/photo_grid/test/seasons/s2.tif", pathShp="/Users/jameschen/Dropbox/photo_grid/test/seasons/s1/s1.shp") grid.cropImg(pts=[[718.3549060542798, 3950.951983298539], [5798.1503131524005, 2488.5866388308978], [7722.315240083507, 8799.847599164927], [2462.9311064718163, 10185.246346555323]]) grid.binarizeImg(k=5, lsSelect=[0, 1], valShad=0, valSmth=0, outplot=True) img = grid.imgs.get("crop") raw = grid.imgs.get("raw") gimg = grid.imgs