Implement the Std::Vector < < Point2i > > Std::Vector in dll wrapper for LabVIEW

Hi, I'm writing a wrapper dll that using OpenCV function. I had been sucessfully implement Std::Vector by referring to "An array of clusters to a dll C sending".

And now, I want to implement the Std::Vector<>> who is a lot like table 2D but each line items may be different.

In LabVIEW, I attribute a range of cluster of the dashboard cluster of 2 I32 elements, structure which is shown below:

I think it has the same functionality as Std::Vector<>> in C++.

So I plug this data on the "Call library function node" structure and generate C code that indicated below:

/* Call Library source file */

#include "extcode.h"

/* lv_prolog.h and lv_epilog.h set up the correct alignment for LabVIEW data. */
#include "lv_prolog.h"

/* Typedefs */

typedef struct {
    int32_t elt1;
    int32_t elt2;
    } TD4;

typedef struct {
    int32_t dimSize;
    TD4 elt[1];
    } TD3;
typedef TD3 **TD3Hdl;

typedef struct {
    TD3Hdl elt1;
    } TD2;

typedef struct {
    int32_t dimSize;
    TD2 elt[1];
    } TD1;
typedef TD1 **TD1Hdl;

#include "lv_epilog.h"

void funcName(TD1Hdl arg1);

void funcName(TD1Hdl arg1)
{

    /* Insert code here */

}

Then, I write this code show below in dll wrapper:

void funcName(TD1Hdl Blobs)
{
    vector < vector > blobs;

    // Distribute contents of blobs to Blobs from LabVIEW
    MgErr err = mgNoErr;
    size_t arraySizeInBytes = Offset(TD1, elt1) + sizeof(TD2)*blobs.size();     // Determine row size
    err = DSSetHSzClr(Blobs, arraySizeInBytes);

    if (err != mgNoErr)
        return;

    (*Blobs)->dimSize = blobs.size();

    for (size_t i = 0; i < blobs.size(); i++) {
        arraySizeInBytes = Offset(TD3, elt) + sizeof(TD4)*blobs[i].size();  // Determine col size of each row
        err = DSSetHSzClr((*Blobs)->elt[i].elt1, arraySizeInBytes);

        if (err != mgNoErr)
            return;

                /*......................*/
        }
}

When I call LabVIEW dll, the program get interuption(i.e shutdown) on line where I want to determine the size of each row.

Could someone give me some suggestions on this subject or promote another application of this requirement?
Thank you very much.

MgErr funcName(TD1Hdl Blobs)
{
    vector < vector > blobs;

        Labeling(image_binary, blobs);         // the prototype of this function is: Labeling(Mat &binary, Vector> &blobs)

    // Distribute contents of blobs to Blobs from LabVIEW
    MgErr err = mgNoErr;
    size_t arraySizeInBytes = Offset(TD1, elt) + sizeof(TD2)*blobs.size();      // Determine row size

        if (contours == NULL)        {                Blobs = (TD1Hdl)DSNewHClr(arraySizeInBytes);                if (Blobs == NULL)                         err = mFullErr;        }        else                err = DSSetHSzClr(Blobs, arraySizeInBytes);
        if (err != mgNoErr)                return err;    for (size_t i = 0; err == mgNoEerr && i < blobs.size(); i++) {
        arraySizeInBytes = Offset(TD3, elt) + sizeof(TD4)*blobs[i].size();  // Determine col size of each row

                if ((*Blobs)->elt[i].elt1 == NULL)                {                        (*Blobs)->elt[i].elt1 = (TD3Hdl)DSNewHClr(arraySizeInBytes);                        if ((*Blobs)->elt[i].elt1 == NULL)                                    err = mFullErr;                }                else               err = DSSetHSzClr((*Blobs)->elt[i].elt1, arraySizeInBytes);
                if (err == mgNoErr)                {                        (*((*Blobs)->elt[i].elt1))->dimSize = blobs[i].size();

                        /*......................*/

                }
        }
        (*Blobs)->dimSize = i;        return err;}

Personaally I've usually done like this. Already, the tar of DSSetHSzClr() indicates if there was something wrong and that the handle cannot really become NULL to call this function.

To be entirely correct and safety integrated, you must do more than that. But as long as you assume that the incoming picture is always smaller that the outgoing Board will be (usually it be 0 items when you enter this function, but if you reuse sort table in the diagram, by storing it in a registry change for example, this may not be true more) this will be enough.

