WALL-E Camera class used for object and color detection.
More...
#include <camera.h>
|
| | OV2640Camera (I2C_HandleTypeDef *i2c, SPI_HandleTypeDef *spi, GPIO_TypeDef *cs_port, uint16_t cs_pin) |
| | Constructor function for the Camera Class.
|
| bool | initialize () |
| | Function initializes the camera for photo capturing by using the OV2640 register and values list in the header/include folder.
|
| bool | captureFrame () |
| | Function captures a single frame from the camera storing the RGB and data from the photo for parsing and basic color detection.
|
| void | printCaptureReport (UART_HandleTypeDef *huart) |
| | Function is designed to parse the photo data captured by the camera. The data is the transmitted via USART to a PUTTY Terminal for viewing and debugging.
|
| void | printBlueDetectionMap (UART_HandleTypeDef *huart) |
| | Function is designed to parse the photo data captured by the camera focusing on blue color pixels and selecting by a threshold value. The data is the transmitted via USART to a PUTTY Terminal for viewing and debugging.
|
| DominantColor | analyzeColor () |
| | Function is the analysis/parsing function to analyze the colors in frame by pixels.
|
| DominantColor | analyzeColorCenter () |
| | Function is the analysis/parsing function focusing solely on the pixels closer to the center of the Camera.
|
|
| void | writeRegister (uint8_t reg, uint8_t val) |
| | Function takes in a register and value utilizing I2C to write to the desired register.
|
| void | csHigh () |
| | Function sets the Chip Select GPIO pin high for SPI Communication.
|
| void | csLow () |
| | Function sets the Chip Select GPIO pin low for SPI Communication.
|
|
| static constexpr size_t | FRAME_SIZE = 160 * 120 * 2 |
WALL-E Camera class used for object and color detection.
◆ OV2640Camera()
| OV2640Camera::OV2640Camera |
( |
I2C_HandleTypeDef * | i2c, |
|
|
SPI_HandleTypeDef * | spi, |
|
|
GPIO_TypeDef * | cs_port, |
|
|
uint16_t | cs_pin ) |
Constructor function for the Camera Class.
◆ analyzeColor()
Function is the analysis/parsing function to analyze the colors in frame by pixels.
- Returns
- None
◆ analyzeColorCenter()
Function is the analysis/parsing function focusing solely on the pixels closer to the center of the Camera.
- Returns
- None
◆ captureFrame()
| bool OV2640Camera::captureFrame |
( |
| ) |
|
Function captures a single frame from the camera storing the RGB and data from the photo for parsing and basic color detection.
- Returns
- None
◆ csHigh()
| void OV2640Camera::csHigh |
( |
| ) |
|
|
private |
Function sets the Chip Select GPIO pin high for SPI Communication.
- Returns
- None
◆ csLow()
| void OV2640Camera::csLow |
( |
| ) |
|
|
private |
Function sets the Chip Select GPIO pin low for SPI Communication.
- Returns
- None
◆ initialize()
| bool OV2640Camera::initialize |
( |
| ) |
|
Function initializes the camera for photo capturing by using the OV2640 register and values list in the header/include folder.
- Returns
- Boolean
◆ printBlueDetectionMap()
| void OV2640Camera::printBlueDetectionMap |
( |
UART_HandleTypeDef * | huart | ) |
|
Function is designed to parse the photo data captured by the camera focusing on blue color pixels and selecting by a threshold value. The data is the transmitted via USART to a PUTTY Terminal for viewing and debugging.
- Parameters
-
| huart | Parameter that sets the USART definition from the STM32 HAL Configuration |
- Returns
- None
◆ printCaptureReport()
| void OV2640Camera::printCaptureReport |
( |
UART_HandleTypeDef * | huart | ) |
|
Function is designed to parse the photo data captured by the camera. The data is the transmitted via USART to a PUTTY Terminal for viewing and debugging.
- Parameters
-
| huart | Parameter that sets the USART definition from the STM32 HAL Configuration |
- Returns
- None
◆ writeRegister()
| void OV2640Camera::writeRegister |
( |
uint8_t | reg, |
|
|
uint8_t | val ) |
|
private |
Function takes in a register and value utilizing I2C to write to the desired register.
- Parameters
-
| reg | Parameter that takes in the register value to write data into |
| val | Parameter that takes in the data to write to specified register |
- Returns
- None
◆ cs_pin_
| uint16_t OV2640Camera::cs_pin_ |
|
private |
Private Variable cs_pin. Sets the Chip Select GPIO definition from the STM32 HAL Config
◆ cs_port_
| GPIO_TypeDef* OV2640Camera::cs_port_ |
|
private |
Private Variable cs_port_. Sets the Chip Select GPIO Port definition from the STM32 HAL Config
◆ frame_buffer_
Private Variable frame_buffer_. Sets the buffer for frame analysis
◆ FRAME_SIZE
| size_t OV2640Camera::FRAME_SIZE = 160 * 120 * 2 |
|
staticconstexprprivate |
Private Variable FRAME_SIZE. Sets the camera's fixed Frame Capture Size
◆ i2c_
| I2C_HandleTypeDef* OV2640Camera::i2c_ |
|
private |
Private Variable i2c_. Sets the I2C definition from the STM32 HAL Config
◆ spi_
| SPI_HandleTypeDef* OV2640Camera::spi_ |
|
private |
Private Variable spi_. Sets the SPI definition from the STM32 HAL Config
The documentation for this class was generated from the following files:
- C:/Users/arath/OneDrive/Documents/ME 507/Project-WALLE/Code/Inc/camera.h
- C:/Users/arath/OneDrive/Documents/ME 507/Project-WALLE/Code/src/camera.cpp