Skip to content
This repository was archived by the owner on Apr 24, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Empty file modified SPTutorial1.pptx
100644 → 100755
Empty file.
Empty file modified train-1/README.md
100644 → 100755
Empty file.
16 changes: 16 additions & 0 deletions train-1/zhongzebin-hm/binary-search/binarySearch.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
template<typename Iter,typename T>
bool binary_search(Iter beg,Iter end,T&& val)
{
if(*beg==val || *end==val)
return true;
if(*beg==*end)
return false;
Iter med=(end-beg)/2+beg;
if(*med==val)
return true;
else
if(*med>val)
binary_search(beg,med,val);
else
binary_search(med,end,val);
}
10 changes: 10 additions & 0 deletions train-1/zhongzebin-hm/binary/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.5)
project(binary)
find_package(OpenCV 3 REQUIRED)
set(CMAKE_CXX_STANDARD 11)
message(STATUS "OpenCV library status:")
message(STATUS " version: ${OpenCV_VERSION}")
message(STATUS " libraries: ${OpenCV_LIBS}")
message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")
add_executable(binary main.cpp)
target_link_libraries(binary LINK_PRIVATE ${OpenCV_LIBS})
22 changes: 22 additions & 0 deletions train-1/zhongzebin-hm/binary/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <opencv2/opencv.hpp>
#include <iostream>
using namespace std;
using namespace cv;
int main()
{
VideoCapture cap;
cap.open("../project_video.mp4");
Mat frame;
cap>>frame;
while(!frame.empty())
{
Mat gray;
Mat binary;
cvtColor(frame,gray,COLOR_BGR2GRAY);
threshold(gray,binary,int(255/2),255,CV_THRESH_BINARY);
imshow("video",binary);
waitKey(10);
cap>>frame;
}
return 0;
}
Binary file added train-1/zhongzebin-hm/binary/project_video.mp4
Binary file not shown.
7 changes: 7 additions & 0 deletions train-1/zhongzebin-hm/install-folly/install_folly.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
git clone https://github.com/facebook/folly
unzip folly.zip
cd folly
mkdir _build
cd _build
cmake ..
make install
17 changes: 17 additions & 0 deletions train-1/zhongzebin-hm/missing-digit/missingNumber.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class Solution {
public:
int missingNumber(vector<int>& nums) {
array<bool,nums.size()+1> a;
a.fill(false);
for(int i=0;i<nums.size();i++)
{
a[nums[i]]=true;
}
int find=0;
while(a[find])
{
find++;
}
return find;
}
};
21 changes: 21 additions & 0 deletions train-1/zhongzebin-hm/rotated-array/rotate.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
class Solution {
public:
void rotate(vector<int>& nums, int k) {
if(nums.size()!=1 && nums.size()!=0 && k!=0 && k%nums.size()!=0)
{
vector<int> temp;
for(int num=1;num<=k%nums.size();num++)
{
temp.push_back(nums[nums.size()-num]);
}
for(int i=nums.size()-1;i>=k%nums.size();i--)
{
nums[i]=nums[i-k%nums.size()];
}
for(int num=0;num<temp.size();num++)
{
nums[num]=temp[temp.size()-1-num];
}
}
}
};
Empty file modified train-2/README.md
100644 → 100755
Empty file.
10 changes: 10 additions & 0 deletions train-2/zhongzebin-hm/ROI/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.5)
project(ROI)
find_package(OpenCV 3 REQUIRED)
set(CMAKE_CXX_STANDARD 11)
message(STATUS "OpenCV library status:")
message(STATUS " version: ${OpenCV_VERSION}")
message(STATUS " libraries: ${OpenCV_LIBS}")
message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")
add_executable(ROI main.cpp)
target_link_libraries(homework1 LINK_PRIVATE ${OpenCV_LIBS})
14 changes: 14 additions & 0 deletions train-2/zhongzebin-hm/ROI/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main()
{
Mat src;
src=imread("../warning.png");
bool fromCenter = false;
Rect2d r = selectROI(src, fromCenter);
Mat cut=src(r);
imshow("cut",cut);
waitKey(0);
return 0;
}
Binary file added train-2/zhongzebin-hm/ROI/warning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions train-2/zhongzebin-hm/ROI/理解.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
该程序读入图像后,手动划分矩形感兴趣区域(可以选择从矩形中心点开始绘制或者左上角点开始绘制,以回车或空格结束);
绘制后对感兴趣区域提取并显示。
10 changes: 10 additions & 0 deletions train-2/zhongzebin-hm/camera_calibration/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.5)
project(camera_calibration)
find_package(OpenCV 3 REQUIRED)
set(CMAKE_CXX_STANDARD 11)
message(STATUS "OpenCV library status:")
message(STATUS " version: ${OpenCV_VERSION}")
message(STATUS " libraries: ${OpenCV_LIBS}")
message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")
add_executable(camera_calibration main.cpp)
target_link_libraries(camera_calibration LINK_PRIVATE ${OpenCV_LIBS})
Loading