相关疑难解决方法(0)

显示图像数据的直方图

我有时需要以直方图的形式显示图像数据的表示.我对访问图像数据的方式特别感兴趣.我很熟悉JFreeChart,包括直方图支持,但我会考虑其他方法.

java swing image jfreechart histogram

7
推荐指数
1
解决办法
1万
查看次数

绘制图形直方图

我正在研究一个项目,我希望显示一个看起来像条形图的单线直方图,条形图中的每一行代表一个像素及其灰度值.

我有一个充满灰度值的数组,我只需要将它们放入这个直方图并让它显示代表值的行......有点像这样

IMAGE             [minimize][maximize][close]



    picture                histogram

                          I
   (Loaded Picture)       I       I
                          I  I    I
                          I  I  I I  

[open][save]
Run Code Online (Sandbox Code Playgroud)

下面是加载数组的代码......我只需要获得一些将使用这些灰度值的代码,并将它们表示为上面的条形图.

 public void showImage(File fileName) {
        Scanner scan;
        try {
            scan = new Scanner(fileName);
            typefile = scan.next();
            iname = scan.next();       
            width = scan.nextInt();
            height = scan.nextInt();
            maxshade = scan.nextInt();
            array = new int[width][height];


            for(int r = 0; r < array.length; r++){
                for(int c = 0; c < array[r].length; c++){
                    array[r][c] = scan.nextInt();                       




            imageArray = array;         
            repaint();                  


        } catch (FileNotFoundException e) { …
Run Code Online (Sandbox Code Playgroud)

java histogram

3
推荐指数
1
解决办法
2万
查看次数

标签 统计

histogram ×2

java ×2

image ×1

jfreechart ×1

swing ×1