English 中文(简体)
• 如何增加古西布尔的不透明性
原标题:how to increase opacity in gaussian blur

我有 Java申请,我需要从图像上提取案文。 案文、字体和图像都经过时间确定。 案文需要看一.,但可以读(相对而言)高于图像。

为了达到这些要求,我创造了一个 drop子。 这样做的办法是,在不透明、不透明、不透明、不透明的情况下,在不透明的情况下,使用 Ga色过滤器。 然后,我再次以不透明方式把案文 draw在倒下的阴影之上。 因此,我用黑白的影子 op着眼光,很快将带来完全的透明度。 然后,我能够从背景形象中汲取这一形象。

我想要解决的问题是, shadow子似乎太透明。 因此,面对光明、繁忙的背景,它没有给白人留下足够的隔.。

因此,如何增加阴影的不透明性? 我尝试增加俄罗斯bl的rad,使阴影更加广泛,但并没有使其更加不透明。

使用Im的代码是:,由罗姆人居伊。 我使用他创造的DropShadow()和gaussianBlurFilter()。 但是,我不是在<代码>paintComponent()上单独绘出下层的阴影和案文,而是提前把它们放在一个变形的Image上。 难道这是我的问题吗? 但我看不出这将如何减少阴影的不透明性。 在<代码>paintComponent(>上不使用g2.setComposite()。

我先看一下如何用某种类型的BufferedImageOp,如“眼光” 页: 1 但是,似乎有许多工作要做简单的调整(我猜测四阵列)。 我不认为重新计算会奏效,因为我希望甲型六氯环己烷的产值与甲型六氯环己烷的原产地相同(0至1)。 如果我能具体指出一个布图白白磷酸(旧的甲型)或像这样的东西,那将是理想的。 但我不知道这样做是容易的。

Details of the code can be seen here:

我将在此包括相关的密码区块,但似乎相关的法典数量太大(编码墙)。

Update

参看。 1. 改变布图德伊姆age的字母价值? 这将是改变下层阴影的不透明性的一种方法。 ......基本重新计算每台钢材的甲型价值,每台甲型六氯环己烷的价值。 TBD:它是否可携带(至64台轨道机器,例如),它是否足够快。 如果I do a = sqrt(a) or a = sin(a * pi *0.5) on each pixel (thinking of a in range 0 to 1),那么速度将很慢? 我很想知道,是否采用一种更简单的方式利用现有的优化,例如,在布赖多伊姆卑斯建造的。 也许答案是建立几阵阵阵。 任何人都知道这方面的一些示范守则?

Final update

采用“眼镜” 参看下文。

最佳回答

下面是我最后拟定的法典,使布赖迪奇更加不透明。 我决定走下去,使用“眼光”,而不是在每张纸上RG光灯,而不是一种可能无法利用和缓慢的 lo。 建立 Look阵列的工作非常糟糕。

/* Make alpha channel more opaque.
 * Modify the alpha (opacity) channel so that values are higher, but still
 * continuous and monotonically increasing.
 */
private static void adjustOpacity(BufferedImage shadowImage) {
    // Use a lookup table with four arrays;
    // the three for RGB are identity arrays (no change).
    byte identityArray[] = new byte[256];
    for (int i=0; i < 256; i++)
        identityArray[i] = (byte)i;

    byte alphaArray[] = new byte[256];
    // map the range (0..256] to (0..pi/2]
    double mapTo90Deg = Math.PI / 2.0 / 256.0;
    for (int i=0; i < 256; i++) {
        alphaArray[i] = (byte)(Math.sin(i * mapTo90Deg) * 256);
    }

    byte[][] tables = {
            identityArray,
            identityArray,
            identityArray,
            alphaArray
    };
    ByteLookupTable blut = new ByteLookupTable(0, tables);
    LookupOp op = new LookupOp(blut, null);

    // With LookupOp, it s ok for src and dest to be the same image.
    op.filter(shadowImage,  shadowImage);
}

似乎在工作(尽管我只字不提在屏幕上进行对比)。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签