Skip to content

Commit f270218

Browse files
authored
Merge pull request #26 from denolf/master
2018.3 release
2 parents b7e0c4d + fd75a0b commit f270218

File tree

210 files changed

+6509
-1344
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

210 files changed

+6509
-1344
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "frameworks/cmakeModules/cmakeModulesXilinx"]
2+
path = frameworks/cmakeModules/cmakeModulesXilinx
3+
url = https://github.com/Xilinx/cmakeModules

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
All PYNQ releases ship with the popular [OpenCV](https://opencv.org/) library pre-installed. The PYNQ computer vision overlays enable accelerating OpenCV components in Programmable Logic (PL). These overlays expose a subset Xilinx' [xfOpenCV](https://github.com/Xilinx/xfopencv) library (a part of Xilinx' [reVISION solution](https://www.xilinx.com/products/design-tools/embedded-vision-zone.html)) at the Python level, combined with the support for HDMI input/output (Pynq-Z1 and Pynq-Z2 only). Webcam, stream or file based input/output remains available through the pre-installed SW OpenCV (on all Pynq boards).
44

5-
Currently this package is compatible with [PYNQ image v2.3](http://www.pynq.io/board).
5+
Currently this package is compatible with [PYNQ image v2.4](http://www.pynq.io/board).
66

77
![](./block_diagram.png)
88

@@ -29,7 +29,7 @@ After the setup, new Jupyter notebooks will be added under the pynqOpenCV folder
2929

3030
When after profiling, the critical OpenCV modules in an application are identified, the generation of a tailored overlay is easily done by specifying those modules as a list in a CMake project file. After that, building the tailored overlay only requires running cmake to generate the Makefiles followed by make to build the overlay.
3131

32-
For detailed instructions: [Building xfOpenCV Overlays for Pynq: CMake based sds++ cross-compilation](overlays/README.md). Currently, this only supports building on the Ultra96 with 2018.2 Xilinx tools.
32+
For detailed instructions: [Building xfOpenCV Overlays for Pynq: CMake based sds++ cross-compilation](overlays/README.md). Currently, this only supports building on the Ultra96 with 2018.3 Xilinx tools.
3333

3434
## License
3535

applicationCode/unitTests/testC++/buildUnitTest.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,27 @@
4747
from distutils.dir_util import mkpath
4848
import shutil
4949

50-
toolchain_file = "../../../../../frameworks/cmakeModules/toolchain_sdx2018.2.cmake"
50+
toolchain_file = "../../../../../frameworks/cmakeModules/cmakeModulesXilinx/toolchain_sds.cmake"
5151
arch = "arm64"
5252
clockID = "3"
53-
platform = "/platforms/Ultra96/bare/2018.2/ultra"
53+
platform = "/group/xrlabs/projects/image_processing/platforms/Ultra96/ultra_v2.4/2018.3/ultra"
5454
usePL = "ON"
5555
noBitstream = "OFF"
5656
noSDCardImage = "ON"
57-
unitTestFileDir = "unitTestFiles"
58-
buildDir = "build"
57+
unitTestFileDir = "unitTestFilesUltra96"
58+
buildDir = "buildUltra96"
5959

60+
#clockID = "2"
61+
#platform = "/group/xrlabs/tools/reVISION/platforms/zcu102_rv_ss/2018.3/zcu102_rv_ss"
62+
#platform = "/group/xrlabs/tools/reVISION/platforms/zcu104_rv_min_2019.1"
63+
#usePL = "ON"
64+
#noBitstream = "OFF"
65+
#noSDCardImage = "ON"
66+
#unitTestFileDir = "unitTestFilesZCU102"
67+
#buildDir = "buildzcu102"
68+
69+
#unitTestFileDir = "unitTestFilesCSIM"
70+
#buildDir = "build2019.1"
6071

6172
#*****************************************************************************
6273
# Create a conversion .bif file
@@ -87,15 +98,15 @@ def buildUnitTest(component):
8798
#run cmake here
8899
os.system("cmake .. -DCMAKE_TOOLCHAIN_FILE="+toolchain_file+" -DSDxArch="+arch+" -DSDxClockID="+clockID+" -DSDxPlatform="+platform+" -DusePL="+usePL+" -DnoBitstream="+noBitstream+" -DnoSDCardImage="+noSDCardImage+" >& cmake.log")
89100
if '-- Build files have been written to' in open('cmake.log').read():
90-
print("\t CMake OK", end='')
101+
print("\t CMake OK", end='', flush=True)
91102
else:
92-
print("\t CMake FAIL", end='')
103+
print("\t CMake FAIL", end='', flush=True)
93104
#run make
94105
os.system("make "+target+" >& make.log")
95106
if '[100%] Built target' in open('make.log').read():
96-
print("\t build OK")
107+
print("\t build OK", flush=True)
97108
else:
98-
print("\t build FAIL")
109+
print("\t build FAIL", flush=True)
99110
os.chdir("..")
100111
return
101112
#convert bitstream

applicationCode/unitTests/testC++/testXfAbsdiff/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
cmake_minimum_required(VERSION 2.8)
3838

3939
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../../../../frameworks/cmakeModules/cmakeModulesXilinx ${CMAKE_CURRENT_SOURCE_DIR}/../../../../frameworks/cmakeModules)
40-
include(rulesForSDxXfOpenCV)
40+
include(rulesForXfOpenCV)
4141
SET(componentName absdiff)
4242

43-
createXfOpenCVUnitTestPL("../../../.." ${componentName})
43+
createXfOpenCVUnitTestPL("../../../.." ${componentName})

applicationCode/unitTests/testC++/testXfAbsdiff/src/goldenOpenCVAbsdiff.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ int main ( int argc, char** argv )
9090
initializeSingleImageTest(fileName1, src1);
9191
initializeSingleImageTest(fileName2, src2);
9292

93-
cvtColor(src1, gray1, CV_BGR2GRAY, 1);
94-
cvtColor(src2, gray2, CV_BGR2GRAY, 1);
93+
cvtColor(src1, gray1, COLOR_BGR2GRAY, 1);
94+
cvtColor(src2, gray2, COLOR_BGR2GRAY, 1);
9595

9696
if (numberOfIterations > 0) {
9797
HRTimer timer;

applicationCode/unitTests/testC++/testXfAbsdiff/src/testSDxXfAbsdiff.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,12 @@ int main ( int argc, char** argv )
124124
xF::Mat dstHLS(height, width, CV_8UC1);
125125

126126
//convert 3-channel image into 1-channel image
127-
cvtColor(src1, src1HLS, CV_BGR2GRAY, 1);
128-
cvtColor(src2, src2HLS, CV_BGR2GRAY, 1);
129-
cvtColor(src1, src1InY, CV_BGR2GRAY, 1);
130-
cvtColor(src2, src2InY, CV_BGR2GRAY, 1);
127+
cvtColor(src1, src1InY, COLOR_BGR2GRAY, 1);
128+
cvtColor(src2, src2InY, COLOR_BGR2GRAY, 1);
129+
//cvtColor(src1, src1HLS, COLOR_BGR2GRAY, 1);
130+
//cvtColor(src2, src2HLS, COLOR_BGR2GRAY, 1);
131+
src1HLS.copyFromCvMat(src1InY);
132+
src2HLS.copyFromCvMat(src2InY);
131133

132134
// Apply OpenCV reference Absdiff
133135
std::cout << "running golden model" << std::endl;
@@ -152,7 +154,7 @@ int main ( int argc, char** argv )
152154
int numberOfDifferences = 0;
153155
double errorPerPixel = 0;
154156
imageCompare(dstHLS, dstSW, numberOfDifferences, errorPerPixel, true, false);
155-
std::cout << "number of differences: " << numberOfDifferences << " average L2 error: " << errorPerPixel << std::endl;
157+
std::cout << "number of differences: " << numberOfDifferences << " average L1 error: " << errorPerPixel << std::endl;
156158

157159
//write back images in files
158160
if (writeSWResult)

applicationCode/unitTests/testC++/testXfAccumulate/CMakeLists.txt

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
cmake_minimum_required(VERSION 2.8)
3838

3939
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../../../../frameworks/cmakeModules/cmakeModulesXilinx ${CMAKE_CURRENT_SOURCE_DIR}/../../../../frameworks/cmakeModules)
40-
include(rulesForSDxXfOpenCV)
40+
include(rulesForXfOpenCV)
4141
SET(componentName accumulate)
4242

4343
createXfOpenCVUnitTestPL("../../../.." ${componentName})

applicationCode/unitTests/testC++/testXfAccumulate/src/goldenOpenCVAccumulate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ int main ( int argc, char** argv )
8686
initializeSingleImageTest(fileName, src);
8787

8888
//convert to grayscale
89-
cvtColor(src, gray, CV_BGR2GRAY, 1);
89+
cvtColor(src, gray, COLOR_BGR2GRAY, 1);
9090
Mat dstSW = Mat::zeros(gray.size(), CV_32FC1);
9191

9292
if (numberOfIterations > 0) {

applicationCode/unitTests/testC++/testXfAccumulate/src/testSDxXfAccumulate.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ int main ( int argc, char** argv )
107107
initializeSingleImageTest(fileName, src);
108108

109109
//convert to grayscale
110-
cvtColor(src, gray, CV_BGR2GRAY, 1);
110+
cvtColor(src, gray, COLOR_BGR2GRAY, 1);
111111
Mat dstSW = Mat::zeros(gray.size(), CV_32FC1);
112112

113113
int width = src.size().width;
@@ -118,7 +118,7 @@ int main ( int argc, char** argv )
118118
xF::Mat dstHLS(height, width, CV_16UC1); //XF_16UC1
119119

120120
//convert 3-channel image into 1-channel image
121-
cvtColor(src, srcHLS, CV_BGR2GRAY, 1);
121+
cvtColor(src, srcHLS, COLOR_BGR2GRAY, 1);
122122

123123
// Apply OpenCV reference accumulate
124124
std::cout << "running golden model" << std::endl;
@@ -146,7 +146,7 @@ int main ( int argc, char** argv )
146146
int numberOfDifferences = 0;
147147
double errorPerPixel = 0;
148148
imageCompare(dstHLS, dstSW, numberOfDifferences, errorPerPixel, true, false);
149-
std::cout << "number of differences: " << numberOfDifferences << " average L2 error: " << errorPerPixel << std::endl;
149+
std::cout << "number of differences: " << numberOfDifferences << " average L1 error: " << errorPerPixel << std::endl;
150150

151151
//write back images in files
152152
if (writeSWResult)

applicationCode/unitTests/testC++/testXfAccumulateSquare/CMakeLists.txt

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
cmake_minimum_required(VERSION 2.8)
3838

3939
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../../../../frameworks/cmakeModules/cmakeModulesXilinx ${CMAKE_CURRENT_SOURCE_DIR}/../../../../frameworks/cmakeModules)
40-
include(rulesForSDxXfOpenCV)
40+
include(rulesForXfOpenCV)
4141
SET(componentName accumulateSquare)
4242

4343
createXfOpenCVUnitTestPL("../../../.." ${componentName})

0 commit comments

Comments
 (0)