igrr / esp32-cam-demo

Demo for working with a camera on ESP32
Apache License 2.0
623 stars 242 forks source link

Is it possible to take full resolution images from ov2640? #98

Open netremo opened 6 years ago

netremo commented 6 years ago

OV2640 is 2MP module, but currently in this example maximum frame size is 800x600. Is it possible to take full resolution photo? I need only one shot image.

Thanks.

lss6378 commented 6 years ago

I think it's possible if you use an esp32-wrover module. It has a 4M PSRAM module.

tmrttmrt commented 6 years ago

Take a look at https://github.com/tmrttmrt/esp32-cam-demo/tree/tmrt. With enough compression it is possible to obtain jpg images with sizes of about 100 kB.

ModMike commented 6 years ago

@tmrttmrt I downloaded your repo and tried to compile but get this error:

xclk.c:31:12: error: 'ledc_channel_config_t {aka struct }' has no member named 'hpoint' ch_conf.hpoint = 0; I understand this happened as the result of the new version of ESP-IDF. I commented out the line but not sure if it will break something else

tmrttmrt commented 6 years ago

I am new to esp32 so have no idea.

sysizlayan commented 5 years ago

@tmrttmrt I downloaded your repo and tried to compile but get this error:

xclk.c:31:12: error: 'ledc_channel_config_t {aka struct }' has no member named 'hpoint' ch_conf.hpoint = 0; I understand this happened as the result of the new version of ESP-IDF. I commented out the line but not sure if it will break something else

I am building with IDF3.2 latest release. I think if you update the version, it will compile.

And I am also wondering if we can take the snapshots with 1600*1200 resolution. Memory allocation of the frame buffer is done using calloc function which allocates memory from internal SRAM, does not use PSRAM. In addition to that, even if the buffer is allocated in PSRAM using MALLOC_CAP_SPIRAM flag, this memory buffer could not be read from or written into by DMA.

I2S uses DMA to write the data to buffer, so PSRAM seems impossible to use for frame buffer to me.

Ping-pong buffering may be a solution but I am not sure if we can change the buffer address while the I2S is reading data from the camera.

@igrr do you have any comments on this issue? If you can inform us about the issue, it would be great.

Thanks in advance.

igrr commented 5 years ago

Sorry folks, I haven't tried anything above 800*600 myself.

A more robust and full featured version of this codebase is currently being developed in Espressif, and it will be released as a (supported) component. For now I can only suggest to either poke a bit more at this yourself, or wait until the other version is released.

I2S uses DMA to write the data to buffer, so PSRAM seems impossible to use for frame buffer to me.

DMA doesn't write to the frame buffer directly; it writes into smaller intermediate buffers, and then the line filter routine copies data over into the frame buffer. Only intermediate buffers need to be in DMA capable memory, frame buffer may be in PSRAM.

Oitzu commented 5 years ago

Short answer: Yes it is possible. No problem at all with the 4M PSRAM module.

javiercuellar73 commented 4 years ago

Short answer: Yes it is possible. No problem at all with the 4M PSRAM module.

Do you have the long answer? How to shoot at 1600*1200 resolution??