Camera & Imaging
AV to USB EasyCapture single-channel video capture card
close

EasyCAP USB2.0 Video Adapter with Audio, it capture High quality video and audio file direct by USB2.0 interface without sound card. Solution for laptop, we have enclosed the professional video editing software Ulead Video 8.0 SE DVD then provide best editing function for you. Video is video-editing software that makes editing your movies as fun as shooting them. The new Video Movie Wizard helps novice users finish stylish movies in only three steps. Share finished projects on DVD, tape, the Web, and mobile devices. High-speed rendering and real-time performance mean less time waiting and more time creating. You create many special effect and clip video files etc.The installation is very simple and the external power is unnecessary.

Specification Rev.2.0
Complies With Universal Serial Bus
Supports NTSC, PAL, Video format
Audio input: Stereo audio (RCA)
Video input: One RCA composite, One S-Video
PAL:720*576@25fps
NTSC:720*480@30fps
Supports high quality video resolution

Include Professional and easy to learn & used video editor software: Ulead Video 8.0 SE DVD
Capture Video & Audio though USB 2.0 interface
Popular USB 2.0 interface and not need other power
Support Brightness, Contrast, Hue, and Saturation control
Could capture audio without the sound card
High plug & play
Support For All Formats: record in DVD±R/RW, DVD±VR, and DVD-Video
Applying to internet conference/net meeting
System:Windows 98/ME,Windows 2000  Win7 32/64bit

package:  

1 x 1 Channel USB DVR Video Audio Capture Adapter Easycap 
  1 x CD Driver 
  1 x USB cable

Raspberry Pi 8Mp 8MegaPixel Camera V2.0
close

The Raspberry Pi camera module v2 replaced the original camera module in April 2016. The v2 camera has a Sony IMX219 8-megapixel sensor (compared to the 5-megapixel OmniVision OV5647 sensor of the original camera).

The camera module can be used to take high-definition video, as well as stills photographs. It’s easy to use for beginners, but has plenty to offer advanced users if you’re looking to expand your knowledge. There are lots of examples online of people using it for time-lapseslow-motion and other video cleverness. You can also use the libraries we bundle with the camera to create effects.

You can read all the gory details about IMX219 and the Exmor R back-illuminated sensor architecture on Sony’s website, but suffice to say this is more than just a resolution upgrade: it’s a leap forward in image quality, colour fidelity and low-light performance. It supports 1080p30, 720p60 and VGA90 video modes, as well as still capture. It attaches via a 15cm ribbon cable to the CSI port on the Raspberry Pi.

The camera works with all models of Raspberry Pi 1, 2 and 3. It can be accessed through the MMAL and V4L APIs, and there are numerous third-party libraries built for it, including the Picamera Python library. See the Getting Started with Picameraresource to learn how to use it.

The camera module is very popular in home security applications, and in wildlife camera traps.

 

  • 8 megapixel camera capable of taking photographs of 3280 x 2464 pixels
  • Capture video at 1080p30, 720p60 and 640x480p90 resolutions
  • All software is supported within the latest version of Raspbian Operating System
  • Applications: CCTV security camera, motion detection, time lapse photography

Mini HD 1000TVL CCTV FPV Camera for Quadcopter QAV210/180/250
close

Compact and simple design, ultra small size, low power consumption, good concealment, excellent stability

Specifications:
Lens focal length: 2.8mm
Singal system: PAL/NTSC system
Horizontal Articulation: 1000TVL
Min Illumination: 0.01LUX
White Balance: Auto
Video Frame Rate: PAL:967H x 582V, NTSC: 976H x 494V
Video Output: 1.0Vp-p75 ohm
Electronic Shutter: 1/50(1/60)-1/100000s
Back Light Compensation: ON/OFF
Synchronization: Inter-sync
Power input: DC12V FPV3.5-5V
Power Consumption: 70mA
Openration Tempetature: -20℃--60℃ (0%-98%)
Size: 24 x 17 x 28mm/0.9 x 0.7 x 1.1 inch
Package size: 90 x 65 x 55mm/ 3.5 x 2.6 x 2.2 inch
Net weight: 14g
Package weight: 39g

IP Camera 1080P with 3.6mm Lens
close

