Go to Post Look guys, I am telling you for the fourth time - you are NEVER going to earn your official "Geek" certificates if you keep spelling "pwned" with an "O" in it! - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rating: Thread Rating: 6 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 02-08-2010, 04:32 PM
PranavSathy PranavSathy is offline
Team Captain
AKA: Pranav Sathyanarayanan
FRC #0263 (Sachem Aftershock)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Holbrook, New York
Posts: 27
PranavSathy is an unknown quantity at this point
Re: Displaying Camera Image in C# Dashboard

The Dashboard Code from LabVIEW doesnt help at all , ive read through the whole thing countless times, the PCVideoServer.cpp I have also read through that code,infact I am sitting right in front of it lol, that is why there is a if(readBytes > 1000) code, it makes sure I am not sending the header or imageSize as parameters to the MemoryStream, actually after much testing, i got the image to display at about .01 fps rofl, it updates the image irregularly and it is lagging BEYONG belief, here is my current code for that image processing:

Code:
if (netStream.DataAvailable)
                {
                    image.indicator.Text = "Data Available";
                    //image.videoStream.Image = Image.FromStream(netStream);
                    data = new byte[serverClient.ReceiveBufferSize];
                    
                    //bytesRead = netStream.Read(data, 0, serverClient.ReceiveBufferSize);
                    bytesRead = client.Receive(data, 0, serverClient.ReceiveBufferSize, 0);
                    //tw.WriteLine(DateTime.Now + " " + bytesRead.ToString());
                    if (bytesRead > 1000)
                    {
                        try
                        {
                            MemoryStream ms = new MemoryStream(data);
                            image.videoStream.Image = Image.FromStream(ms, false, true);
                        }
                        catch (Exception ex)
                        {
                            tw.WriteLine(DateTime.Now + ex.ToString());
                        }
                    }
                }
Reply With Quote
  #2   Spotlight this post!  
Unread 02-08-2010, 04:38 PM
MattD's Avatar
MattD MattD is offline
Registered User
AKA: Matthew Douglas
FRC #0228 (GUS Robotics)
Team Role: Alumni
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Indianapolis, IN
Posts: 185
MattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to behold
Send a message via AIM to MattD
Re: Displaying Camera Image in C# Dashboard

Quote:
Originally Posted by PranavSathy View Post
The Dashboard Code from LabVIEW doesnt help at all , ive read through the whole thing countless times, the PCVideoServer.cpp I have also read through that code,infact I am sitting right in front of it lol, that is why there is a if(readBytes > 1000) code, it makes sure I am not sending the header or imageSize as parameters to the MemoryStream, actually after much testing, i got the image to display at about .01 fps rofl, it updates the image irregularly and it is lagging BEYONG belief, here is my current code for that image processing:
The problem is that you're just randomly grabbing chunks of data > 1000 bytes in length, throwing it into an image, and hoping that everything lines up correctly.

I would recommend reading 8 bytes first, and look for the 0x01,0x00,0x00,x00 header in the first 4. If that's there, read the length from the next 4 bytes. Then, read in that number of bytes from your networkstream, and pass it into Image.FromStream(). Repeat.
__________________
GUS Robotics Team 228

2010 WPI Engineering Inspiration Award
2010 WPI Regional Champions (Thanks 230 & 20!)
2010 CT VEX Champions
2010 CT VEX Innovate Award
2009 QCC VEX Champions
2009 CT Motorola Quality Award
2007 CT J&J Sportsmanship Award
2006 CT Best Website Award
Reply With Quote
  #3   Spotlight this post!  
Unread 02-08-2010, 04:46 PM
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Displaying Camera Image in C# Dashboard

What I meant was that the data you are giving image.fromstream is NOT in the format it accepts.
ex:
asdfghjkl is the image data it expects, and you are sending it something else, like 10000009asdfghjkl or a different encoding (but it should be fine if it is a JPEG)
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
  #4   Spotlight this post!  
Unread 02-08-2010, 04:47 PM
PranavSathy PranavSathy is offline
Team Captain
AKA: Pranav Sathyanarayanan
FRC #0263 (Sachem Aftershock)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Holbrook, New York
Posts: 27
PranavSathy is an unknown quantity at this point
Re: Displaying Camera Image in C# Dashboard

