Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Image processing using microcontroller(PIC)

Status
Not open for further replies.

ComputerAngel

Junior Member level 2
Joined
May 28, 2017
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
202
Hello pals, I am new to PIC and I want to use it for my project. Based on its features, it is not suitable for that purpose but however since it is a prototype project I want to use it. My questions are:
1) Can I run openCV on the microcontroller(PIC) or I have to write codes for process the image myself?
2) How can I interface a camera with the microcontroller (PIC)?
Am working on iris identification system. Thank you.
 

As far as I know, none of the PIC familly has enough RAM memory to store neither a frame buffer, as well the temporary data for their math operations. Moreover, an 8 bit processor ( without ALU multiplier ) would require much more time to do the same job that a 32 bit core would do.
 

So are probably not able to do this using openCV on a PIC. It looks like openCV is more meant for userspace applications on Windows, Linux, etc. Extensive porting may be required and is probably not what you are looking for to start with a PIC. Also it would matter if it was a PIC10, 12, 16, 18, 24, 32. The word size varies between them: 8, 16, 32 bits. The PIC32 is actually MIPS versus Microchips hardvard PIC architecture. The cores also vary in terms of implementation for example hardware multiply. This would all come into play in determining performance and what would be required to port it. Also the program memory alone would probably be a deal breaker here.

openCV may be possible on something like a Raspberry PI or Beagle Bone.

You probably could do image processing on a PIC, but this would be for more of an exercise of theory than practicality. The question is how fast, how complex of image processes, and how large of an image. I would recommend starting out with custom code, as you will probably be doing that in the porting process alone. (You could take concepts from it though.) So it could do simple things like flipping the colors and stuff. However for much more I would recommend a larger processor. A PIC32 and maybe a PIC24E/H would be a good place to start.

Just to be annoying: So RAM could be worked around using external memory, but that would be really slow. Again the lack of an ALU does not make it impossible, just slow. Now not having an ALU will increase the program size which most microcontrollers do not allow external program memory. (Now you could make program the reads an external memory chip that executes the instructions from that. Which would be really really slow and inefficient.) For example someone claims to have built a ARM emulator on a PIC. Then proceeded to use this to boot an ARM distro of the linux kernel. It took forever, but supposedly worked.

What kind of camera it was would determine how to connect it. Again there are lots of little tricks to make it work, but you would probably not want to do any of them in practice.
 

Thank you. I will use computer system to process the image if the school agrees.


Please, have you any resources (documentation) on how to do image processing on microcontroller? I'd be glad if you can share it with me.
if have please email it to me manpasumathias[at]gmail.co!

PIC16 family doesn't have inbuilt USB module, ho can I interface USB to it with the computer system since it go
lows RS232 protocol?

[MODERATED]Consecutive posts merged

Alright. Thanks
 

Just to clarity a detail of my post made earlier. I meant to say the lack of an ALU multiply or other useful instructions would make it slow, but still not impossible. There is a only a couple instructions that you really need, from those you can actually implement all the others via procedures using those basic instructions. ALU is just a combination logic circuit so, not sure what the processor would be without it...

There is several ways to get a PIC16 to talk to a computer. USB via serial or UART is one of the most common, using a bridge chip like the FTDI FT232. You can get these fairly cheap online as breakout boards.

As for the image processing, I am sorry to say I am not going to be much help there.
 

I think your question about using microcontrollers for image processing has already been answered. Microcontrollers are not general purpose computers and are generally used for lower-speed processing but doing that processing for days or years on end.
I'm a bit confused about what you are trying to do with the PIC16 device - they generally have a UART (without knowing which specific device you are talking about it is had to say more) which uses 0-5V (or 0-3.3v) signal levels. You will need to use some form of interfacing chip whether you use RS232 or USB.
Susan
 

Thanks a lot. I get your point.
I thought of the same thing too, Microcontrollers don't allow pipelining because they weren't designed to and also interrupts might affect program execution when it occurs and would render the microcontroller very slow as you said. Thanks
 

My laptop doesn't have RS232 so am using USB port for communication
 

In that case you will need a USB to serial converter such as the FTDI232R which has a USB (device) interface on one side and CMOS/TTL serial UART lines on the other. Simply connect the FTDI232R serial lines to the MCU's serial lines and go from there.
Depending on exactly which USB to Serial device you use, you may need to be careful about the voltages on the serial lines - you need to either make sure they are both 5V or 3.3V, or that you have level shifters in between. (There are some 'cheap and nasty' options around level shifting so you need to understand what you are doing if you try to use those.)
Also I didn't say that microcontrollers were 'very slow'; I said that were used for lower-speed processing. I'm using MCUs that have 70MIPS and can easily handle the audio compression/decompression and other DSP related tasks (as well as the user interface and links to a host computer). Also interrupts should not slow things down significantly if they are correctly implemented. It really comes down to selecting the appropriate device for the task.
Susan
 

Thanks. actually my first reply was for [bluelassers], thanks, your reply helped a lot.

I wasn't saying microcontrollers are slow, I was saying that image processing would render it slow and may affect other parts of the programs like interrupts as I was told but never tried. Thanks a lot for your response, I will do as you guys have suggested.


A very big thank you to you all
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top