CPU: industrial grade inbuilt mini access controller HI3518E
operating system: inbuilt LINUX operating system
image sensor: 1 million pixels COMS
image code standard  :H.264
Video satndard :PAL/NTSC
Video quality :VGA@25fps
image motion detecting: support
Lowest illumination: 0.1LUX/F1.2
Screenshot function :support
Video mode: Manual video ,motion detecting video, timing video, alarm video

Record on:TF card 
Alarm trigger: speaker alarm, alarm video, screenshots and send Email
Network: a RJ45 interface, 10/100 m adaptive
WIFI:support/ 802.11b/g/n
PTZ monitoring: inbuilt horizontal vertical control motor
Power supply :DC 5V 2A
power dissipation: 1.5W
work temperature:0°  c±55° c
work humidity:10% -90%
Size:95*130*135mm

Infrared Night Vision IR 5MP Raspberry Pi NoIR Camera Orignal
close

The Raspberry Pi Camera Board Features a 5MP (2592×1944 pixels)
Omnivision 5647 sensor in a fixed focus module
The module attaches to Raspberry Pi, by way of a 15 Pin Ribbon Cable, to the dedicated 15-pin MIPI Camera Serial Interface (CSI)
The CSI bus is capable of extremely high data rates, and it exclusively carries pixel data to the BCM2835 processor
The sensor itself has a native resolution of 5 megapixel, and has a fixed focus lens onboard
The camera is capable of 2592 x 1944 pixel static images, and also supports 1080 p @ 30 fps, 720 p @ 60 fps  and 640 x480 p 60/90 video recording
The camera is supported in the latest version of Raspbian, the Raspberry Pi's preferred operating system

Specification:
Fully Compatible with Both the Model A and Model B Raspberry Pi
5 MP Omnivision 5647 Camera Module
Still Picture Resolution: 2592 x 1944
Viewing angle: 69.9 degrees 
Camera angle: Size can be replaced
Video: Supports 1080 p @ 30 fps, 720 p @ 60 fps  and 640 x480 p 60/90 Recording 15-pin MIPI Camera Serial Interface
Size: Approx. 25 x 24 x 9 mm /0.99 x 0.95 x 0.36 inch
Image Color: Black and White

Android Phone Camera 3.5 Mega Endoscope 5.5MM Lens
close

Feature:
Resolution: HD 640*480
1280*720(only on PC)
View Angel:66
Focal distance:4cm
Diameter:5.5mm/7.0mm
Lihgt: 6 adjustable white LEDs
Waterproof level:IP67
Support systems:android/widows 2000/XP/Vista/7
Temperature:-20 to 80 degree

 

Mini 600TVL CMOS 1/3 Inch FPV Color Camera 11g Light Weight
close

Features:
Brand new and high quality
Compatible to all types of camera lens 
High sensitivity infrared night vision system
Featured by multi-function ,small volume, lightness,low consumption, wide supply voltage scope
Convenience in installation
Extensive usage in security, monitoring, video meeting, audio-video e-mail,video door bell, video phone, computer

Features:
Brand new and high quality
Compatible to all types of camera lens 
High sensitivity infrared night vision system
Featured by multi-function ,small volume, lightness,low consumption, wide supply voltage scope
Convenience in installation
Extensive usage in security, monitoring, video meeting, audio-video e-mail,video door bell, video phone, computer...

Specifications:
Image Sensor: 1/3 inch HD Color CMOS
Horizontal Resolution: 600TV Line 
Resolution ratio: NTSC: 510 x 492
Voltage : 8-12 V
Color: Black
Material: Plastic
Size: 2 x 2x 3 cm
weight: 11grams


Package includes:
1 X CMOS 600TVL Mini Camera

Micro Serial CMOS Camera 600TVL 728×488
close

light-sensitive chip: 1/3 inch  HD Color CMOS 

2. Depending on the frequency standard: NTSC / PAL  

Effective pixels: 728 (H) × 488 (V)

photosensitive area: 4622μ m × 3611μm 

5. Definition: 600 TVL 

6. Minimum illumination 0.1 Lux 

7. Additional features: vertical and horizontal mirror function selectable

8. Video Output: 1.0Vp-p 75Ω 

pixel size: 6.35μ m × 7.4μm

10. Dynamic Range: 63.7dB

