# Nicla vision & sensor.JPEG

**URL:** <https://forums.openmv.io/t/nicla-vision-sensor-jpeg/9005>\
**Category:** Arduino Boards\
**Created:** [December 11, 2023, 8:13pm UTC](https://forums.openmv.io/t/nicla-vision-sensor-jpeg/9005 "2023-12-11T20:13:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephane](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@stephane](https://forums.openmv.io/u/stephane)\
**Post date:** [December 11, 2023, 8:13pm UTC](https://forums.openmv.io/t/nicla-vision-sensor-jpeg/9005/1 "2023-12-11T20:13:18Z")

</div>

Hi,

I want to acquire a full resolution image. but, due to lack of RAM, I can’t. and I didn’t find any way to get a binning image. HW JPEG compression can be a solution.

STM32H747 of nicla vision support HW JPEG encoding on DMCI interface (file:///home/skumy/Downloads/an5020-digital-camera-interface-dcmi-on-stm32-mcus-stmicroelectronics.pdf)  
Any way to enable this feature on OpenMV ?

thanks  
stéphane

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [December 11, 2023, 8:24pm UTC](https://forums.openmv.io/t/nicla-vision-sensor-jpeg/9005/2 "2023-12-11T20:24:29Z")

</div>

Hi, the camera sensor doesn’t support that. That feature is only for the OV5640 which can output a JPEG image. The Galaxy Core sensor doesn’t support that.

Given the RAM limits and lack of JPEG support output from the camera module on the Nicla there is no way to actually capture the maximum resolution from the camera.

That said, if you want a larger FoV we added a flag you can set to make that happen: [sensor — camera sensor — MicroPython 1.20 documentation (openmv.io)](https://docs.openmv.io/library/omv.sensor.html#sensor.IOCTL_SET_FOV_WIDE)

Just turn that on before calling snapshot via `sensor.ioctl(sensor.IOCTL_SET_FOV_WIDE, True)`. You’ll get a frame rate drop but the FoV will increase by a very large amount.

---

<div class="post-metadata">

**Author:** ![stephane](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@stephane](https://forums.openmv.io/u/stephane)\
**Post date:** [December 11, 2023, 8:40pm UTC](https://forums.openmv.io/t/nicla-vision-sensor-jpeg/9005/3 "2023-12-11T20:40:13Z")

</div>

Great !  
yes it’s for FoV

I try this with last firmware (4.5.2) and basic sample but no change in IDE

```auto
import sensor
import time

sensor.reset() # Reset and initialize the sensor.

sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.VGA) # Set frame size to QVGA (320x240)
sensor.skip_frames(time=2000) # Wait for settings take effect.
clock = time.clock() # Create a clock object to track the FPS.

while True:
    clock.tick() # Update the FPS clock.
    sensor.ioctl(sensor.IOCTL_SET_FOV_WIDE, True)    
    img = sensor.snapshot() # Take a picture and return the image.
    print(clock.fps()) # Note: OpenMV Cam runs about half as fast when connected
    # to the IDE. The FPS should increase once disconnected.

```

any idea ?

---

<div class="post-metadata">

**Author:** ![stephane](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@stephane](https://forums.openmv.io/u/stephane)\
**Post date:** [December 11, 2023, 9:03pm UTC](https://forums.openmv.io/t/nicla-vision-sensor-jpeg/9005/4 "2023-12-11T21:03:16Z")

</div>

OK  
Not work for VGA  
only less resolution (QVGA, HVGA)

Bug or limitation ?

thanks

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [December 11, 2023, 9:05pm UTC](https://forums.openmv.io/t/nicla-vision-sensor-jpeg/9005/5 "2023-12-11T21:05:53Z")

</div>

VGA has a maximum FoV. But, you can’t really store a VGA sized image in RAM with RGB565. Our driver will try to switch to BAYER for that resolution but the Galaxy Core camera doesn’t like to output BAYER images except at particular resolutions.

---

<div class="post-metadata">

**Author:** ![stephane](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@stephane](https://forums.openmv.io/u/stephane)\
**Post date:** [December 11, 2023, 9:13pm UTC](https://forums.openmv.io/t/nicla-vision-sensor-jpeg/9005/6 "2023-12-11T21:13:49Z")

</div>

OK for VGA output in RGB565

Sorry but no for FoV.  
FoV in QVGA & IOCTL\_SET\_FOV\_WIDE is better (realy better) than VGA

It’s very strange. Great Fov to Less Fov :  
QVGA & FOV\_WIDE \> HVGA & FOV\_WIDE \> VGA

I just test with IDE

I think I don’t understand something…

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [December 11, 2023, 9:31pm UTC](https://forums.openmv.io/t/nicla-vision-sensor-jpeg/9005/7 "2023-12-11T21:31:34Z")

</div>

Here’s the logic. It does it’s best: [openmv/src/omv/sensors/gc2145.c at master · openmv/openmv (github.com)](https://github.com/openmv/openmv/blob/master/src/omv/sensors/gc2145.c#L828)

It’s likely because VGA is an even division ratio and the camera outputs corrupted BAYER images if you use an even division ratio so we don’t allow that.

E.g. remove this and you can use any scale: [openmv/src/omv/sensors/gc2145.c at master · openmv/openmv (github.com)](https://github.com/openmv/openmv/blob/master/src/omv/sensors/gc2145.c#L856)

But, then sensor.BAYER images will be corrupted. Note that we cannot store VGA RGB565 given the RAM available so the sensor driver is silently changing the image format to sensor.BAYER.

---

<div class="post-metadata">

**Author:** ![stephane](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@stephane](https://forums.openmv.io/u/stephane)\
**Post date:** [December 11, 2023, 9:51pm UTC](https://forums.openmv.io/t/nicla-vision-sensor-jpeg/9005/8 "2023-12-11T21:51:08Z")

</div>

OK thanks,  
I will try with firmware modification but it’s longer than in script 🙂
