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

run binding opencv2.x demo failed #111

Open
orange-jacky opened this issue Jun 23, 2017 · 4 comments
Open

run binding opencv2.x demo failed #111

orange-jacky opened this issue Jun 23, 2017 · 4 comments

Comments

@orange-jacky
Copy link

package exam2

import . "github.com/lazywei/go-opencv/gocv"
import "github.com/gonum/matrix/mat64"
import "fmt"

func Sample2() {

objPts := mat64.NewDense(4, 3, []float64{
	0, 25, 0,
	0, -25, 0,
	-47, 25, 0,
	-47, -25, 0})

imgPts := mat64.NewDense(4, 2, []float64{
	1136.4140625, 1041.89208984,
	1845.33190918, 671.39581299,
	302.73373413, 634.79998779,
	1051.46154785, 352.76107788})

camMat := GcvInitCameraMatrix2D(objPts, imgPts)
fmt.Println(camMat)

}

main function call Sample2, it issued,

ithub.com/lazywei/go-opencv/gocv

github.com/lazywei/go-opencv/gocv

gocv_core.i:121: Warning 503: Can't wrap 'operator =' unless renamed to a valid identifier.
gocv_core.i:129: Warning 503: Can't wrap 'operator CvSize' unless renamed to a valid identifier.
gocv_core.i:130: Warning 503: Can't wrap 'operator CvSize2D32f' unless renamed to a valid identifier.
gocv_core.i:121: Warning 503: Can't wrap 'operator =' unless renamed to a valid identifier.
gocv_core.i:129: Warning 503: Can't wrap 'operator CvSize' unless renamed to a valid identifier.
gocv_core.i:130: Warning 503: Can't wrap 'operator CvSize2D32f' unless renamed to a valid identifier.
gocv_core.i:121: Warning 503: Can't wrap 'operator =' unless renamed to a valid identifier.
gocv_core.i:129: Warning 503: Can't wrap 'operator CvSize' unless renamed to a valid identifier.
gocv_core.i:130: Warning 503: Can't wrap 'operator CvSize2D32f' unless renamed to a valid identifier.
gocv_core.i:156: Warning 503: Can't wrap 'operator =' unless renamed to a valid identifier.
gocv_core.i:170: Warning 503: Can't wrap 'operator CvRect' unless renamed to a valid identifier.
gocv_core.i:40: Warning 503: Can't wrap 'operator =' unless renamed to a valid identifier.
gocv_core.i:45: Warning 503: Can't wrap 'operator CvPoint' unless renamed to a valid identifier.
gocv_core.i:46: Warning 503: Can't wrap 'operator CvPoint2D32f' unless renamed to a valid identifier.
gocv_core.i:47: Warning 503: Can't wrap 'operator Vec<int,2>' unless renamed to a valid identifier.
gocv_core.i:40: Warning 503: Can't wrap 'operator =' unless renamed to a valid identifier.
gocv_core.i:45: Warning 503: Can't wrap 'operator CvPoint' unless renamed to a valid identifier.
gocv_core.i:46: Warning 503: Can't wrap 'operator CvPoint2D32f' unless renamed to a valid identifier.
gocv_core.i:47: Warning 503: Can't wrap 'operator Vec<float,2>' unless renamed to a valid identifier.
gocv_core.i:40: Warning 503: Can't wrap 'operator =' unless renamed to a valid identifier.
gocv_core.i:45: Warning 503: Can't wrap 'operator CvPoint' unless renamed to a valid identifier.
gocv_core.i:46: Warning 503: Can't wrap 'operator CvPoint2D32f' unless renamed to a valid identifier.
gocv_core.i:47: Warning 503: Can't wrap 'operator Vec<double,2>' unless renamed to a valid identifier.
gocv_core.i:82: Warning 503: Can't wrap 'operator =' unless renamed to a valid identifier.
gocv_core.i:86: Warning 503: Can't wrap 'operator CvPoint3D32f' unless renamed to a valid identifier.
gocv_core.i:88: Warning 503: Can't wrap 'operator Vec<int,3>' unless renamed to a valid identifier.
gocv_core.i:82: Warning 503: Can't wrap 'operator =' unless renamed to a valid identifier.
gocv_core.i:86: Warning 503: Can't wrap 'operator CvPoint3D32f' unless renamed to a valid identifier.
gocv_core.i:88: Warning 503: Can't wrap 'operator Vec<float,3>' unless renamed to a valid identifier.
gocv_core.i:82: Warning 503: Can't wrap 'operator =' unless renamed to a valid identifier.
gocv_core.i:86: Warning 503: Can't wrap 'operator CvPoint3D32f' unless renamed to a valid identifier.
gocv_core.i:88: Warning 503: Can't wrap 'operator Vec<double,3>' unless renamed to a valid identifier.
gocv_core.i:241: Warning 516: Overloaded method cv::Mat::diag(cv::Mat const &) ignored,
gocv_core.i:239: Warning 516: using cv::Mat::diag() const instead.
gocv_core.i:279: Warning 516: Overloaded method cv::Mat::at< float >() const ignored,
gocv_core.i:279: Warning 516: using cv::Mat::at< float >() instead.
gocv_core.i:279: Warning 516: Overloaded method cv::Mat::at< float >(int) ignored,
gocv_core.i:279: Warning 516: using cv::Mat::at< float >(int) const instead.
gocv_core.i:279: Warning 516: Overloaded method cv::Mat::at< float >(int const *) const ignored,
gocv_core.i:279: Warning 516: using cv::Mat::at< float >(int const *) instead.
gocv_core.i:279: Warning 516: Overloaded method cv::Mat::at< float >(int) const ignored,
gocv_core.i:279: Warning 516: using cv::Mat::at< float >(int) instead.
gocv_core.i:279: Warning 516: Overloaded method cv::Mat::at< float >(cv::Point) const ignored,
gocv_core.i:279: Warning 516: using cv::Mat::at< float >(cv::Point) instead.
gocv_core.i:279: Warning 516: Overloaded method cv::Mat::at< float >(int,int) const ignored,
gocv_core.i:279: Warning 516: using cv::Mat::at< float >(int,int) instead.
gocv_core.i:279: Warning 516: Overloaded method cv::Mat::at< float >(int,int,int) const ignored,
gocv_core.i:279: Warning 516: using cv::Mat::at< float >(int,int,int) instead.
gocv_core.i:280: Warning 516: Overloaded method cv::Mat::at< double >() const ignored,
gocv_core.i:280: Warning 516: using cv::Mat::at< double >() instead.
gocv_core.i:280: Warning 516: Overloaded method cv::Mat::at< double >(int) ignored,
gocv_core.i:280: Warning 516: using cv::Mat::at< double >(int) const instead.
gocv_core.i:280: Warning 516: Overloaded method cv::Mat::at< double >(int const *) const ignored,
gocv_core.i:280: Warning 516: using cv::Mat::at< double >(int const *) instead.
gocv_core.i:280: Warning 516: Overloaded method cv::Mat::at< double >(int) const ignored,
gocv_core.i:280: Warning 516: using cv::Mat::at< double >(int) instead.
gocv_core.i:280: Warning 516: Overloaded method cv::Mat::at< double >(cv::Point) const ignored,
gocv_core.i:280: Warning 516: using cv::Mat::at< double >(cv::Point) instead.
gocv_core.i:280: Warning 516: Overloaded method cv::Mat::at< double >(int,int) const ignored,
gocv_core.i:280: Warning 516: using cv::Mat::at< double >(int,int) instead.
gocv_core.i:280: Warning 516: Overloaded method cv::Mat::at< double >(int,int,int) const ignored,
gocv_core.i:280: Warning 516: using cv::Mat::at< double >(int,int,int) instead.
go build github.com/lazywei/go-opencv/gocv: build output "/var/folders/34/z2z_vp1573g5014m8k7wys100000gn/T/go-build498457648/github.com/lazywei/go-opencv/gocv/_obj/gocv.go" already exists and is not an object file

Elapsed: 2.052s
Result: Error

how to fix this? hope your reply

@deadprogram
Copy link

Same problem here...

@deadprogram
Copy link

The solution here is to rename the file gocv.go to anything else. The current SWIG builders as called by the Golang compilers produce a conflict with the filename.

@sudhir1527
Copy link

Hi deadprogram,
I searched gocv.go file and i did not find it.

I also have same problem

@deadprogram
Copy link

I was saying to rename https://github.com/go-opencv/go-opencv/blob/master/gocv/gocv.go to something else like gocvwrapper.go, in order to get around the build problem.

Hope that helps!

Also, please check out my own project https://GoCV.io which is a much more complete OpenCV 3.x wrapper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants