@@ -335,40 +335,40 @@ cdef class PyMat:
335335
336336 def get_value (self , x , y , memory_type = PyMEM.PyMEM_CPU):
337337 cdef uchar1 value1u
338- cdef types.Vector2[uchar1]* value2u = new types.Vector2[uchar1]()
339- cdef types.Vector3[uchar1]* value3u = new types.Vector3[uchar1]()
340- cdef types.Vector4[uchar1]* value4u = new types.Vector4[uchar1]()
338+ cdef types.Vector2[uchar1] value2u = types.Vector2[uchar1]()
339+ cdef types.Vector3[uchar1] value3u = types.Vector3[uchar1]()
340+ cdef types.Vector4[uchar1] value4u = types.Vector4[uchar1]()
341341
342342 cdef float1 value1f
343- cdef types.Vector2[float1]* value2f = new types.Vector2[float1]()
344- cdef types.Vector3[float1]* value3f = new types.Vector3[float1]()
345- cdef types.Vector4[float1]* value4f = new types.Vector4[float1]()
343+ cdef types.Vector2[float1] value2f = types.Vector2[float1]()
344+ cdef types.Vector3[float1] value3f = types.Vector3[float1]()
345+ cdef types.Vector4[float1] value4f = types.Vector4[float1]()
346346
347347 if self .get_data_type() == PyMAT_TYPE.PyMAT_TYPE_8U_C1:
348348 status = getValueUchar1(self .mat, x, y, & value1u, memory_type.value)
349349 return types.PyERROR_CODE(status), self .get_data()[x, y]
350350 elif self .get_data_type() == PyMAT_TYPE.PyMAT_TYPE_8U_C2:
351- status = getValueUchar2(self .mat, x, y, value2u, memory_type.value)
351+ status = getValueUchar2(self .mat, x, y, & value2u, memory_type.value)
352352 return types.PyERROR_CODE(status), np.array([value2u.ptr()[0 ], value2u.ptr()[1 ]])
353353 elif self .get_data_type() == PyMAT_TYPE.PyMAT_TYPE_8U_C3:
354- status = getValueUchar3(self .mat, x, y, value3u, memory_type.value)
354+ status = getValueUchar3(self .mat, x, y, & value3u, memory_type.value)
355355 return types.PyERROR_CODE(status), np.array([value3u.ptr()[0 ], value3u.ptr()[1 ], value3u.ptr()[2 ]])
356356 elif self .get_data_type() == PyMAT_TYPE.PyMAT_TYPE_8U_C4:
357- status = getValueUchar4(self .mat, x, y, value4u, memory_type.value)
357+ status = getValueUchar4(self .mat, x, y, & value4u, memory_type.value)
358358 return types.PyERROR_CODE(status), np.array([value4u.ptr()[0 ], value4u.ptr()[1 ], value4u.ptr()[2 ],
359359 value4u.ptr()[3 ]])
360360
361361 elif self .get_data_type() == PyMAT_TYPE.PyMAT_TYPE_32F_C1:
362362 status = getValueFloat1(self .mat, x, y, & value1f, memory_type.value)
363363 return types.PyERROR_CODE(status), self .get_data()[x, y]
364364 elif self .get_data_type() == PyMAT_TYPE.PyMAT_TYPE_32F_C2:
365- status = getValueFloat2(self .mat, x, y, value2f, memory_type.value)
365+ status = getValueFloat2(self .mat, x, y, & value2f, memory_type.value)
366366 return types.PyERROR_CODE(status), np.array([value2f.ptr()[0 ], value2f.ptr()[1 ]])
367367 elif self .get_data_type() == PyMAT_TYPE.PyMAT_TYPE_32F_C3:
368- status = getValueFloat3(self .mat, x, y, value3f, memory_type.value)
368+ status = getValueFloat3(self .mat, x, y, & value3f, memory_type.value)
369369 return types.PyERROR_CODE(status), np.array([value3f.ptr()[0 ], value3f.ptr()[1 ], value3f.ptr()[2 ]])
370370 elif self .get_data_type() == PyMAT_TYPE.PyMAT_TYPE_32F_C4:
371- status = getValueFloat4(self .mat, x, y, value4f, memory_type.value)
371+ status = getValueFloat4(self .mat, x, y, & value4f, memory_type.value)
372372 return types.PyERROR_CODE(status), np.array([value4f.ptr()[0 ], value4f.ptr()[1 ], value4f.ptr()[2 ],
373373 value4f.ptr()[3 ]])
374374
0 commit comments