I hope you dont mind me asking, but can you give me the example for the code for that, becuase from what I have logged, as in BYTES READ, the amount varies, this what an example would look like, this is from my log file:
Code:
2/9/2010 4:53:35 AM StartStream()
2/9/2010 4:53:35 AM Connecting!
2/9/2010 4:53:35 AM Connected
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 7867
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 8009
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 8039
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 8003
2/9/2010 4:53:36 AM 4384
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 3649
2/9/2010 4:53:36 AM 4
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 7995
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 2032
2/9/2010 4:53:36 AM 6001
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 8040
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 6412
2/9/2010 4:53:36 AM 1620
2/9/2010 4:53:36 AM 4384
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 3657
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 8041
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 8061
2/9/2010 4:53:36 AM 4
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 8040
2/9/2010 4:53:36 AM 4384
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 3631
2/9/2010 4:53:36 AM 4
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 7984
2/9/2010 4:53:36 AM 4
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 8011
2/9/2010 4:53:36 AM 4
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 8033
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 8057
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 8062
2/9/2010 4:53:36 AM 4
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 8084
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 4948
2/9/2010 4:53:36 AM 3128
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 8073
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 8037
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 8025
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 572
2/9/2010 4:53:36 AM 4380
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 568
2/9/2010 4:53:36 AM 8192
2/9/2010 4:53:36 AM 2329
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 8000
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 7988
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 8002
2/9/2010 4:53:37 AM 4
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 8000
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 8026
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 8017
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 4952
2/9/2010 4:53:37 AM 3053
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 8009
2/9/2010 4:53:37 AM 4384
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 3589
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 572
2/9/2010 4:53:37 AM 7400
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 7926
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 2032
2/9/2010 4:53:37 AM 5880
2/9/2010 4:53:37 AM 4
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 7911
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 7954
2/9/2010 4:53:37 AM 4
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 7905
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 6412
2/9/2010 4:53:37 AM 1515
2/9/2010 4:53:37 AM 5785
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 2108
2/9/2010 4:53:37 AM 4
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 7842
2/9/2010 4:53:37 AM 4384
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 3438
2/9/2010 4:53:37 AM 4
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 7828
2/9/2010 4:53:37 AM 4380
2/9/2010 4:53:37 AM 4380
2/9/2010 4:53:37 AM 7300
2/9/2010 4:53:37 AM 4384
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 3361
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 7676
2/9/2010 4:53:37 AM 8
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 7656
2/9/2010 4:53:37 AM 4384
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 3187
2/9/2010 4:53:37 AM 4
2/9/2010 4:53:37 AM 8192
2/9/2010 4:53:37 AM 7611
2/9/2010 4:53:38 AM 4
2/9/2010 4:53:38 AM 8192
2/9/2010 4:53:38 AM 7574
2/9/2010 4:53:38 AM 4380
2/9/2010 4:53:38 AM 8192
2/9/2010 4:53:38 AM 3255
2/9/2010 4:53:38 AM 4384
2/9/2010 4:53:38 AM 8192
2/9/2010 4:53:38 AM 3259
2/9/2010 4:53:38 AM 4384
2/9/2010 4:53:38 AM 8192
2/9/2010 4:53:38 AM 3321
2/9/2010 4:53:38 AM 4384
2/9/2010 4:53:38 AM 8192
2/9/2010 4:53:38 AM 2028
2/9/2010 4:53:38 AM 8192
2/9/2010 4:53:38 AM 8192
2/9/2010 4:53:38 AM 747
2/9/2010 4:53:38 AM 4384
2/9/2010 4:53:38 AM 4380
2/9/2010 4:53:38 AM 7229
2/9/2010 4:53:38 AM 4
2/9/2010 4:53:38 AM 8192
2/9/2010 4:53:38 AM 7908
2/9/2010 4:53:38 AM 8192
2/9/2010 4:53:38 AM 7895
2/9/2010 4:53:38 AM 8192
2/9/2010 4:53:38 AM 572
2/9/2010 4:53:38 AM 7201
2/9/2010 4:53:38 AM 8192
2/9/2010 4:53:38 AM 2032
2/9/2010 4:53:38 AM 4380
2/9/2010 4:53:38 AM 1305
2/9/2010 4:53:38 AM 8192
2/9/2010 4:53:38 AM 7646
2/9/2010 4:53:38 AM 8192
2/9/2010 4:53:38 AM 7553
2/9/2010 4:53:38 AM 8192
2/9/2010 4:53:38 AM 7481
2/9/2010 4:53:38 AM 4
2/9/2010 4:53:38 AM 8192
2/9/2010 4:53:38 AM 7335
2/9/2010 4:53:38 AM 4384
2/9/2010 4:53:38 AM 8192
2/9/2010 4:53:38 AM 2860
2/9/2010 4:53:38 AM 8192
2/9/2010 4:53:38 AM 7272
2/9/2010 4:53:38 AM 8192
2/9/2010 4:53:38 AM 4952
2/9/2010 4:53:38 AM 2333
2/9/2010 4:53:38 AM 8192
2/9/2010 4:53:38 AM 7233
2/9/2010 4:53:38 AM 4
2/9/2010 4:53:38 AM 8192
2/9/2010 4:53:38 AM 7198
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 7137
2/9/2010 4:53:39 AM 4
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 685
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 3488
2/9/2010 4:53:39 AM 5840
2/9/2010 4:53:39 AM 1814
2/9/2010 4:53:39 AM 4380
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 1766
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 568
2/9/2010 4:53:39 AM 5664
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 6239
2/9/2010 4:53:39 AM 4
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 6213
2/9/2010 4:53:39 AM 4
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 6330
2/9/2010 4:53:39 AM 4384
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 2058
2/9/2010 4:53:39 AM 4380
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 2055
2/9/2010 4:53:39 AM 4
2/9/2010 4:53:39 AM 4380
2/9/2010 4:53:39 AM 4380
2/9/2010 4:53:39 AM 5916
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 2032
2/9/2010 4:53:39 AM 4522
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 6799
2/9/2010 4:53:39 AM 4384
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 2769
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 7424
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 7716
2/9/2010 4:53:39 AM 4
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 7880
2/9/2010 4:53:39 AM 4384
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 3548
2/9/2010 4:53:39 AM 4384
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 3523
2/9/2010 4:53:39 AM 4384
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 3544
2/9/2010 4:53:39 AM 4
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 7927
2/9/2010 4:53:39 AM 4
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 7917
2/9/2010 4:53:39 AM 4
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 7926
2/9/2010 4:53:39 AM 4
2/9/2010 4:53:39 AM 4380
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 3526
2/9/2010 4:53:39 AM 8192
2/9/2010 4:53:39 AM 6408
2/9/2010 4:53:40 AM 4380
2/9/2010 4:53:40 AM 8192
2/9/2010 4:53:40 AM 5071
2/9/2010 4:53:40 AM 8192
2/9/2010 4:53:40 AM 6408
2/9/2010 4:53:40 AM 1520
2/9/2010 4:53:40 AM 4
2/9/2010 4:53:40 AM 8192
2/9/2010 4:53:40 AM 4948
2/9/2010 4:53:40 AM 2999
2/9/2010 4:53:40 AM 8192
2/9/2010 4:53:40 AM 7915
2/9/2010 4:53:40 AM 4384
2/9/2010 4:53:40 AM 8192
2/9/2010 4:53:40 AM 3566
2/9/2010 4:53:40 AM 8192
2/9/2010 4:53:40 AM 7934
2/9/2010 4:53:40 AM 8192
2/9/2010 4:53:40 AM 7942
2/9/2010 4:53:40 AM 4
2/9/2010 4:53:40 AM 8192
2/9/2010 4:53:40 AM 7949
2/9/2010 4:53:40 AM 8192
2/9/2010 4:53:40 AM 7984
2/9/2010 4:53:40 AM 8192
2/9/2010 4:53:40 AM 2032
2/9/2010 4:53:40 AM 4380
2/9/2010 4:53:40 AM 1543
2/9/2010 4:53:40 AM 8192
2/9/2010 4:53:40 AM 7942
2/9/2010 4:53:40 AM 8192
2/9/2010 4:53:40 AM 4952
2/9/2010 4:53:40 AM 3031
2/9/2010 4:53:40 AM 8192
2/9/2010 4:53:40 AM 3488
2/9/2010 4:53:40 AM 4464
2/9/2010 4:53:40 AM 8192
2/9/2010 4:53:40 AM 4948
2/9/2010 4:53:40 AM 3016
2/9/2010 4:53:40 AM 4380
2/9/2010 4:53:40 AM 4380
2/9/2010 4:53:40 AM 7416
2/9/2010 4:53:40 AM 8192
2/9/2010 4:53:40 AM 7957
2/9/2010 4:53:40 AM 8192
2/9/2010 4:53:40 AM 3492
2/9/2010 4:53:40 AM 4488
2/9/2010 4:53:40 AM 8192
2/9/2010 4:53:40 AM 4948
2/9/2010 4:53:40 AM 3051
2/9/2010 4:53:40 AM 8192
2/9/2010 4:53:40 AM 2028
2/9/2010 4:53:40 AM 5926
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 7974
2/9/2010 4:53:41 AM 8
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 7734
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 3492
2/9/2010 4:53:41 AM 4510
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 7868
2/9/2010 4:53:41 AM 90
2/9/2010 4:53:41 AM 4380
2/9/2010 4:53:41 AM 4380
2/9/2010 4:53:41 AM 7442
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 4948
2/9/2010 4:53:41 AM 2989
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 7868
2/9/2010 4:53:41 AM 135
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 7868
2/9/2010 4:53:41 AM 101
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 8013
2/9/2010 4:53:41 AM 4
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 7992
2/9/2010 4:53:41 AM 4
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 2028
2/9/2010 4:53:41 AM 4380
2/9/2010 4:53:41 AM 1558
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 7991
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 7956
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 7970
2/9/2010 4:53:41 AM 4
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 7978
2/9/2010 4:53:41 AM 4
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 7976
2/9/2010 4:53:41 AM 4
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 6408
2/9/2010 4:53:41 AM 1576
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 7970
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 2032
2/9/2010 4:53:41 AM 5905
2/9/2010 4:53:41 AM 4
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 7977
2/9/2010 4:53:41 AM 4
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 7973
2/9/2010 4:53:41 AM 4384
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 3563
2/9/2010 4:53:41 AM 4
2/9/2010 4:53:41 AM 8192
2/9/2010 4:53:41 AM 7962
2/9/2010 4:53:42 AM 4384
2/9/2010 4:53:42 AM 8192
2/9/2010 4:53:42 AM 3590
2/9/2010 4:53:42 AM 8192
2/9/2010 4:53:42 AM 572
2/9/2010 4:53:42 AM 7396
2/9/2010 4:53:42 AM 8192
2/9/2010 4:53:42 AM 8017
2/9/2010 4:53:42 AM 4384
2/9/2010 4:53:42 AM 8192
2/9/2010 4:53:42 AM 3634
As you can see, there is no consistency to where the 4 is. Also , these numbers are the amount of bytes read

