From 11:00 PM CST Friday, Feb 14th - 6:30 PM CST Saturday, Feb 15th, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Floodfill Algorithm

Hi,
 
I need a floodfill algorithm in LabVIEW version 7.1 that uses purely LabVIEW commands, no CINs or DLLs.  I'd use IMAQ, but it is too complicated to use, and also I don't have the full package.  If I could just get the algorithm, because I don't need a subvi, just something that can perform floodfill.  I would really appreciate your help!  Thanks!
 
7J1L1M
0 Kudos
Message 1 of 19
(5,813 Views)

"7J1L1M" <x@no.email> wrote in message news:1162942807406-437957@exchange.ni.com...
Hi,
&nbsp;
I need a floodfill algorithm in LabVIEW version 7.1 that uses purely LabVIEW commands, no CINs or DLLs.&nbsp; I'd use IMAQ, but it is too complicated to use, and also I don't have the full package.&nbsp; If I could just get the algorithm, because I don't need a subvi, just something that can perform floodfill.&nbsp; I would really appreciate your help!&nbsp; Thanks!
&nbsp;
7J1L1M




http://en.wikipedia.org/wiki/Flood_fill


Regards,


Wiebe.
0 Kudos
Message 2 of 19
(5,800 Views)

Thanks Wiebe.  Would someone else have a LabVIEW program as well?  Smiley Indifferent

7J1L1M

0 Kudos
Message 3 of 19
(5,792 Views)

"7J1L1M" <x@no.email> wrote in message news:1162995008897-438264@exchange.ni.com...
Thanks Wiebe.&nbsp; Would someone else have a LabVIEW program as well?&nbsp; Smiley Indifferent
7J1L1M



OK, I though that was to easy..


Why do you need the algorithm? Is it just to color the picture? Do you need the total nr of connecting pixels?


Also important... How fast should it be?


Normally, I'd use NI Vision to do a threshold (bandpass) on the color, and then a blob analysis. That would get you you the same result as a floodfill.


Here is some source code, but it's in C. Converting it to LabVIEW can be tricky (if it has to be fast):


http://student.kuleuven.be/~m0216922/CG/floodfill.html


Here's some in depth information:


http://www.math.tau.ac.il/~dcor/Graphics/cg-slides/flood-fill03.pdf


Regards,


Wiebe.
0 Kudos
Message 4 of 19
(5,778 Views)

Wiebe,

Thanks for you reply.  I have two main reasons for the floodfill thing.  For one program, I need it for a picture editor, but I can't use IMAQ (hard to use) and I don't have quite all the commands.  I also need to use the algorithm to tailor up a mask for a picture interface.  I was also hoping to use something that doesn't require outside files (just in case it causes a computer failure, my LabVIEW doesn't seem to like them very much...).  I will try the C-Code, but how would I implement it into LabVIEW?  I am not very good at the DLL interface node, everytime I do it myself, I always mess up.  Thanks for your help, and I look forward to your next email.

7J1L1M

0 Kudos
Message 5 of 19
(5,771 Views)

Oh, sorry, I forgot to specify the speed and other things.

I would prefer it to be a nice, fast, and simple algorithm.

Also, I need its sensitivity to be definable (4 and 8 connectivity).  Sorry I forgot to say that!

 

7J1L1M

0 Kudos
Message 6 of 19
(5,769 Views)