This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| String p = Objects.requireNonNull(getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS)).getAbsolutePath() + "/IOC_Report"; | |
| Log.d(TAG, "Path: " + p); | |
| File directory = new File(p); | |
| Log.d(TAG, "initData: " + directory.getAbsolutePath()); | |
| File[] files = directory.listFiles(); | |
| Log.d(TAG, "Size: " + files.length); | |
| for (int i = 0; i < files.length; i++) { | |
| Log.d(TAG, "FileName:" + files[i].getName()); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import spectral.io.envi as envi | |
| from matplotlib import pyplot as plt | |
| """ | |
| 超高速小畫家 | |
| * 顏色增加改for迴圈寫法 | |
| * 改顏色也換寫法 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # %% | |
| from PIL import Image | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| from spectral.io import envi | |
| def read_rgb_ir(folder, key): | |
| r = np.array(Image.open(f"{folder}/{key}_R.tif")) | |
| g = np.array(Image.open(f"{folder}/{key}_G.tif")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| cam = cv2.VideoCapture(0 + cv2.CAP_DSHOW) | |
| cam.set(cv2.CAP_PROP_FRAME_WIDTH, 1280) | |
| cam.set(cv2.CAP_PROP_FRAME_HEIGHT, 720) | |
| cam.set(cv2.CAP_PROP_CONVERT_RGB, 0) | |
| try: | |
| print("Starting video. Press CTRL+C to exit.") | |
| while True: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| void main() { | |
| runApp(const MyApp()); | |
| } | |
| class MyApp extends StatefulWidget { | |
| const MyApp({Key? key}) : super(key: key); | |
| @override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // find TextInputLayout | |
| TextInputLayout textInputLayout = findViewById(R.id.textInputLayout); | |
| // 隨意設定一個 startIcon | |
| textInputLayout.setStartIconDrawable(R.drawable.ic_check); | |
| // 從 textInputLayout 找出 icon 後隱藏 | |
| CheckableImageButton icon = textInputLayout.findViewById(R.id.text_input_start_icon); | |
| icon.setVisibility(View.GONE); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // find TextInputLayout | |
| TextInputLayout textInputLayout = findViewById(R.id.textInputLayout); | |
| // set error enable and error text | |
| textInputLayout.setErrorEnabled(true); | |
| textInputLayout.setError(" 需完成信箱驗證唷"); | |
| // 關閉原本的錯誤 icon | |
| textInputLayout.setErrorIconDrawable(null); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import numpy as np | |
| def Algorithm(cube, tar, num, off_set=0): | |
| [w, h, di] = cube.shape | |
| flatten_array = cube.reshape(w * h, di).T | |
| result_bands = [] | |
| for i in range(num): | |
| result = [] # local result before sort |