Giter VIP home page Giter VIP logo

tekker / esp32-ov7670-hacking Goto Github PK

View Code? Open in Web Editor NEW
75.0 12.0 18.0 2.92 MB

Based on https://github.com/igrr/esp32-cam-demo extended with an ILI9341 display, with a Telnet interface to change OV7670 settings on the fly. Streams BMP files from RGB565 and YUV422 (encoded to RGB565) picture formats. Compile with latest esp-idf. Check out new telnet command "video 1" to auto capture to LCD as fast as possible for videocam mode, "video 0" to stop or "video Z" where Z is delay in ms between each capture / LCD refresh.

License: Apache License 2.0

Makefile 0.45% C 99.55%
esp32 ili9341 libtelnet telnet smallargs ov7670 camera

esp32-ov7670-hacking's People

Contributors

esp32de avatar igrr avatar krzychb avatar oitzu avatar tekker avatar tuanpmt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp32-ov7670-hacking's Issues

fixes for ov7670_sine() & ov7670_calc_cmatrix()

ov7670_sine() in ov7670.c line 657
should be for correct results:

      theta = 180 - theta;
      sine = ov7670_sin_table[theta / SIN_STEP];

ov7670_calc_cmatrix() line 701

void ov7670_calc_cmatrix( ov7670_info_t *info, int *matrix )
{
   int i;
   int tmp_matrix[CMATRIX_LEN];  // <----------------

   // Apply the current saturation setting first.
   // | 1    0    0  |   |            |   |                        |
   // |              |   |            |   |                        |
   // | 0   sat   0  | * | M0  M1  M2 | = | sat*M0  sat*M1  sat*M2 |
   // |              |   |            |   |                        |
   // | 0    0   sat |   | M3  M4  M5 |   | sat*M3  sat*M4  sat*M5 |

   for( i = 0; i < CMATRIX_LEN; i++ )
      tmp_matrix[i] = ( info->sat * info->cmatrix[i] ) >> 7;

   // Then, if need be, rotate the hue value.
   if( info->hue != 0 )
   {
      int sinth, costh;

      sinth = ov7670_sine( info->hue );
      costh = ov7670_cosine( info->hue );

      // | 1    0     0  |   |            |   |                                             |
      // |               |   |            |   |                                             |
      // | 0   cos   sin | * | M0  M1  M2 | = | cos*M0+sin*M3  cos*M1+sin*M4  cos*M2+sin*M5 |
      // |               |   |            |   |                                             |
      // | 0  -sin   cos |   | M3  M4  M5 |   | cos*M3-sin*M0  cos*M4-sin*M1  cos*M5-sin*M2 |

      matrix[0] = ( ( costh * tmp_matrix[0] ) + ( sinth * tmp_matrix[3] ) ) / 1000;
      matrix[1] = ( ( costh * tmp_matrix[1] ) + ( sinth * tmp_matrix[4] ) ) / 1000;
      matrix[2] = ( ( costh * tmp_matrix[2] ) + ( sinth * tmp_matrix[5] ) ) / 1000;
      matrix[3] = ( ( costh * tmp_matrix[3] ) - ( sinth * tmp_matrix[0] ) ) / 1000;
      matrix[4] = ( ( costh * tmp_matrix[4] ) - ( sinth * tmp_matrix[1] ) ) / 1000;
      matrix[5] = ( ( costh * tmp_matrix[5] ) - ( sinth * tmp_matrix[2] ) ) / 1000;
   }
   else
   {
      for( i = 0; i < CMATRIX_LEN; i++ )
         matrix[i] = tmp_matrix[i];
   }
}

Viele Gruesse
Axel

Play small video (10 s) from RAM

Hi,
Do you think that is it possible to play a small video (~10 seconds) from RAM using the basic concepts of your code?

The idea is to read the video from flash or sd, copy it to RAM and then use DMA.

Thanks!

DisplayBuffer is null!!

@tekker Hi, tekker, I have a NodeMCU-32S based on ESP32 and an OV7670 camera. I am using the newest ESP-IDF , all compiles cleanly and when I flash/run, the log shows: DisplayBuffer is null!!(in camera.c), unless i change currFbPtr=pvPortMallocCaps(3202402, MALLOC_CAP_32BIT); (in app_main.c) to currFbPtr=pvPortMallocCaps(1601202, MALLOC_CAP_32BIT);

and i add some codes to make a test:
size_t free8start=0, free32start=0, free8=0, free32=0;

free32=heap_caps_get_largest_free_block(MALLOC_CAP_32BIT);
free8=heap_caps_get_largest_free_block(MALLOC_CAP_8BIT);
free8start=heap_caps_get_minimum_free_size(MALLOC_CAP_8BIT);
free32start=heap_caps_get_minimum_free_size(MALLOC_CAP_32BIT);

ESP_LOGI(TAG, "Free (largest free blocks) 8bit-capable memory : %d, 32-bit capable memory %d\n", free8, free32);
ESP_LOGI(TAG, "Free (min free size) 8bit-capable memory : %d, 32-bit capable memory %d\n", free8start, free32start);

it print:
Free (largest free blocks) 8bit-capable memory : 144272, 32-bit capable memory 144272
Free (min free size) 8bit-capable memory : 272396, 32-bit capable memory 338868

i think it's
3202402=153600>144272 that make pvPortMallocCaps(3202402, MALLOC_CAP_32BIT) return NULL

Have you meet this issues?

OV7670 webserver images

Hello Tekker, I have been following this post since igrr's original post on the camera and the esp32. I was massively delighted to see you have been able to get the ov7670 working with the esp32. I am looking to view the images through a webpage served up by the esp instead of a display. If you can point me to the variables that contain the image data or where it is stored, I would love to work on achieving this. I have been looking through the code but am still unsure as to where the actual image data is stored. Would you be willing to help me out? I am pursuing this for a larger project that I am working on. Thank you for your work already.

No response on SCCB interface

I'm having trouble getting my OV7670 (without FIFO) camera to work with my LOLIN32 board.
It's always returning 0 when I run SCCB_Probe()

My connections are:

OV7670 ESP32
GND GND
3.3v 3.3v
PWDN GND (via 10kΩ)
XCLK 18
PWDN 5
SIOC SCL (22)
SIOD SDA (21)

Everything else is floating.

I can confirm a 10 MHZ signal on XCLK, and I can see some other frequencies on the PCLK, HREF and VSYNC pins.

I moved the code into a standalone program to attempt to debug, but I cant seem to get it to work.
The code is here: https://gist.github.com/mic159/c80494c7be5034150e29d21b0388d5a6

Is there something obvious I'm doing wrong, or is my module broken?

CAMERA_PF_GRAYSCALE mode not working

Hi

I tried replacing the CAMERA_PF_RGB565 with CAMERA_PF_GRAYSCALE to start getting grayscale images from the OV7670 but keep on running into LoadStoreError.

I uncommented the necessary lines and the LoadStoreError triggers here :
branch : framebuffer_overlay
file : camera.c
line 911 : dst[0] = src[0].sample1;

From here : https://github.com/SuperHouse/esp-open-rtos/wiki/Crash-Dumps
I find that it is likely because of trying to access a byte or word in a manner not allowed.

@tekker @igrr Did you manage to get grayscale mode to work with this branch ?
Any pointers are appreciated!

[Feature Request] ST7789V support for ESP32-Wrover-Kit v3

Hi @tekker thanks for the awesome work, it provided me a lot of fun!

This is a noobish request, I got myselft an ESP32-Wrover-Kit v3 and have some free time over the weekends to test and play with it.
Feel free to close this request if you find this is inappropriate.

I've ordered a couple of OV7670 cam modules to play with the Wrover Kit, and so far I managed to get a few snapshots using the feature-rgb_bitmap branch of this project.

I also attempted to modify the ov7670_ili9341 branch to get it working with the LCD bundled with my v3 Dev Kit (an ST7789V).
I found a driver implementation (IoTuz has support for ST7789v) and built this init code:

DRAM_ATTR static const ili_init_cmd_t ili_init_cmds[]={
    {0x36, {0}, 1},
    {0x3A, {0x55}, 1},
    {0xB2, {0x0C,0x0C,0x00,0x33,0x33}, 5},
    {0xB7, {0x35}, 1},
    {0xBB, {0x2B}, 1},
    {0xC0, {0x2C}, 1},
    {0xC2, {0x01,0xFF}, 2},
    {0xC3, {0x11}, 1},
    {0xC4, {0x20}, 1},
    {0xC6, {0x0F}, 1},
    {0xD0, {0xA4,0xA1}, 2},
    {0xE0, {0xD0,0x00,0x05,0x0E,0x15,0x0D,0x37,0x43,0x47,0x09,0x15,0x12,0x16,0x19}, 14},
    {0xE1, {0xD0,0x00,0x05,0x0D,0x0C,0x06,0x2D,0x44,0x40,0x0E,0x1C,0x18,0x16,0x19}, 14},
    {0x11, {0}, 0x80}, // optional
    {0x29, {0}, 0x80}, // optional
    {0, {0}, 0xff},
};

Obviously, modifying only this is not enough and I wonder if and where would be some other ili9341-specific code that also need to be adapted.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.