Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

1473R FPGA Analysis Questions

I am working on FPGA analysis on a 1473R board with a line camera.  Image acquisition is working great, but I have two questions:

 

The camera is a two tap camera, so I get two pixels every time through the loop.  Is there an easy way to line the pixels up single file for analysis, or do I have to do the analysis twice in each loop?

 

Does anybody have an example of the best method of doing convolution on the FPGA?  I am thinking I will use edge detection and possibly peak detection, but it depends on the images I get.

 

Thanks,

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 1 of 4
(5,122 Views)

I am excited to hear that you are beginning to work on Vision FPGA. This is an exciting field that is relatively new. The challenge with Vision FPGA is that the hardware is not able to store a lot of data onboard the FPGA at any given time. Because of that, you will not be able to store more than just a few lines at a time before you will need to release the memory and move on to the next line.

 

If want to make sure that I understand your first question. Are you saying that you have an operation that you would like to perform on a single pixel at a time (a threshold operation, perhaps)? If so, then I would recommend trying to process both pixels in the acquisition loop.

 

I don't know if anyone has ever posted an example of convolution on the FPGA. I think that it can be done. You would need to store a few lines of data at a time in the block RAM. Once you have enough lines, then you can start multiplying the kernal by your image. I think that will be challenging to implement.

 

Jeremy P.

 

Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(5,075 Views)

I am acquiring from a line camera, and each line of data is independent.  I want to do convolution on a single line of data to find the edges.  It looks like I will have to analyze both values in parallel, so I will have to multiply and sum two sets of coefficients and points each time through the loop to get two output values each time through the loop.  It is going to be a messy program, because I don't see a clean way to do it.  I don't plan on storing any data in RAM unless I have to.

 

The camera is a Basler spL-2048, and I get two pixel values every clock cycle since it is a two tap camera.  I would love to be able to transfer the pixels to a buffer where I can pull out the points one at a time.  The clock would need to be pretty fast for the loop that is pulling them out of the buffer to keep up, though.  I'm not sure which way would work best - two parallel convolutions at the pixel clock speed, or a single convolution at double the pixel clock speed.  I was hoping somebody could suggest the best method so I don't have to try all the different possibilties.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 3 of 4
(5,072 Views)

Hi Bruce,

 

You pretty much covered the two main approaches I have seen:

-Analyze the pixels in parallel

-Buffer the data to block RAM (or DRAM) and process as single-tap in another loop

 

I think both are equally valid and neither is definitively better for all applications.

 

The first is easy when your algorithm can easily be extended to a parallel form (say a histogram).

 

The second is better when the algorithm is harder to do in parallel. The issues with that (that you already brought up) are that you may need to increase the clock rate of your other loop if you want the processing to be able to keep up with the full pixel clock. However, if your line rate is sufficiently low this may not be a problem because you would have time to catch up between lines. If you do want to make the clock of your processing loop faster, you might have to explore ways to pipeline your algorithm to be able to run at that clock rate.

 

Eric

 

 

 

Message 4 of 4
(5,069 Views)