Last edited by PranavSathy : 02-08-2010 at 04:54 PM.
Reply With Quote
  #5   Spotlight this post!  
Unread 02-08-2010, 04:58 PM
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Displaying Camera Image in C# Dashboard

depending on the image, the size varies, because JPEG is a compressed format
for example, a pure black image will be much smaller than a picture where every pixel is a different color
Edit: look at the attachment sizes
Attached Thumbnails
Click image for larger version

Name:	test.jpg
Views:	7
Size:	1.1 KB
ID:	8560  Click image for larger version

Name:	plasma.jpg
Views:	12
Size:	47.2 KB
ID:	8561  
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib

Last edited by byteit101 : 02-08-2010 at 05:02 PM. Reason: added sample
Reply With Quote
  #6   Spotlight this post!  
Unread 02-08-2010, 05:00 PM
PranavSathy PranavSathy is offline
Team Captain
AKA: Pranav Sathyanarayanan
FRC #0263 (Sachem Aftershock)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Holbrook, New York
Posts: 27
PranavSathy is an unknown quantity at this point
Re: Displaying Camera Image in C# Dashboard

Ok, even with a code that just read 8 bytes at a time, not a single string that I printed into the log had a NUMBER or a 0x00 or whatever the header was, they were all messed up jumbles of characters. I honestly am stuck here, as the image displays once and then doesnot update for anotehr few minutes, then updates, few minutes, one more frame, few minutes, one more frame etc. on and on.
Reply With Quote
  #7   Spotlight this post!  
Unread 02-08-2010, 05:04 PM
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Displaying Camera Image in C# Dashboard

look at it in a byte array, you should see a 1 then 0 0 0 etc...
in a string, this would be a box followed by \0\0\0 (but only in the debugger, output is cut by \0
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote
  #8   Spotlight this post!  
Unread 02-08-2010, 05:06 PM
PranavSathy PranavSathy is offline
Team Captain
AKA: Pranav Sathyanarayanan
FRC #0263 (Sachem Aftershock)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Holbrook, New York
Posts: 27
PranavSathy is an unknown quantity at this point
Re: Displaying Camera Image in C# Dashboard

I did :d, I went through the entire output, I simple just wrote the entire byte array as a string into the log file, there was no 1\0\0\0 in the whole log file.

I also looked for \0. I found one of those in every output, as expected, but not in the beginning of the byte array, they were found near the middle of each one. Also only a few of them were followed by a number like 5, or 4, or 7.

Last edited by PranavSathy : 02-08-2010 at 05:11 PM.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Labview Dashboard not displaying camera. GunfighterJ NI LabVIEW 1 02-02-2010 07:20 PM
Reinstall of dashboard doesn't fix camera image streaming ellisk Programming 2 01-20-2010 08:04 AM
[Help Needed] Camera to Dashboard basicxman C/C++ 1 01-19-2010 06:20 PM
Can we use the camera image on Dashboard this year? Jon236 Programming 1 01-11-2010 12:52 PM
Only Camera works in Dashboard keehun Programming 1 01-06-2009 07:22 AM


All times are GMT -5. The time now is 10:37 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi