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.

[PIC] Take a picture by camera with PIC controller

Status
Not open for further replies.

Ranbeer Singh

Full Member level 5
Joined
Jul 30, 2015
Messages
259
Helped
22
Reputation
44
Reaction score
22
Trophy points
1,298
Location
Faridabad India
Activity points
3,266
Hello,

I am making a automatic material testing device with camera & PIC. I am using a B&W camera for capture a image.
How can take a photo with camera & my PIC controller?
 

Hi,

With most cameras I know you need to press a button to take a picture.

Consider an electric energized magnet.

Klaus
 

Hi Ranbeer. I'm an electronic newbie but I know pic. If I had to do that, I would isolate the camera button "trigger voltage", activate it using a pic port (bit set) with a resistor (maybe a capacitor? I'm learning about capacitors so I don't have any idea). Your doubt is about pic programming?
 

Thanks for your fast replies

With most cameras I know you need to press a button to take a picture.
I am planing to use OV7670 camera module. I am not understanding to trigger to take photo. When i enable camera module F2 pin ...he will start send the data continually (Until F2 in not in reset mode).
How will check that what was my image end data?
 

Another aspect to consider: Which PIC controller are you using? Does it have the memory and processing speed (that camera's data sheet shows 30fps at 640x480 pixels with a variety of data formats but typically 16-bits per pixel = 614KB every 33mSec just to store the image).
Also that device requires the controller to drive it via several signals. If you don't want to load the MCU with a lot of that detial, then you will need one that has the appropriate drivers.
Also a quick Google search turned up https://nerdclub-uk.blogspot.com.au/2015/01/connecting-to-ov7670-camera-with-pic.html but I have no idea if that would be appropriate for your requirements as they seem to be using a much reduced image size and I think all they are doing with the image is to pass it to something else.
Susan
 
Another aspect to consider: Which PIC controller are you using? Does it have the memory and processing speed (that camera's data sheet shows 30fps at 640x480 pixels with a variety of data formats but typically 16-bits per pixel = 614KB every 33mSec just to store the image).
Also that device requires the controller to drive it via several signals. If you don't want to load the MCU with a lot of that detial, then you will need one that has the appropriate drivers.
Also a quick Google search turned up https://nerdclub-uk.blogspot.com.au/2015/01/connecting-to-ov7670-camera-with-pic.html but I have no idea if that would be appropriate for your requirements as they seem to be using a much reduced image size and I think all they are doing with the image is to pass it to something else.
Susan

Ok, Susan did a big point. If you need to handle the picture data, I would recommend you to not use PIC, this task may be hard even for Arduino Controllers. I think this is the case for a Raspberry that has built-in camera and you will find no difficulty to make it black and white, and upload the picture (or even a movie) to a server.
 
Hi

I will store a single original image data in external EEPROM and compare with new image data....This is my procedure.
I have disided to use PIC32xxxx controller. It have 2mb flash, 160kb auxiliary flash, 512kb ram & 200Mhz.

Is it right for this purpose?
 

To compare images they have to be decoded from JPG first. After that some image processing have to be performed. For this task any kind of linux based device will be more suitable.
And we know nothing about real requiments - frame rate, what type of image processing will be needed. May be he means motion detection? Or what?
Anyway, I dodn't believe in any success soon.
 

Also the OP says that they will store the initial image in EEPROM and then compare with new image data. What I don't understand from this is how often a new image will be written to the EEPROM.
This may or may not be important because EEPROMs often have a (relatively) limited number of erase/write cycles. While you can get (say) 1 million cycles as a typical rating, if you are writing a new image every second, then teh EEPROM will only last for 278 hours or about 11 days. On the other hand if you are writing an image every hour or day or longer period then you should be fine.
Susan
 

Easyrider83

You are right...It's not a simple work. I want to check a part like molding dai. All equipment like bolts and other part fitted by lineman or not. I will have a orginal image hex codes in my EEPROM and Will take a photo of real molding dai and will compare both's hex codes.

- - - Updated - - -

Also the OP says that they will store the initial image in EEPROM and then compare with new image data. What I don't understand from this is how often a new image will be written to the EEPROM.
This may or may not be important because EEPROMs often have a (relatively) limited number of erase/write cycles. While you can get (say) 1 million cycles as a typical rating, if you are writing a new image every second, then teh EEPROM will only last for 278 hours or about 11 days. On the other hand if you are writing an image every hour or day or longer period then you should be fine.
Susan

I will store a single image file in EEPROM only and will check like this.....
Code:
int Camera_Data[];
int index;
 while(index < Total_EEPROM_Writen_Address)
{
if(Camera_Data[index] == EEPROM_Data(index)) Right_Image();
else { Wrong_Image(); }
index++;
}(index)
 

First - explain in detail what you wanna do.
Motion detection is not a just frame comparison.
 

You are right...It's not a simple work. I want to check a part like molding dai. All equipment like bolts and other part fitted by lineman or not. I will have a orginal image hex codes in my EEPROM and Will take a photo of real molding dai and will compare both's hex codes.

This sounds like standard (these days) production line QC

If I understand correctly you want to store a reference image of a correctly produced product
and compare that to those on a production line as they are manufactured - to reject faulty items?

In order to design something or suggest hardware you first need to provide some basic info
such as resolutions, speeds required, colour info is often important with this sort of application,
(even if you are working b/w (all colour is just tone in reality) ) and size of components etc.

I've used (installed) such equipment (never designed any) for surface mount and barcode inspection
and it can work very well - and be a massive QC help.

If this is what you are trying to design the more info you can give the better as suggested above.
Certain PICs can be used for this but more info on data required would be needed.
 

I have detaild in previous post that what I need. A product like a dai... will come ( one piece in a minute) and check its small components are correctly installed or not according to sample image.
Can you suggests any other method for this propose?
 
Last edited:

I have detaild in previous post that what I need.
No - what you have told us is your solution to a problem. This is commonly called the "XY Problem" (https://xyproblem.info/).
One of the first things I was taught at Engineering School was to make sure that you correctly define the problem because you will solve the problem you define.
Susan
 

With a task like this the word "detail" means detail. All of it.
As aussie,Susan and easyrider have suggested - much more info is needed to be very helpful.
However - depending on how complex your object is you may or may not be able to do this with a pic.
Don't forget as easyrider said - the images will never be the same -
This means you must do image processing
Some of the complexities would include:
Get the lighting right and stable
first clean the image
then you need to know how big your comparison areas are - where in the image exactly and how
to line them up on the camera and in software
then more image processing - depending on the size/colour of target areas you might get away
with a pattern match(light/dark) or you may need to run a full edge/shape detection
That is where you dont want either a pic of some sort or an aduino
(go back a few years for some of my earlier posts for info on that sort of thing)
But then at 1 object a minute I may be tempted to just employ an apprentice to check the objects.

Out of sheer coincidence my copy of "instrumentation" magazine landed on my desk this afternoon
and it has some features on this sort of thing this month (april issue)
One company listed is www.stemmer-imaging.co.uk - it may be worth a look at their site to see
what a built system looks like.

If the parts added have much weight it might be easier to do a precise weight comparison.
That wont tell you about fitting but at least you'd be able to implement it quickly and get
some idea. Again it depends on exactly what you're doing.

Just one more tip - Transfer your master image from eeprom to ram on startup -
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top