微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

这段代码有什么问题,因为它没有给出输出图片?

如何解决这段代码有什么问题,因为它没有给出输出图片?

代码没有给出输出图片

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()

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。