-
-
Notifications
You must be signed in to change notification settings - Fork 55.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved edge detection sample #25515
base: 5.x
Are you sure you want to change the base?
Improved edge detection sample #25515
Conversation
string onnxModel = parser.get<string>("model"); | ||
int backend = parser.get<int>("backend"); | ||
int target = parser.get<int>("target"); | ||
int imageSize = parser.get<int>("imageSize"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is issue with command line parameters handling. Invocation without params leads to sigsegv:
[ WARN:0@0.002] global samples.cpp:61 findFile cv::samples::findFile('baboon.jpg') => '/home/alexander/Projects/OpenCV/opencv-next-build/../opencv-next/samples/data/baboon.jpg'
terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(5.0.0-pre) /home/alexander/Projects/OpenCV/opencv-next/modules/dnn/src/onnx/onnx_importer.cpp:278: error: (-5:Bad argument) Can't read ONNX file: in function 'ONNXImporter'
Abort (core dumped)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, canny is now default
@@ -0,0 +1,31 @@ | |||
import cv2 as cv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new approach destroys original sample with custom layer. Formally, all code blocks are there, but the sample does not create Net and does not use the new layer.
// Define namespace to simplify code | ||
using namespace cv; | ||
using namespace cv::dnn; | ||
using namespace std; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not the best practice in case of std
namespace
#25006 #25314
This pull request removes hed_pretrained caffe model to the SOTA dexined onnx model for edge detection. Usage of conventional methods like canny has also been added
The obsolete cpp and python sample has been removed
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.