07-24-2012 04:46 PM
Solved! Go to Solution.
07-25-2012 11:38 AM
Hi mjstone,
Unfortunately, Vision Development Module (VDM) is not supported on Linux; however, LabVIEW 8.6 and later for Linux should support MathScript nodes (see this link).
Another option would be to use OpenCV for the machine vision as it is free and you could code in Python.
07-25-2012 11:42 AM
07-26-2012 05:21 PM
There are a couple of different ways to pass the image to the dll (that will be doing the processing).
The best way would be to convert it to an array (using the IMAQ ImageToArray.vi) and then pass the array reference to the dll. Here is an excellent community example that discusses this.
Passing the actual pointer could be difficult as it is a specific data structure (see this post). This post discusses a potential way of doing it but passing the array would be a more robust solution (albeit a slower one).
07-26-2012 05:46 PM
07-26-2012 05:48 PM
So MJStone, I was hovering over the me too button. Until I hit the part about worms. Please extrapolate, why worms?
07-26-2012 05:59 PM - edited 07-26-2012 06:02 PM
*sigh* I'm an engineer in a bio lab. They're not the kind of worms you're used to, but these guys devote their entire existence to http://en.wikipedia.org/wiki/Planarians . Incidentally, they do like to feed normal worms to them, live. It's a bit scary watching 10 of the little buggers latch onto one. They want high-zoom pictures over a long time (weeks), but they currently have to swivel the camera by hand constantly as the planarians move.
07-26-2012 06:08 PM
Are they similar to this bugger on my arm?
I know nothing of flatworms.
07-26-2012 06:12 PM
They're only about 1 cm long. Also they have cute little eyespots that look like googly eyes if you squint a bit: http://islandwood.org/kids/stream_health/Images/planarian2.jpg
07-27-2012 05:41 PM
So, I ended up trying to write a simple C++ wrapper function. Right now, I'm not even doing the image processing, just setting a region of interest and saving. However, in order to do this, I need to make an instance of the OpenCV Mat class, and apparently LabVIEW can't handle any sort of C++ classes. When I try to import the library, LabVIEW tells me that it cannot find the file (which is pretty much the catchall error, for some reason, and pops up in a lot of cases where you do something wrong with the Call Library Node).
Thus, I tried making a C wrapper around my C++ wrapper. Same error. Any ideas why? Here's the code:
C++ WRAPPER: opencvl.cxx
#include <opencv2/opencv.hpp>
#include "opencvlv.h"
using namespace cv;
int saveROI(unsigned char *pixels, unsigned int width, unsigned int height, unsigned int roix, unsigned int roiy, unsigned int roiwidth, unsigned int roiheight, char *filename)
{
Mat roi(height, width, CV_8UC1, pixels);
roi = Mat(roi, Rect(roix, roiy, roiwidth, roiheight));
imwrite(filename, roi);
return 0;
}
C++ HEADER: opencvlv.h
extern int saveROI(unsigned char *pixels, unsigned int width, unsigned int height, unsigned int roix, unsigned int roiy, unsigned int roiwidth, unsigned int roiheight, char *filename);
C WRAPPER: opencvlvwrap.c
#include "opencvlvcwrap.h"
#include "opencvlv.h"
int saveROICWrap(unsigned char *pixels, unsigned int width, unsigned int height, unsigned int roix, unsigned int roiy, unsigned int roiwidth, unsigned int roiheight, char *filename)
{
saveROI(pixels, width, height, roix, roiy, roiwidth, roiheight, filename);
return 0;
}
C HEADER: opencvlvwrap.h
extern int saveROI(unsigned char *pixels, unsigned int width, unsigned int height, unsigned int roix, unsigned int roiy, unsigned int roiwidth, unsigned int roiheight, char *filename);
Not much time left to work on this project and I'm getting held up by the little things...