Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6375

Using MultiDimensional (2D) arrays as enums for Kernel convolution matrices

$
0
0

I'm making a very basic Image Processing program in Java and I have a few pre-defined 3x3 matrices for various convolutions (sharpens, blurs, edge detections etc) I have them hard coded for now for testing purposes but am trying to put them in a more appropriate format like enum but I'm not sure how to use 2D arrays as enums. When I try to access the kernels indices I just get a warning that the expected type is array but resolved to kernel.

    IDENTITY(new  double[][] {            {0, 0, 0},            {0, 1, 0},            {0, 0, 0}    }),    EDGE_DETECTION_1(new double[][]  {            {-1, -1, -1},            {-1, 8, -1},            {-1, -1, -1}    }),    EDGE_DETECTION_2(new double[][] {            {1, 0, -1},            {0, 0, 0},            {-1, 0, 1}    }),

Kernel array

I'm a little new to using enums more complicated than basic Strings etc so I could be missing very obvious things but I would appreciate any pointers.


Viewing all articles
Browse latest Browse all 6375

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>