Announcement

Collapse
No announcement yet.

Wrong Picture Size RAW

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Wrong Picture Size RAW

    Hello!

    When I request a preview picture for 80x60 in RAW I consistently get the correct picture-size of 4800 bytes. This works up to 160x120 without any problems.
    At a resolution of 320x240 the returned picture-size is only 11520 bytes instead of 76800 and I only receive 76445 bytes.

    Since the bytes that indicate the pictureSize are consisten and easy to find (AA,0A,02,b1,b2,b3) and the calculation works i can't see where the problem might be.

    Example at 320x240 - Serial buffer being: 170, 10, 2, 0, 44, 1
    [HTML]
    for (int i = 0; i < 200; i++){ Thread.Sleep(1); if (bufferLength == 12) { pictureSize = (UInt16)(serialBuffer[5]

  • #2


    code again....

    for (int i = 0; i < 200; i++){ Thread.Sleep(1); if (bufferLength == 12) { pictureSize = (UInt16)(serialBuffer[5]

    Comment


    • #3


      You are almost certainly overrunning your comms input buffer.

      You should be able to check for it to prove that's what's going on.

      Perhaps try using a second level comms buffer.
      Mark

      Comment


      • #4


        You are almost certainly overrunning your comms input buffer.

        You should be able to check for it to prove that's what's going on.

        Perhaps try using a second level comms buffer
        This explains why i miss some bytes but it doesn't explain the wrong picture size?
        What are the reasons the camera would send me the wrong size.
        @RAW 8bit Grayscale up to 160x120 everything works fine. every resolution above returns a wrong picture size.

        Comment


        • #5


          Um, yeah, in that case shouldn't your code be more like

          pictureSize = (UInt32)(serialBuffer[5]
          Mark

          Comment


          • #6


            Exactly that's what my code should be!
            uint16 just was too small.

            It will always be the programmer making the mistakes

            Thanks for your time!

            Comment

            Working...
            X