def main(): args = sys.argv[1:] if (args[0] == "log"): log() elif (args[0] == "show"): if (len(args) == 1): show()
def command_line(dictionary): while True: command = input('Enter your command: ') if command == 'exit': return 'exit' elif command == 'move': functions.move() elif command == 'help': for command, description in list(commands_list.items()): print(command + ' = ' + description) elif command == 'add': functions.add() return functions.update() elif command == 'remove': functions.remove() elif command == 'print': continue elif command == 'show': functions.show() elif command == 'train': return functions.train(dictionary)
#analiza factoriala #elimin rotatia model_fa = fact.FactorAnalyzer(rotation=None) #construiesc modelul - standardizeaza modelul model_fa.fit(x) #calcul scoruri f = model_fa.transform(x) #plot al scorurilor functions.plot_scoruri( f[:, 0], f[:, 1], list(t.index), "F1", "F2", "Plot Scoruri - Analiza Factoriala" ) #coloana 1 din scoruri, aferenta primei componente principale #matrice de corelatii l = model_fa.loadings_ #varianta factorilor alpha_fa = model_fa.get_factor_variance() #aici merge facuta si tabelare # model factorial sklearn - daca e fara factor_analyzer -- alta metoda de factorizare folosita model_fa_sk = dec.FactorAnalysis(n_components=3) model_fa_sk.fit(x) #extragem scorurile f_sk = model_fa_sk.transform(x) functions.plot_scoruri( f_sk[:, 0], f_sk[:, 1], list(t.index), "F1", "F2", "Plot Scoruri SK - Analiza Factoriala" ) #coloana 1 din scoruri, aferenta primei componente principale functions.show()
def show(a): functions.show(window, a)
from functions import create, remove, menu, show menu() n = int(input("Uildliin dugaar oruulna uu: ")) if n == 1: show() elif n == 2: create() elif n == 3: remove() elif n == 4: print("homework") else: print("Ta programmaas garlaa")
mode = sys.argv[2]#leitura do modo pathImg = sys.argv[1]#caminho da imagem #pega a mensagem oculta no arquivo messagem file_message = open("messagem.txt", "r") message = str() for line in file_message: message += line file_message.close() if mode == 'ocultar': img = Image.open(pathImg) length = img.size if(verifyLength(message, img)): hide(message, img, length) else: print("Imagem com tamanho insufiente!") elif mode == "mostrar": img = Image.open(pathImg) text = show(img) print(text) file_message_show = open("messagem_revelada.txt", 'w') for line in text: file_message_show.write(line) file_message_show.close()
print("4 - Update pay") print("5 - Exit") option = input() if option == "1": while True: print("---VIEWING MODE---") print("1 - See full list of employees") print("2 - See full list of managers") print("3 - See full list of developers") print("4 - See full list of interns") print("5 - Go back to main menu") viewOption = input() if viewOption == "1": print("Showing list of all employees...\n") show("SELECT * FROM employees") elif viewOption == "2": print("Showing list of all managers...\n") show("SELECT * FROM employees WHERE position = 'manager'") elif viewOption == "3": print("Showing list of all developers...\n") show("SELECT * FROM employees WHERE position = 'developer'") elif viewOption == "4": print("Showing list of all interns...\n") show("SELECT * FROM employees WHERE position = 'intern'") elif viewOption == "5": print("Returning to main menu...\n") break else: print("Invalid option.\n")
if (im[i][j] >= 210): im[i][j] = 255 else: im[i][j] = 0 im = ~im imgFinal = np.copy(im) (rows, cols) = im.shape estructura = np.array([[1], [1], [1]]) #Falta por convertir a manual imgFinal = cv2.erode(imgFinal, estructura, iterations=1) imgFinal = cv2.dilate(imgFinal, estructura, iterations=1) imgFinal = cv2.bitwise_not(imgFinal) return imgFinal """ test = f.loadimg("test.png") f.show(test) test = f.to_grey(test) test = cv2.adaptiveThreshold(test,255,cv2.ADAPTIVE_THRESH_MEAN_C,cv2.THRESH_BINARY,15,-2) f.saveimg(test) data = line_separator(test) result = separator_blocks(test,data) #mg(test) """ #Demo1 #Demo def get_body(image): gray = cv2.medianBlur(image, 5)
focus, show, contrast, checkBrightness) # Import Image and resize image = cv2.imread('flower.jpg') image = resize(image) imageOriginal = image.copy() # Checks the brightness of the image and adjusts #If the image is too blurry, improve contrast by equalizing histogram channels image = equalize(image) # Find the item you want to enlarge. If it is not correct, adjust the k value to an odd number from 0-9. k = 5 contours = contours(image, k) rect, drawing = findPage(contours, imageOriginal) name = 'Box Drawn' show(drawing, name) # Warp the boxed item to full screen. You can play with focusing/sharpening the image based on your needs. warp = transform(imageOriginal, rect) warp = checkBrightness(warp) # Focus/Sharpen the scanned photo. Change the alpha value to adjust the level of focus in the photo alpha = 4 warp = focus(warp, alpha) warp = sharp(warp) name = 'Scanned Photo' show(warp, name)