cdle-traininglabs icon indicating copy to clipboard operation
cdle-traininglabs copied to clipboard

FaceAnonymizationWebCam Issue on Mac

Open codenamewei opened this issue 5 years ago • 3 comments

Mac Java java version "1.8.0_221"

https://gist.github.com/codenamewei/fa73de5eefc377dfe498d950496348b4

Screenshot 2020-08-19 at 2 05 15 PM

@kenghooi-teoh

codenamewei avatar Aug 19 '20 06:08 codenamewei

https://gist.github.com/khalidmjii/ec64a7a32fa72dbd967d9b0e31def0d0

khalidmjii avatar Aug 19 '20 09:08 khalidmjii

I abled to reproduce two problems with different JDK 8 patches

@choowilson @kenghooi-teoh Yet not able to find the solutions as of now.

Screenshot 2020-08-20 at 10 03 14 AM Screenshot 2020-08-20 at 10 02 31 AM

codenamewei avatar Aug 20 '20 02:08 codenamewei

Not sure how to debug the unknown exception, but here's a workaround:

Instead of using .imshow, we can use the following code,

    // Before while loop in in FaceRecognitionWebcam.java
    // Create image window named "My Image".
    final CanvasFrame canvas = new CanvasFrame(caption, 1.0);

    // Request closing of the application when the image window is closed.
    canvas.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

    // Convert from OpenCV Mat to Java Buffered image for display
    final OpenCVFrameConverter converter = new OpenCVFrameConverter.ToMat();

    // Show image on window. //Inside while loop in FaceRecognitionWebcam.java
    canvas.showImage(converter.convert(image));`

kenghooi-teoh avatar Aug 25 '20 06:08 kenghooi-teoh