Tags: NI Software

Similar Questions

  • How to get the interrupt vector (the number that is used to index the IDT) upper filter driver

    Hello world
    I have a very urgent question to get the vector of interruption of a upper filter driver:
    In my project, I need to know the vector interrupt assigned to a specific device (not for standard devices that have fixed the interrupt vector value). I know that normally, the interrupt vector value can be obtained in the pilot of the underlying function (usually for the parameters to IoConnectInterrupt()) with the following code:
    pIrpStack-> Parameters.StartDevice.AllocatedResourcesTranslated. > List [0]. PartialResourceList.PartialDescriptors [0].u.Interrupt.Vector

    But I don't have the source code for the driver of the underlying function, so I wrote a upper filter driver to do the same thing to get the value. I don't know if it is feasible or not. But when the above code has been run in the upper filter driver, I got blue screen or restart. I have viewd the minidump file and got the error code C0000005 NTSTATUS, which is probably an access violation. I wonder if the upper filter driver has the privilege of access to descriptors of material resources. If not, can anyone suggest a way to get the vector of interruption of a specific device?

    BTW, I use the Intel processor and running Windows XP.

    Thank you much in advance!

    Hello qqMichelle,

    Thanks for visiting the site of the community of Microsoft Windows XP. The question you posted would be better suited to the MSDN Community. Please click HERE to find a community that will provide the support you want.
    See you soon

    Engineer Jason Microsoft Support answers visit our Microsoft answers feedback Forum and let us know what you think.

  • I want to install Acrobat Standard DC 2015 on a local computer.  A program needs to use reference the local installation files.  The STD Acrobat DC installed locally?

    I want to install Acrobat Standard DC 2015 on a local computer.  A program needs to use reference the local installation files.  The STD Acrobat DC installed locally?

    Yes.

    RonB

  • How to change each color of the illustrator vector object in 2013 of PowerPoint?

    When my client want different colors on vector graphical objects in PowerPoint.

    For example, I created graphics in Adobe Illustrator CS6 element, and then save as .emf file with color RGB, once exported mode then I insert the image from that file in PowerPoint 2013, after that I used separate both times. When I click on the different color theme, but it has not changed color.

    See video screenshot: 2015-10-03_1414 - fatech library

    I'm trying to understand how to change each color of the illustrator vector object in 2013 of PowerPoint? Please help me!

    Thank you

    FATECH wrote:

    But I want other options...

    There is no all.

    Illustrator and MS-Office share not all the graphics features of construction at the file level. There is no universal edit-ability between the two.

    .. which is the best export (eps, emf, or svg), then insert a vector file into PowerPoint?

    If your Illustrator illustration is vector of 100% and contains no live effects, complex gradients, blends, etc., the first thing to try is copy > paste special > enhanced metafile.

    Otherwise, SPE may work, or you can use the pixelation in PNG. Personally, I do not consider export raster format Illustrator to be a stable workflow method, so I'd be inclined to use Photoshop as an intermediate step: Illustrator > Save As PDF > open in Photoshop > save in PNG. Just my preference.

  • Flash canvas Hack: the best vector graphics on the retina and HD

    Tired of the fuzzy vector graphics on retina of Apple and another HD displays when you create HTML5 stuff in FlashCC?

    Place this code in the first frame of your code/timeline:

    if (window.devicePixelRatio > 1) {
    
        var canvasWidth = canvas.width;
        var canvasHeight = canvas.height;
    
    
        canvas.width = canvasWidth * window.devicePixelRatio;
        canvas.height = canvasHeight * window.devicePixelRatio;
        canvas.style.width = canvasWidth+"px";
        canvas.style.height = canvasHeight+"px";
    
        //console.log(window.devicePixelRatio);
         stage.scaleX=stage.scaleY=window.devicePixelRatio;
    }
    
    
    
    
    
    

    .. .and that's it! Vector smooth on the retina.

    I have not fully tested this for all screens, so if anyone else can check on Windows DPI high resolution, please let me know.

    See you soon,.

    Adam

    http://Adam.Piettes.com

    Hi Marcel,.

    The file you are publishing uses a custom template which is obsolete. It lacks some of the chips, which were introduced in CC Animate 2015.2.1, including that necessary to display the newly added HiDPI.

    To get the latest model settings, Goto, publish > Advanced tab and click on 'Default' and now to test the animation.

    You may need to add additional code (for example script above files) from the old model to the new model.

    To learn more about patterns, see here: creating HTML5 ads with CC animate: Google HTML5 Ad Templates | Blog hosting the Adobe team

    Let me know if encounter you problems.

  • Manipulate the shapes &amp; vectors with Expressions

    Hello

    Is it possible to manipulate the different vectors of a path or shape in After Effects using expressions? How one would call the individual vectors in the script of the expression? If not, are there other ways to draw and adjust the forms via expressions? Thank you

    -Saib

    As I said, you can't. The question here is, you actually want to animate the mask or shape layer paths? Most of which can be done easily with distorting (and much more intuitive, too) as Bézier or the puppet tool. So for me, you simply follow a bad strategy here...

    Mylenium

  • Implement the deployment of Machine virtual Windows Server 2012 with a data Bit Locker encryption?

    Hi all

    Is it possible to implement the feature data Bit Locker encryption on my Virtual Machine to Windows Server 2012 Std on the Platform VMware ESXi 5.1 vSphere update 1 ?

    The hypervisor is currently running on servers HP Blade BL 460 c G8 . Read well the hardware specification: http://h18001.www1.hp.com/products/quickspecs/14208_na/14208_na.pdf I see that he has taken a TPM installed on the blade, but I don't know how to make sure that it is activated or used by the Virtual Machine?

    Any kind of help would be greatly appreciated.

    Thanks in advance

    I had a few goes at it and it's not like you can virtualize a TPM. It would make sense if it was the case - the secure TPM was not designed to manage multiple instances of the OS.

    I ended up making USB passthrough on a USB stick and have the Bitlocker key stored on this stick as a demo. Certainly not a transaction supported, but it showed that the storage of key seems to be the only issue.

  • Garmin Vector pedals USB ANT + in LabVIEW

    Hello

    I would like to read the data of the vector Garmin pedals in LabView. For this, I would use the Ant + Garmin USB Stick.

    I read a lot of similar topics in the Forum. But there was no real solution. Is there someone who works in the same topic or someone who already has a solution?

    I also read on a Toolbox ANT +, but I don't know where I can find.

    Any idea would be appreciated.

    Thank you
    -BR

    Hi BR,

    I have a solution for this problem, as I am the developer of the tool that you mention.

    Communication with the pedals of Garmin Vector 2 using an ANTUSB-m is possible, we tested here at the office.

    Unfortunately our website is currently undergoing a large redevelopment so it's not complete with all the information, but you can check it out here. There is still a little work to do on the site, so please have some patience when looking for things.

    You can also find details on the Web site if you have any questions.

    See you soon,.

    Darren.

  • Encryption with dbms_crypto does not correspond to vectors of tests published for OFB mode

    Hello

    I use the dbms_crypto package in Oracle Express 11.2 I am trying to see that changes of encryption according to the "operating mode".  For reference, I used vectors of tests published on the web site: AES Test vectors I used these test vectors for a while with several languages such as Python PyCrypto and have generally found the information on this page to be reliable.

    When you try to use the BBA (output feedback mode) with AES256 encryption, I get a result that does not match the name on the web site of Test vectors.  Curiously, the result I get when using BBA mode matches the indicated result on the vector of Test for the ECB mode Web site, and in fact, if I use dbms_crypto ECB mode I get the same result. (If I try the CBC mode, I get the result the CBC matches appear on the web site of Test vectors).

    This suggests that when you specify the OFB mode in the call to dbms_crypto.encrypt, it's actually using ECB instead.

    I'm happy to share my code with someone who is interested.  I have not write it here now, though. It's pretty simple.  I use to set the mode,

    l_modNUMBER: = dbms_crypto. ENCRYPT_AES256
    + dbms_crypto. CHAIN_OFB
    + DBMS_CRYPTO. PAD_NONE;

    very similar to the Oracle documentation on this topic.

    Thanks for your interest,

    Norbert Kremer

    Hi Norbert,.

    Please report to us that I did a quick test on versions Enterprise Edition 11.2.0.3 and the 12.1.0.1.0, the 12 c seems to be OK, but 11.2.0.3 has a problem:

    Using the first vector to test for the OFB 256 - bit AES encryption mode

    Encryption key: 603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4

    Initialization vector, ciphertext Test vector

    6bc1bee22e409f96e93d7e117393172a dc7e84bfda79164b7ecd8486985d3860 000102030405060708090A0B0C0D0E0F

    Result:

    Connected to:

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    With the partitioning option

    SQL > @ofb

    Result: F3EED1BDB5D2A03C064B5A7E3DB181F8

    Expected: dc7e84bfda79164b7ecd8486985d3860

    PL/SQL procedure successfully completed.

    Connected to:

    Database Oracle 12 c Enterprise Edition Release 12.1.0.1.0 - 64 bit Production

    With the options of partitioning, OLAP, advanced analytics and Real Application Testing

    SQL > @ofb

    Result: DC7E84BFDA79164B7ECD8486985D3860

    Expected: dc7e84bfda79164b7ecd8486985d3860

    PL/SQL procedure successfully completed.

    I'll file a bug for this issue shortly and put you here,

    Greetings,

    Damage ten Monkshood

  • Vector illustration of harvest for use in Flash

    It is a really hard question. I try to use a complex vector artwork in Flash (exported from or imported from Illustrator)- but I want only the field of illustration that has been trimmed off. When I bring it in Flash (and I tried several ways to get there) - what I get is the illustration with a mask applied. I do not want)-j' have need of have completely cropped out it all while preserving the scalability/vectors of the illustration. I tried the dimensioning of the artboard, clipping masks, cropmarks, etc. - but Flash keeps import the entire illustration - using a mask.

    The only solution I've seen is to separate the vectors and make every effort for the flash drawing objects and then cut the edges - but they are COMPLEX and the process destroys the drawing illustrations.

    No idea how to 'clear' or cut areas in an Illustrator illustration outside clipping/plan of work/cropmarks masks?

    As amazing as is, Illustrator does not provide an appropriate way to actually reframe his work. He seems to have some fundamental problem associated with open paths not filled, which manifests itself in all its cutting path and combination tools and features.

    The Pathfinder operations delete fills and/or strokes or expand stokes. The only tool for Illustrator that can cut some parts of the work that contains open contours, not met without destroy the already applied strokes and fills is the still problematic Eraser tool.

    Download the Eraser tool. Press Alt while dragging a rectangle selection outside of the limits of the work you want to crop and dragging on the work. Repeat for the other sides.

    This can always give unacceptable results. The unpredictable fake gum of the open paths it cuts. He added handfuls extended to endpoints of straight segments. He cannot cut certain constructions such as mixtures or the content of the envelopes unless these constructions are first developed. In short, since it was added, Illustrator has now three different cutting tools, which are far from what has been provided in all the other competitors for decades.

    It may be well for your use in Flash. It depends on the specificity of the work, and degree of accuracy, you need the portions remaining to be.

    Understand: The cubic Bezier tracks that are drawn in programs like Illustrator (and even in Flash, using the pen tool) undergo a redesign in the final SWF, because Flash converts in quadratic curves for efficiency.

    It is very easy to end up with enormously bloated swf when the final work is created in the development of programs and then used 'as-is' in Flash.

    JET

  • I get a JavaScript Application error: "setTimeout" called on an object that does not implement the interface Window for Firefox.

    I get a pop up box with the message: Application JavaScript error: "setTimeout" called on an object that does not implement the interface Window for Firefox.

    But it seems to appear when I go to Amazon.com. Then he opens with this message and the OK option? But as fast as I can click OK, another box appears. After all a half dozen, she disappears - until what I move to another part of Amazon! I uninstalled - reinstalled and then - Firefox and BA. I do not understand this!

    (And of course, there is always the possibility that it is not only attacking me on Amazon... There may be a lot of other sites that also trigger, and I just haven't been there yet.)

    Hello

    Try Firefox Safe mode to see if the problem goes away. Firefox Safe mode is a troubleshooting mode that temporarily disables hardware acceleration, restores some settings and disables add-ons (extensions and themes).

    If Firefox is open, you can restart Firefox Safe mode in the Help menu:

    • In Firefox 29,0 and above, click on the menu button

      click Help

      then select restart with disabled modules.

    • In previous versions of Firefox, click on the Firefox button in the upper left of the Firefox window and click help (or click on help in the Menu bar, if you do not have a Firefox button) and click on restart with disabled modules.

    If Firefox is not running, you can start Firefox in Mode safe mode as follows:

    • On Windows: Hold down the SHIFT key when you open the desktop Firefox or shortcut in the start menu.
    • On Mac: Hold the option key during the startup of Firefox.
    • On Linux: Exit Firefox, go to your Terminal and run firefox-safe-mode
      (you may need to specify the installation path of Firefox for example/usr/lib/firefox)

    When the Firefox Safe Mode window appears, select "start mode safe."

    If the problem is not present in Firefox Safe Mode, your problem is probably caused by an extension, theme or hardware acceleration. Please follow the steps described in the section Troubleshooting extensions, themes and problems of hardware acceleration to resolve common Firefox problems to find the cause.

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before you open Firefox for normal use again.

    When find you what is causing your problems, please let us know. This might help others with the same problem.

  • Is it possible to implement the special keys to a program name

    Canned commands

    Is it possible to implement the special keys to program a name & address, etc.?

    In addition, if there is a low-cost program that does the same thing please let me know.

    Thank you

    Damon

    Settings - general - keyboard - replacing text

    It works for your needs?

  • How can I implement the family sharing with separate billing?

    I want to implement sharing of the family, but would prefer that the purchases made by the members of the family have been charged to their own methods of payment rather than mine (as a family organiser).

    When family members purchases will be deducted from the balance (if they have a), or taken from map of the organiser (if they do not have a balance or if it does not cover the purchase, in which case the excess will be charged at map of the Organizer), a member may not use their card for purchases (and any balance on the account of the Organizer cannot be used).

  • Hardware Toshiba implemented the program always crashes

    My Toshiba hardware implemented the program crashes and I get this error message
    Problem event name: APPCRASH
    Application name: rundll32.exe_Shell32.dll
    Application version: 6.1.7600.16385
    Application timestamp: 4a5bc637
    Fault Module name: msvcrt.dll
    Fault Module Version: 7.0.7600.16385
    Timestamp of Module error: 4a5bda6f
    Exception code: 40000015
    Exception offset: 00056202
    OS version: 6.1.7601.2.1.0.768.3
    Locale ID: 3081
    Additional information 1: e165
    More information 2: e1652446e2a08661f301069e3d3002c2
    3 more information: b5d4
    Additional information 4: b5d41abf30ccf3a8321b59a4ced6abd8

    Ive done malware and virus checks come back clear and the registry clean and Defrag. Ive done an analysis of file system which makes the system corrupt files but unable to fix. Can anyone help, cheers, Jeff

    Can you please tell us which laptop model you have and what operating system are you using?

  • Implement the json JWT with labview web token

    I need to implement of JWT authentication with labview, how can it be done?

    I'm not aware of an existing library of JWT for LabVIEW. You can see the site of JWT to the creation and analysis of JWT requires:

    JSON encoder / decoder

    base64 encode / decode

    and a signature / encryption method (commonly built HMACSHA256 depends on the Oracle application)

    JSON encoding and decoding is available for LabVIEW 2013: https://zone.ni.com/reference/en-XX/help/371361K-01/glang/flat_unflat_string/

    The other two are not available of NEITHER, but have implementations in the LabVIEW community:

    Base64:

    https://decibel.NI.com/content/docs/doc-5544

    https://decibel.NI.com/content/docs/doc-23233

    Signature:

    https://lavag.org/files/file/198-encryption/

    https://decibel.NI.com/content/docs/doc-22585

    If unfortunately JWT support is not provided by default, but all the necessary parts to the realization that he should be here.

Maybe you are looking for

  • My Satellite Pro L Gets a BSOD after going into sleep

    My Satellite Pro L Gets a BSOD after going into sleepWe spend whenever my laptop is asleep or in hibernation.When she comes back, it goes to BSOD. Can you help me please?

  • How to set the order of the login items

    Is it possible to control the order in which the elements of opening loading at startup? I have a called Snapz Pro who charge near the end, and for some reason it loads in 'active' mode (as if I clicked it), and I must escape out of it before I can u

  • Satellite L450D-11V - power indicator does not

    I just bought my L450D-11V a week ago. I noticed today that power led (indicator on the power button / stop) does not respont or act even when I put a computer to sleep. According to the manual, it should blink orange and white in other conditions. I

  • bort underh'll rensa disc

    I'll do it to dvd movie can't and will have the word yo Swedish English

  • Print-toFile.

    I had to reinstall Windows XP Pro. In doing so, I was unable to restore Print-toFile. The printer XPS and XPS files viewer products import or copy in Exel 2003. Can anyone suggest a method without cost th print to Excel-readable file? Some announced