Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

12bit to 8bit conversion

I am using a USB controller that can handle only 8 bits.Now i want to pass a 12 bit image data through the usb controller.Any idea of how to handle the 12 bit data will be of immense help.
0 Kudos
Message 1 of 24
(5,358 Views)

Hi muks,

can you explain in more detail please? What is the task ot the usb controller?

 

Try to help. 

Mike 

0 Kudos
Message 2 of 24
(5,354 Views)
At present i have got 12 bit data and i am ignoring the lsb feeding to the usb controller.The usb controller transfers the data to my pc.I am converting the 8 bit data into an image.
0 Kudos
Message 3 of 24
(5,353 Views)

Hi muks,

is it possible for you to cut the 12 bit data into 8 bit partitions, send it and rebuild the 12 bit?

Mike 

Message 4 of 24
(5,353 Views)

Hi mike,

            That is exactly what i am trying to do.Can you give me a idea on how to go about it? 

0 Kudos
Message 5 of 24
(5,338 Views)
In addition if at all i do that will i be compromising on using any image processing functions? in other words can i use all image processing function on a 12 bit image? I think the grayscale level will get increased to 4096 instead of 255.
0 Kudos
Message 6 of 24
(5,338 Views)
Mike any idea?
0 Kudos
Message 7 of 24
(5,326 Views)

Hi muks,

maybe i misunderstand you. In which format do you have your data?

Mike

0 Kudos
Message 8 of 24
(5,323 Views)

Is it more difficult than it sounds?  Instead of sending a single 8 bit value, first send the 4 usb padded with zeroes, then send the 8 lsb.  On the other end, put them together as a 16 bit value, which is how LV is going to use them.

 

You could try to be ultra efficient and pack two 12 bit values into three 8 bit values, but that would be a little more challenging.  I would only try it if you really need the increase in speed, which wouldn't be much.  The processing on both ends would be more complex.

 

Bruce

Bruce Ammons
Ammons Engineering
Message 9 of 24
(5,322 Views)

Hi my dear community friend,

          I dug into some resources. Your problem might be solved using either performing "Downshift" method or "Bit plane Slicing".

 

Downshift:

          by applying downshift, you can convert your 12 bits image to 16 bits image and I'm confident you can deal with it from that point.

 

Bit Plane Slicing:

          which by you may eliminate the lower bit planes (planes 0,1,2,3) and keeping the remaining 8 bit planes (plane 4,5,6,7,8,9,10,11). The lower bit planes contain finer details, so your loss won't be drastic.

 

         Downshift methd is already available in NI IMAQ. for the second resolution, you may resort to perform pixel by pixel operation, extracting pixel value, trim the mentioned lower planes and construct the new image.

 

       I hope it makes sense and muks, you are my hero.  

Waleed El-Badry MSc.,MCPD, ISTQB Certified Tester
Assistant Lecturer
Mechatronics Department
Faculty of Engineering
Misr University for Science & Technology



View Waleed El-Badry's profile on LinkedIn

Message 10 of 24
(5,299 Views)