0

I am new in image processing and attempting to write a Scala program for edge detection in an image. I tried this sample in here: https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/cpp/edge.cpp?rev=4079

but there are some problems with my code. This is my code :

  def onTrackbar( a:Int) {
  Imgproc.blur(dst, dst, Size(3,3))
  Imgproc.Canny(dst, dst, 1, 1*3, 3)

 }//onTrackbar for tracking should be translated from the C++ code sample
 createTrackbar("Canny threshold", "Edge map", 1, 100, onTrackbar)

 onTrackbar(0, 0)

First, I don't know if that's the right way to send int and void (Unit) variables.

Second, the compiler keep saying that it cannot recognize "createTrackbar" although I have imported the Imgproc library.

Third, compiler says : "overloaded method value Canny with alternatives" I have seen several samples and tried to follow them. but it's not working, I appreciate if anyone can help me.

Mahsa
  • 1,502
  • 7
  • 18
  • 40
  • hmm, if that relies on the opencv java bindings, then there's bad news: no gui functionality is supplied there (from highgui, btw, not from imgproc). you will have to do that using your prefered gui lib. – berak Aug 03 '14 at 17:11
  • @berak I have included Highgui as well! – Mahsa Aug 03 '14 at 17:39
  • again , the problem is, that there's no Highgui.namedWindow in java, and no trackbar attachable to that. – berak Aug 03 '14 at 19:09
  • replacing the idea using awt / swing, whatever. – berak Aug 03 '14 at 19:18
  • 1
    @Rubic OpenCV programming is a LOT easier using C++. I suggest ditching scala. – Bull Aug 04 '14 at 01:16
  • The project I am working on is in Scala and I am asked to work with Scala... There are lot of Opencv samples in C++ but unfortunately not on Scala – Mahsa Aug 04 '14 at 15:24

0 Answers0