cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Adventurer
Adventurer
1,191 Views
Registered: ‎03-22-2018

Output Image Deformed

Jump to solution

Hi, 

 

I started a Vivado HLS project to implement a convolution block that also executes erode and dilate operations. My testbench receives a small input image and writes the result in an output image. The problem is that this output image is being deformed and I didn't found out why it's happening.

 

imageBmp.bmpimageOut.bmp

 

I'm sending my source codes and both the images. If someone could take a look, it will help me a lot. I started using Vivado for researches purpose, so it really means to me to get things working.

 

Thank you

0 Kudos
Reply
1 Solution

Accepted Solutions
Advisor
Advisor
1,168 Views
Registered: ‎04-26-2015

It looks like it's stretched every line by a factor of about 3:1, so my first guess would be that your input image is being read in as RGB and you're trying to treat it like monochrome. You could easily just bypass the function to verify that it's a testbench problem rather than an issue with your convolution.

View solution in original post

5 Replies
Advisor
Advisor
1,169 Views
Registered: ‎04-26-2015

It looks like it's stretched every line by a factor of about 3:1, so my first guess would be that your input image is being read in as RGB and you're trying to treat it like monochrome. You could easily just bypass the function to verify that it's a testbench problem rather than an issue with your convolution.

View solution in original post

Adventurer
Adventurer
1,153 Views
Registered: ‎03-22-2018

It worked! Thanks!

 

I though that if I did the conversion in matlab, I didn't had to worry about it in Vivado.

0 Kudos
Reply
Advisor
Advisor
1,150 Views
Registered: ‎04-26-2015

"imread" has a flag "CV_LOAD_IMAGE_GRAYSCALE" which might correct the problem for you. Otherwise, you can explicitly convert to 1-channel during the processing.

Adventurer
Adventurer
1,142 Views
Registered: ‎03-22-2018

Nice! I've solved this problem now, but unfortunattely looks like that only the dilate is working. Erode is giving me a full black image and the default convolution is given me a very weird result:

 

imageOut.bmp

 

Maybe my functions sumWindow and minWindow are not implemented properly...

0 Kudos
Reply
Adventurer
Adventurer
1,133 Views
Registered: ‎03-22-2018

Solved. It indeed wasn't coded properly haha thanks

0 Kudos
Reply