LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I after compare from 2 images automatic mark the image differenz?

Hello, Mike,

I have some questions, can you maybe explain those?

1. Why will you at first change all none zero values to red, then to gray? What did you mean with "So that the no pixels go lost while changing to gray"? Why will you change all changes to gray, then edit them? Why can you not edit them in other color, maybe yellow etc.?

2. Can you explain the sheets: "objects1" -> "objects2" -> "objects3" -> "objects6" -> "objects5" -> "objects4"?
I mean,  can you explain me,  what each sheet did? And what is the relationship between the sheets?

3. I don't understand that "getobject.vi" so well, can you explain me it shortly, too? Each sheet?

Thanks a lot, I am new here and have some problem to understand your program, it is maybe litte difficult for me.
I know it is maybe too much for you, you have worte me the examples, but without your help I can not quite unterstand the program;-(
I ask for your help and patient explanations, thank you.

Regarts,
Johnny


0 Kudos
Message 11 of 28
(1,378 Views)
Hi Johnny,
to one: "normally" all picture working algorithms work with gray scale picture. During the first trial with your pictures i see that, if i directly convert it to gray, some pixels are also black. So i first change all none black pixels to red and then to gray. The gray scale picture array has a size of width*height, while your "normal" pictures have a size of (width*3)*height, if they have a depth of 24bit, so it´s easier to use gray scale pictures.

to two:
- objects1:
* will only be called one time while running
* creates the 2d array from the difference array
* create a 1d array with value 255, this is the white line
- objects2:
* will also be called only one time
* scans the 2d array line by line and column by column -> if there is a value greater than "0", then there is an "object", now i use only the scan results from top to bottom
- objects3:
* calls the getobjetcs vi and add on all sides 10 pixel to the found object
- objects5:
* deletes the found object in the 2d array (the original size not with the 10 pixel on every side
- objects4:
* draw a white line into the 2d array (can be removed, only for debugging)
* checks if all array elements are "0", if yes then the program ends, else starts with objects2
- objects6:
* saves the little object pictures (not used in the last version!)

to three:
- 0) top edge exists already
- 1) search for the left edge
- 2) search for the right edge
- 3) search for the bottom (from top to bottom, between found left and right edge, until all pixels are "0")

If you have further questions, don´t hesitate to ask.

Mike

Message Edited by MikeS81 on 05-18-2008 08:13 PM
Message 12 of 28
(1,375 Views)
Hello Mike,

what did you mean with the "0,299", "0,587" and "0,114" on the sheet "intogray"? How did you got these 3 faktor? Why did you used that?

And how exactly is the logic on the sheets "0, Default", "1" and "2"of the Picture.getobjects.vi? Can you explain me each .VIs, how they work?

For my need I don't need the sheets "read", "empty", "getobjects", "cyclecol" and "save" of "Picture.Main.vi", right? But I need the sheet "exit" to quit the program, right?

regarts,

Johnny


0 Kudos
Message 13 of 28
(1,367 Views)
Hi Johnny,
the human eye see different color with different intensity, and 0.299, ... are the best constants to calculate the associate gray scale for the picture. I got this values from different books and wikipedia. 🙂

I discribe the function of the getobject.vi tomorrow, ok?

Yes, it could be. You need only the cases which can be called if you start with "read2".

Hope it helps.

Mike
Message 14 of 28
(1,365 Views)
Okay, you can write the getobject.vi tomorrow, thanks a lot.

Good night.


Regarts,

Johnny
0 Kudos
Message 15 of 28
(1,363 Views)
Hello Mike,

Can you maybe explain me the getobjects.vi?

Thanks a lot \(^,^)/

regarts,

Johnny
0 Kudos
Message 16 of 28
(1,341 Views)
Hi Johnny,
sorry for the delayed response.
 
Start case is case "0". this case searches for the left edge. Every iteration i create a subset from the whole array which will be searched for a none "0" (black) pixel. This subset move in each iteration to the left and to the bottom, but only if there are none zero pixel. If the entire subset is black this case is over and the left edge is found. This value will insert into the cluster.
Case"1": searches for the right edge and uses also a subset with the width 20x20 pixel. it moves only to the right. The subset will be scanned column by column until there is no column with a pixel other than black.
Case"2": searches for the bottom edge. Starts at the top and scans row by row until there is a complete black line. The row has only a size from left to right found edge.
 
Mike
Message 17 of 28
(1,333 Views)
Good morning, Mike,

thank you.

regarts, johnny
0 Kudos
Message 18 of 28
(1,331 Views)
Hello, Mike,
 
I have 2 questions, can you help me?
 
Question 1: "decimate 1D Array" in the case "intogray"
 
I don`t unterstand this "decimate 1D Array" very well. How does this "decimate 1D Array" work?
You have got the difference image in the case "difference", and then you have already in the case "intored" change all none zero values to red, why do you not use the same method like that to chagen all red values to gray?
After the case "intored" the difference image has only color from black and red, right?
This "decimate 1D Array" has an input and treee outputs, which mean is the each output? Color? but we have here only 2 colors from last case, black and rot, right? Why hat each output a other factor to multiply? What happens after the multiplication?
Can you give me litte more detail and explain about  this case "intogray"?
 
 
Question 2: Test report
 
I would like to create a test report for my program, maybe a Word file.
 
My idea is, I want to get a Testreport like Appendix "test report.doc"
How can I do that? Can you help me at this point? Maybe a sample program? Thank you in advance!
 
All black texts or lines would be fixed or defined , they are the basic for my test protocol.
All blue texts or lines would be manually from user entered, before user starts the picture Main.vi.
All red texts or lines would be automatically from the programm collected and entered.
All image will be automatically inserted.
The word file will be saved in the order of PC.
 
regarts,
 
Johnny
 
 
0 Kudos
Message 19 of 28
(1,299 Views)
Hi Johnny,
 
How does this "decimate 1D Array" work?
The describtion in the context help about this function is very good. Smiley Happy I use it, because i need the R, G and B values each in one array, to calculate the gray value. For more information see this link: i think you can read it: http://de.wikipedia.org/wiki/RGB-Farbraum Smiley Happy
 
why do you not use the same method like that to chagen all red values to gray?
is described in the above link.
 
After the case "intored" the difference image has only color from black and red, right?
Yes, but each pixel has 3Byte, one for red, one for green and on for blue.
 
Why hat each output a other factor to multiply?
human see different colors with different intensity, that´s the reason.
 
What happens after the multiplication?
After the multiplication we have only gray values, that means each pixel is represented by a value where R,G and B are equal. And because of this we do all following calculations with a reduced array, where we have only one Byte/Pixel.
 
You can use ActiveX funtions or the report generation toolkit to write a test report.
 
Mike
Message 20 of 28
(1,276 Views)