- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I am working on image image processing on cyclone II. if I have 8 bit data in YCbCr then Is it possible to normalize an image by: current pixel / 255 If there is another option please suggest me, I am working on DSP Builder v6.0. Thank YouLink Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
/255 is rather hard work
/256 is a lot easier as it is just a right bit shift by 8. In FPGA there is no need to do any bit shifting like this.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- /255 is rather hard work /256 is a lot easier as it is just a right bit shift by 8. In FPGA there is no need to do any bit shifting like this. --- Quote End --- But at the same time I want data bus of the same width(before normalization and after normalization). Further, Is it possible to re-gain the same image on de-normalization? Thank You Tricky
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If all you are doing is /256 and want an 8 bit fractional, you actually do nothing at all. You just "pretend" you did a divide. In an FPGA there is no real bitshifting when dividing, you just append zeros depending on which way you shift.
So if you had 152, and then divide by 256, then multiply by 1.5 (answer = 228), you just do this: input = 10011000 (152) 1.5 = 1.1 just append zeros to 1.5 (multiply by 256) = 110000000 Do the multiply. You have 8 bits fractional and 8 bits integer. (because your source, 152 was all fractional bits) so you discard the 8 LSBs and you have your answer so you have:
0 1 0 0 1 1 0 0 0
x 1 1 0 0 0 0 0 0 0
-------------------------------------
= 0 1 0 0 1 1 0 0 0
+ 0 1 0 0 1 1 0 0 0
-------------------------------------
0 1 1 1 0 0 1 0 0|0 0 0 0 0 0 0 0
--Integer Fraction
11100100 = 228

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page