Accesing Memory Address
Well I will explain my problem I am using a wrapper from a c++ to a python program that retrieve a frame from a camera an store it on a Mat*, but when I try to obtain the image in the python script what I am obtaining is a memory address and no the information of the image itself.
Anyone know how can I solve it?
I show my main scrip and the terminal's output
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import cv2
import time
import ctypes
from biblioteca import lib
objectInstance = lib.classInstance();
initializace = lib.initializeCamera(objectInstance);
print initializace
frame = lib.getFrame(objectInstance)
frame = lib.getFrame(objectInstance)
print frame
time.sleep(5)
lib.freeClass(objectInstance)
Output:
1878271672
First off all, remove the pointers in the OpenCV2.x interface. OpenCV uses some sort of smart pointers that do not need this explicit pointers. If you do than very unexpected things happen. The second part of your problem is actually a python problem, not sure if you will find the answer here.
btw, your library will have to return a numpy array, not a pointer to cv::Mat.
maybe have a look, how opencv handles this