11. The signal to noise ratio: 46.4dB  

12. The electronic shutter (N) 1 / 60-1 / 100000 (P) 1 / 50-1 / 100000  

13 Operating voltage: DC3.3-5.0V; consumption 110MA 

14.PCB size: 12 * 12mm ± 0.5mm; overall thickness of 8.65mm

15. Working temperature: -5 ℃ ~ 50 ℃ RH95% Max

16 Storage temperature: -40 ℃ ~ 85 ℃ RH95% Max

17 Weight: about 5g

18 , Lens: 4.5MM default monitor all glass lens, M7 lens, viewing angle of 75 degrees; (optionally other lenses, please contact customer service.)

As default shipping PAL

Wiring instructions:

Red pick DC3.3-5V power input (3.7V lithium battery can)

Black ground wire connected to the negative power supply and video

VIDEO yellow video output connected to the positive

 

 

Features:

, monitoring, and model ships preferred DIY accessories;

, directly to the camera with a monitor with AV signal input or display or TV connected to real-time monitoring capabilities; connect a wireless transmitter, enabling wireless reception.

, ultra-small products directly 3.7V battery, ideal for DIY electronics enthusiasts use

, the product is relatively small angle, diagonal viewing angle of 75 degrees, very suitable for aerial DIY.

RASPBERRY PI CAMERA MODULE (CLONE)
close

This 5mp camera module is capable of 1080p video and still images and connects directly to your raspberry pi. Connect the included ribbon cable to the CSI (Camera Serial Interface) port on your Raspberry Pi, boot up the latest version of Raspbian and you are good to go!

The board itself is tiny, at around 25mm x 20mm x 9mm and weighing in at just over 3g, making it perfect for mobile or other applications where size and weight are important. The sensor has a native resolution of 5 megapixel, and has a fixed focus lens onboard. In terms of still images, the camera is capable of 2592 x 1944 pixel static images, and also supports 1080p30, 720p60 and 640x480p60/90 video.

Note: This module is only capable of taking pictures and video, not sound.

Documents:

Mini Wide Angle FPV Camera 700 TVL 3.6mm PAL
close

Specifications:
Definition: 700 TVL
Illumination: 0.5lux, 0.001lux
S/N: more than or equal to 48dB
Gama: 0.45
Focal length: 3.6mm
Frame speed: PAL 25f/s
White balance: auto
Video out: CVBS 1Vp-p
Audio out: yes
TV format: PAL 
Power: 12v 1A
Voltage range: DC 5V-12V
Power consumption: 80mA, 120mA

Size: approx 1.4x1.3x1cm
Color: multicolor
Net weight: 5g

Package includes:
1x FPV Camera
1X user manaul

Raspberry Pi Camera Board v2 - 8 Megapixels (Original)
close

Snap, snap! The Camera v2 is the new official camera board released by the Raspberry Pi Foundation!

The Raspberry Pi Camera Board v2 is a high quality 8 megapixel Sony IMX219 image sensor custom designed add-on board for Raspberry Pi, featuring a fixed focus lens. It's capable of 3280 x 2464 pixel static images, and also supports 1080p30, 720p60, and 640x480p90 video.

The Raspberry Pi Camera Module is an official product from the Raspberry Pi Foundation. The original 5-megapixel model was released in 2013, and an 8-megapixel Camera Module v2 was released in 2016. For both iterations, there are visible light and infrared versions.

HARDWARE SPECIFICATION

  Camera Module v1 Camera Module v2
Net price $25 $25
Size Around 25 × 24 × 9 mm  
Weight 3g 3g
Still resolution 5 Megapixels 8 Megapixels
Video modes 1080p30, 720p60 and 640 × 480p60/90 1080p30, 720p60 and 640 × 480p60/90
Linux integration V4L2 driver available V4L2 driver available
C programming API OpenMAX IL and others available OpenMAX IL and others available
Sensor OmniVision OV5647 Sony IMX219
Sensor resolution 2592 × 1944 pixels 3280 × 2464 pixels
Sensor image area 3.76 × 2.74 mm 3.68 x 2.76 mm (4.6 mm diagonal)
Pixel size 1.4 µm × 1.4 µm 1.12 µm x 1.12 µm
Optical size 1/4" 1/4"
Full-frame SLR lens equivalent 35 mm  
S/N ratio 36 dB  
Dynamic range 67 dB @ 8x gain  
Sensitivity 680 mV/lux-sec  
Dark current 16 mV/sec @ 60 C  
Well capacity 4.3 Ke-  
Fixed focus 1 m to infinity  
Focal length 3.60 mm +/- 0.01 3.04 mm
Horizontal field of view 53.50 +/- 0.13 degrees 62.2 degrees
Vertical field of view 41.41 +/- 0.11 degrees 48.8 degrees
Focal ratio (F-Stop) 2.9 2.0

