小编Jes*_*ent的帖子

RuntimeWarning:在ubyte_scalars中遇到溢出

我是Python新手,这是我编写的第一个东西,我只是想知道如何删除此警告:

Warning (from warnings module):
  File "C:\Users\Luri\Desktop\Bot Stuff\ImageSaver.py", line 76
    currentdiff=abs(anread[w,h])-abs(bnread[w,h])
RuntimeWarning: overflow encountered in ubyte_scalars
Run Code Online (Sandbox Code Playgroud)

我试过谷歌搜索答案,并没有任何清楚的事情来解决这个问题.

我正在尝试编写一个程序来比较从我的光标周围的矩形和我正在搜索的参考图像中不断更新的图像.

然后,根据光标相对于目标图像的区域,它将相应地进行调整.

感谢您提供任何帮助!

-J

代码如下:

import os
import sys
import time
import Image
import ImageGrab
import win32api
import numpy, scipy

def mousePos():
#---------------------------------------------------------
#User Settings:
  SaveDirectory=r'C:\Users\Luri\Desktop\Bot Stuff'
  ImageEditorPath=r'C:\WINDOWS\system32\mspaint.exe'
#Here is another example:
#ImageEditorPath=r'C:\Program Files\IrfanView\i_view32.exe'
#---------------------------------------------------------
  i,j = win32api.GetCursorPos()
  print 'Your Cusor Position is:', i,j
  time.sleep(1)
  size = 112, 58
#-------------------
#data is defined as | x0y0 = [0,0] = (xpos-56,ypos-29) | x0y1 = …
Run Code Online (Sandbox Code Playgroud)

python warnings runtime image image-processing

13
推荐指数
2
解决办法
4万
查看次数

标签 统计

image ×1

image-processing ×1

python ×1

runtime ×1

warnings ×1