Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
17 years ago

Simple stuff! bit selection and counters! HELP!

Hi guys,

I am a bit of a newbie to programming in general and am doing a project for school. I am using Quartus and I have a DE2 board and a terasic camera which I am using to capture a video stream and do image processing on it (simple colour segmentation).

Now I need to feed these filtered pixels into Nios for further manipulations so I have to reduce the resolution of the image otherwise Nios has memory issues.

What I need to do is only sample every 20th pixel. I have the x and y coordinates of the pixels. So I thought I would do this in schematic capture and have a modulus counter counting up til 20 for x and y, and only taking that pixel... how would I do this? any clue?

My resolution is 640x480 so my aim is to reduce this to 32x24 because that would be a much smaller array to feed into Nios.

Any help would be highly appreciated because this is very urgent.

Thankssss

Dani

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Hi guys,

    Now I need to feed these filtered pixels into Nios for further manipulations so I have to reduce the resolution of the image otherwise Nios has memory issues.

    What I need to do is only sample every 20th pixel. I have the x and y coordinates of the pixels. So I thought I would do this in schematic capture and have a modulus counter counting up til 20 for x and y, and only taking that pixel... how would I do this? any clue?

    My resolution is 640x480 so my aim is to reduce this to 32x24 because that would be a much smaller array to feed into Nios.

    --- Quote End ---

    Before actually feeding this data to the cpu, you can simply store it on an on-board memory. Later, you can sample the data from the memory either directly in NIOS or in your HDL design (from where you can feed it to NIOS).
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    [slightly off topic] The standard approach in reducing the image size - without losing information - is to low-pass filter the image first, and then downsample. You could be doing that, you just didn't mention it.