HARDWARE FEATURES

Available Implemented
Chief ray angle correction Yes
Global and rolling shutter Rolling shutter
Automatic exposure control (AEC) No - done by ISP instead
Automatic white balance (AWB) No - done by ISP instead
Automatic black level calibration (ABLC) No - done by ISP instead
Automatic 50/60 Hz luminance detection No - done by ISP instead
Frame rate up to 120 fps Max 90fps. Limitations on frame size for the higher frame rates (VGA only for above 47fps)
AEC/AGC 16-zone size/position/weight control No - done by ISP instead
Mirror and flip Yes
Cropping No - done by ISP instead (except 1080p mode)
Lens correction No - done by ISP instead
Defective pixel cancelling No - done by ISP instead
10-bit RAW RGB data Yes - format conversions available via GPU
Support for LED and flash strobe mode LED flash
Support for internal and external frame synchronisation for frame exposure mode No
Support for 2 × 2 binning for better SNR in low light conditions Anything output res below 1296 x 976 will use the 2 x 2 binned mode
Support for horizontal and vertical sub-sampling Yes, via binning and skipping
On-chip phase lock loop (PLL) Yes
Standard serial SCCB interface Yes
Digital video port (DVP) parallel output interface No
MIPI interface (two lanes) Yes
32 bytes of embedded one-time programmable (OTP) memory No
Embedded 1.5V regulator for core power Yes

SOFTWARE FEATURES

Full camera software documentation can be found at raspbian/applications/camera.

   
Picture formats JPEG (accelerated), JPEG + RAW, GIF, BMP, PNG, YUV420, RGB888
Video formats raw h.264 (accelerated)
Effects negative, solarise, posterize, whiteboard, blackboard, sketch, denoise, emboss, oilpaint, hatch, gpen, pastel, watercolour, film, blur, saturation
Exposure modes auto, night, nightpreview, backlight, spotlight, sports, snow, beach, verylong, fixedfps, antishake, fireworks
Metering modes average, spot, backlit, matrix
Automatic white balance modes off, auto, sun, cloud, shade, tungsten, fluorescent, incandescent, flash, horizon
Triggers Keypress, UNIX signal, timeout
Extra modes demo, burst/timelapse, circular buffer, video with motion vectors, segmented video, live preview on 3D models

MECHANICAL DRAWING

  • Camera Module v2 PDF

OV7670 300KP VGA CAMERA MODULE
close

OV7670 image sensor, small size, low operating voltage, and provides all the features of the single-chip VGA camera and image processor. 

OV7670 image sensor, small size, low operating voltage, and provides all the features of the single-chip VGA camera and image processor. Through theSCCB bus control, you can output the entire frame, sub-sampled, take the window way affect the data resolution of 8 bits. VGA image of the product is up to 30 frames / sec. Users can fully control the image quality, data format and transmission mode. The process of image processing functions including gamma curves, white balance, saturation, chroma, and so can beprogrammed through the SCCB interface. OmmiVision image sensor applications unique sensor technology to improve image quality by reducing or eliminating the optical or electronic defect, such as fixed pattern noise, tail-blooming, clear and stable color image. 

