This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.List; | |
import org.opencv.core.Core; | |
import org.opencv.core.*; | |
import org.opencv.core.MatOfFloat; | |
import org.opencv.core.MatOfByte; | |
import org.opencv.core.Scalar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <opencv2/opencv.hpp> | |
#include <opencv2/dnn.hpp> | |
#include <opencv2/dnn/layer.details.hpp> | |
class CropLayer : public cv::dnn::Layer | |
{ | |
public: | |
CropLayer(const cv::dnn::LayerParams ¶ms) : Layer(params) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.opencv.core.*; | |
import org.opencv.dnn.*; | |
import org.opencv.imgcodecs.Imgcodecs; | |
import org.opencv.imgproc.Imgproc; | |
import java.util.*; | |
public class SimpleSample { | |
public static void main(String[] args) { | |
// Load the native library. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> make install | |
... | |
-- Up-to-date: C:/prog/Python37/Lib/site-packages/cv2/__init__.py | |
-- Up-to-date: C:/prog/Python37/Lib/site-packages/cv2/load_config_py2.py | |
-- Up-to-date: C:/prog/Python37/Lib/site-packages/cv2/load_config_py3.py | |
-- Up-to-date: C:/prog/Python37/Lib/site-packages/cv2/config.py | |
-- Up-to-date: C:/prog/Python37/Lib/site-packages/cv2/misc/__init__.py | |
-- Up-to-date: C:/prog/Python37/Lib/site-packages/cv2/misc/version.py | |
-- Up-to-date: C:/prog/Python37/Lib/site-packages/cv2/mat_wrapper/__init__.py | |
-- Up-to-date: C:/prog/Python37/Lib/site-packages/cv2/utils/__init__.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static PyObject* pyopencv_cv_calcHist(PyObject* , PyObject* py_args, PyObject* kw) | |
{ | |
using namespace cv; | |
pyPrepareArgumentConversionErrorsStorage(2); | |
{ | |
PyObject* pyobj_images = NULL; | |
vector_Mat images; | |
PyObject* pyobj_channels = NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
using cv2, open a webcam and record a video file | |
""" | |
def rec(cap_id, vid_filename): | |
cap = cv2.VideoCapture(cap_id) | |
fourcc = cv2.VideoWriter_fourcc(*'XVID') | |
out = cv2.VideoWriter(vid_filename, fourcc, 20.0, (640,480)) | |
while(cap.isOpened()): | |
ret, frame = cap.read() | |
if ret==True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!git clone https://github.com/opencv/opencv | |
!git clone https://github.com/opencv/opencv_contrib | |
!mkdir /content/build | |
%cd /content/build | |
!cmake -DOPENCV_EXTRA_MODULES_PATH=/content/opencv_contrib/modules \ | |
-DBUILD_SHARED_LIBS=OFF \ | |
-DBUILD_TESTS=OFF \ | |
-DBUILD_PERF_TESTS=OFF \ | |
-DBUILD_EXAMPLES=OFF \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node { | |
name: "conv2d_input" | |
op: "Placeholder" | |
attr { | |
key: "dtype" | |
value { | |
type: DT_FLOAT | |
} | |
} | |
attr { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<class _Tp> | |
struct WeightedBoxesFusion { | |
typedef Rect_<_Tp> RECT; | |
struct Box { | |
int label; | |
float x1,y1,x2,y2, score, weight; | |
Box() {} | |
Box(int label, float x1,float y1,float x2,float y2, float score, float weight) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "opencv2/opencv.hpp" | |
using namespace cv; | |
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int IMAGE_SIZE = 513; | |
cv::Mat faceImg= cv::imread("C:/data/persons/unsorted/139539.png"); |
NewerOlder