LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Image Proccessing

Solved!
Go to solution

Hi. I have a problem which involves merging two images. Essentially i have an image with a person in front of a greenscreen and a background images. I want to create a VI where all the relevant green pixels from one image are replaced with the pixels from the other image, with some user interface which can adjust some parameters. I was wondering if anybody could help ?

0 Kudos
Message 1 of 10
(1,896 Views)

Do you want to learn how to "do this yourself", or are you looking to hire someone to do this for you?  Do you have LabVIEW and experience in LabVIEW programming?  Are you planning to use NI's "Vision" Toolkits (and do you already have them, and experience in using them)?

 

Bob Schor

0 Kudos
Message 2 of 10
(1,890 Views)

Hi Bob, yes I would like to learn how to do this myself ideally, some guidance or examples may be useful. I have Labview and minimal experience, im intending to complete the task using only Labview standard tools and blocks. I will attach my very much failed attempt at the task so maybe you can see where im trying to go, although i may be going in the complete wrong direction. Thanks for your help

0 Kudos
Message 3 of 10
(1,874 Views)

I would recommend using NI Vision which has a library of useful functions.

 

You can start by reading the IMAQ Vision concepts manual Chapter 14 Color inspection, and then move to the LabVIEW example finder for NI Vision Color.

0 Kudos
Message 4 of 10
(1,836 Views)

Hi Bob,

I was wondering if you could help me with my problem. So I essentially want a programme which

test all three colours of an image (JPG). Then use the results of all three tests to make one decision that a pixel is "green" or not and, if it is "green", then swap that whole pixel for the one from the other picture. Using standard LABVIEW without any add ons. To essentially use green screen to superimpose one image onto the other one. I hope you can help. I have been told using an and and block is the way to go about it.
Many thanks in advance.
Alex
0 Kudos
Message 5 of 10
(1,800 Views)

Hi

I was wondering if anyone could help me with my problem. So I essentially want a programme which

test all three colours of an image (JPG). Then use the results of all three tests to make one decision that a pixel is "green" or not and, if it is "green", then swap that whole pixel for the one from the other picture. Using standard LABVIEW without any add ons. Using the programme to essentially use green screen to superimpose one image onto the other one. I have been told using an AND block is the way to go about it. I want the front panel to have some threshold controls. an image of the greenscreen photo, an image of the background photo and an image of the photos mixed. Any advice at all would be much appreciated.
Many thanks in advance.
Alex
0 Kudos
Message 6 of 10
(1,791 Views)

Hi AJ,

 


@AJ1507 wrote:

So I essentially want a programme which test all three colours of an image (JPG). Then use the results of all three tests to make one decision that a pixel is "green" or not and, if it is "green", then swap that whole pixel for the one from the other picture. Using standard LABVIEW without any add ons. To essentially use green screen to superimpose one image onto the other one.


So what have you tried so far? Mind to attach your current VI with two example images (one with green screen, one with "other pixels")?

 

How do you define "green"? I would suggest to implement to test the RGB value of a pixel:

 

 

IF R and B rather small, while G is rather large THEN "green" ELSE "not green"

 

 

Define your limits for the typical range of 0…255 for individual colors!

(A little bit more advanced would be to convert from RGB to HSV and only check the H value.)

 

Iterate over all the pixels in the image…

 

Edit after merging your other message:

Please keep things in one place! No need to start a new thread for the very same problem!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 10
(1,793 Views)

Hi Gerd,

 

Thank you very much for your response and apologies for starting a new thread. I am new here. I have attached my current VI, as I'm sure you can see from it I am getting rather confused with things, however it may make more sense as to what I'm trying to achieve. I want to test the pixels (although knobs may not be the best way) to adjust thresholds and find the right threshold for what i define as 'green' my next problem is how to replace the 'green' pixel with a pixel from the other image. I believe using the RGB the way I am isn't correct as i want to replace the whole pixel not just RGB elements of it. 

Download All
0 Kudos
Message 8 of 10
(1,778 Views)
Solution
Accepted by topic author AJ1507

Hi AJ,

 

what about this as a simple startup:

You need to refine the decision process according to your needs…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 10
(1,775 Views)

Thank you very much Gerd. That is extremely helpful, and something i can now play around with.

Once again thank you very much for your help

0 Kudos
Message 10 of 10
(1,770 Views)