Graphic Converter for LED POV Displays.

Post here to discuss programming in VB.net

Moderators: Chuckt, Garth, bitfogav

robertrndya
decided to stick around...
decided to stick around...
Posts: 39
Joined: Mon Apr 25, 2011 6:33 pm

Re: Graphic Converter for LED POV Displays.

Post by robertrndya » Wed Jun 08, 2011 8:08 pm

robertrndya wrote:So now I'm getting the different colors for values form 000-FFF and segregating them into the 8 colors(black,blue,green,cyan,red,pink,yellow,white). Then hopefully I'l get good results for any given picture.

I got the values from 000-FFF and segregated them into the 8 colors. But I got a LOT of values under 'Green'. I put all the other values in the code but when I put all the green values in the code and save the project VB just closes saying any unsaved matter will be lost :cry: . I still put in a few green values in the code and its working, but if I put any more green values then that same problem occurs again, and I don't understand why. Is it some code size issue?? or is it something to do with the size of the IF-ELSEIF condition(where the green values are for comparison)??

Also another thing is that after putting so many values I can recognize a lot more pixels. BUT, in 1 color I end up getting some pixels of some other color as well(for example I had 1st put some values in the code for comparison by extracting the values from the 'google' image itself so I was getting good accuracy for the "Google" image. But now, I replaced the old values, from the code, with the new set of values. And now some values which were under 'white' have come under 'blue' and 'yellow' and some values under 'blue' have come under 'pink' and 'green' and so on. So where I was getting perfect 'blue' for the 'G' and 'g' of "Google", now I'm getting a lil bit of 'cyan', 'pink', 'yellow' and the same thing happens for the rest of the colors as well). :( :( :(

Now where i get 'cyan' 'yellow' and 'pink' in the G's, if I put those values under 'Blue' in the code then if I scan another image it may detect those same values as 'blue' in spite of that image having 'cyan' 'yellow' or 'pink' at a particular position. What can I do now???? :?: :?: :?: :?: :?: :?: :?: :shock: :shock: :shock: :shock: :shock: :shock: :shock: :?: :?: :?: :?: :?: :?: :?:

User avatar
brad
Site Admin
Site Admin
Posts: 2576
Joined: Fri Mar 26, 2010 10:30 pm

Re: Graphic Converter for LED POV Displays.

Post by brad » Wed Jun 08, 2011 9:46 pm

If you want individual colors, you need to specify it.

For example, if you want JUST blue - you need to do something like

Code: Select all

If blue > 128 AND green < 128 and RED < 128 then
If you want JUST cyan, then you want something like

Code: Select all

If blue > 128 AND green > 128 and RED < 128 then
hopefully that helps :D

robertrndya
decided to stick around...
decided to stick around...
Posts: 39
Joined: Mon Apr 25, 2011 6:33 pm

Re: Graphic Converter for LED POV Displays.

Post by robertrndya » Wed Jun 08, 2011 10:20 pm

I actually already tried that method. But I was getting a lot of Black color in the output. And if I reduced the reference intensity from 128 to 100 then I get CYAN also in the BLUE of 'G' and so on. That's exactly why I stuck to my logic of comparing the scanned value with pre-determined values.

User avatar
brad
Site Admin
Site Admin
Posts: 2576
Joined: Fri Mar 26, 2010 10:30 pm

Re: Graphic Converter for LED POV Displays.

Post by brad » Thu Jun 09, 2011 5:29 am

Can you post your entire project here in a zip file?

robertrndya
decided to stick around...
decided to stick around...
Posts: 39
Joined: Mon Apr 25, 2011 6:33 pm

Re: Graphic Converter for LED POV Displays.

Post by robertrndya » Thu Jun 09, 2011 8:14 pm

Here it is
Attachments
Test123.rar
(150.68 KiB) Downloaded 303 times
Last edited by robertrndya on Sat Jun 18, 2011 2:56 pm, edited 2 times in total.

User avatar
brad
Site Admin
Site Admin
Posts: 2576
Joined: Fri Mar 26, 2010 10:30 pm

Re: Graphic Converter for LED POV Displays.

Post by brad » Fri Jun 10, 2011 10:03 pm

Very interesting code.

I can't get it to do anything unfortunately. When I open a graphic - it exits saying there was a problem. I then saw that you have 300, 300 defined so I found a graphic that was 300 x 300 pixels - but then it froze.

I am also wondering about your code where it checks the pixels, you have numbers greater than 255 in there but with your RGB values, (i am quite positive) that you don't get any number greater than 255 for any one color.

Did you get the idea for this code from somewhere else? could you give a few instructions as to how you have been using the software to open an image?

robertrndya
decided to stick around...
decided to stick around...
Posts: 39
Joined: Mon Apr 25, 2011 6:33 pm

Re: Graphic Converter for LED POV Displays.

Post by robertrndya » Sat Jun 11, 2011 4:52 pm

Hi Brad,

I think I understood where you got confused with the values. Is it because you saw it comparing the scanned value with values like "500", "401" and so on, is it? Well, they are just CSS Hex values. So the RGB value of any of pixels is never greater than 255 for any 1 color. :)

I initially got the code for scanning an image from the net. The code would scan an image check for a certain RGB intensity and on matching would replace that pixel with RED color. So I took that code and kept modifying it until I've reached where I've reached.

When the form loads, the code loads a picture box.

Code: Select all

Private Sub Form1_Load(ByVal ByValsenderAsObject, ByVal ByValeAsEventArgs) Handles Me.Load
        Controls.Add(pb1)
        pb1.Dock = DockStyle.Fill
        ' AddHandler Button1.Click, AddressOf Button1_Click

    End Sub
On clicking the START button you get an Open File Dialogue Box. Select an image and it will scan the pixels of that image. I kept the array dimensions as 300x300 assuming that I'll not scan an image bigger than that. However, if you put an image of size 300x300 to scan then it will take quite some time to scan it. So when you said it "FROZE" when you tried, I assume that it was just working fine.
If you insert a textbox in the form and remove the comment for the following part of code,

Code: Select all

'TextBox1.AppendText(q & "  ")
                        'If y = image1.Height - 1 Then TextBox1.AppendText(vbCrLf)
within the WITH - END WITH loop, you'll get my point.

I've scaled the GOOGLE image down to the size of 80x32 and 60x24 and scan this scaled image. In fact I wanted to ask you how YOU scan an image, since your scanning goes pretty faster than mine. Can you please give me your code for scanning and also for displaying the converted image? Please upload your project.

User avatar
brad
Site Admin
Site Admin
Posts: 2576
Joined: Fri Mar 26, 2010 10:30 pm

Re: Graphic Converter for LED POV Displays.

Post by brad » Sun Jun 12, 2011 2:57 pm

Download my Super Pixel Bros converter - it has all the details you need for this sort of thing :)

download/file.php?id=474

robertrndya
decided to stick around...
decided to stick around...
Posts: 39
Joined: Mon Apr 25, 2011 6:33 pm

Re: Graphic Converter for LED POV Displays.

Post by robertrndya » Fri Jun 17, 2011 8:38 pm

Hi Brad,

I've given up on trying to get the appropriate colors generated in the software. Instead, I'm just displaying the scanned RGB CSS Hex values in the excel sheet. So atleast I get the shape of the image that I scan (logos). Then I manually color the cells with the appropriate color and fill them with the appropriate values.

I've moved on to displaying multiple frames on the POV now.

Thanx a lot for all the help with VB.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest