Digital Camera with STM32 and OV7670

Digital Camera with STM32 and OV7670


Hi everyone. I created a digital camera with STM32 Discovery board. I’d introduce it in this video This is the camera I created This is the front side, and a camera module is mounted here On the back side, you can see 3.2 inch display and buttons and dial for control are on the right side On the side, there is a USB connecter. so you can supply power from USB charger like this. Finally, SD card slot is here So let’s turn on the power Connecting USB cable here, You can see liveview image I’m shaking my hand,,, Responsivity is pretty nice, and FPS is OK Now, let’s take some pictures I need some objects… One is colorful so that I can check the color later and the other one So, I’m taking a photo of the left object first You can see color is shown appropreately. By pushing the button on the top right, you can take a photo. I’m taking the other one Due to narrow FOV, it looks like this… anyway, I got two photos now then, by pushing the bottom right button, it enters playback mode and you can see the picture I took By rotating the dial, the next content is displayed I move to recording mode again. As for this dial, Usual cameras on the market, this kind of dial is used to change camera settings such as ISO and shutter speed but the camera module I used it doesn’t have iris, so f number is fixed as for gain(ISO) and shutter speed This camera module takes care of AGC and AE control So, I don’t need to control these stuffs. and there is nothing to do with this dial So, in this project, I assigned JPEG encode quality setting to this dial When I rotate this dial, a blue bar appears When it goes to left, JPEG quality is low Then, I’m taking a picture with this setting then, set the JPEG encode quality as high take another one let’s see the differences move to playback mode This is the photo I took with low quality This is very noisy and you can see even macro block This is the photo with High quality You can use this dial like this Finally, I’d like to introduce is you can take movie as well There is a dial in the middle, and you can actually push this by pushing this button you can start movie record during recording, fps becomes slow due to heavy load FPS is around 5fps anyway, recording movie now… it’s enough by pushing this button again movie record is finished move to playback mode by pushing mode button skip the previous contents yes this is a movie I recorded now During movie play, you can pause it by pushing middle button By pushing it again, you can restart movie play pause play pause play When it reaches the end, movie play stops As you saw you can capture still photo and record movie and play them These contents is recorded as JPEG and Motion JPEG Since they are common formats the contents saved in the SD card must be played in PC So, let’s check it next In my desktop PC, I inserted the SD card In the SD card you can find four JPEG files and one movie file I open one of them This is the first photo This is the second one The third one with low JPEG quality therefore the size is very small Image is very noisy, though This is the fourth image with high quality so the file size is a little big and the last content is the movie file of motion JPEG I can play it in movie player but, this motion JPEG format doesn’t contain FPS information so, play speed depends on player software so, it looks like fast-forward play anyway, like this because the contents created in camera is normal format, you can play them in PC Then, I’d like to play the contents created in PC I don’t need them anymore I create some jpeg files The first image size is 320×240 save it to the SD card as JPEG file This is the jpeg file I created now For playback mode The camera can play a variety of size So I create a big landscape image and save it as test2.jpg then I will create portrait image Now I have three contents in total Next, I’m making movie file I got a free contents from the internet easy to check color The camera is not as powerful as to decode mp4 file So, I’ll convert mp4 into motion JPEG I need some command works for this First, I need to populate jpeg files from the mp4 frame by frame To do this, I use ffmpeg I create the folder to contain it, first run ffmpeg this is the filename the camera can play movie up to 10 fps so I set fps as 10fps The camera can decode big image, but it takes time to resize so I make the size small now use the same size as display, I mean 320×240 Now I got bunch of JPEG files Motion JPEG is a file combining these JPEG files So I use command again copy in binary mode copy all the jpeg files in temp folder to one avi file done I don’t need them Now, let’s play these contents in the camera this is the sd card containing the contents tuen the power on move to play back mode This is the first created JPEGfile The second one When I open big image it is automatically adjusted to display size (320×240 regardless of aspect This is the movie file The motion JPEG movie file is played well At the end, I’d like to summarize the spec of the camera Still photo capture is available JPEG format is supported and the size is 320×240 Movie record is available as motion JPEG format The maximum fps is 5fps In playback mode, you can play JPEG file In addition to the contents captured in the camera itself You can play JPEG file created in another device such as PC The maximum size is 2560 x 1920 I didn’t show it now, but you can play RGB555 format file , which is a similar format as bitmap as for movie, fps is around 10fps in playback mode These contents can be stored in SD card with FAT32 format You can find source code in my GitHub You can find software and hardware design document as well Please check it if you are interested Thank you for watching!!!

17 thoughts on “Digital Camera with STM32 and OV7670”

  1. Hi it is amaizing. I wonder if I can record video with Arduino and OV7670?? also I wonder if I need to use an STM board to create colorful video. If not, can you recommend what product would be good with a board that uses the Arduino? Ultimately I want to make a car black box.

  2. you frickin idiot,cant you speak normal?? dont understand a fuck what you are saying you dumb,,thumbs down of course

  3. タケシ様 ビデオの内容は大変啓発できまして、ありがとうございました。ビジネスにつながると思います。
    いろいろと連絡する手段を探しましたが、見つかりませんでした。
    教えていただけますか?

  4. great experiment, how can we get a magnification ? for example 10000x ? can it be done by software or we need a better lense ? thanks

Leave a Reply

Your email address will not be published. Required fields are marked *