How to add two images together (green screen system) in LabVIEW - labview

I have two images, one with subject and other one with background. The subject image has green background and I want to remove the green color from subject and add the subject without green color to another background, basically changing the background of one picture with another in LabVIEW without C code or MATLAB code, only using LabVIEW blocks.
So far, I got the following, but I am not getting one thing how to remove a very small portion of pixels. How to solve this problem,

So your algorithm is to replace a pixel, when red - blue =0 in the first place.
This condition is true for all this colors:
While there is no magenta in the picture, there is some almost black below the elbow and some almost white at the hand. So, that's replaced.
Try to restrict the colors to be replaced more, maybe like this:
Also, I'd to this independently for red and blue. So, for example
green > A AND red < B AND blue < C AND green-red > D AND green-blue > E
Since one of your files is names "final lec final.vi", I'd stop here ;-)
Oh, and just for fun: Playing with brightness and contrast reveals the JPEG artifacts, which is one part of the problem:

Related

Coreldraw Multiple Contours in VBA

Guys I Am trying to set up a three colour text that is editable
Basically what I want is the text to be black
A 1st contour of 1mm that is white
a 2nd contour of 2mm thick which is black
I have tried the following 2 step contour
ActiveSelection.CreateContour cdrContourOutside, 2, 2, , , CreateRGBColor(0, 0, 0), CreateRGBColor(255, 255, 255)
this works perfectly as I want and when I edit the text the contour changes to the new text however the contours are both the same width (2mm) and not 1 & 2mm as i want
Also I cant get it to specify the correct color for each contour
If I break apart the 1st contour then add another this gives me contours of different widths and colors but I then loose the edit ability as the contour is not attached to the text
Any Ideas I Know its possible as I have seen a commercial macro that does it
Any Help appreciated
Mark
The best I can do for you is to show you the object model. I do not have CorelDraw and therefore cannot test anything.
Here is the link to the CorelDraw Object Model.
http://apps.corel.com/partners_developers/csp/resources/CorelDRAW%20VBA%20Object%20Model.pdf
And here is a link to a Programming Guide for CorelDraw.
http://apps.corel.com/partners_developers/csp/resources/dvba_pg.pdf
You can look up "Applying Effects" on page 72 of the programming guide which may help.
I would suggest also looking at creating curves from the .Shapes object and then looking at the TextRange object. the TextRange.Text property is the actual text you want to see and the TextRange.colorindex is the color of the text I believe. You will have to do some exploring, but this should help.

Convert colored line in Bitmap image to System.Drawing.Graphics

is there any way to convert a colored lines in a picture (say Path Lines in Google Earth, colored red ) into lines of Drawable objects (System.Drawing.Graphics)? If there is no direct way, please point me to the right directions on how to do this?
Basically I want to convert those 3 red lines in the image into 3 red line objects in VB.NET through code. Thanks.

How to compare two line graphs using data points

I have 2 graphs as below with the blue line indicating an ideal scenario and the orange lines indicating couple of real scenarios. I wanted to check how similar the blue and orange lines are. Looking at the graph, it is obvious that the orange line in chart on top has very similar pattern as blue line. On the other hand, the orange line in bottom chart , has completely conflicting pattern. what is the best way to conclude the orange line in top chart is the better/ closest resembling pattern, mathematically.

Vb.net Identify how much specific colors in an image

is there a vb.net code to identify how much specific color(brown,yellow,green) in an image? Like I have an image of a leaf and i want to identify how much yellow colors, brown colors and green colors of that image so i can have a result that either the leaf is:
dead-ALMOST BROWN
healthy-ALL GREEN
unhealthy-YELLOWISH
Do i need to convert the image first to other types like bitmap/threshold ?
DO you have any reference for this? Thanks a Lot in advance

How to cut out numbers from an image dynamically?

i've got to this stage:
where i can find the numbers in the above image but i need to cut them out so i can retain the order etc. but the as the number increases the spacing changes and the position of the number?
so i think it should be a find a white PX the continue until it find a solid black col and then use the points to do a simple cut any help would be great.
A simple solution would be this:
Find the first upmost horizontal line which contains white pixels
From that line find the first horizontal line which contains only black pixels
Those two lines are your upper and lower borders.
Between this borders proceed like this:
Find the first most left vertical line which contains white pixels
From that line find the last vertical line which contains only black pixels and which comes directly after a line with white pixels.
Those two lines are your left and right borders.
The steps to separate single numbers can be performed analogously.
If you need to identify which numbers are in your picture, I recommend using specialized computer vision libraries.
Some VB.net pseudo code to get you going:
Sub FindTopBorder(image As MyImage) As Integer
For y = 0 to image.Height - 1
For x = 0 to image.Width - 1
Dim pixel = image.GetPixel(x, y)
If ('Check if pixel is white here with RGB or Color') Then
Return y
End If
Next
Next
' Just in case there are no white pixels or use an exception instead
Return -1
End Sub
I would start looking into Connected component segmentation. You find a pixel which is within a character (number). Then run the connected component algorithm which finds all connected pixels under specific set of rules (e.g. slight deviation in color, stop at hard borders etc).
http://en.wikipedia.org/wiki/Connected-component_labeling
If you can use libraries, I'm sure OpenCV or similar libraries support this out of the box.
//edit
I see you need VB.net. Probably it is easiest to port some algorithm to VB or create one yourself.
See e.g. http://www.codeproject.com/Articles/336915/Connected-Component-Labeling-Algorithm
What to expect
Input
An image containing two shapes:
Output
Now each is separated into single images.