This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Again BMP upload to the EVM 6500 / C900

Other Parts Discussed in Thread: DLPC350, DLPC900

Hello all,

this is my first post so please let me know in case I chose the wrong forum...

I am trying to write an application framework which communicated with the C900 chip on a EVM6500 in matlab. All basic functionalities are implemented and I will publish the code later this year on github in case any body is interested... However, I am still struggling with the most important part of sending data to the DLP.

The context of the application is like follows: By means of the DLP I project a certain pattern on a target. A camera records the pattern, which will be then compared to a reference pattern. A correction is calculated by matlab which then is fed to the DLP. This loop continues until a certain confidence bound has been reached.

The projected patterns are all 1bit patterns and the application is time critical. Thus in a further development step I will of course use Enhanced RLE for compression of the data being transmitted.

My question for now is: how can I generate the desired bitmap data for the 1bit image. My understanding is, that I have to pack the 1bit data in a 24bit stack. When trying to do this, I end up with the DLP showing the desired bitmap three times side by side while the remaining area of the DLP is just blank.

Does this point to a problem with the header information in the bitmap even though I rather suspect the data itself to not meet the required needs.

The matlab code I use for creating the data from a n*m matrix named BMP looks like follows:

function data = prepBMP(BMP)
%prepBMP Adds a header to the matrix BMP
%

  bitDepth = 1; % define bit depth. FIXME: make a parameter
  signature = ['53'; '70'; '6C'; '64']; % add required header
  imageWidth = dec2hex(typecast(uint16(size(BMP,2)),'uint8')); % set image width 
  imageHeight = dec2hex(typecast(uint16(size(BMP,1)),'uint8')); % set image height
  numOfBytes = dec2hex(typecast(uint32(size(BMP,1)*size(BMP,2)*...
      bitDepth),'uint8')); % set number of bytes in the image
  backgroundColor = ['00'; '00'; '00'; '00']; % define background color
  compression = '00'; % no compression. FIXME: add compression

  header = [signature; imageWidth; imageHeight; numOfBytes; ...
      'FF'; 'FF'; 'FF'; 'FF'; 'FF'; 'FF'; 'FF'; 'FF'; backgroundColor; ...
      '00'; compression; '01'; '00'; '00'; '00'; '00'; '00'; '00'; '00';...
      '00'; '00'; '00'; '00'; '00'; '00'; '00'; '00'; '00'; '00'; '00';...
      '00'; '00'; '00']; % combine full header

  BMP = BMP'; % transpose in order to meet the bitmap indexing requirements

  BMP3c = [BMP(:), zeros(size(BMP(:),1),2)]; % add two more colors in order to build the full 24 bit bitmap
  data = [header; dec2hex(BMP3c(:),2);]; % combine header and data

  data = dec2bin(hex2dec(data),8); % convert to binary form and return

end

I guess the only thing I would need in order to understand the structure of the bitmap data would be a bitwise example representation of a 2 by 2 pixel bitmap with 1bit colordepth where the upper left and the lower right pixel is black while the other ones are white. Could anybody help me out with that?

Thank you very much in advance.

Best regards

Klaus Hueck

  • Hello Klaus,

    We are working on your question. We will get back to you with a more complete answer early next week. Thank you for your patience.

    Best regards,
    Trevor
  • Hello Trevor,


    Thanks for the reply and happy new year! I was wondering if you've had time to look into that issue. Any help on that would be very much appreciated!


    Best regards,

    Klaus

  • Hi Trevor, 

    As I still was not able to resolve the above mentioned issue, I wanted to get back to you in order to ask if you or one of your collegues have had time to look into it.

    Sorry for beeing a bit pushy on that, but by now  there is a certain urge to solve that problem. 

    Thank you very much for considering my post!

    Best reagards

    Klaus

  • Hello Klaus,

    I sent you an E2E friend request. Please accept this, I have some material I would like to share with you.

    Thanks,
    Trevor
  • Hi Klaus,

    Actually there is a much easier way for you to check out what is happening. The source code for the LightCrafter 6500 GUI was released last month. Download the source code from the EVM page to get a better idea of how bitmaps are sent.

    Best regards,

    Trevor

  • Hi Trevor, 

    Thanks for pointing me to the new software package you provide which includes the sources. However, I have to admit, that I am slightly confused, as for example the API.c file provided in the software package clearly refers to the DLPC350 and not the DLPC900 which we are actually dealing with. Did I miss anything? Did you have time to look into the code I provided in the first post in beginning of December? The second file which would be helpful in my case would be the BMPParser.c I suppose. But for a person not very well familiar to c the code is very hard to read and comments are rare. Thus I would really apprechiate if you could point me towards the solution of my problem. 

    Best

    Klaus

  • Hi Trevor,

    The problem I mentioned in my first post back in December last year is still not resolved.

    I am a bit disappointed that apparently no one of the TexasInstruments technical support staff even looked at the code example I provided. Additionally nobody even cared about replying to the post dated January 22nd and now I read in another topic, that you took the source code offline due to a known bug?

    This is actually not what I was hoping for in terms of customer support!

    Please consider my two posts (dated Dec. 16th 2015 and Jan. 22nd 2016) again!

    I am looking forward to your answer.

    With best regards,

    Klaus
  • Hello Klaus,

    I apologize for the delays while I was out on travel. Thank you for your feedback, we are taking it seriously. For the time being, we do not have any published support materials on the BMP parsing other than the source code for the BMP parser. We also rarely review or test code for debugging purposes, although our E2E community can be very receptive to such reviews at times.

    Having said that, I will work on posting a solution to your problem by tomorrow evening (US time), and I will look into implementing a longer term fix with more detailed documentation about image handling in the DLPC900 Programmer's Guide.

    Best regards,
    Trevor
  • Hi Klaus,

    I have not tested your code, but looking it over, the header appears to be okay. I believe the issue you may be seeing is caused by the BMP3c data. The BMP data appears to be a 1-bit image, for example, an x may appear as

    1   0   1

    0   1   0

    1   0   1

    You then add two 0's after each 1-bit pixel:

    1   0   0

    0   0   0

    1   0   0

    0   0   0

    1   0   0

    0   0   0

    1   0   0

    0   0   0

    1   0   0

    In binary, the change to a 24-bit BMP for the first pixel would be 1 followed by 23 zeros (which in hex, would be 80 00 00). To explain it in a way that follows the thought process of your code, you would first add seven zeros to each pixel in BMP, and then to add two more colors, you would add 8 zeros two more times to each pixel. In the hex example given above (80 00 00), each pair of numbers represents an 8-bit "color."

    Best regards,

    Trevor

  • Dear Trevor, 

    thank you very much for the detailed explanation and the reply to my post. I will try to implement your suggested pattern and let you know if it works. 

    Thank you again for looking into the code example!

    Best

    Klaus