03-19-2022 11:17 AM
I need to make 2 things :
1. Input a drawing with white background and black drawing (continuous line with random curves) and convert it to a 2d array
2. I draw on a paper above a camera and send live drawing
I'm quite new to labview, I know some machine vision feature but this is totally new for me
Thanks in advance, any help would be appreciated
Solved! Go to Solution.
03-19-2022 02:09 PM
I hope you have a "reasonable" amount of experience and expertise in "ordinary" LabVIEW (i.e. LabVIEW + DAQmx, reading from USB DAQ devices and/or VISA so you have experience with getting data from Hardware and processing 1-D and 2-D Arrays of data), say several months. LabVIEW "Vision" hardware works a little differently, and can be something of a challenge to tackle on your own.
I assume you have a WebCam or something similar that you plan to use to acquire your images -- something relatively inexpensive that is meant to be plugged into your PC's USB Port to allow you to make Video calls, for example (Logitech makes such things -- there's one sitting on my monitor).
Here's how to get started:
Bob Schor
03-19-2022 10:54 PM
Oh about that I did have some experience, I make some pattern matching with 1 cam (both in labview and in vision assistant) , stereo calibration and depth image with 2 cam
03-20-2022 08:33 AM
Should I put every 1(black) that appear on a 0(white) paper in an array?
03-20-2022 07:52 PM - edited 03-20-2022 09:18 PM
@PULSE.Wannabe wrote:
I1. Input a drawing with white background and black drawing (continuous line with random curves) and convert it to a 2d array
How should the 2D array represent the drawing? What's the datatype?
Is the drawing static?
An image is already basically a 2D array of pixels, so I am not entirely sure what you mean by "conversion"? What's the datatype of the desired 2D array (boolean? numeric? array of elapsed seconds since drawn? etc.) How will it be used later?
03-20-2022 10:10 PM
I recommend that you go to the Web and type "LabVIEW IMAQ Image to array" and do some reading/studying. Learn what a "Pixel" is, and how it can be represented. Then think about what values you want for the Pixel. Note Pixels come in various "sizes" (usually measured in "bits").
Bob Schor
03-21-2022 03:42 AM
@PULSE.Wannabe wrote:
Should I put every 1(black) that appear on a 0(white) paper in an array?
Sorry I didn't make it clear here.
here's the step in detail :
1. I draw an abstract line on a piece of white paper with black ink above a glass with camera below
2. The cam will capture an RGB image (I think)
3. I convert it to binary image then display it on a 2d array
but can I obtain which position / where did I start my drawing ?
for example : I start drawing a straight line from bottom left paper, then I make a star shape, then from the last point, I make a zigzag line until it reach the end of the top right corner paper
03-21-2022 10:16 AM
@PULSE.Wannabe wrote:
but can I obtain which position / where did I start my drawing ?for example : I start drawing a straight line from bottom left paper, then I make a star shape, then from the last point, I make a zigzag line until it reach the end of the top right corner paper
So you are still talking about a sequence of events (start...then...then...then etc.), so I am assuming that you want to modify the 2D array continuously while the drawing takes place.
If you get an RGB image, but you are dealing with a B&W image, it is sufficient to use one color channel (e.g. red). You you need a suitable calibration for the threshold to decide what's black and what's white.
2D arrays have index 0,0 in the upper left. If that differs for the raw image array, adjust accordingly. If the camera is below the glass, you might also need to mirror the image to represent how it looks from above.
Array elements on the front panel are typically significantly larger than a pixels, so most likely you need to do some decimation. Alternatively, you could display your array in an intensity graph, of course.
To give us a better idea what we are dealing with, could you attach a typical acquired image?
03-22-2022 06:00 AM
example drawing
example array of the drawing above
I draw from bottom left to top right, I want an array that provides every pixel position from the bottom left to top right , first pixel position (x,y) will be when I put my pen down (bottom right) and the last position is when I take my pen off the paper. but can labview do that?
03-22-2022 10:38 AM
The "short answer" is LabVIEW Vision can do that. The more complete answer is that this is a multi-facetted problem, each part of which requires perhaps a reasonable level of expertise with both Image Acquisition and Image Analysis.
Here are some of the facets:
Bob Schor