Giter Club home page Giter Club logo

getting-started's People

Contributors

luigidr avatar maxizu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

getting-started's Issues

mat2Image

Hey @luigidr
at FXHelloCVController.java Lines 160-168 you convert a mat to a JavaFX Image. Sometimes this fct (random time) will not convert a mat correctly and the ImageViewer stops working(Will not receive a correct image anymore). Atm i dont know why, but i will find it out. I found this code which works well and is more performant.
http://stackoverflow.com/questions/29120869/how-to-convert-matopencv-to-imagejavafx
Performance: Mat -> BufferedImage -> JavaFXImage http://cell0907.blogspot.de/2013/12/from-mat-to-bufferedimage.html
-->

private Image mat2Image(Mat frame) {
try{
 return SwingFXUtils.toFXImage(matToBufferedImage(frame),null);
} catch (Exception e) {
 System.out.println("Cant convert mat");
 return null;
}
}
public BufferedImage matToBufferedImage(Mat matBGR){   
          int width = matBGR.width(), height = matBGR.height(), channels = matBGR.channels() ;  
          byte[] sourcePixels = new byte[width * height * channels];  
          matBGR.get(0, 0, sourcePixels);  
              //TYPE_BYTE_GRAY - gray images , TYPE_3BYTE_BGR - 3 Channles
          image = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR);  
          final byte[] targetPixels = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();  
          System.arraycopy(sourcePixels, 0, targetPixels, 0, sourcePixels.length);  
          return image;  
}  

How to display IplImage in Imageview

I am trying to display IplImage on imageview in application. But Imageview_id.setImage() allows only Image obj as parameter. Is there is another method to display iplImage in imageview ? or How to convert IplImage to Image?

Util problem

Errors in FXHelloCVController.java

					Image imagetoshow = Utils.mat2Image(frame);
					updateImageView(currentFrame, imagetoshow);

Error: The method mat2Image(Mat) is undefined for the type Utils

private void updateImageView(ImageView view, Image image){
Utils.onFXThread(view.imageProperty(), image);

Error : The method onFXThread(ObjectProperty, Image) is undefined for the type Utils

UnsatisfiedLinkError on mac

I have done everything according to the doc.I can find a file named libopencv_java310.so in /path/to/opencv-3.1.0/build/lib.
Also ,I configured the Native library path to /path/to/opencv-3.1.0/build/lib in eclipse.

but after running he HelloCV project,an error below occured:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java310 in java.library.path.

Huge memory leak on Mat object (not thread safe)

There is a huge memory leak here. Im trying to fix, but even calling Mat.release(), didn't worked. I think may there is an issue calling read(Mat mat) from another thread.

	private Mat grabFrame()
	{
		// init everything
		Mat frame = new Mat();
		
		// check if the capture is open
		if (this.capture.isOpened())
		{
			try
			{
				// read the current frame
				this.capture.read(frame);
				
				// if the frame is not empty, process it
				if (!frame.empty())
				{
					Imgproc.cvtColor(frame, frame, Imgproc.COLOR_BGR2GRAY);
				}
				
			}
			catch (Exception e)
			{
				// log the error
				System.err.println("Exception during the image elaboration: " + e);
			}
		}
		
		return frame;
	}

Location is not set

Hi, I have used netbeans instead of eclipse for the project, but I have followed everything mentioned in the tutorial. Yet I get a "Location is not set" error, and here is a printscreen of what I am seeing exactly. Can I know why is the error being caused since I do not really get it and how can it be fixed.
Error
Edited: I have created another package for the utils.Utils but I assume that has nothing to do with it.

Move Thread to Executor

Generally, it is "better" to prefer the Java Executor to classical Thread.

If possible, replace the processFrame thread with an Executor object or with a JavaFX object suitable for concurrency (i.e., from javafx.concurrent).

Set Image on Imageview

FXHelloCVController.java Line 72. It's not allowed to set a new Image (ImageViewer) from another Thread(Runnable).
Possible fix:

FXHelloCVController.java Line72
setFrametoImageView(imageToShow) instead of currentFrame.setImage(imageToShow);

FXHelloCVController.java Line 113

private void setFrametoImageView(Image frame){
   Platform.runLater(() -> {
      currentFrame.setImage(frame);
      //set Image height/width by window size
   });
}

FPS always shows zero

The FPS calculation present in the application doesn't work with the latest version of Java 8/JavaFX/OpenCV 3.1. It always shows "0.0".

It seems that, for live videos, the method used in the code doesn't work (it should work for "offline" videos). Amend or remove the FPS calculation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.