Ask Your Question

Revision history [back]

type problem with cv.detail.resultRoi

My python program :

import cv2 as cv
import numpy as np
fs=cv.FileStorage("testYaml.yml",cv.FileStorage_READ)
coin=[]
w=fs.getNode("coin0").mat()
coin.append(tuple(w.transpose()[0]))
w=fs.getNode("coin1").mat()
coin.append(tuple(w.transpose()[0]))
print('I'm happy : ')
s=[(-319, -239), (-249, -224)]
print(cv.detail.resultRoi(s,[(638, 478), (674, 526)]))
print('I'm NOT happy : ')
print(cv.detail.resultRoi(coin,[(638, 478), (674, 526)]))
print('I am happy with ',type(s[0][0]),' != but not with ',type(coin[0][0]))

Now results are

I am happy : (-319, -239, 71, 17)

I am NOT happy :

Traceback (most recent call last): File "C:\Users\Laurent\Desktop\testYaml.py", line 13, in <module> print(cv.detail.resultRoi(coin,[(638, 478), (674, 526)])) SystemError: <built-in function="" resultroi=""> returned NULL without setting an error

I am happy with < class 'int '> != but not with < class 'numpy.int32 '>

Only difference is

my yaml file is

%YAML:1.0
---
coin0: !!opencv-matrix
   rows: 2
   cols: 1
   dt: i
   data: [ -319, -239 ]
coin1: !!opencv-matrix
   rows: 2
   cols: 1
   dt: i
   data: [ -249, -224 ]

type problem with cv.detail.resultRoi

My python program :

import cv2 as cv
import numpy as np
fs=cv.FileStorage("testYaml.yml",cv.FileStorage_READ)
if fs.isOpened():
     print("Check file path")
     exit()
coin=[]
w=fs.getNode("coin0").mat()
coin.append(tuple(w.transpose()[0]))
w=fs.getNode("coin1").mat()
coin.append(tuple(w.transpose()[0]))
print('I'm happy : ')
s=[(-319, -239), (-249, -224)]
print(cv.detail.resultRoi(s,[(638, 478), (674, 526)]))
print('I'm NOT happy : ')
print(cv.detail.resultRoi(coin,[(638, 478), (674, 526)]))
print('I am happy with ',type(s[0][0]),' != but not with ',type(coin[0][0]))

Now results are

I am happy : (-319, -239, 71, 17)

I am NOT happy :

Traceback (most recent call last): File "C:\Users\Laurent\Desktop\testYaml.py", line 13, in <module> print(cv.detail.resultRoi(coin,[(638, 478), (674, 526)])) SystemError: <built-in function="" resultroi=""> returned NULL without setting an error

I am happy with < class 'int '> != but not with < class 'numpy.int32 '>

Only difference is

my yaml file is

%YAML:1.0
---
coin0: !!opencv-matrix
   rows: 2
   cols: 1
   dt: i
   data: [ -319, -239 ]
coin1: !!opencv-matrix
   rows: 2
   cols: 1
   dt: i
   data: [ -249, -224 ]

type problem with cv.detail.resultRoi

My python program :

import cv2 as cv
import numpy as np
fs=cv.FileStorage("testYaml.yml",cv.FileStorage_READ)
if fs.isOpened():
     print("Check file path")
     exit()
coin=[]
w=fs.getNode("coin0").mat()
coin.append(tuple(w.transpose()[0]))
w=fs.getNode("coin1").mat()
coin.append(tuple(w.transpose()[0]))
print('I'm happy : ')
s=[(-319, -239), (-249, -224)]
print(cv.detail.resultRoi(s,[(638, 478), (674, 526)]))
print('I'm NOT happy : ')
print(cv.detail.resultRoi(coin,[(638, 478), (674, 526)]))
print('I am happy with ',type(s[0][0]),' != but not with ',type(coin[0][0]))

Now results are

I am happy : (-319, -239, 71, 17)

I am NOT happy :

Traceback (most recent call last): File "C:\Users\Laurent\Desktop\testYaml.py", line 13, in <module> print(cv.detail.resultRoi(coin,[(638, 478), (674, 526)])) SystemError: <built-in function="" resultroi=""> returned NULL without setting an error

I am happy with < class 'int '> != but not with < class 'numpy.int32 '>

Only difference is class 'int and class 'numpy.int32 but it cannot be that ?

my yaml file is

%YAML:1.0
---
coin0: !!opencv-matrix
   rows: 2
   cols: 1
   dt: i
   data: [ -319, -239 ]
coin1: !!opencv-matrix
   rows: 2
   cols: 1
   dt: i
   data: [ -249, -224 ]

type problem with cv.detail.resultRoi

My python program :

import cv2 as cv
import numpy as np
fs=cv.FileStorage("testYaml.yml",cv.FileStorage_READ)
if fs.isOpened():
     print("Check file path")
     exit()
coin=[]
w=fs.getNode("coin0").mat()
coin.append(tuple(w.transpose()[0]))
w=fs.getNode("coin1").mat()
coin.append(tuple(w.transpose()[0]))
print('I'm happy : ')
s=[(-319, -239), (-249, -224)]
print(cv.detail.resultRoi(s,[(638, 478), (674, 526)]))
print('I'm print('I am NOT happy : ')
print(cv.detail.resultRoi(coin,[(638, 478), (674, 526)]))
print('I am happy with ',type(s[0][0]),' != but not with ',type(coin[0][0]))

Now results are

I am happy : (-319, -239, 71, 17)

I am NOT happy :

Traceback (most recent call last): File "C:\Users\Laurent\Desktop\testYaml.py", line 13, in <module> print(cv.detail.resultRoi(coin,[(638, 478), (674, 526)])) SystemError: <built-in function="" resultroi=""> returned NULL without setting an error

I am happy with < class 'int '> != but not with < class 'numpy.int32 '>

Only difference is class 'int and class 'numpy.int32 but it cannot be that ?

my yaml file is

%YAML:1.0
---
coin0: !!opencv-matrix
   rows: 2
   cols: 1
   dt: i
   data: [ -319, -239 ]
coin1: !!opencv-matrix
   rows: 2
   cols: 1
   dt: i
   data: [ -249, -224 ]

type problem with cv.detail.resultRoi

My python program :

import cv2 as cv
import numpy as np
fs=cv.FileStorage("testYaml.yml",cv.FileStorage_READ)
if fs.isOpened():
     print("Check file path")
     exit()
coin=[]
w=fs.getNode("coin0").mat()
coin.append(tuple(w.transpose()[0]))
w=fs.getNode("coin1").mat()
coin.append(tuple(w.transpose()[0]))
print('I'm print('I am happy : ')
s=[(-319, -239), (-249, -224)]
print(cv.detail.resultRoi(s,[(638, 478), (674, 526)]))
print('I am NOT happy : ')
print(cv.detail.resultRoi(coin,[(638, 478), (674, 526)]))
print('I am happy with ',type(s[0][0]),' != but not with ',type(coin[0][0]))

Now results are

I am happy : (-319, -239, 71, 17)

I am NOT happy :

Traceback (most recent call last): File "C:\Users\Laurent\Desktop\testYaml.py", line 13, in <module> print(cv.detail.resultRoi(coin,[(638, 478), (674, 526)])) SystemError: <built-in function="" resultroi=""> returned NULL without setting an error

I am happy with < class 'int '> != but not with < class 'numpy.int32 '>

Only difference is class 'int and class 'numpy.int32 but it cannot be that ?

my yaml file is

%YAML:1.0
---
coin0: !!opencv-matrix
   rows: 2
   cols: 1
   dt: i
   data: [ -319, -239 ]
coin1: !!opencv-matrix
   rows: 2
   cols: 1
   dt: i
   data: [ -249, -224 ]

type problem with cv.detail.resultRoi

My python program :

import cv2 as cv
import numpy as np
fs=cv.FileStorage("testYaml.yml",cv.FileStorage_READ)
if not fs.isOpened():
     print("Check file path")
     exit()
coin=[]
w=fs.getNode("coin0").mat()
coin.append(tuple(w.transpose()[0]))
w=fs.getNode("coin1").mat()
coin.append(tuple(w.transpose()[0]))
print('I am happy : ')
s=[(-319, -239), (-249, -224)]
print(cv.detail.resultRoi(s,[(638, 478), (674, 526)]))
print('I am NOT happy : ')
print(cv.detail.resultRoi(coin,[(638, 478), (674, 526)]))
print('I am happy with ',type(s[0][0]),' != but not with ',type(coin[0][0]))

Now results are

I am happy : (-319, -239, 71, 17)

I am NOT happy :

Traceback (most recent call last): File "C:\Users\Laurent\Desktop\testYaml.py", line 13, in <module> print(cv.detail.resultRoi(coin,[(638, 478), (674, 526)])) SystemError: <built-in function="" resultroi=""> returned NULL without setting an error

I am happy with < class 'int '> != but not with < class 'numpy.int32 '>

Only difference is class 'int and class 'numpy.int32 but it cannot be that ?

my yaml file is

%YAML:1.0
---
coin0: !!opencv-matrix
   rows: 2
   cols: 1
   dt: i
   data: [ -319, -239 ]
coin1: !!opencv-matrix
   rows: 2
   cols: 1
   dt: i
   data: [ -249, -224 ]