When using OpenMV4-H7-Plus to drive GENX320 event camera module, the code example given by the official obtains all frame image data. Does anyone know how to get GENX320 raw data?
Hi, you need to recompile the firmware with this disabled (e.g. set to 0):
The camera driver will then receive events from the event camera and process them to create a frame here:
You can find the struct fields for the event here:
See the TS value.
…
We do not recommend to do this though. It’s incredibly taxing on the CPU to generate an image from random access events.
If you are not interested in processing the event image as an image but processing events as they come in… you are welcome to modify the firmware as you like to do whatever you want. Note that the camera driver will buffer 25600 events before processing them. To change the buffer depth will require serious modifications of the frame capture DMA system which is completely non-trivial.
…
Instead, we recommend just setting the frame rate you want. Which defines the integration time as 1/fps, and then processing the full frames. The H7 Plus can run up to 375 Hz which should be more than enough to have very good temporal resolution.
Thank you very much for your reply, but when I follow the tutorial in “Building the Firmware From Source” to download the openmv code in ubuntu 22.04 and compile it, I always get an error after executing the command “make -j$(nproc) TARGET=OPENMV4P”, and the error statement says that many variables are not defined.
What is the reason for this problem? Is it because of my bad network that the source code is not fully downloaded or is it something else?
Thank you very much for your reply, but when I follow the tutorial in “Building the Firmware From Source” to download the openmv code in ubuntu 22.04 and compile it, I always get an error after executing the command “make -j$(nproc) TARGET=OPENMV4P”, and the error statement says that many variables are not defined.
What is the reason for this problem? Is it because of my bad network that the source code is not fully downloaded or is it something else?
I repeated it several times and got the same problem。
---- Replied Message ----
From | Kwabena W. Agyeman via OpenMV Forumsnotifications@openmv1.discoursemail.com |
- | - |
Date | 4/17/2025 01:15 |
To | 18886352025@163.com |
Subject | [OpenMV Forums] [OpenMV Boards] Inquiry About Fetching Event Data from GENX320 with OpenMV4-H7-Plus |
| kwagyeman
April 16 |
- | - |
Hi, you need to recompile the firmware with this disabled (e.g. set to 0):
boards/OPENMV4P/omv_boardconfig.hmaster
1. #define OMV_OV7725_PLL_CONFIG (0x41) // x4
1. #define OMV_OV7725_BANDING (0x7F)
1. #define OMV_OV9650_ENABLE (1)
1. #define OMV_MT9M114_ENABLE (1)
1. #define OMV_MT9V0XX_ENABLE (1)
1. #define OMV_LEPTON_ENABLE (1)
1. #define OMV_PAG7920_ENABLE (1)
1. #define OMV_PAJ6100_ENABLE (1)
1. #define OMV_FROGEYE2020_ENABLE (1)
1. #define OMV_GENX320_EHC_ENABLE (1)
1. // FIR drivers configuration.
1. #define OMV_FIR_MLX90621_ENABLE (1)
1. #define OMV_FIR_MLX90640_ENABLE (1)
1. #define OMV_FIR_MLX90641_ENABLE (1)
1. #define OMV_FIR_AMG8833_ENABLE (1)
1. #define OMV_FIR_LEPTON_ENABLE (1)
1. // UMM heap block size
1. #define OMV_UMM_BLOCK_SIZE 256
The camera driver will then receive events from the event camera and process them to create a frame here:
drivers/sensors/genx320.cmaster
1. psee_write_ROI_Y(offset * sizeof(uint32_t), 0);
1. }
1. }
1. #endif // (OMV_GENX320_CAL_ENABLE == 1)
1. static void snapshot_post_process(image_t *image) {
1. #if (OMV_GENX320_EHC_ENABLE == 1)
1. for (uint32_t i = 0; i < ACTIVE_SENSOR_SIZE; i++) {
1. image->data[i] = __USAT((((int8_t *) image->data)[i] * contrast) + brightness, UINT8_T_BITS);
1. }
1. #else
1. uint8_t *out = fb_alloc(ACTIVE_SENSOR_SIZE, FB_ALLOC_NO_HINT);
1. memset(out, brightness, ACTIVE_SENSOR_SIZE);
1. for (uint32_t i = 0; i < (ACTIVE_SENSOR_SIZE / sizeof(uint32_t)); i++) {
1. uint32_t val = ((uint32_t *) image->data)[i];
1. uint32_t x = __EVT20_X(val);
1. uint32_t y = __EVT20_Y(val);
1. switch (__EVT20_TYPE(val)) {
1. case TD_LOW: {
1. if ((x < ACTIVE_SENSOR_WIDTH) && (y < ACTIVE_SENSOR_HEIGHT)) {
You can find the struct fields for the event here:
drivers/genx320/include/evt_2_0.hmaster
1. * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
1. * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1. * See the License for the specific language governing permissions and limitations under the License.
1. *
1. ******************************************************************************
1. */
1. #ifndef INC_EVT_2_0_H_
1. #define INC_EVT_2_0_H_
1. #define __EVT20_TYPE(__VAL__) ((__VAL__ >> 28)& 0xFU)
1. #define __EVT20_TS(__VAL__) ((__VAL__ >> 22) & 0xF3U)
1. #define __EVT20_X(__VAL__) ((__VAL__ >> 11) & 0x7FFU)
1. #define __EVT20_Y(__VAL__) ((__VAL__ ) & 0x7FFU)
1. #define __EVT20_TIME_HIGH(__VAL__) ((__VAL__ ) & 0xFFFFFFFU)
1. #define TD_LOW 0x0U /*!< EVT2.0 TD Event, Decrease in illumination */
1. #define TD_HIGH 0x1U /*!< EVT2.0 TD Event, Increase in illumination */
1. #define EV_TIME_HIGH 0x8U /*!< Timer High bits */
1. #define EXT_TRIGGER 0xAU /*!< External triggers */
1. #define OTHERS 0xEU /*!< To be used in extension in the event types */
See the TS value.
…
We do not recommend to do this though. It’s incredibly taxing on the CPU to generate an image from random access events.
If you are not interested in processing the event image as an image but processing events as they come in… you are welcome to modify the firmware as you like to do whatever you want. Note that the camera driver will buffer 25600 events before processing them. To change the buffer depth will require serious modifications of the frame capture DMA system which is completely non-trivial.
…
Instead, we recommend just setting the frame rate you want. Which defines the integration time as 1/fps, and then processing the full frames. The H7 Plus can run up to 375 Hz which should be more than enough to have very good temporal resolution.
Hi, you need to clone the repo, then git submoudule update --init
. Then cd into lib/micropython
and then git submoudule update --init
. Then cd into mpy-cross
and make
. Then go back to openmv
top and make TARGET=OPENMV4P -j
.
Make sure to make clean
before the two make calls to cleanout anything.