High sensitivity for low-light applications 
Low voltage suitable for embedded applications 
Standard SCCB interface compatible with I2C interface 
RawRGB to RGB (GRB4: 2:2, RGB565/555/444), YUV (4:2:2) and YCbCr (4:2:2)output format 
support VGA, CIF, and from CIF to 40x30 the size 
VarioPixel subsampling way 
eliminate light stripes, automatic black level calibration image quality control including color saturation, hue, gamma, sharpness ANTI_BLOOM
ISP has eliminate noise and dead pixel compensation function 
support image scaling 
The lens is the loss of light compensation 
50/60Hz detection 
the saturation automatically adjust ( UV adjustment) 
edge enhancement automatically adjust 
Noise Reduction automatically adjust 
key parameters 
photosensitive array 640X480 
IO voltage 2.5V to 3.0V ( internal LDO to core supplies ) the
power operation 60mW/15fpsVGAYUV
Sleep < 20 ? A
temperature operation from -30 � C to 70 � C 
0 � C to 50 � C
( 8 -bit) output format ? YUV/YCbCr4 RGB565/555/444 GRB4: 2:2: 2:2 Raw RGB Data
Optical size of 1/6 "
field of view angle of 25 � 
maximum Zhen rate 30fps VGA
Sensitivity 1.3V / (Lux-sec)
signal to noise ratio of 46 dB
dynamic range of 52 dB
browsing mode progressive 
electronic exposure 
area of 3.6 ? mx 3.6 ? m
dark current 12 mV / s at 60 � C

Datasheet: http://www.eleparts.co.kr/data/design/product_file/Board/OV7670_CMOS.pdf

Application Note: 
http://www.ovt.com/download_document.php?type=document&DID=63


Hacking the OV7670 camera module (SCCB cheat sheet inside)
An in-depth look of the OV7670 camera module 
The OV7670 is a low cost image sensor + DSP that can operate at a maximum of 30 fps and 640 x 480 ("VGA") resolutions, equivalent to 0.3 Megapixels. The captured image can be pre-processed by the DSP before sending it out. This preprocessing can be configured via the Serial Camera Control Bus (SCCB). You can see the full datasheet here.

 

There are many camera modules, that come with standard 0.1" spaced headers, in eBay with prices under $10. I'll be using the one shown below, it comes WITHOUT a FIFO buffer.

http://2.bp.blogspot.com/-wA292kqWOd8/UA14qSGOY9I/AAAAAAAAAPU/RpQRCkFyv4I/s200/ov7670.JPG

HARDWARE

The camera module comes with a 9x2 header, the pin diagram is shown below:

VDD

GND

SDIOC

SDIOD

VSYNC

HREF

PCLK

XCLK

D7

D6

D5

D4

D3

D2

D1

D0

RESET

PWDN

Now, I'll cover the meaning of these pins.

Pin

Type

Description

VDD**

Supply

Power supply

GND

Supply

Ground level

SDIOC

Input

SCCB clock

SDIOD

Input/Output

SCCB data

VSYNC

Output

Vertical synchronization

HREF

Output

Horizontal synchronization

PCLK

Output

Pixel clock

XCLK

Input

System clock

D0-D7

Output

Video parallel output

RESET

Input

Reset (Active low)

PWDN

Input

Power down (Active high)

**A note about supply voltage and I/O voltage.

As stated in the datasheet:

  • VDDA can range from 2.45V to 3.00V.
  • VDDC can range from 1.62V to 1.98V.
  • VDDIO can range from 1.7V to 3.00V.

