问题描述
import numpy as np
import cv2 as cv
img = cv.imread('Picture1.jpg',0)
cv.imshow('image',img)
cv.waitKey(0)
cv.imwrite('Picture1.jpg',img)
cv.destroyAllWindows()
解决方法
确保 awk 'NR==FNR { # On the first process of the file
tot1+=$(NF-1); # Create a variable with a running total of the last but one field
tot2+=$NF; # Create a variable with a running total of the last field
next
}
NR!=FNR && FNR == 1 { Process on the second pass and there the line/record is the first
print # Print the line (headers)
}
NR!=FNR && FNR != 1 { # Second pass of the file and none headers
for (i=1;i<NF-1;i++) {
printf "%s ",$i # Loop through the text field printing
}
printf "%s %s\n",($(NF-1)/tot1)*100,($(NF)/tot2)*100 # Print the calculated fields (utilising totals)
}' taxa taxa
文件与您正在运行的 python 文件位于同一目录中。
或者尝试拨打Picture1.jpg
:
startWindowThread()