05-13-2009 11:05 AM
05-15-2009 06:19 AM
hi c.minnel, thanks for taking ur time out. but unfortunately ur code is for labview 8.6, where as i have 8.5 version. so its not working for me. can u convert it to 8.5 please.
secondly, please have a look at this code. it is converting the bitstream(1D array) to JPEG or 2D array.
if any one can explain this please.
i ll appreciate if some one explains this rather than proposing another solution.
also a better explanation of the previous code(converting 2D array to 1D array) is still required.
thanks
05-15-2009 06:42 AM
altenback, ur solution worked equally good. 2D array is converted to 1D array. but i need an explanation some things.
now if i want to convert the bitstream(1D array) back to the 2D array(picture), so can u propose a solution here.
05-15-2009 10:58 AM - edited 05-15-2009 11:00 AM
irish_sunset wrote:altenback, ur solution worked equally good. 2D array is converted to 1D array. but i need an explanation some things.
Well, we cannot convert directly to 0,1 because we want a number for each bit, i.e. 32 bits per number. If you would convert directly (and I am not even sure what that means!), you'll only get one bit per number.
Due to the autoindexing at the FOR loop, we get a 3D array. Reshaping it to a 1D array with a size of the product of the dimensions is the output we want. Why don't you simply place a few indicators or probes at the various locations and simply test for yourself with some simple input data?
irish_sunset wrote:now if i want to convert the bitstream(1D array) back to the 2D array(picture), so can u propose a solution here.
That's trivial too. What have you tried so far?
05-15-2009 11:07 AM
irish_sunset wrote:now if i want to convert the bitstream(1D array) back to the 2D array(picture), so can u propose a solution here.
Cinverting back is only possible if you know at least one of the dimensions of the image. This information is lost. You probably should add e.g. the first dimension encoded in the first 32 bits of the output, for example.
05-20-2009 10:03 AM
this is the code for converting three 1D(bitstream array back to 2D array(jpg picture). i am not completely understanding it. explanation of this code is required.thanks
05-20-2009 11:41 AM
the code in the prevous message is working fine, but as i am new to labview so i am not getting as to what is happening in the code and how is it working.
thanks
05-20-2009 12:22 PM
Remember, each bit was expanded to require 8bits of space (each U8 represents 1 bit). So if you take the total number of elements divided by 32, that tells you how many U32's there were originally. The second chunk of code divides the array into 32 element blocks that are then converted into U32's. This reconstitutes the original U32 array, but only in one dimension. That last chunk of code converts the 1-D array into a 2-D array of the size defined by the 2 elements in the JPG Size array. Again, this isn't the best way to do all of this, but if it works, it works.
Chris
05-28-2009 02:58 PM
05-28-2009 03:31 PM
I guess what I mean is, it seems like this whole process is kind of silly and inefficient. If you have equipment that really needs to see a bit stream like this, than it's all good. But if you have any flexibility over the process I would take a look at our earlier suggestions that didn't involve expanding every bit into 8 bits.
I will be out of the office for a while, but if you post a question, I'll try to get back to you when I get back.
Chris