You can (hopefully) see here (sorry, it's buried among other files) the schematic of the model I'm using in this post. As you can see U1 and U2 are LDO regulators, one is a 2.8V regulator for VDDA and VDDIO and the other is a 1.8V regulator for VDDC. The actual regulator that gets soldered on the module seems to vary between modules.

In conclusion, for the same model I'm using:

  • You can safely supply 3.3V (3.0V - 3.6V) to the OV7670 VDD. (I used this configuration)
  • You can safely use a maximum of 3.0V for the I/O pins. However the module I/O pins will work at 2.8V.
  • A 5V supply for the OV7670 VDD might work (try at your own risk), it depends on the maximum input voltage of the LDO regulators your module has.
  • You can use 3.3V on the I/O pins, the internal I/O protection diodes will clamp the I/O voltage to 2.8V. However, this may degrade the OV7670 faster and/or cause more power loss. (I used this configuration)

STRUCTURE OF AN IMAGE

Before going into the signaling, it's necessary to understand how video and images are representend in digital format.

A video is a succession of frames, a frame is a still image taken at an instant of time. A frame is compromised of lines, and a line is compromised of pixels. A pixel is the smallest part of a digital image, and it looks like a colored dot.

 

P0

P1

P2

P3

P4

L0

         

L1

         

L2

         

L3

         

L4

         

A 5x5 image

For example, the image above has 5 lines, and each line has 5 pixels. This means the image has a resolution of 5x5 pixels. This image is monochrome, there are also color image. This color can be encoded in various formats, in the next section we'll cover the most relevant formats for the OV7670.

PIXEL FORMATS

Monochrome

In monochromes images, each pixel is stored as 8 bits, representing gray scale levels from 0 to 255. Where 0 is black, 255 is white and the intermediate values are grays.

RGB

Is a fact that any color can be decomposed in red, green and blue light at different intensities. This approach is known as the RGB color model. Using this model, each pixel must be stored as three intensities of these red, green and blue lights.

http://upload.wikimedia.org/wikipedia/commons/2/28/RGB_illumination.jpg 
RGB color model. Image from wikipedia.

The most common format is RGB888, in this format each pixel is stored in 24 bits, the red, green and blue channels are stored in 8 bits each. This means that the intensity of each light can go from 0 to 255, where 0 is the absence of light, and 255 is the maximum intensity.

The formats used by the OV7670 are the RGB565, RGB555 and RGB444. The difference with the RGB888 format, is the number of bits assigned to each channel. For example, in the RGB565 format, the red channel is stored as 5 bits, the green channel as 6 bits and the blue channel as 5 bits. These formats take less memory when stored but in exchange sacrifice the number of colors available.

YCbCr

YCbCr is a format in which a RGB color can be encoded. The Y or luminance component is the amount of white light of a color, and the Cb and Cr are the chroma components, which respectly encode the blue and red levels relative to the luminance component.

http://upload.wikimedia.org/wikipedia/commons/2/29/Barn-yuv.png 
Decomposition of an image into its Y, Cb and Cr components. Image from wikipedia.

As you can see the Y channel encodes the gray scale levels of the image. Therefore, the easiest way to get a monochrome image from the OV7670 is to extract the Y channel of the YCbCr format.

As the RGB format, the YCbCr also stores each channel as 8 bits (from 0 to 255) and we can convert from YCbCr to RGB using the following expression.

 

The OV7670 uses the YCbCr422 format, this format is stored as follows:

 

Byte 0

Byte 1

Byte 2

Byte 3

Word 0

Cb0

Y0

Cr0

Y1

Word 1

Cb2

Y2

Cr2

Y3

Word 2

Cb4

Y4

Cr4

Y5

Data stored as words (4 bytes)

Or equivalently, the data arrives in the following order:

N

Byte

1st

Cb0

2nd

Y0

3rd

Cr0

4th

Y1

5th

Cb2

6th

Y2

7th

Cr2

8th

Y3

...

...

And the actual pixels are the following:

Pixel 0

Y0 Cb0 Cr0

Pixel 1

Y1 Cb0 Cr0

Pixel 2

Y2 Cb2 Cr2

Pixel 3

Y3 Cb2 Cr2

Pixel 4

Y4 Cb4 Cr4

Pixel 5

Y5 Cb4 Cr4

Notice each pixel is 3 byte long (e.g. Y0, Cb0 and Cr0), as in the RGB format. But, in the YCbCr422 format, the Cb and Cr channels are shared between two consecutive pixels (e.g. pixels 0 and 1 share Cb0 and Cr0). Therefore two pixels are "compressed" into 4 bytes or 32 bits, this means that in average each pixel is stored as 2 bytes or 16 bits. From the example above, 3 words (12 bytes) store 6 pixels.

The extra advantage of YCbCr is that the Y channel is the grayscale image, whereas in RGB you'll need to average the 3 channels to get the grayscale image.

SIGNALING

The OV7670 sends the data in a parallel synchronous format. First of all, to get any data out of the OV7670, is necessary to supply a clock signal on the XCLK pin. According to the datasheet, this clock must have a frequency between 10 and 48 MHz. However, I have successfully used a 8 MHz clock with some configuration via the SCCB.

If you are using a microcontroller that has clock output, you can use that to clock the OV7670, these can generally output their inner system clock prescaled by some factor. If your microcontroller doesn't have clock output capability, but you're using an external crystal, then you can connect the OSC_OUT pin to the OV7670.

After a clock signal has been applied to the XCLK pin, the OV7670 will start driving its VSYNC, HREF and D0-D7 pins. Let's take a look at these signals.

http://2.bp.blogspot.com/-K-OIuy-inUU/UA2gp3SYgYI/AAAAAAAAAPg/Gure3RWI8G4/s320/href.png 
Horizontal Synchronization

First thing to notice, the D0-D7 must be sampled at the rising edge of the PCLK signal. Number two, D0-D7 must be sampled only when HREF is high. Also, the rising edge of HREF signals the start of a line, and the falling edge of HREF signals the end of the line.

All these bytes sampled when HREF was high, correspond to the pixels in one line. Note that one byte is not a pixel, it depends on the format chosen. By default, the format is YCbCr422, this means that in average two bytes correspond to a pixel.

http://3.bp.blogspot.com/-cjOYTMj4C4M/UA2kV-db8GI/AAAAAAAAAPs/rtCGSIGjOHo/s320/vga.png 
VGA timing

The image above shows the signals for a "VGA" (640 x 480) frame. During HSYNC high state, we must capture 640 pixels, equivalent to a line. The 480 lines, equivalent to a frame, are captured during the low state of VSYNC. This means that the falling edge of VSYNC signals the start of a frame, and its rising edge signals the end of a frame.

That covers all the process of obtaining one frame, the remaining question is how fast are frames sent. By default, the PCLK will have the same frequency of XCLK, however prescalers and PPLs can be configured using the SCCB, to produce a PCLK of different frequency.

A PCLK of 24 MHz will produce 30 fps, a PCLK of 12 MHz will produce 15 fps and so on. All this is independent of the format of the image (VGA, CIF, QCIF, etc).

SCCB (Serial Camera Control Bus)

What makes the OV7670 so versatile is its inner DSP, that can pre-process the image before its sent. This DSP can be accessed via a SCCB interface. This SCCB protocol is very similar to the I2C protocol. You can see the SCCB specification here.

I couldn't get my STM32 microcontroller's I2C module to work with the OV7670's SCCB interface, so I implemented a bit bang version of the SCCB specification. This implementation is my peripheral librarylibstm32pp.

After making sure the SCCB is working, we can tweak the OV7670.

Changing the FPS

To change the frames per second (fps), we need to change the frequency of PCLK. And for that we need to modify the following registers via the SCCB.

Register

Address

Default

Description

CLKRC

0x11

0x80

Bit[6]:

0: Apply prescaler on input clock 
1: Use external clock directly

Bit[0-5]:

Clock prescaler
F(internal clock) = F(input clock) / (Bit[0-5] + 1)
Range [0 0000] to [1 1111]

DBLV

0x6B

0x0A

Bit[7-6]:


PLL control
00: Bypass PLL
01: Input clock x4
10: Input clock x6
11: Input clock x8

Bit[4]:

Regulator control
0: Enable internal regulator
1: Bypass internal regulator

Now that you know the involved registers, the process is straightforward. For example, say we have a 8 MHz input clock and we want a 24 MHz PCLK. The only possible configuration is prescaler by 2, and PLL x6.

  • CLKRC Bit[6] must be 0, to enable prescaler.
  • CLKRC Bit[0-5] must be 1, to enable prescaler by 2.
  • DBLV Bit[7-6] must be 10, to enable PLL x6

Pseudocode:
?


1
2
3
4
5
6
7
8
9
10
11

unsigned char tmp;

/* Configuration for 30 FPS */

// CLKRC register: Prescaler = 2 
tmp = readOV7670(0x11); 
writeOV7670(0x11, (tmp & 0b10000000) | 0b00000001);

// DBLV register: PLL = 6 
tmp = readOV7670(0x6B); 
writeOV7670(0x6B, (tmp & 0b00111111) | 0b10000000);

Changing the frame format/resolution

The OV7670 can use various frame formats:

  • VGA (640 x 480)
  • QVGA (320 x 240)
  • CIF (352 x 240)
  • QCIF (176 x 144)
  • Manual scaling

By default, the OV7670 uses the VGA format, if you want to do image processing on a microcontroller with the OV7670 output, this may be way too much data, and you might want the QCIF format instead. To change the format we need to modify the following registers.