UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer pearliyi
Observer
542 Views
Registered: ‎10-13-2017

Channel Combine of xfopencv

I tried to use the merge function of xfopencv to combine A,R,G,B channels.

I used the example channelcombine from Xilinx Github

I build the example and run it on a zcu104 board with revision platform

But the result was wrong, I can only get a full black picture which had only a single channel.

Some test files are attached,

R/G/B/Ahls_out.jpg are the input. out_ocv.jpg is the output of OpenCV. hls_out.jpg is the output of xfopencv.

Can anybody help?

Besides, these four test files in the data directory of channelcombine example are all rgb files, this may be misleading

Rhls_out.jpg
Ghls_out.jpg
Bhls_out.jpg
Ahls_out.jpg
out_ocv.jpg
hls_out.jpg
0 Kudos
3 Replies
Highlighted
Xilinx Employee
Xilinx Employee
506 Views
Registered: ‎05-25-2018

Re: Channel Combine of xfopencv

Hi @pearliyi,

Do you see any error percentage being printed on the console when you run the 'channel combine' example as is?

0 Kudos
Observer pearliyi
Observer
473 Views
Registered: ‎10-13-2017

Re: Channel Combine of xfopencv

You mean the "Percentage of pixels above error threshold" ?

It is 0.0000

屏幕快照 2018-12-24 上午10.03.34.png

0 Kudos
Observer pearliyi
Observer
461 Views
Registered: ‎10-13-2017

Re: Channel Combine of xfopencv

I got the correct output image by copying the output data from  xf::Mat to cv::Mat;

//this will get the full black output image 
xf::imwrite("hls_out.jpg",imgOutput);
//this can get the correct output image
out_img.create(in_gray1.rows, in_gray1.cols, CV_8UC4); out_img.data = imgOutput.copyFrom(); cv::imwrite("cpy_out.jpg", out_img);

UG1233 says xf::imwrite support XF_8UC4, why can't I get the correct output by this?

屏幕快照 2018-12-24 上午11.00.26.png