当前位置: 首页 > news >正文

FPGA图像处理(四)------ 图像裁剪

`timescale 1ns / 1ps
//
// Description:  图像裁剪算法
//
module image_crop(input wire clk,input wire reset,input wire [10:0] img_width,input wire [10:0] img_height,input wire [10:0] img_x_start,input wire [10:0] img_x_end,input wire [10:0] img_y_start,input wire [10:0] img_y_end,input wire valid_i,input wire [23:0] img_data_i,output reg valid_o,output reg [23:0] img_data_o);//参数声明reg [10:0] x_cnt_r; //行计数器reg [10:0] y_cnt_r; //列计数器//计数always@(posedge clk or posedge reset) beginif(reset) beginx_cnt_r <= 'b0;y_cnt_r <= 'b0;end else beginx_cnt_r <= valid_i ? ((x_cnt_r == img_width - 1) ? 0 : x_cnt_r + 1) : x_cnt_r;y_cnt_r <= valid_i&&(x_cnt_r == img_width - 1) ? ((y_cnt_r == img_height - 1) ? 0 : y_cnt_r + 1) : y_cnt_r;endend    always@(posedge clk or posedge reset) beginif(reset) beginvalid_o <= 'b0;img_data_o <= 'b0;end else beginvalid_o <= valid_i&&(x_cnt_r >= img_x_start)&&(x_cnt_r < img_x_end)&&(y_cnt_r >= img_y_start)&&(y_cnt_r < img_y_end) ? 1'b1 : 1'b0;img_data_o <= img_data_i;endendendmodule

 

http://www.dtcms.com/a/179478.html

相关文章:

  • 【C语言】(8)—指针2
  • 65.Three.js案例-使用 MeshNormalMaterial 和 MeshDepthMaterial 创建 3D 图形
  • Screeps Arena基础入门
  • 基于STM32、HAL库的CP2104 USB转UART收发器 驱动程序设计
  • 最新Spring Security实战教程(十四)OAuth2.0精讲 - 四种授权模式与资源服务器搭建
  • 湖南省密码协会成立,麒麟信安担任副会长单位共话密码创新应用之道
  • 【Python Web开发】05-WSGI概述
  • WordPress插件:WPJAM Basic优化设置
  • 数据库(MySQL)基础
  • 【AI提示词】费曼学习法导师
  • 【时时三省】(C语言基础)怎样定义和引用二维数组
  • 开平机:卷材高效成板的核心装备
  • 无需标记点,精准面部捕捉!无线面捕头盔赋予自由表演空间
  • Java大师成长计划之第15天:Java线程基础
  • 3.5/Q1,GBD数据库最新文章解读
  • ubuntu24.04安装anaconda
  • Spring Boot + Vue 实现在线视频教育平台
  • Spring Boot 3 + Undertow 服务器优化配置
  • modbus 帧信息格式
  • Linux/AndroidOS中进程间的通信线程间的同步 - 消息队列
  • [数据库之十一] 数据库索引之联合索引
  • 主备Smart Link + Monitor Link组网技术详细配置
  • java实战(第六篇):统计投票信息
  • C++ STL 入门:map 键值对容器
  • 手写Promise的静态方法
  • 2024年 AI大模型我该买一张什么显卡?
  • 【行业深度解析】什么是马甲包?
  • 责任链设计模式
  • vue3的深入组件-组件 v-model
  • 免费AI图像编辑平台,最新无损放大技术