950円
「電子回路 基礎からシステムまで」 安藤繁 定価: ¥ 3,740 学生時代に購入してほぼ使用していません。 カバーは外してしまいました。 #安藤繁 #本 #BOOK #コンピュータ #IT #自然科学と技術
// xf_median_blur.h
// 2020/03/09 by marsee
// xfopencv/examples/medianblur/xf_median_blur_config.h のコードを引用している
// https://github.com/Xilinx/xfopencv/blob/master/examples/medianblur/xf_median_blur_config.h
// xfopencv/examples/medianblur/xf_config_params.h のコードを引用している
// https://github.com/Xilinx/xfopencv/blob/master/examples/medianblur/xf_config_params.h
// 2022/01/10 : for Vitis Vision Library
#ifndef __XF_MEDIAN_BLUR_H__
#define __XF_MEDIAN_BLUR_H__
#include "hls_stream.h"
#include "ap_int.h"
#include "common/xf_common.hpp"
#include "ap_axi_sdata.h"
#include "common/xf_infra.hpp"
#include "common/xf_axi_io.hpp"
#include "imgproc/xf_median_blur.hpp"
//#include "xf_config_params.hpp"
#define NO 1 // Normal Operation
#define RO 0 // Resource Optimized
#define RGB 1
#define GRAY 0
/* Filter window size*/
#define WINDOW_SIZE 3
/* set the height and weight */
#define WIDTH 1920
#define HEIGHT 1080
#if NO
#define NPxPC XF_NPPC1
#else
#define NPxPC XF_NPPC8
#endif
#if GRAY
#define TYPE XF_8UC1
#define CHANNELS 1
#define STREAMW 8
#else
#define TYPE XF_8UC3
#define CHANNELS 3
#define STREAMW 32
#endif
typedef hls::stream<ap_axiu<STREAMW,1,1,1> > AXI_STREAM;
#endif
// xf_median_blur.cpp
// 2020/03/08 by marsee
// xfopencv/HLS_Use_Model/Standalone_HLS_AXI_Example/xf_ip_accel_app.cpp のコードを引用している
// https://github.com/Xilinx/xfopencv/blob/master/HLS_Use_Model/Standalone_HLS_AXI_Example/xf_ip_accel_app.cpp
// xfopencv/examples/medianblur/xf_median_blur_accel.cpp のコードを引用している
// https://github.com/Xilinx/xfopencv/blob/master/examples/medianblur/xf_median_blur_accel.cpp
// 2022/01/10 : for Vitis Vision Library
#include "xf_median_blur.h"
void median_blur_accel_axis(AXI_STREAM& _src, AXI_STREAM& _dst, int img_height, int img_width){
#pragma HLS INTERFACE mode=s_axilite port=img_width
#pragma HLS INTERFACE mode=s_axilite port=img_height
#pragma HLS INTERFACE mode=s_axilite port=return
#pragma HLS INTERFACE mode=axis register_mode=both port=_src register
#pragma HLS INTERFACE mode=axis register_mode=both port=_dst register
xf::cv::Mat<TYPE, HEIGHT, WIDTH, NPxPC> img_in(img_height, img_width);
xf::cv::Mat<TYPE, HEIGHT, WIDTH, NPxPC> img_out(img_height, img_width);
#pragma HLS DATAFLOW
xf::cv::AXIvideo2xfMat(_src, img_in);
xf::cv::medianBlur <WINDOW_SIZE, XF_BORDER_REPLICATE, TYPE, HEIGHT, WIDTH, NPxPC> (img_in, img_out);
xf::cv::xfMat2AXIvideo(img_out, _dst);
}
// xf_median_blur_config_tb.cpp
// 2020/03/08 by marsee
// xfopencv/HLS_Use_Model/Standalone_HLS_AXI_Example/xf_dilation_tb.cpp のコードを引用している
// https://github.com/Xilinx/xfopencv/blob/master/HLS_Use_Model/Standalone_HLS_AXI_Example/xf_dilation_tb.cpp
// xfopencv/examples/medianblur/xf_median_blur_tb.cpp のコードを引用している
// https://github.com/Xilinx/xfopencv/blob/master/examples/medianblur/xf_median_blur_tb.cpp
// 2022/01/10 : for Vitis Vision Library
#include "opencv2/opencv.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgcodecs/imgcodecs.hpp"
#include "xf_median_blur.h"
#include "common/xf_axi.hpp"
#include "common/xf_sw_utils.hpp"
void median_blur_accel_axis(AXI_STREAM& _src, AXI_STREAM& _dst, int img_height, int img_width);
int main(int argc, char** argv)
{
if(argc != 2)
{
fprintf(stderr,"Invalid Number of Arguments!\nUsage:\n");
fprintf(stderr,"<Executable Name> <input image path> \n");
return -1;
}
cv::Mat out_img,ocv_ref;
cv::Mat in_img,in_img1,diff;
// reading in the color image
#if GRAY
in_img = cv::imread(argv[1], 0);
#else
in_img = cv::imread(argv[1], 1);
#endif
if (in_img.data == NULL)
{
fprintf(stderr,"Cannot open image at %s\n", argv[1]);
return 0;
}
// create memory for output images
/* reading the gray/color image */
#if GRAY
ocv_ref.create(in_img.rows,in_img.cols,CV_8UC1);
out_img.create(in_img.rows,in_img.cols,CV_8UC1);
diff.create(in_img.rows,in_img.cols,CV_8UC1);
in_img1.create(in_img.rows,in_img.cols,CV_8UC1);
#else
ocv_ref.create(in_img.rows,in_img.cols,CV_8UC3);
out_img.create(in_img.rows,in_img.cols,CV_8UC3);
diff.create(in_img.rows,in_img.cols,CV_8UC3);
in_img1.create(in_img.rows,in_img.cols,CV_8UC3);
#endif
int img_height = in_img.rows;
int img_width = in_img.cols;
///////////////// Opencv Reference ////////////////////////
cv::medianBlur(in_img,ocv_ref,WINDOW_SIZE);
cv::imwrite("out_ocv.jpg", ocv_ref);
AXI_STREAM _src,_dst;
xf::cv::cvMat2AXIvideoxf<NPxPC>(in_img, _src);
median_blur_accel_axis(_src, _dst, img_height, img_width);
xf::cv::AXIvideo2cvMatxf<NPxPC>(_dst, in_img1);
cv::imwrite("hls.jpg", in_img1);
////////////////// Compute Absolute Difference ////////////////////
cv::absdiff(ocv_ref, in_img1, diff);
float err_per;
xf::cv::analyzeDiff(diff,0,err_per);
cv::imwrite("diff_img.jpg",diff);
in_img.~Mat();
out_img.~Mat();
ocv_ref.~Mat();
in_img.~Mat();
in_img1.~Mat();
diff.~Mat();
if(err_per > 0.0f)
{
return 1;
}
return 0;
}
を設定した。-I/media/masaaki/Ubuntu_Disk/Xilinx_github/Vitis_Libraries/vision/L1/include -std=c++0x -I/usr/local/include
を設定した。-L/usr/local/lib -lopencv_core -lopencv_imgcodecs -lopencv_imgproc
を設定した。/media/masaaki/Ubuntu_Disk/Vitis_HLS/ZYBO_Z7_20/2021.2/xf_median_blur/test2.jpg
を設定した。-I/media/masaaki/Ubuntu_Disk/Xilinx_github/Vitis_Libraries/vision/L1/include -std=c++0x
を設定した。-I/media/masaaki/Ubuntu_Disk/Xilinx_github/Vitis_Libraries/vision/L1/include -std=c++0x
ERROR: [SYNCHK 200-61] /media/masaaki/Ubuntu_Disk/Xilinx_github/Vitis_Libraries/vision/L1/include/common/xf_utility.hpp:66:
unsupported memory access on variable 'tmp_buf' which is (or contains) an array with unknown size at compile time.
だった。ERROR: [HLS 207-812] 'common/xf_common.hpp' file not found (xf_dilation/xf_dilation_config.h:22:10)
xf_dilation_accel.cpp
xf_dilation_config.h
xf_dilation_tb.cpp
xf_config_params.h
を設定した。-I/media/masaaki/Ubuntu_Disk/Xilinx_github/Vitis_Libraries/vision/L1/include -std=c++0x -I/usr/local/include
を設定した。-L/usr/local/lib -lopencv_core -lopencv_imgcodecs -lopencv_imgproc
を指定した。/media/masaaki/Ubuntu_Disk/Xilinx_github/Vitis_Libraries/vision/data/128x128.png
電子回路 : 基礎からシステムまで
![]()
- Author:marsee
- FPGAの部屋へようこそ!
FPGAの部屋の有用と思われるコンテンツのまとめサイトを作りました。ご利用ください。
http://marsee101.web.fc2.com/index.html
最近の記事
- Vitis HLS 2021.2 で Vitis Vision Library を使用する7(AXI4-Stream 入出力の xf_median_blur 編 3) (01/18)
- Vitis HLS 2021.2 で Vitis Vision Library を使用する6(AXI4-Stream 入出力の xf_median_blur 編 2) (01/16)
- Vitis HLS 2021.2 で Vitis Vision Library を使用する5(AXI4-Stream 入出力の xf_median_blur 編 1) (01/15)
- Vitis HLS 2021.2 で Vitis Vision Library を使用する4(rgbirbayer 編) (01/14)
- Vitis HLS 2021.2 で Vitis Vision Library を使用する3(dilation 編 3) (01/13)
- Vitis HLS 2021.2 で Vitis Vision Library を使用する2(dilation 編 2) (01/12)
- Vitis HLS 2021.2 で Vitis Vision Library を使用する1(dilation 編 1) (01/11)
最近のコメント
- 7of9:MicroBlaze プロセッサの BRAM メモリの増減の方法 (01/13)
- 7of9:Vivado HLS で DMA Write IP を作る(オフセット・アドレス指定編) (12/22)
- 7of9:Vivado HLS で DMA Write IP を作る(オフセット・アドレス指定編) (12/22)
- 西山茂丸:OWON SDS-1102(オシロスコープ)を買いました (11/23)
- 名無し:OWON SDS-1102(オシロスコープ)を買いました (11/14)
- marsee:RBG 24 ビット・データ入出力対応のソーベル・フィルタを Vitis HLS 2021.1 で作成する1 (11/08)
- marsee:”MicroZed Chronicles: Kria & Raspberry Pi Camera”をやってみる2 (11/06)
電子回路 : 基礎からシステムまで
- ぱふぅ家のホームページ:Windows 10 が Creators Update に (08/22)
- ぱふぅ家のホームページ:Windows 10 が Creators Update に (12/27)
- ぱふぅ家のホームページ:Windows 10 が Creators Update に (12/10)
- OSQZSS:白基板 (11/21)
- iPhoneSDK他いろいろ 開発メモ:[FPGA][電子工作]FPGA関連のおすすめサイトのまとめ (10/04)
月別アーカイブ
- 2022年01月 (18)
- 2021年12月 (31)
- 2021年11月 (29)
- 2021年10月 (26)
- 2021年09月 (32)
- 2021年08月 (27)
- 2021年07月 (28)
- 2021年06月 (30)
- 2021年05月 (31)
- 2021年04月 (29)
- 2021年03月 (31)
- 2021年02月 (27)
- 2021年01月 (29)
- 2020年12月 (31)
- 2020年11月 (30)
- 2020年10月 (29)
- 2020年09月 (26)
- 2020年08月 (28)
- 2020年07月 (26)
- 2020年06月 (35)
- 2020年05月 (31)
- 2020年04月 (29)
- 2020年03月 (30)
- 2020年02月 (29)
- 2020年01月 (29)
- 2019年12月 (32)
- 2019年11月 (29)
- 2019年10月 (32)
- 2019年09月 (25)
- 2019年08月 (29)
- 2019年07月 (30)
- 2019年06月 (30)
- 2019年05月 (27)
- 2019年04月 (27)
- 2019年03月 (29)
- 2019年02月 (28)
- 2019年01月 (27)
- 2018年12月 (28)
- 2018年11月 (30)
- 2018年10月 (26)
- 2018年09月 (35)
- 2018年08月 (38)
- 2018年07月 (28)
- 2018年06月 (30)
- 2018年05月 (33)
- 2018年04月 (29)
- 2018年03月 (29)
- 2018年02月 (30)
- 2018年01月 (37)
- 2017年12月 (35)
- 2017年11月 (30)
- 2017年10月 (31)
- 2017年09月 (27)
- 2017年08月 (30)
- 2017年07月 (29)
- 2017年06月 (29)
- 2017年05月 (24)
- 2017年04月 (28)
- 2017年03月 (29)
- 2017年02月 (23)
- 2017年01月 (29)
- 2016年12月 (32)
- 2016年11月 (25)
- 2016年10月 (34)
- 2016年09月 (28)
- 2016年08月 (28)
- 2016年07月 (25)
- 2016年06月 (25)
- 2016年05月 (26)
- 2016年04月 (23)
- 2016年03月 (24)
- 2016年02月 (24)
- 2016年01月 (30)
- 2015年12月 (32)
- 2015年11月 (27)
- 2015年10月 (29)
- 2015年09月 (25)
- 2015年08月 (23)
- 2015年07月 (26)
- 2015年06月 (20)
- 2015年05月 (34)
- 2015年04月 (25)
- 2015年03月 (22)
- 2015年02月 (25)
- 2015年01月 (35)
- 2014年12月 (29)
- 2014年11月 (27)
- 2014年10月 (29)
- 2014年09月 (23)
- 2014年08月 (26)
- 2014年07月 (30)
- 2014年06月 (28)
- 2014年05月 (25)
- 2014年04月 (26)
- 2014年03月 (26)
- 2014年02月 (26)
- 2014年01月 (31)
- 2013年12月 (36)
- 2013年11月 (26)
- 2013年10月 (31)
- 2013年09月 (27)
- 2013年08月 (31)
- 2013年07月 (34)
- 2013年06月 (32)
- 2013年05月 (22)
- 2013年04月 (31)
- 2013年03月 (24)
- 2013年02月 (21)
- 2013年01月 (29)
- 2012年12月 (28)
- 2012年11月 (26)
- 2012年10月 (28)
- 2012年09月 (29)
- 2012年08月 (23)
- 2012年07月 (28)
- 2012年06月 (27)
- 2012年05月 (28)
- 2012年04月 (29)
- 2012年03月 (20)
- 2012年02月 (25)
- 2012年01月 (33)
- 2011年12月 (29)
- 2011年11月 (32)
- 2011年10月 (31)
- 2011年09月 (27)
- 2011年08月 (24)
- 2011年07月 (23)
- 2011年06月 (23)
- 2011年05月 (29)
- 2011年04月 (23)
- 2011年03月 (28)
- 2011年02月 (24)
- 2011年01月 (26)
- 2010年12月 (27)
- 2010年11月 (20)
- 2010年10月 (26)
- 2010年09月 (27)
- 2010年08月 (31)
- 2010年07月 (26)
- 2010年06月 (29)
- 2010年05月 (30)
- 2010年04月 (29)
- 2010年03月 (30)
- 2010年02月 (22)
- 2010年01月 (30)
- 2009年12月 (31)
- 2009年11月 (31)
- 2009年10月 (31)
- 2009年09月 (26)
- 2009年08月 (29)
- 2009年07月 (30)
- 2009年06月 (32)
- 2009年05月 (27)
- 2009年04月 (24)
- 2009年03月 (24)
- 2009年02月 (24)
- 2009年01月 (32)
- 2008年12月 (27)
- 2008年11月 (24)
- 2008年10月 (28)
- 2008年09月 (25)
- 2008年08月 (24)
- 2008年07月 (22)
- 2008年06月 (22)
- 2008年05月 (20)
- 2008年04月 (17)
- 2008年03月 (19)
- 2008年02月 (17)
- 2008年01月 (22)
- 2007年12月 (24)
- 2007年11月 (26)
- 2007年10月 (33)
- 2007年09月 (45)
- 2007年08月 (26)
- 2007年07月 (24)
- 2007年06月 (17)
- 2007年05月 (20)
- 2007年04月 (22)
- 2007年03月 (26)
- 2007年02月 (22)
- 2007年01月 (22)
- 2006年12月 (23)
- 2006年11月 (20)
- 2006年10月 (19)
- 2006年09月 (18)
- 2006年08月 (18)
- 2006年07月 (26)
- 2006年06月 (22)
- 2006年05月 (24)
- 2006年04月 (20)
- 2006年03月 (23)
- 2006年02月 (22)
- 2006年01月 (26)
- 2005年12月 (24)
- 2005年11月 (21)
- 2005年10月 (19)
- 2005年09月 (11)
- 2005年08月 (17)
- 2005年07月 (13)
- 2005年06月 (2)
- 2005年05月 (4)
カテゴリー
- カテゴリ別の目次 (27)
- FPGAリテラシー及びチュートリアル (26)
- プリント基板の作成過程 (14)
- StateCADの使い方 (4)
- Spartan3E Starter Kit (22)
- 旅行記 (3)
- Virtex4のお勉強 (18)
- PSoC (6)
- FPGAからクロック出力 (5)
- 回顧録 (6)
- マイコン関連 (29)
- Xilinx ISEについて (72)
- CADツール (43)
- QuartusⅡ (17)
- Virtex5のお勉強 (7)
- VGAコントローラ (29)
- その他のFPGAの話題 (349)
- 日記 (742)
- Chipscope (25)
- UCFの書き方 (14)
- Floorplannerの使い方 (3)
- シミュレーション (72)
- PCI (26)
- Timing Analyzerの使い方 (4)
- FPGAチップ内の配線方法 (23)
- その他のXilinxのツールについて (18)
- 入門Verilog (37)
- DDR SDRAMコントローラ (57)
- VHDLの書き方 (33)
- FPGA Editorの使い方 (11)
- PACEの使い方 (3)
- アサーション事始め (16)
- その他のFPGA用ツールについての話題 (5)
- パソコン関連 (44)
- FPGAのリセットについて (7)
- 基板のFPGA回路 (2)
- Doxygen (4)
- Spartan3E Starter Kit でマイコンを作る (20)
- SVN, TRAC (4)
- VMware (7)
- EDK (100)
- Suzaku-V_SZ410 (1)
- Linux (108)
- Floorplan Editorの使い方 (2)
- Spartan3A Starter Kit (27)
- FPGAのトラブル (5)
- AlteraのFPGA (6)
- PlanAheadについて (27)
- ChipScope、シミュレーション協調検証 (4)
- Virtex-6, Spartan-6 (15)
- iPhone (1)
- SignalTapⅡ (3)
- EDAツールについて (10)
- SOPC Builder (7)
- NiosⅡ EDS (6)
- 画像処理 (79)
- Constraints Editor (3)
- 木工 (56)
- Altera DE0ボード (3)
- SystemVerilog (16)
- Core Generator (12)
- Ruby (3)
- Spartan-6 FPGA SP605 評価キット (16)
- ISim (18)
- PCI Express (10)
- SDR SDRAMコントローラ (4)
- VC++ (1)
- IP (71)
- Make出展 (30)
- SMM (21)
- OV9655 (7)
- NSL (15)
- XUPV5-LX110T (8)
- Artix-7, Kintex-7, Virtex-7 (3)
- プリント基板作成 (24)
- MicroBlazeクロスコンパイラ (4)
- エレキジャック・フォーラム (7)
- MIG (10)
- FPGA内蔵マイクロコントローラ (8)
- FPGAボードで学ぶ組込みシステム開発入門[Altera偏] (12)
- FPGA-CAFE (2)
- Altium Designer (72)
- AXI4 Master IPの作製 (39)
- Atlysボード (13)
- XBee (1)
- MicroBlaze MCS (12)
- DVI, HDMI (26)
- AXI4 Slave IPの作製 (18)
- Zynq (54)
- AX4 Lite Slave IPの作製 (11)
- HLS (1)
- Vivado (157)
- AXI4バス (27)
- ZedBoard (126)
- XST (2)
- 制約 (3)
- CMOSイメージセンサ (23)
- 複数のAXI4 バスを持つIPの作製 (17)
- AXI4-Stream IPの作製 (6)
- AXI Lite Master IPコアの作製 (4)
- Parallella-16 (10)
- Helio (1)
- Vivado HLS (374)
- FC2ブログ (1)
- Co-design (20)
- スマートフォン (1)
- スポーツ (1)
- AXI4バスの演習資料 (16)
- マラソン・トレーニング日記 (6)
- ZYBO (200)
- OpenCV (39)
- Altera_MAX10 (11)
- Edison (3)
- Synthesijer (6)
- Node.js (0)
- Deep Learning (4)
- SDSoC (68)
- DE0-Nano-SoC (8)
- Synverll (3)
- Make (1)
- MPSoC (5)
- ステレオカメラによる画像解析 (19)
- Z-turn Board (4)
- Zybot (86)
- 白線検出 (19)
- ドローン (2)
- PYNQ (46)
- FPGAのマイクロプロセッサ (3)
- 演算処理のFPGAへの適用方法 (1)
- DNN (220)
- AWS-FPGA (5)
- reVISION, xfOpenCV (36)
- ZYBO Z7 (40)
- UltraZed-EG (6)
- intel HLS (17)
- Ultra96 (234)
- TensorFlow, Keras (33)
- SDK (5)
- Docker (8)
- PetaLinux (30)
- Edge TPU (8)
- Jetson Nano (1)
- ROS (1)
- Donkey Car (6)
- Vitis (168)
- Karuta (4)
- Vitis HLS (93)
- Vitis_Vision (49)
- NNgen (14)
- RapidWright (3)
- finn-hlslib (2)
- Wio Terminal (3)
- finn (14)
- VSCode (2)
- WSL2 (11)
- Alveo (8)
- Genesys_ZU (14)
- ZynqBerryZero (14)
- Nexys Video (1)
- MicroBlaze (9)
- FPGAを使用したシステム (28)
- Vitis-AI (13)
- GENESIS Dev Env (2)
- PIC (5)
- Dynamic Function eXchange (37)
- KRIA KV260 Vision AI Starter Kit (67)
- RISC-V と Chisel で学ぶ はじめての CPU 自作 (1)
- Hello FPGA (1)
- Libero SoC (1)
- SmartHLS (17)
- Zynq UltraScale+ MPSoC (1)
カレンダー
12 | 2022/01 | 02 日 月 火 水 木 金 土 - - - - - - 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 - - - - -
天気予報
ブログ検索
ブロとも申請フォーム
ブログ内検索
RSSフィード
リンク