Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

How to extract the data of one color channel

wwang
Beginner
1,181 Views
I have an image buffer that has RGB data inside. I want to get only the data of one channel. It seems like the function ippiCopy_8u_C3C1R can do it, but there is no parameter the let me specify which channel to copy?
0 Kudos
2 Replies
tld
Beginner
1,181 Views
It seems that the ippiCopy_8u_C3C1R function copies the "first" channel in the source buffer. By offsetting the source buffer, (by 1 or 2), you can choose which channel to copy...

Copy red channel:
ippiCopy(rgb, rgbStep, singleChannel, singleChannelStep, size);

Copy green channel:
ippiCopy(rgb+1, rgbStep, singleChannel, singleChannelStep, size);

Copy blue channel:
ippiCopy(rgb+2, rgbStep, singleChannel, singleChannelStep, size);


... otherwise, you can use ippiCopy_8u_C3P3R - however, this will copy all three channels to 3 separate buffers.
0 Kudos
Vladimir_Dudnik
Employee
1,181 Views

absolutely correct

Thank you Thomas

0 Kudos
Reply