Searching \ for '[PIC]: PIC32 for camera capture' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: piclist.org/techref/microchip/devices.htm?key=pic
Search entire site for: 'PIC32 for camera capture'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: PIC32 for camera capture'
2012\05\21@171333 by Andre Abelian

picon face
Hi all,

does any one know if pic32 will have enough speed to capture a camera data?
I am thinking to use 5 mp camera directly connected to pic and of course there is
a RAM too for a buffer. main purpose of the camera is to sense a motion change and 
send the data thru wireless when change detected. I am originally picked altera cyclone3 FPGA
part for some how I believe PIC32 may do the job. once the motion is detected we can stop it
send it out then continue. I do not need to do continues live video transmit  or some thing.

any idea or suggestion will appreciate

thanks

Andre  

2012\05\21@172542 by Jason White

picon face
On Mon, May 21, 2012 at 5:13 PM, Andre Abelian <spam_OUTabelian.andreTakeThisOuTspamyahoo.com> wrote:
> Hi all,
>
> does any one know if pic32 will have enough speed to capture a camera data?
> I am thinking to use 5 mp camera directly connected to pic and of course there is
> a RAM too for a buffer. main purpose of the camera is to sense a motion change and
> send the data thru wireless when change detected. I am originally picked altera cyclone3 FPGA
> part for some how I believe PIC32 may do the job. once the motion is detected we can stop it
> send it out then continue. I do not need to do continues live video transmit  or some thing.
>
> any idea or suggestion will appreciate

I am no expert at this, but the frame rate you want to read from the
camera and process the data will determine whether or not your
processor is fast enough. More details please !


-- Jason White

2012\05\21@181409 by Isaac Marino Bavaresco

