c/c++program design - sustech

Post on 02-May-2022

6 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

C/C++ Program DesignCS205

Week 8

Prof. Shiqi Yu (于仕琪)<yusq@sustech.edu.cn>

ARM Development Board

ARM• ARM (previously an acronym for Advanced RISC Machine and

originally Acorn RISC Machine) is a family of reduced instruction set computing (RISC) architectures for computer processors1.• ARM is the most widely used instruction set architecture (ISA) and the

ISA produced in the largest quantity.

1. https://en.wikipedia.org/wiki/ARM_architecture

Raspberry Pi 4• Broadcom BCM2711, Quad core

Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz• 2GB, 4GB or 8GB LPDDR4-3200

SDRAM (depending on model)• 2.4 GHz and 5.0 GHz IEEE 802.11ac

wireless, Bluetooth 5.0, BLE• Gigabit Ethernet• 2 USB 3.0 ports; 2 USB 2.0 ports.• Raspberry Pi standard 40 pin GPIO

header (fully backwards compatible with previous boards)• 2 ×micro-HDMI ports (up to

4kp60 supported)

https://www.raspberrypi.org/

EAIDK-310

• ARM 4-core 64-bit, Cortex-A53,1.3GHz• LPDDR3 1GB RAM• 802.11 ac/a/b/g/n, 2.4G/5GHz• 1xUSB3, 3xUSB2, 1xMicro-USB• Bluetooth 5.0

http://www.eaidk.com/

How to develop programs with ARM Development boards

Almost the same with a PC with Linux OS.• gcc/g++• Makefile• cmake

Some Tricks in OpenCV

What’s an image?

cv:Mat class

• Matrix: 2D array? Much more than that.

• modules/core/include/opencv2/core/mat.hpp

class CV_EXPORTS Mat{public:

// some functionsint rows, cols;//pointer to datauchar* data;//size_t step.pMatStep step;

};

cv:Mat class

… … int flags int dims int rows int cols

uchar* data int* refcount

… … …

Matrix data Ref count

step in cv::Mat

•How many bytes for a row of Matrix 4(row)x3(col)?Ø Can be 3, 4, 8, and any other values >=3.Ø Memory alignment for SIMD

ROI: Region of interest • Mat A

Ø rows=100Ø cols=100Ø step=100Ø data=0xABCDEF00

• Mat BØ rows=100Ø cols=100Ø step=100Ø data=0xABCDEF00

• Mat BØ rows=30Ø cols=28Ø step=100Ø data=0xABCE0698

A

B

C

Mat

Matrix Data

top related