Image conversion software
Moderators: Chuckt, Garth, bitfogav
-
- decided to stick around...
- Posts: 27
- Joined: Sun Mar 28, 2010 1:27 pm [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Image conversion software
Hi Brad,
Its been a while, I see your page is still active. I was hoping that you could point me in the direction of your code for the image conversion software you made for your pov. I will be making a bike wheel pov and was going to modify the code for a radial pov. Any help would be great.
Thanks in advance,
Digg
Its been a while, I see your page is still active. I was hoping that you could point me in the direction of your code for the image conversion software you made for your pov. I will be making a bike wheel pov and was going to modify the code for a radial pov. Any help would be great.
Thanks in advance,
Digg
- brad
- Site Admin
- Posts: 2578
- Joined: Fri Mar 26, 2010 10:30 pm [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: Image conversion software
Surly you didn't think bradsprojects would be gone!
I would love you to re-code the software for a radial POV, could you please post back here with your progress?
I have attached the VB.NET project for you although it does need a few improvements, for example when spitting out the array data, it gives you decimal places which need to be removed, like this:
This will need to be fixed so it gives you:
It's not really commented at all but let me know how you go.
I would love you to re-code the software for a radial POV, could you please post back here with your progress?
I have attached the VB.NET project for you although it does need a few improvements, for example when spitting out the array data, it gives you decimal places which need to be removed, like this:
Code: Select all
const MyDataRed(8.000) as byte = (%10011101, %10011111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111)
const MyDataGreen(8.000) as byte = (%00001010, %00000000, %00011111, %10011111, %11111111, %11111111, %11111111, %11111111)
const MyDataBlue(8.000) as byte = (%10110101, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111)
Code: Select all
const MyDataRed(8) as byte = (%10011101, %10011111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111)
const MyDataGreen(8) as byte = (%00001010, %00000000, %00011111, %10011111, %11111111, %11111111, %11111111, %11111111)
const MyDataBlue(8) as byte = (%10110101, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111, %11111111)
-
- decided to stick around...
- Posts: 27
- Joined: Sun Mar 28, 2010 1:27 pm [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: Image conversion software
Thanks Brad,
Sorry for the late response. I had tried to respond on my iPhone last week but it must not have gone through. It when a little like this:
I would never think that this site would go down but I am glad to know that it is still up with mostly the same people still doing interesting things. I will keep you posted on my work but I will not have much time to do much development for the next few weeks. I am more experienced with C++/C and python do to school but picking up VB again should not prove too hard.
Also wanted to thank you for helping me get my start with micro-controllers and POVs.
Sorry for the late response. I had tried to respond on my iPhone last week but it must not have gone through. It when a little like this:
I would never think that this site would go down but I am glad to know that it is still up with mostly the same people still doing interesting things. I will keep you posted on my work but I will not have much time to do much development for the next few weeks. I am more experienced with C++/C and python do to school but picking up VB again should not prove too hard.
Also wanted to thank you for helping me get my start with micro-controllers and POVs.
-
- decided to stick around...
- Posts: 27
- Joined: Sun Mar 28, 2010 1:27 pm [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: Image conversion software
I was looking at the problem you were having but the decimal places are not showing up unless I make it a really big picture.
I think this should "fix" it but i don't have the problem you are talking about sorry.
replace your DoConversion() with this. All I did was add arraySize. Let me know if this works
I think this should "fix" it but i don't have the problem you are talking about sorry.
replace your DoConversion() with this. All I did was add arraySize. Let me know if this works
Code: Select all
Private Sub DoConversion()
TextBoxInfo.Text = "Converting Image"
DataCounter = 0 ' clear the counters that we use when converting
DataCounter2 = 0 ' clear the counters that we use when converting
TextBoxRed.Clear()
TextBoxGreen.Clear()
TextBoxBlue.Clear()
TextBoxAllData.Clear()
Dim Directory As New IO.DirectoryInfo(DirectoryName)
Dim Files As IO.FileInfo() = Directory.GetFiles("*.*")
'Dim FileName As IO.FileInfo
Dim arraySize As Integer
arraySize = Int(PictureBox1.Height * (PictureBox1.Width / DataType))
If RadioButtonArduino.Checked Then
If RadioButtonLongWords.Checked Then
TextBoxRed.AppendText("const prog_uint32_t " & TextBoxOutputName.Text & "Red" & "[" & arraySize & "]PROGMEM={0b")
TextBoxGreen.AppendText("const prog_uint32_t " & TextBoxOutputName.Text & "Green" & "[" & arraySize & "]PROGMEM={0b")
TextBoxBlue.AppendText("const prog_uint32_t " & TextBoxOutputName.Text & "Blue" & "[" & arraySize & "]PROGMEM={0b")
ElseIf RadioButtonWords.Checked Then
TextBoxRed.AppendText("const prog_uint16_t " & TextBoxOutputName.Text & "Red" & "[" & arraySize & "]PROGMEM={0b")
TextBoxGreen.AppendText("const prog_uint16_t " & TextBoxOutputName.Text & "Green" & "[" & arraySize & "]PROGMEM={0b")
TextBoxBlue.AppendText("const prog_uint16_t " & TextBoxOutputName.Text & "Blue" & "[" & arraySize & "]PROGMEM={0b")
ElseIf RadioButtonBytes.Checked Then
TextBoxRed.AppendText("const prog_uint8_t " & TextBoxOutputName.Text & "Red" & "[" & arraySize & "]PROGMEM={0b")
TextBoxGreen.AppendText("const prog_uint8_t " & TextBoxOutputName.Text & "Green" & "[" & arraySize & "]PROGMEM={0b")
TextBoxBlue.AppendText("const prog_uint8_t " & TextBoxOutputName.Text & "Blue" & "[" & arraySize & "]PROGMEM={0b")
End If
End If
If RadioButtonSwordfish.Checked Then
If RadioButtonLongWords.Checked Then
TextBoxRed.AppendText("const " & TextBoxOutputName.Text & "Red" & "(" & arraySize & ") as longword = (%")
TextBoxGreen.AppendText("const " & TextBoxOutputName.Text & "Green" & "(" & arraySize & ") as longword = (%")
TextBoxBlue.AppendText("const " & TextBoxOutputName.Text & "Blue" & "(" & arraySize & ") as longword = (%")
ElseIf RadioButtonWords.Checked Then
TextBoxRed.AppendText("const " & TextBoxOutputName.Text & "Red" & "(" & arraySize & ") as word = (%")
TextBoxGreen.AppendText("const " & TextBoxOutputName.Text & "Green" & "(" & arraySize & ") as word = (%")
TextBoxBlue.AppendText("const " & TextBoxOutputName.Text & "Blue" & "(" & arraySize & ") as word = (%")
ElseIf RadioButtonBytes.Checked Then
TextBoxRed.AppendText("const " & TextBoxOutputName.Text & "Red" & "(" & arraySize & ") as byte = (%")
TextBoxGreen.AppendText("const " & TextBoxOutputName.Text & "Green" & "(" & arraySize & ") as byte = (%")
TextBoxBlue.AppendText("const " & TextBoxOutputName.Text & "Blue" & "(" & arraySize & ") as byte = (%")
End If
End If
ConvertImage()
If OutputRed.Checked = True Then
TextBoxAllData.AppendText(TextBoxRed.Text & vbCrLf)
End If
If OutputGreen.Checked = True Then
TextBoxAllData.AppendText(TextBoxGreen.Text & vbCrLf)
End If
If OutputBlue.Checked = True Then
TextBoxAllData.AppendText(TextBoxBlue.Text)
End If
TextBoxAllData.SelectAll()
TextBoxAllData.Copy()
TextBoxInfo.Text = "Data Copied To Clipboard"
MsgBox("Data Has Been Copied To The Clipboard")
End Sub
- brad
- Site Admin
- Posts: 2578
- Joined: Fri Mar 26, 2010 10:30 pm [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: Image conversion software
Thanks for the code Digg, but I think I know the problem. I declared the variables as decimal instead of integers! My mistake
-
- decided to stick around...
- Posts: 27
- Joined: Sun Mar 28, 2010 1:27 pm [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: Image conversion software
That is your problem, but as a quick fix to it I just did the calculation and put it into an integer so that I did not have to go find all the variables. It will also run slightly faster this way as it will not have to do the math each time. I doubt you could tell the difference in speed though.
- brad
- Site Admin
- Posts: 2578
- Joined: Fri Mar 26, 2010 10:30 pm [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: Image conversion software
Glad it works for you
How is your version coming along?
How is your version coming along?
-
- semi-newbie
- Posts: 12
- Joined: Wed Jul 02, 2014 7:30 am [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: Image conversion software
hello Brad,
I'm doing some testing with this program (Arduino and Swordfish Graphic Converter), but when I convert the image it returns a wrong value in the corresponding binary.
When I use your program (POV GRAPHIC CONVERTER) the corresponding binary value the image is correct and works fine in POV Project.
I checked everything and can not find the problem.
What could be different between the two codes? Please help me troubleshoot the problem.
Sorry for bad english.
thank you in advance
Follow converted images below:
correct image
const GreenData(16) as byte = (%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00111000,%00111000,%00111000,%00000000,%00000000)
same image with error
const MyDataGreen(16) as byte =
(%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000, %00000000,%00011100,%00011100,%00011100,%00000000,%00000000,%00000000)
I'm doing some testing with this program (Arduino and Swordfish Graphic Converter), but when I convert the image it returns a wrong value in the corresponding binary.
When I use your program (POV GRAPHIC CONVERTER) the corresponding binary value the image is correct and works fine in POV Project.
I checked everything and can not find the problem.
What could be different between the two codes? Please help me troubleshoot the problem.
Sorry for bad english.
thank you in advance
Follow converted images below:
correct image
const GreenData(16) as byte = (%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00111000,%00111000,%00111000,%00000000,%00000000)
same image with error
const MyDataGreen(16) as byte =
(%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000, %00000000,%00011100,%00011100,%00011100,%00000000,%00000000,%00000000)
- brad
- Site Admin
- Posts: 2578
- Joined: Fri Mar 26, 2010 10:30 pm [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: Image conversion software
Hi ORB11,
I am pretty sure with the swordfish and Arduino version you can choose to scan the image from top to bottom or front left to right (or something to that effect). If your image is not being drawn correctly when using that version then I would try selecting the other drawing option and see if that works for you.
I.E. if you were trying top to bottom and it wasn't working, then you should try left to right and vice versa.
One obvious thing to note though is that in your code you posted, the arrays are called different things.
I am pretty sure with the swordfish and Arduino version you can choose to scan the image from top to bottom or front left to right (or something to that effect). If your image is not being drawn correctly when using that version then I would try selecting the other drawing option and see if that works for you.
I.E. if you were trying top to bottom and it wasn't working, then you should try left to right and vice versa.
One obvious thing to note though is that in your code you posted, the arrays are called different things.
-
- semi-newbie
- Posts: 12
- Joined: Wed Jul 02, 2014 7:30 am [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: Image conversion software
hi Brad,
Thanks for the quick feedback.
I'm trying to develop a conversion program for course completion,
but I'm encountering this problem in converting the image to binary.
Could you provide me the changes you made in your program to work properly ?
Thank you.
Thanks for the quick feedback.
I'm trying to develop a conversion program for course completion,
but I'm encountering this problem in converting the image to binary.
Could you provide me the changes you made in your program to work properly ?
Thank you.
- brad
- Site Admin
- Posts: 2578
- Joined: Fri Mar 26, 2010 10:30 pm [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: Image conversion software
I'm not sure exactly what you mean by that?Could you provide me the changes you made in your program to work properly ?
Where did you download the Arduino and Swordfish Graphic Converter from? because I am pretty sure I have only ever made one version of it.
-
- semi-newbie
- Posts: 12
- Joined: Wed Jul 02, 2014 7:30 am [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: Image conversion software
Hi Brad,
Sorry not explaining myself very well, I'm trying to use this code you attached earlier in this topic (Arduino and Swordfish Graphic Converter.zip), but when I convert an image with this, the binary data do not match the correct data! You could do a test with the version that is available here earlier this Topic to confirm that the image conversion is equal to your new project (PovConverterBigGraphics POV one PIC RGB)?
Falt image
Arduino and Swordfish Graphic Converter.ZIP this Topic
const MyDataRed(8) as byte =(%00000000,%00000000,%00001000,%00000000,%00000000,%00000000,%00000000,%00000000)
const MyDataGreen(8) as byte =(%00000000,%00000000,%00000000,%00000000,%00001000,%00000000,%00000000,%00000000)
const MyDataBlue(8) as byte =(%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00001000,%00000000)
'///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
correct image
POV one chip (viewtopic.php?f=17&t=344 )
const RedData(8) as byte =(%00000000,%00000000,%00000000,%00000000,%00100000,%00000000,%00000000,%00000000)
const GreenData(8) as byte =(%00000000,%00000000,%00000000,%00000000,%00001000,%00000000,%00000000,%00000000)
const BlueData(8) as byte =(%00000000,%00000000,%00000000,%00000000,%00000010,%00000000,%00000000,%00000000)
NOTE: The same image 8 x 8 have different binary conversion! Why??
Thanks Brad
Sorry not explaining myself very well, I'm trying to use this code you attached earlier in this topic (Arduino and Swordfish Graphic Converter.zip), but when I convert an image with this, the binary data do not match the correct data! You could do a test with the version that is available here earlier this Topic to confirm that the image conversion is equal to your new project (PovConverterBigGraphics POV one PIC RGB)?
Falt image
Arduino and Swordfish Graphic Converter.ZIP this Topic
const MyDataRed(8) as byte =(%00000000,%00000000,%00001000,%00000000,%00000000,%00000000,%00000000,%00000000)
const MyDataGreen(8) as byte =(%00000000,%00000000,%00000000,%00000000,%00001000,%00000000,%00000000,%00000000)
const MyDataBlue(8) as byte =(%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00001000,%00000000)
'///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
correct image
POV one chip (viewtopic.php?f=17&t=344 )
const RedData(8) as byte =(%00000000,%00000000,%00000000,%00000000,%00100000,%00000000,%00000000,%00000000)
const GreenData(8) as byte =(%00000000,%00000000,%00000000,%00000000,%00001000,%00000000,%00000000,%00000000)
const BlueData(8) as byte =(%00000000,%00000000,%00000000,%00000000,%00000010,%00000000,%00000000,%00000000)
NOTE: The same image 8 x 8 have different binary conversion! Why??
Thanks Brad
Last edited by ORB11 on Fri Aug 15, 2014 8:10 am, edited 1 time in total.
- brad
- Site Admin
- Posts: 2578
- Joined: Fri Mar 26, 2010 10:30 pm [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: Image conversion software
Okay, for some reason I thought you had downloaded a different version.
Try this one and let me know how you go
Try this one and let me know how you go
-
- semi-newbie
- Posts: 12
- Joined: Wed Jul 02, 2014 7:30 am [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: Image conversion software
hi Brad,
Thanks for the quick feedback.
I did several tests with the new project and when I enable the Left to Right option the image are OK! but when I enable the option Top to Bottom image is not OK!
I tried to make some changes, such as invert the function (For) of X with Y but the most we got was OK to have the image with only 8 Height value.
What can be wrong in the function Top to Bottom?
Thanks Brad
Thanks for the quick feedback.
I did several tests with the new project and when I enable the Left to Right option the image are OK! but when I enable the option Top to Bottom image is not OK!
I tried to make some changes, such as invert the function (For) of X with Y but the most we got was OK to have the image with only 8 Height value.
What can be wrong in the function Top to Bottom?
Thanks Brad
- brad
- Site Admin
- Posts: 2578
- Joined: Fri Mar 26, 2010 10:30 pm [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: Image conversion software
It all depends on how your image is drawn. This will determine whether you should scan the image left to right or if you should scan it top to bottom.
Could you please post your image here so I can see what it should look like?
Could you please post your image here so I can see what it should look like?
Who is online
Users browsing this forum: No registered users and 1 guest