what method is instead of below code in opencv .net wrapper

Ask questions on using Emgu CV with C++
Post Reply
iman_kh
Posts: 11
Joined: Tue Sep 09, 2008 1:46 am

what method is instead of below code in opencv .net wrapper

Post by iman_kh » Thu Sep 18, 2008 8:36 am

hi,
what is instead of below code in opencv .net wrapper :

this is my code in C++ native :

hist = cvcreateHist(. . .);

my problem : cvSetReal1D(hist->bins,0,0);
my problom : cvSetReal1D(hist->bins,0,255);

canming
Site Admin
Posts: 1038
Joined: Thu Feb 28, 2008 4:16 pm

Re: what method is instead of below code in opencv .net wrapper

Post by canming » Fri Sep 19, 2008 8:28 am

I just wrapped the cvSetReal1D in SVN.

If you got a MCvHistogram object cvHist , you can do the following:
CvInvoke.cvSetReal1D(CvHist->bins, 0, 0);

In C#, if you have a IntPtr, you can convert it to MCvHistogram by calling:
MCvHistogram cvHist = (MCvHistogram) Marshal.PtrToStructure(ptr, typeof(MCvHistogram));
If you are using the managed histogram class, just use its MCvHistorgram prperty.

If you are developping managed C++ functions, you can keep your existing code, take a look at the CPlusPlus example in the 1.3.0.0 source release.

iman_kh
Posts: 11
Joined: Tue Sep 09, 2008 1:46 am

Re: what method is instead of below code in opencv .net wrapper

Post by iman_kh » Sat Sep 20, 2008 9:00 am

hi and so thanks for your help,
but i can not find and method with this name (cvSetReal1D) in cvInvoke class ? also i can not see any information
on its document , do you realy certain for existence of this method ? (i am using v 1.3)

in vc++ , i can access to pointer of my MCvhistogram variable by marshal class but my problem is , that type of ( bins ) field on my variable is IntPtr too and i can not access to this field to modify it, please send too me an example of this , such as your previous reply .
so thanks

canming
Site Admin
Posts: 1038
Joined: Thu Feb 28, 2008 4:16 pm

Re: what method is instead of below code in opencv .net wrapper

Post by canming » Tue Sep 23, 2008 8:30 am

The latest change is available from SVN only.

For information on how to check out code from SVN, take a look at the following page:
http://sourceforge.net/svn/?group_id=216500

A very good client to access SVN from windows can be found here
http://tortoisesvn.tigris.org/

In VC++, if you have a MCvHistogram structure hist , you can do the following:

cvSetReal1D(hist->bin.ToPointer(), .., ..);

Cheers,
Canming

Post Reply