Skip to content
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

add support detecting #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add support detecting #10

wants to merge 1 commit into from

Conversation

Danile71
Copy link

@Danile71 Danile71 commented Oct 15, 2020

need AlexeyAB/darknet#6838 for libdarknet

example:

result, bboxs := darknet.Detect(*imageFile)
	if result != -1 {
		for _, bbox := range bboxs {
			fmt.Println(bbox.Rect, bbox.Confidence, bbox.ObjId)
		}
	}

@LdDl
Copy link
Owner

LdDl commented Oct 15, 2020

Do we really need tight OpenCV integration?

// #cgo windows  CPPFLAGS:   -IC:/opencv/build/install/include
// #cgo windows  LDFLAGS:    -LC:/opencv/build/install/x64/mingw/lib -lopencv_core420 -lopencv_face420 -lopencv_videoio420 -lopencv_imgproc420 -lopencv_highgui420 -lopencv_imgcodecs420 -lopencv_objdetect420 -lopencv_features2d420 -lopencv_video420 -lopencv_dnn420 -lopencv_xfeatures2d420 -lopencv_plot420 -lopencv_tracking420 -lopencv_img_hash420 -lopencv_calib3d420

although, you can get image.Image by using this GoCV method: https://godoc.org/gocv.io/x/gocv#Mat.ToImage
then you can convert it do DarknetImage https://github.com/LdDl/go-darknet/blob/master/image.go#L61

pseudocode:

gocvMat := gocv.NewMat()
stdMat := gocvMat.ToImage()
darknetImage := darknet.Image2Float32(stdMat)

@LdDl LdDl self-requested a review October 15, 2020 14:13
@LdDl LdDl added the enhancement New feature or request label Oct 15, 2020
@Danile71
Copy link
Author

Do we really need tight OpenCV integration?

// #cgo windows  CPPFLAGS:   -IC:/opencv/build/install/include
// #cgo windows  LDFLAGS:    -LC:/opencv/build/install/x64/mingw/lib -lopencv_core420 -lopencv_face420 -lopencv_videoio420 -lopencv_imgproc420 -lopencv_highgui420 -lopencv_imgcodecs420 -lopencv_objdetect420 -lopencv_features2d420 -lopencv_video420 -lopencv_dnn420 -lopencv_xfeatures2d420 -lopencv_plot420 -lopencv_tracking420 -lopencv_img_hash420 -lopencv_calib3d420

although, you can get image.Image by using this GoCV method: https://godoc.org/gocv.io/x/gocv#Mat.ToImage
then you can convert it do DarknetImage https://github.com/LdDl/go-darknet/blob/master/image.go#L61

pseudocode:

gocvMat := gocv.NewMat()
stdMat := gocvMat.ToImage()
darknetImage := darknet.Image2Float32(stdMat)

gocv can't work without opencv libs.

I will test, imho direct using mat will be faster, then converting

@LdDl
Copy link
Owner

LdDl commented Oct 15, 2020

Do we really need tight OpenCV integration?

// #cgo windows  CPPFLAGS:   -IC:/opencv/build/install/include
// #cgo windows  LDFLAGS:    -LC:/opencv/build/install/x64/mingw/lib -lopencv_core420 -lopencv_face420 -lopencv_videoio420 -lopencv_imgproc420 -lopencv_highgui420 -lopencv_imgcodecs420 -lopencv_objdetect420 -lopencv_features2d420 -lopencv_video420 -lopencv_dnn420 -lopencv_xfeatures2d420 -lopencv_plot420 -lopencv_tracking420 -lopencv_img_hash420 -lopencv_calib3d420

although, you can get image.Image by using this GoCV method: https://godoc.org/gocv.io/x/gocv#Mat.ToImage
then you can convert it do DarknetImage https://github.com/LdDl/go-darknet/blob/master/image.go#L61
pseudocode:

gocvMat := gocv.NewMat()
stdMat := gocvMat.ToImage()
darknetImage := darknet.Image2Float32(stdMat)

gocv can't work without opencv libs.

I will test, imho direct using mat will be faster, then converting

gocv can't work without opencv libs.

I know about it :)
You can check current workflow around mat/float32/raw bytes here: https://github.com/LdDl/odam

@LdDl LdDl self-assigned this Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants