kouroshkarimi Posted August 21, 2022 Share Posted August 21, 2022 Hi Im working on bounding box vitis vision ip core but it dont work with streaming and i dont know how to change it to work. my code in vitis_hls is here. Can some one help? Link to comment Share on other sites More sharing options...
0 Niță Eduard Posted August 22, 2022 Share Posted August 22, 2022 (edited) Hello @kouroshkarimi, You will also need another Mat (which is actually a FIFO) to act as a consumer, in order for dataflow to work. If I recall correctly, the bounding box function is not made for streaming applications. As such, you will need to modify it/write a new function to achieve what you are trying to do. A pseudocode of such a function would look like similar to this (this only uses 1 roi). new_boundingbox(src_mat, dst_mat, roi, color) { for(i = 0; i < rows; i++) { for(j = 0; j < cols; j++) { // read pixel from src mat src_pixel = src_mat.read(i * rows + j) // check that pixel is located on the rectangle described by x0,y0,x1,y1 if (is_on_rectangle(src_pixel, roi) { // color it dst_pixel = color } else { // keep original pixel dst_pixel = src_pixel } // write data to dst mat dst_mat.write(dst_pixel, i * rows+ j) } } } Edited August 22, 2022 by Niță Eduard format Link to comment Share on other sites More sharing options...
0 kouroshkarimi Posted August 24, 2022 Author Share Posted August 24, 2022 On 8/22/2022 at 2:45 AM, Niță Eduard said: Hello @kouroshkarimi, You will also need another Mat (which is actually a FIFO) to act as a consumer, in order for dataflow to work. If I recall correctly, the bounding box function is not made for streaming applications. As such, you will need to modify it/write a new function to achieve what you are trying to do. A pseudocode of such a function would look like similar to this (this only uses 1 roi). new_boundingbox(src_mat, dst_mat, roi, color) { for(i = 0; i < rows; i++) { for(j = 0; j < cols; j++) { // read pixel from src mat src_pixel = src_mat.read(i * rows + j) // check that pixel is located on the rectangle described by x0,y0,x1,y1 if (is_on_rectangle(src_pixel, roi) { // color it dst_pixel = color } else { // keep original pixel dst_pixel = src_pixel } // write data to dst mat dst_mat.write(dst_pixel, i * rows+ j) } } } thanks it worked. Link to comment Share on other sites More sharing options...
Question
kouroshkarimi
Hi
Im working on bounding box vitis vision ip core but it dont work with streaming and i dont know how to change it to work. my code in vitis_hls is here. Can some one help?
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now