LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Vision IMAQ Color Learn VI - problem

Solved!
Go to solution

Dear Everyone,

 

I have the following problem. 

 

I have a school project to write a program which counts the colored things that are shown to the camera, classified by colors. I solved this with the usage of NI_Vision_Development_Module.lvlib:IMAQ ColorLearn. To the 'Color Spectrum' output are wired parallel an '1D array (64bit real)', an 'Index Array' and an 'Array Max & Min'. I wanted to handle only 6 kind of colors (red, blue, green, yellow, black, white). My idea was to show this colors to the camera and check which value has a maximum in the 'Color Spectrum'. It was working fine, the cells were in these patterns: (i=0 - red, i=4 - yellow, etc.). With the 'Array Max & Min' then I get the index of the color with the maximum value in the array and with a 'Case Structure' I made the counting. It was working perfectly, I have tested it in many environments. 

With 7 days after the last save of the program (the final, working version), today I have opened it again but the count does not work, the colors are mixed up. I show red to the camera and in the 'Color Spectrum' it is in i=1, not in i=0 as before, yellow  is in i=3 and so on to the other colors. I have loaded back many backup savings and all have the same issue, every is the same. It will be the easiest to reinitialize my array_index-color_name pairs, but I would like to know what has happened. I have never seen such a thing before.

 

I am using Labview 2016 (64bit) Student License, Windows 7 SP1 (64bit).

 

Thanks for your suggestions.

 

Best regards,

Lajos

 

 

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

Was your VI open the entire time until you closed an reopened it before this issue? The only thing I can think is something wasn't initialized properly.

 

Please include a Snippet of your code, or attach your VIs, so that we can better assist you. We are here to help, but won't spend all that extra time recreating your code from scratch.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 10
(3,532 Views)

Here is a screenshot about that part of the program. 

0 Kudos
Message 3 of 10
(3,531 Views)

Dear James,

 

my program was closed and reopened again. The screenshot. that I have posted is not a replay for your question so please do not take that as a harm beacause the lack of any salutation. I also attach my VI, the only modification I have made is the translation to english.

 

Thank you.

0 Kudos
Message 4 of 10
(3,523 Views)
Solution
Accepted by topic author bulgakov

Thanks for supplying the screenshot.

 

So the output "Index(es)" is changing behavior? It doesn't look to me like that should behave any differently depending on inputs unless you changed the saturation threshold. I found one thing online that suggests index 1 should be red.

 

If it's the Boolean checks that are behaving differently, maybe you had a different input for the "Érzékenyzég" input that wasn't saved?

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 5 of 10
(3,515 Views)

Has the lighting changed at all? Maybe you need to handle a range of index maximums for each color. Example: 0-1 = red, 2-4 = yellow, etc

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 6 of 10
(3,514 Views)

Nope the lighting is now the same. Here is the story about. 

1) Like 7 days before I have saved the last version of the VI (the same as I have attached), it worked perfectly. Also I made a backup save to my drive and closed the whole Labview. 2) Few days later I opened it in different conditions, also different lights, it worked perfectly. I closed Labview, no save was made.

3) Now. I opened it and the colors were mixed up. The backup save also behaves bad, it has the same problem. The conditions are the same as by the first occassion. 

 

Between the 2. and 3. points I made an another VI, which reads QR codes. Can be there any kind of options which take effect to this VI because of that? They were made sepparately. I mean any kind of setup for the camera which takes effect globaly. 

0 Kudos
Message 7 of 10
(3,506 Views)

If you've eliminated the version of the LabVIEW code as the cause of the issue then it must be related to the camera or other hardware settings. Is there a way to reinitialize the camera or load the old settings?

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 8 of 10
(3,500 Views)

I manipulated the picture of the camera only inside the QR reader VI, I did not change any hardware settings. If there was any kind of setting that would be automatically exported from a VI to the whole Labview then I do not know how would it be possibly to reset it. But it makes no sense since you say, that red is i=1, then I have to reinitalize my color VI, because it is working fine now. 

 

If you had a source that lists all the colors with their indexes, sharing with me would be a great help. 

 

Thank you very much for your suggestions, much appreciated.

 

Cheers, 

Lajos

0 Kudos
Message 9 of 10
(3,498 Views)

Dear James, 

 

excuse me for reposting. I have managed to download an earlier version from my drive, luckily it stores the older ones not just overwrite the files. It works perfectly with my original setup (its counter is a preversion). I also attach it if you would like to see. And what I really do not understand, after running the original VI, the final VI is working too without any modification.

 

It will stay a mistery to me. 

 

Cheers, 

Lajos

0 Kudos
Message 10 of 10
(3,474 Views)