flavicon
face
SUPPOSING that the PIC can DMA transfer data from the sensor to an
external memory in one cycle (it can't), the maximum frame rate you
could accomplish would be 16fps at 80MHz, and you would have no time to
process it.
Usually, image processing is much more intensive than the capture (that
is, you will need to access each pixel several times).

Your external memory needs to be at least 10MiB (16MiB is the logical
choice) for color images (YCbCr) or 5MiB (8MiB being the logical choice)
for gray scale images, just to hold one frame.

Do you really need such a large image? We do fingerprint recognition
with VGA sensors (640x480) cropped to 440x380.
We use a dsPIC to pre-process the image but the capture is done with a
Xilinx CPLD coupled to a 256KiBx8 static RAM.
We can capture approx. 13 frames per second and can determine if a valid
fingerprint is present in less than 1/2 second.


Best regards,

Isaac



Em 21/5/2012 18:13, Andre Abelian escreveu:
{Quote hidden}

> Andre

2012\05\22@113450 by Walter Banks

picon face
Look into some of the optical mice approaches for motion detection. The processing requirements
are quite low. It is possible a optical mice chip set would work for the application

w..


Andre Abelian wrote:

{Quote hidden}

>

2012\05\22@223349 by Andre Abelian

picon face
Hi Jason,

Finally I chose the part MT9P401 from Aptina. based on my understanding
the pixel output period is every 10.4nS. so the pic should be able to capture 12 bit "12 pins" data  ever
10 nS and save it in SDRAM. basically there are 5.000.000 pixels I need to capture and store them in SDRAM.
 how about  pic24EP  120mhz is it faster then pic32? in my case I really need 16 bit.
 pic32 is 80mhz/2  40 mhz and pic24EP is 120mhz/2  60 mhz. what do you think?

any suggestion will appreciate

thanks

Andre.   


________________________________
From: Jason White <.....whitewaterssoftwareinfoKILLspamspam@spam@gmail.com>
To: Microcontroller discussion list - Public. <piclistspamKILLspammit.edu> Sent: Monday, May 21, 2012 2:25 PM
Subject: Re: [PIC]: PIC32 for camera capture
On Mon, May 21, 2012 at 5:13 PM, Andre Abelian <.....abelian.andreKILLspamspam.....yahoo.com> wrote:
{Quote hidden}

I am no expert at this, but the frame rate you want to read from the
camera and process the data will determine whether or not your
processor is fast enough. More details please !


-- Jason White

2012\05\22@224740 by Andre Abelian

picon face
Hi Isaac,

I didn't see your replay for some reason. the purpose of this camera is to capture
a person and send email as attachment. the quality is important. in your case how pic is 
communicating with CPLD?  in my case the only part I am not clear is I have to sense a motion.
if old picture and new are not same then I have to send new picture out thru
wireless to pc. what about PIC24EP? 

thanks

Andre
   



________________________________
From: Isaac Marino Bavaresco <EraseMEisaacbavarescospam_OUTspamTakeThisOuTyahoo.com.br>
To: Microcontroller discussion list - Public. <piclistspamspam_OUTmit.edu> Sent: Monday, May 21, 2012 3:14 PM
Subject: Re: [PIC]: PIC32 for camera capture
SUPPOSING that the PIC can DMA transfer data from the sensor to an
external memory in one cycle (it can't), the maximum frame rate you
could accomplish would be 16fps at 80MHz, and you would have no time to
process it.
Usually, image processing is much more intensive than the capture (that
is, you will need to access each pixel several times).

Your external memory needs to be at least 10MiB (16MiB is the logical
choice) for color images (YCbCr) or 5MiB (8MiB being the logical choice)
for gray scale images, just to hold one frame.

Do you really need such a large image? We do fingerprint recognition
with VGA sensors (640x480) cropped to 440x380.
We use a dsPIC to pre-process the image but the capture is done with a
Xilinx CPLD coupled to a 256KiBx8 static RAM.
We can capture approx. 13 frames per second and can determine if a valid
fingerprint is present in less than 1/2 second.


Best regards,

Isaac



Em 21/5/2012 18:13, Andre Abelian escreveu:
{Quote hidden}

> Andre 

2012\05\23@064801 by Isaac Marino Bavaresco

flavicon
face
Em 22/5/2012 23:47, Andre Abelian escreveu:
> Hi Isaac,
>
> I didn't see your replay for some reason. the purpose of this camera is to capture
> a person and send email as attachment. the quality is important. in your case how pic is
> communicating with CPLD?

I implemented a bit-banged 8-bit bus. It can transfer 8MB/s.


>   in my case the only part I am not clear is I have to sense a motion.


You need to store at least two images (10MB for B/W images, 20MB for
color images) and compare them.
The biggest problem I see is that you cannot simply bytewise compare the
images, you must use some intelligent algorithm to detect real movement,
not noise or small changes in lighting.
Prepare to scan both images several times (read each pixel more than
once) and do a lot of math (FFT, filtering, wavelet, etc.).
I think that this task is up to a much larger processor (ARM9 @ 400MIPS,
etc).


> if old picture and new are not same


They will never be the same, always there are a lot of noise, moving
shadows, difference in lighting, vibration, etc.


>  then I have to send new picture out thru
> wireless to pc. what about PIC24EP?

They can do 60MIPS. Just to scan two 5MP images and compare them would
take 0.25s *IF* you could access each pixel in one cycle and do the
compare in one cycle.
As far as I know, no PIC or dsPIC have external bus interface that can
access such a large memory (not even they have SDRAM controllers), and
surely not at one transfer per clock.
If you implement your own bus, it will be much slower. My implementation
takes 5 instructions to do a transfer and it is optimized as hell, and
the address generation is done by the CPLD, The dsPIC just needs to
mange the data and control lines.


As I said, you need a large MPU (100's of MIPS) with some MB of SDRAM
and a large cache.


Best regards,

Isaac


{Quote hidden}

>> Andre

2012\05\23@072550 by Yigit Turgut

picon face
I don't think PIC is your way to go in this case. You might be able to
detect the motion in grayscale precisely, but face recognition, person
identification from image etc can not be done real-time via PIC. As
others stated you can check out ARM9-10-11. Why don't you switch to
FPGA ? An entry level FPGA will be capable of doing these kinds of
tasks very well without that much of an effort.

On Wed, May 23, 2012 at 1:48 PM, Isaac Marino Bavaresco
<RemoveMEisaacbavarescoTakeThisOuTspamyahoo.com.br> wrote:
{Quote hidden}

>

2012\05\23@085616 by Isaac Marino Bavaresco

flavicon
face
Did you notice that 10ns is 100MHz?

That means that you have to read one 12-bit pixel from the sensor and
store it to external memory faster than any PIC can execute one instruction..
Even a 400MHz ARM would have a hard time doing this without hardware
assistance. I tried and desisted. It is doable, but the ARM becomes
enslaved by the image capture.


Isaac





Em 22/5/2012 23:33, Andre Abelian escreveu:
{Quote hidden}

>

2012\05\23@112500 by Andre Abelian
picon face
Isaac,

I agree. My question is let say I use cpld to capture the data now i need to compare portion of the image to
determine as motion change. I am thinking to use dual ported ram to capture the image and use pic to access
to ram and compare data? what do you think?

Andre



________________________________
From: Isaac Marino Bavaresco <RemoveMEisaacbavarescoEraseMEspamEraseMEyahoo.com.br>
To: Microcontroller discussion list - Public. <RemoveMEpiclistspam_OUTspamKILLspammit.edu> Sent: Wednesday, May 23, 2012 5:56 AM
Subject: Re: [PIC]: PIC32 for camera capture
Did you notice that 10ns is 100MHz?

That means that you have to read one 12-bit pixel from the sensor and
store it to external memory faster than any PIC can execute one instruction..
Even a 400MHz ARM would have a hard time doing this without hardware
assistance. I tried and desisted. It is doable, but the ARM becomes
enslaved by the image capture.


Isaac





Em 22/5/2012 23:33, Andre Abelian escreveu:
{Quote hidden}

>

2012\05\23@112654 by M.L.

flavicon
face
On Wed, May 23, 2012 at 7:25 AM, Yigit Turgut <y.turgutSTOPspamspamspam_OUTgmail.com> wrote:
> I don't think PIC is your way to go in this case. You might be able to
> detect the motion in grayscale precisely, but face recognition, person
> identification from image etc can not be done real-time via PIC. As
> others stated you can check out ARM9-10-11. Why don't you switch to
> FPGA ? An entry level FPGA will be capable of doing these kinds of
> tasks very well without that much of an effort.
>


I agree with Yigit that you need more processing speed. An FPGA is a
good option and is in fact used in many custom and professional camera
applications.

-- Martin K

2012\05\23@113313 by Andre Abelian

picon face
Yigit,

the way I am seeing iti need to use cpld to capture the image in background and
use pic to access to ram using dual ported ram that way motion can be detected
like you suggested using gray scale portion. Now my question is for pic do I need 
ram? or I can use internal program memory instead?

thanks

AA




________________________________
From: Yigit Turgut <spamBeGoney.turgutSTOPspamspamEraseMEgmail.com>
To: Microcontroller discussion list - Public. <KILLspampiclistspamBeGonespammit.edu> Sent: Wednesday, May 23, 2012 4:25 AM
Subject: Re: [PIC]: PIC32 for camera capture
I don't think PIC is your way to go in this case. You might be able to
detect the motion in grayscale precisely, but face recognition, person
identification from image etc can not be done real-time via PIC. As
others stated you can check out ARM9-10-11. Why don't you switch to
FPGA ? An entry level FPGA will be capable of doing these kinds of
tasks very well without that much of an effort.

On Wed, May 23, 2012 at 1:48 PM, Isaac Marino Bavaresco
<EraseMEisaacbavarescospamEraseMEyahoo.com.br> wrote:
{Quote hidden}

>

2012\05\23@121118 by Isaac Marino Bavaresco

flavicon
face
You don't need dual port RAM.

Implement a counter in the CPLD to generate the RAM address and
increment it after each access. Provide some means for the PIC to reset
the counter.
Connect the pixel clock from the sensor to trigger the memory writes and
increment the address counter. Probably that logic must include HSYNC
and VSYNC also.
Add a signal for the CPLD signal that a frame is finished and another to
start and cancel the capture by the PIC. It would be a bonus if you can
read and modify the address counter also, and even better if the PIC can
also write to the RAM.

Don't forget that your logic must wait for the start of a frame before
it starts to write to the RAM, and it must stop when the frame is done.

My design does all that and more, so I can use some of the RAM for
application data. I use SRAM. As you need SDRAM, perhaps a CPLD is not
enough. Probably you need an FPGA.


Isaac




Em 23/5/2012 12:24, Andre Abelian escreveu:
{Quote hidden}

>>

2012\05\23@121926 by Andre Abelian

picon face
Isaac,

You mentioned 10mb for grayscale and 20 mb for color. is't single reading of 
each pixel has all information? if I scan twice image may change. my understanding was
single scan of each pixel will give all information but I am not sure this is my first project
to learn.

what do you think?

AA   


________________________________
From: Isaac Marino Bavaresco <spamBeGoneisaacbavaresco@spam@spamspam_OUTyahoo.com.br>
To: Microcontroller discussion list - Public. <TakeThisOuTpiclistspamspammit.edu> Sent: Wednesday, May 23, 2012 3:48 AM
Subject: Re: [PIC]: PIC32 for camera capture
Em 22/5/2012 23:47, Andre Abelian escreveu:
> Hi Isaac,
>
> I didn't see your replay for some reason. the purpose of this camera is to capture
> a person and send email as attachment. the quality is important. in your case how pic is
> communicating with CPLD?

I implemented a bit-banged 8-bit bus. It can transfer 8MB/s.


>   in my case the only part I am not clear is I have to sense a motion.


You need to store at least two images (10MB for B/W images, 20MB for
color images) and compare them.
The biggest problem I see is that you cannot simply bytewise compare the
images, you must use some intelligent algorithm to detect real movement,
not noise or small changes in lighting.
Prepare to scan both images several times (read each pixel more than
once) and do a lot of math (FFT, filtering, wavelet, etc.).
I think that this task is up to a much larger processor (ARM9 @ 400MIPS,
etc).


> if old picture and new are not same


They will never be the same, always there are a lot of noise, moving
shadows, difference in lighting, vibration, etc.


>  then I have to send new picture out thru
> wireless to pc. what about PIC24EP?

They can do 60MIPS. Just to scan two 5MP images and compare them would
take 0.25s *IF* you could access each pixel in one cycle and do the
compare in one cycle.
As far as I know, no PIC or dsPIC have external bus interface that can
access such a large memory (not even they have SDRAM controllers), and
surely not at one transfer per clock.
If you implement your own bus, it will be much slower. My implementation
takes 5 instructions to do a transfer and it is optimized as hell, and
the address generation is done by the CPLD, The dsPIC just needs to
mange the data and control lines.


As I said, you need a large MPU (100's of MIPS) with some MB of SDRAM
and a large cache.


Best regards,

Isaac


{Quote hidden}

>> Andre 

2012\05\23@122423 by Yigit Turgut

picon face
As Isaac stated, you don't need dual ram, it all can be done in CPLD.
5MP sounds big to me, why do you think you need 5MP? What kind of
algorithm are you planning to use for comparison ?

On Wed, May 23, 2012 at 6:30 PM, Andre Abelian <@spam@abelian.andreRemoveMEspamEraseMEyahoo.com> wrote:
{Quote hidden}

>> -

2012\05\23@122437 by Andre Abelian

picon face
Martin,

I am thinking to use 144 pin cyclone 2 with dual ported ram connected with pic32
to sense a motion change in center of the image. fpga will continually scan and update
ram and pic try to figure out the change. I agree with Isaac to use higher ram.
i will go with 16mb just incase.

AA




________________________________
From: M.L. <.....m@spam@spamEraseMElkeng.net>
To: Microcontroller discussion list - Public. <.....piclistRemoveMEspammit.edu> Sent: Wednesday, May 23, 2012 8:26 AM
Subject: Re: [PIC]: PIC32 for camera capture
On Wed, May 23, 2012 at 7:25 AM, Yigit Turgut <.....y.turgutSTOPspamspam@spam@gmail.com> wrote:
> I don't think PIC is your way to go in this case. You might be able to
> detect the motion in grayscale precisely, but face recognition, person
> identification from image etc can not be done real-time via PIC. As
> others stated you can check out ARM9-10-11. Why don't you switch to
> FPGA ? An entry level FPGA will be capable of doing these kinds of
> tasks very well without that much of an effort.
>


I agree with Yigit that you need more processing speed. An FPGA is a
good option and is in fact used in many custom and professional camera
applications.

-- Martin K

2012\05\23@123013 by Isaac Marino Bavaresco

flavicon
face
Andre,


It seems that you are a little lost with this design. The PIC with
largest RAM have 128kB, you need at least 10MB.
And there is no way for a CPLD or whatever push data at 100MB/s into the
PIC.

You need to capture to an external memory using an autonomous frame
grabber and then process the images.

Understand that the image processing will take orders of magnitude more
time than the capture process.


Isaac



Em 23/5/2012 12:30, Andre Abelian escreveu:
{Quote hidden}

>> -

2012\05\23@125643 by Isaac Marino Bavaresco

flavicon
face
You want to compare two images, so you must hold both in RAM.
They may be two consecutive images or a base image plus another taken
some time in the future.

Each image has 5,000,000 pixels. A grayscale image uses one byte per
pixel, a color image uses two bytes per pixel.
So a grayscale image needs 5,000,000 bytes of RAM and a color image
needs 10,000,000 bytes of RAM.
Thus the figures, 10MB for grayscale images and 20MB for color images.

For capturing, each pixel is read once and stored, but the comparison
algorithm may need to do several passes over the captured data.


Isaac



Em 23/5/2012 13:19, Andre Abelian escreveu:
{Quote hidden}

>>> Andre

2012\05\23@153237 by Andre Abelian

picon face
Isaac,

I guess I didn't explain clearly. the purpose of pic is to compare 2 pictures but
not full picture. lets say small area in the center half inch square. I am almost thinking that separate
PIR sensor is better idea. image comparing is workable but needs better understanding and experiment.
The way I am seeing it there are lots of situations where it may create false triggering on e of them is

darkness may add noise and create false triggering.

Isaac, what I do not get it is that in datasheet only says each pixel is 12 bit wide and I do not
see how to decode? you are saying I have to read a few times in order to get gray scale and color.
based on datasheet pixel bit will output every 10.4 ns and on falling edge read 12 pins output data.
you said 1 byte for grayscale 2 bytes for color that 24 bit data. my question is how to get 24 bit data
if it outputs only 12bit.

thanks

Andre








________________________________
From: Isaac Marino Bavaresco <EraseMEisaacbavarescoRemoveMEspamSTOPspamyahoo.com.br>
To: Microcontroller discussion list - Public. <RemoveMEpiclistKILLspamspamTakeThisOuTmit.edu>
Sent: Wednesday, May 23, 2012 9:30 AM
Subject: Re: [PIC]: PIC32 for camera capture

Andre,


It seems that you are a little lost with this design. The PIC with
largest RAM have 128kB, you need at least 10MB.
And there is no way for a CPLD or whatever push data at 100MB/s into the
PIC.

You need to capture to an external memory using an autonomous frame
grabber and then process the images.

Understand that the image processing will take orders of magnitude more
time than the capture process.


Isaac



Em 23/5/2012 12:30, Andre Abelian escreveu:
{Quote hidden}

>> -

2012\05\23@180033 by Mark Hanchey

flavicon
face
On 5/21/2012 5:13 PM, Andre Abelian wrote:
> Hi all,
>
> does any one know if pic32 will have enough speed to capture a camera data?
The Pic isn't up to that task , not at 5mp resolutions. You really need something with dedicated dsp abilities to start manipulating data like that .  Here is a site about open source cameras for micros, even there best designs cannot do 5mp and they are involving ARM chips.

http://www.cmucam.org/

If it were me I wouldn't do 5mp as that high a resolution isn't needed to do motion detection, 640x480 can do that easily and color also isn't needed.
Mark

2012\05\23@180456 by Isaac Marino Bavaresco

flavicon
face
Em 23/5/2012 16:32, Andre Abelian escreveu:
> Isaac,
>
> I guess I didn't explain clearly. the purpose of pic is to compare 2 pictures but
> not full picture. lets say small area in the center half inch square. I am almost thinking that separate
> PIR sensor is better idea. image comparing is workable but needs better understanding and experiment.
> The way I am seeing it there are lots of situations where it may create false triggering on e of them is
>
> darkness may add noise and create false triggering.
>
> Isaac, what I do not get it is that in datasheet only says each pixel is 12 bit wide and I do not
> see how to decode? you are saying I have to read a few times in order to get gray scale and color.
> based on datasheet pixel bit will output every 10.4 ns and on falling edge read 12 pins output data.
> you said 1 byte for grayscale 2 bytes for color that 24 bit data. my question is how to get 24 bit data
> if it outputs only 12bit.


Your sensor is 12-bit, so each "byte" will be 12-bit.

When I say "grayscale" image, I'm talking about a B/W sensor (or a color
one that can be configured to output B/W images) that outputs only the
luminance (Y) component of image.
The image is composed of a sequence of 12-bit values representing the
brightness of each pixel.

A color sensor outputs the image as a sequence of two values (12-bit
each in your case), first the luminance (Y) and then the color component
(CbCr) for each pixel.
Some color sensors can output the image in RGB format (usually 5:6:5
bits) or in the YUV format.
In a color sensor in YCbCr or YUV mode, if you discard the second value,
you get the grayscale image.


Isaac





{Quote hidden}

>>> --

2012\05\24@131528 by Andre Abelian

picon face
thanks Mark..


________________________________
From: Mark Hanchey <RemoveMEmarkspamBeGonespamRemoveMEpixeltrickery.com>
To: KILLspampiclistspamBeGonespammit.edu Sent: Wednesday, May 23, 2012 3:00 PM
Subject: Re: [PIC]: PIC32 for camera capture
On 5/21/2012 5:13 PM, Andre Abelian wrote:
> Hi all,
>
> does any one know if pic32 will have enough speed to capture a camera data?
The Pic isn't up to that task , not at 5mp resolutions. You really need something with dedicated dsp abilities to start manipulating data like that .  Here is a site about open source cameras for micros, even there best designs cannot do 5mp and they are involving ARM chips.

http://www.cmucam.org/

If it were me I wouldn't do 5mp as that high a resolution isn't needed to do motion detection, 640x480 can do that easily and color also isn't needed.
Mark

More... (looser matching)
- Last day of these posts
- In 2012 , 2013 only
- Today
- New search...