本文整理汇总了Java中com.google.zxing.LuminanceSource.getRow方法的典型用法代码示例。如果您正苦于以下问题:Java LuminanceSource.getRow方法的具体用法?Java LuminanceSource.getRow怎么用?Java LuminanceSource.getRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.zxing.LuminanceSource
的用法示例。
在下文中一共展示了LuminanceSource.getRow方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBlackRow
import com.google.zxing.LuminanceSource; //导入方法依赖的package包/类
@Override
public BitArray getBlackRow(int y, BitArray row) throws NotFoundException {
LuminanceSource source = getLuminanceSource();
int width = source.getWidth();
if (row == null || row.getSize() < width) {
row = new BitArray(width);
} else {
row.clear();
}
initArrays(width);
byte[] localLuminances = source.getRow(y, luminances);
int[] localBuckets = buckets;
for (int x = 0; x < width; x++) {
int pixel = localLuminances[x] & 0xff;
localBuckets[pixel >> LUMINANCE_SHIFT]++;
}
int blackPoint = estimateBlackPoint(localBuckets);
int left = localLuminances[0] & 0xff;
int center = localLuminances[1] & 0xff;
for (int x = 1; x < width - 1; x++) {
int right = localLuminances[x + 1] & 0xff;
// A simple -1 4 -1 box filter with a weight of 2.
int luminance = ((center * 4) - left - right) / 2;
if (luminance < blackPoint) {
row.set(x);
}
left = center;
center = right;
}
return row;
}
示例2: getBlackRow
import com.google.zxing.LuminanceSource; //导入方法依赖的package包/类
@Override
public BitArray getBlackRow(int y, BitArray row) throws NotFoundException {
LuminanceSource source = getLuminanceSource();
int width = source.getWidth();
if (row == null || row.getSize() < width) {
row = new BitArray(width);
} else {
row.clear();
}
initArrays(width);
byte[] localLuminances = source.getRow(y, luminances);
int[] localBuckets = buckets;
for (int x = 0; x < width; x++) {
localBuckets[(localLuminances[x] & 0xff) >> LUMINANCE_SHIFT]++;
}
int blackPoint = estimateBlackPoint(localBuckets);
if (width < 3) {
// Special case for very small images
for (int x = 0; x < width; x++) {
if ((localLuminances[x] & 0xff) < blackPoint) {
row.set(x);
}
}
} else {
int left = localLuminances[0] & 0xff;
int center = localLuminances[1] & 0xff;
for (int x = 1; x < width - 1; x++) {
int right = localLuminances[x + 1] & 0xff;
// A simple -1 4 -1 box filter with a weight of 2.
if (((center * 4) - left - right) / 2 < blackPoint) {
row.set(x);
}
left = center;
center = right;
}
}
return row;
}
示例3: getBlackRow
import com.google.zxing.LuminanceSource; //导入方法依赖的package包/类
public BitArray getBlackRow(int y, BitArray row) throws NotFoundException {
int x;
LuminanceSource source = getLuminanceSource();
int width = source.getWidth();
if (row == null || row.getSize() < width) {
row = new BitArray(width);
} else {
row.clear();
}
initArrays(width);
byte[] localLuminances = source.getRow(y, this.luminances);
int[] localBuckets = this.buckets;
for (x = 0; x < width; x++) {
int i = (localLuminances[x] & 255) >> 3;
localBuckets[i] = localBuckets[i] + 1;
}
int blackPoint = estimateBlackPoint(localBuckets);
int left = localLuminances[0] & 255;
int center = localLuminances[1] & 255;
for (x = 1; x < width - 1; x++) {
int right = localLuminances[x + 1] & 255;
if ((((center * 4) - left) - right) / 2 < blackPoint) {
row.set(x);
}
left = center;
center = right;
}
return row;
}
示例4: getBlackMatrix
import com.google.zxing.LuminanceSource; //导入方法依赖的package包/类
public BitMatrix getBlackMatrix() throws NotFoundException {
int y;
byte[] localLuminances;
LuminanceSource source = getLuminanceSource();
int width = source.getWidth();
int height = source.getHeight();
BitMatrix matrix = new BitMatrix(width, height);
initArrays(width);
int[] localBuckets = this.buckets;
for (y = 1; y < 5; y++) {
int x;
localLuminances = source.getRow((height * y) / 5, this.luminances);
int right = (width * 4) / 5;
for (x = width / 5; x < right; x++) {
int i = (localLuminances[x] & 255) >> 3;
localBuckets[i] = localBuckets[i] + 1;
}
}
int blackPoint = estimateBlackPoint(localBuckets);
localLuminances = source.getMatrix();
for (y = 0; y < height; y++) {
int offset = y * width;
for (x = 0; x < width; x++) {
if ((localLuminances[offset + x] & 255) < blackPoint) {
matrix.set(x, y);
}
}
}
return matrix;
}
示例5: getBlackRow
import com.google.zxing.LuminanceSource; //导入方法依赖的package包/类
@Override
public BitArray getBlackRow(int y, BitArray row) throws NotFoundException {
LuminanceSource source = getLuminanceSource();
int width = source.getWidth();
if (row == null || row.getSize() < width) {
row = new BitArray(width);
} else {
row.clear();
}
initArrays(width);
byte[] localLuminances = source.getRow(y, luminances);
int[] localBuckets = buckets;
for (int x = 0; x < width; x++) {
int pixel = localLuminances[x] & 0xff;
localBuckets[pixel >> LUMINANCE_SHIFT]++;
}
int blackPoint = estimateBlackPoint(localBuckets);
int left = localLuminances[0] & 0xff;
int center = localLuminances[1] & 0xff;
for (int x = 1; x < width - 1; x++) {
int right = localLuminances[x + 1] & 0xff;
// A simple -1 4 -1 box filter with a weight of 2.
int luminance = ((center << 2) - left - right) >> 1;
if (luminance < blackPoint) {
row.set(x);
}
left = center;
center = right;
}
return row;
}
示例6: getBlackRow
import com.google.zxing.LuminanceSource; //导入方法依赖的package包/类
@Override
public BitArray getBlackRow(int y, BitArray row) throws NotFoundException {
LuminanceSource source = getLuminanceSource();
int width = source.getWidth();
if (row == null || row.getSize() < width) {
row = new BitArray(width);
} else {
row.clear();
}
initArrays(width);
byte[] localLuminances = source.getRow(y, luminances);
int[] localBuckets = buckets;
for (int x = 0; x < width; x++) {
int pixel = localLuminances[x] & 0xff;
localBuckets[pixel >> LUMINANCE_SHIFT]++;
}
int blackPoint = estimateBlackPoint(localBuckets);
int left = localLuminances[0] & 0xff;
int center = localLuminances[1] & 0xff;
for (int x = 1; x < width - 1; x++) {
int right = localLuminances[x + 1] & 0xff;
// A simple -1 4 -1 box filter with a weight of 2.
int luminance = ((center * 4) - left - right) / 2;
if (luminance < blackPoint) {
row.set(x);
}
left = center;
center = right;
}
return row;
}
示例7: getBlackRow
import com.google.zxing.LuminanceSource; //导入方法依赖的package包/类
@Override
public BitArray getBlackRow(int y, BitArray row) throws NotFoundException {
LuminanceSource source = getLuminanceSource();
int width = source.getWidth();
if (row == null || row.getSize() < width) {
row = new BitArray(width);
} else {
row.clear();
}
initArrays(width);
byte[] localLuminances = source.getRow(y, luminances);
int[] localBuckets = buckets;
for (int x = 0; x < width; x++) {
int pixel = localLuminances[x] & 0xff;
localBuckets[pixel >> LUMINANCE_SHIFT]++;
}
int blackPoint = estimateBlackPoint(localBuckets);
int left = localLuminances[0] & 0xff;
int center = localLuminances[1] & 0xff;
for (int x = 1; x < width - 1; x++) {
int right = localLuminances[x + 1] & 0xff;
// A simple -1 4 -1 box filter with a weight of 2.
int luminance = ((center << 2) - left - right) >> 1;
if (luminance < blackPoint) {
row.set(x);
}
left = center;
center = right;
}
return row;
}
示例8: getBlackMatrix
import com.google.zxing.LuminanceSource; //导入方法依赖的package包/类
public BitMatrix getBlackMatrix()
{
LuminanceSource luminancesource = getLuminanceSource();
int i = luminancesource.getWidth();
int j = luminancesource.getHeight();
BitMatrix bitmatrix = new BitMatrix(i, j);
a(i);
int ai[] = e;
for (int k = 1; k < 5; k++)
{
byte abyte1[] = luminancesource.getRow((j * k) / 5, d);
int l1 = (i << 2) / 5;
for (int i2 = i / 5; i2 < l1; i2++)
{
int j2 = (0xff & abyte1[i2]) >> 3;
ai[j2] = 1 + ai[j2];
}
}
int l = a(ai);
byte abyte0[] = luminancesource.getMatrix();
for (int i1 = 0; i1 < j; i1++)
{
int j1 = i1 * i;
for (int k1 = 0; k1 < i; k1++)
{
if ((0xff & abyte0[j1 + k1]) < l)
{
bitmatrix.set(k1, i1);
}
}
}
return bitmatrix;
}
示例9: getBlackRow
import com.google.zxing.LuminanceSource; //导入方法依赖的package包/类
public BitArray getBlackRow(int i, BitArray bitarray)
{
int j = 1;
LuminanceSource luminancesource = getLuminanceSource();
int k = luminancesource.getWidth();
byte abyte0[];
int ai[];
if (bitarray == null || bitarray.getSize() < k)
{
bitarray = new BitArray(k);
} else
{
bitarray.clear();
}
a(k);
abyte0 = luminancesource.getRow(i, d);
ai = e;
for (int l = 0; l < k; l++)
{
int j2 = (0xff & abyte0[l]) >> 3;
ai[j2] = 1 + ai[j2];
}
int i1 = a(ai);
int j1 = 0xff & abyte0[0];
int k1 = 0xff & abyte0[j];
int l1 = j1;
while (j < k - 1)
{
int i2 = 0xff & abyte0[j + 1];
if ((k1 << 2) - l1 - i2 >> 1 < i1)
{
bitarray.set(j);
}
j++;
l1 = k1;
k1 = i2;
}
return bitarray;
}
示例10: getBlackRow
import com.google.zxing.LuminanceSource; //导入方法依赖的package包/类
@Override
public BitArray getBlackRow(int y, BitArray row) throws NotFoundException {
LuminanceSource source = getLuminanceSource();
int width = source.getWidth();
if (row == null || row.getSize() < width) {
row = new BitArray(width);
} else {
row.clear();
}
initArrays(width);
byte[] localLuminances = source.getRow(y, luminances);
int[] localBuckets = buckets;
for (int x = 0; x < width; x++) {
int pixel = localLuminances[x] & 0xff;
localBuckets[pixel >> LUMINANCE_SHIFT]++;
}
int blackPoint = estimateBlackPoint(localBuckets);
int left = localLuminances[0] & 0xff;
int center = localLuminances[1] & 0xff;
for (int x = 1; x < width - 1; x++) {
int right = localLuminances[x + 1] & 0xff;
// A simple -1 4 -1 box filter with a weight of 2.
int luminance = ((center * 4) - left - right) / 2;
if (luminance < blackPoint) {
row.set(x);
}
left = center;
center = right;
}
return row;
}
示例11: getBlackRow
import com.google.zxing.LuminanceSource; //导入方法依赖的package包/类
public BitArray getBlackRow(int y, BitArray row) throws NotFoundException {
LuminanceSource source = getLuminanceSource();
int width = source.getWidth();
if (row == null || row.getSize() < width) {
row = new BitArray(width);
} else {
row.clear();
}
initArrays(width);
byte[] localLuminances = source.getRow(y, luminances);
int[] localBuckets = buckets;
for (int x = 0; x < width; x++) {
int pixel = localLuminances[x] & 0xff;
localBuckets[pixel >> LUMINANCE_SHIFT]++;
}
int blackPoint = estimateBlackPoint(localBuckets);
int left = localLuminances[0] & 0xff;
int center = localLuminances[1] & 0xff;
for (int x = 1; x < width - 1; x++) {
int right = localLuminances[x + 1] & 0xff;
// A simple -1 4 -1 box filter with a weight of 2.
int luminance = ((center << 2) - left - right) >> 1;
if (luminance < blackPoint) {
row.set(x);
}
left = center;
center = right;
}
return row;
}