Please check the docstring as well as previous discussions. This has been
discussed before. Basically, asMat() needs the user to tell if they want a
single-channel or a multi-channel Mat instance. Try asMat(data, True) if you
want a single-channel Mat instance.
As for the last error, I will take a look. It seems to be a bug. Thanks for
raising. :)
Cheers,
Minh-Tri
--
Dr. Minh-Tri Pham
Research Fellow, University of Surrey, UK
Email: t.p...@surrey.ac.uk or pmt...@gmail.com
Mob: +44 (0) 778 774 1089 | Tel: +44 (0) 148 368 4711
Lucky one. I want it to become finally spring here again. Sunny, but cold
right now here (~10 degrees during the day).
> However another question. I tried this:
I suppose that cv.asMat is returning a NumPy ndarray object, that is accessing
the native OpenCV data block referenced from its array structure. NumPy does
go about many things by recording the data arrangement *without* performing
actual data operations on the data block if not necessary. So I'd expect that
cvData.shape returns the current *representation* of the array, whereas
cvData.size() will probably give you information on the physical layout of the
memory block.
But that's just guesswork, but based on common practice in NumPy.
HTH.
Viele Gruesse in den Sommer,
Guy
--
Guy K. Kloss
Institute of Information and Mathematical Sciences
Te Kura Pūtaiao o Mōhiohio me Pāngarau
Room 2.63, Quad Block A Building
Massey University, Auckland, Albany
Private Bag 102 904, North Shore Mail Centre
voice: +64 9 414-0800 ext. 9266 fax: +64 9 441-8181
eMail: G.K...@massey.ac.nz http://iims.massey.ac.nz
Cheers,
Minh-Tri
On 7/14/2010 9:05 AM, Guy K. Kloss wrote:
> On Wed, 14 Jul 2010 18:00:27 stefan wrote:
>> Sorry for this. Its to hot for programming in Germany at the moment ;-)
>
> Lucky one. I want it to become finally spring here again. Sunny, but cold
> right now here (~10 degrees during the day).
>
>> However another question. I tried this:
>
> I suppose that cv.asMat is returning a NumPy ndarray object, that is accessing
> the native OpenCV data block referenced from its array structure. NumPy does
> go about many things by recording the data arrangement *without* performing
> actual data operations on the data block if not necessary. So I'd expect that
> cvData.shape returns the current *representation* of the array, whereas
> cvData.size() will probably give you information on the physical layout of the
> memory block.
>
> But that's just guesswork, but based on common practice in NumPy.
>
> HTH.
>
> Viele Gruesse in den Sommer,
>
> Guy
>
--
Dr. Minh-Tri Pham
Research Fellow, University of Surrey, UK
Email: t.p...@surrey.ac.uk or pmt...@gmail.com