OCR In Image Processing - Cannot Find TIFF File

Oct 9, 2013

class mmm {
public static void main(String[] args) {
OcrEngine ocr = new OcrEngine();
ocr.setImage(ImageStream.fromFile("pp.tif"));
// ocr.setImage((IImageStream) new File("pp.tif"));

[Code] ....

In above code giving error .

Exception in thread "main" com.aspose.ms.System.IO.FileNotFoundException: Can't find file: pp.tiff.

Where i am wrong. I am trying to pass all formt(.png,.gif,.jpg) images. I am giving proper path ....

View Replies


ADVERTISEMENT

Write Out Multiple BufferedImages To Single TIFF File?

May 28, 2015

I need to write out multiple BufferedImages to a single tiff file. Each image represents a seismic time slice which can be several megabytes in size.  I have used the TIFFEncodeParam.setExtraImages method and saved all my BufferedImages to a vector but my since I create so many BIs I keep running out of memory. Is there a way to create a BI, write it out to a TIFF file, then discard the BI and create the next one?

View Replies View Related

Image Processing In Java

Jan 26, 2012

I'm relatively new to java and to image processing ... What I've done so far is make a simple application which opens the webcam and can take and save a picture. Ive then loaded the image pixel data into a 2d array. How then do I do what is known as 'fast fourier transform' on it from here?

View Replies View Related

Image Processing - Array Of Pixels

Feb 13, 2015

I am trying to process an array of pixels, checking each within a 5*5 mask. Ive declared my mask as a 2d array and get the pixel values within a nested for loop. Im getting an ArrayIndexOutOfBoundsException at the line:

mask[0][4] = dsIm.red[i-1][j+3];

Have I declared my mask wrong for a 5*5 mask. Is my logic wrong?

I won't give all the code, but basically Im trying to check all 25 pixel values within the mask:

int [][] mask = new int[5][5];
System.out.println("We are in the method just written");
//loop one loop
for(int i = 1; i <= h-2; i++)
{
for(int j = 1; j<=w-2; j++)

[Code] .....

View Replies View Related

Use Java Programming For Image Processing

Feb 12, 2015

can we use java programming for image processing. if yes then how do we do it?

View Replies View Related

Image Processing Pattern Matching / Combination Algorithm

Jun 9, 2014

The problem I am trying to solve relates to block-matching or image-within-image recognition. This is an algorithm problem I am working on in java, but computationally, my computer can't handle generating all the combinations at one time.

I see an image, extract the [x,y] of every black pixel and create a set for that image, such as

{[8,0], [9,0], [11,0]}

The set is then augmented so that the first pixel in the set is at [0,0], but the relationship of the pixels is preserved. For example, I see {[8,0], [9,0]} and change the set to {[0,0], [1,0]}. The point of the extraction is that now if I see {[4,0], [5,0]}, I can recognize that basic relationship as two vertically adjacent pixels, my {[0,0], [1,0]}, since it is the same image but only in a different location.

I have a list of these pixel sets, called "seen images". Each 'seen image' has a unique identifier, that allows it to be used as a nested component of other sets. For example:

{[0,0], [1,0]} has the identifier 'Z'

So if I see:

{[0,0], [1, 0], [5,6]}

I can identify and store it as:

{[z], [5, 6]}

The problem with this is that I have to generate every combination of [x,y]'s within the pixel set to check for a pattern match, and to build the best representation. Using the previous example, I have to check:

{[0,0], [1,0]},
{[0,0], [5,6]},
{[1,0], [5,6]} which is {[0,0], [4,5]}
{[0,0], [1,0], [5,6]}

And then if a match occurs, that subset gets replaced with it's ID, merged with the remainder of the original set, and the new combination needs to be checked if it is a 'seen image':

{[z],[5, 6]}

The point of all that is to match as many of the [x,y]'s possible, using the fewest pre-existing pieces as components, to represent a newly seen image concisely. The greedy solution to get the component that matches the largest subset is not the right one. Complexity arises in generating all of the combinations that I need to check, and then the combinations that spawn from finding a match, meaning that if some match and swap produces {[z], [1,0], [2,0]}, then I need to check (and if matched, repeat the process):

{[z], [1,0]}
{[z], [2,0]}
{[1,0], [2,0]} which is {[0,0], [1,0]}
{[z], [1,0], [2,0]}

Currently I generate the pixel combinations this way (here I use numbers to represent pixels 1 == [x,y]) Ex. (1, 2, 3, 4): Make 3 lists:

1.) 2.) 3.)
12 23 34
13 24
14

Then for each number, for each list starting at that number index + 1, concatenate the number and each item and store on the appropriate list, ex. (1+23) = 123, (1+24) = 124

1.) 2.) 3.)
12 23 34
13 24
14
---- ---- ----
123 234
124
134

So those are all the combinations I need to check if they are in my 'seen images'. This is a bad way to do this whole process. I have considered different variations / optimizations, including once the second half of a list has been generated (below the ----), check every item on the list for matches, and then destroy the list to save space, and then continue generating combinations. Another option would be to generate a single combination, and then check it for a match, and somehow index the combinations so you know which one to generate next.

How to optimize what I am doing for a set of ~million items. I also have not yet come up with a non-recursive or efficient way to handle that each match generates additional combinations to check.

View Replies View Related

Processing Text File Into Specific Format In Java

Mar 30, 2014

I have text file of this form:

0file:/home/lenovo/mallet/cleantweet/242874110.240622335890878130.1593492469451548700.130861040068201270.1129582267689684590.0868854788292128480.
0807757885763000940.078431372549019660.0604575163398692850.02926967888604717320.020389315146348393
1file:/home/lenovo/mallet/cleantweet

[Code] ....

Am i going in correct way?

View Replies View Related

How To Find DPI Of Image

Jan 8, 2015

How can I find the DPI of an image? The following code tells me the size of the image in pixels which I want to convert to millimetres. When I have looked at conversions I can find - "mm = (pixels * 25.4) / dpi" but how do I find out the DPI?

public class NewMain {
/**
* @param args the command line arguments
* @throws java.io.IOException
*/
public static void main(String[] args) throws IOException {
String filename = null;
BufferedImage bimg = ImageIO.read(new File("testimage.jpg"));
int width = bimg.getWidth();

[Code]...

View Replies View Related

JSP :: String URL For Image In Database And Show Image In File

Dec 24, 2014

I had string url for image in mysql database and I want show image in mu jsp file bu I can't.

<c:forEach var="urun" items="${listUrun.rows}">
<tr>
<td><c:out value="${urun.kitapresim}" /></td>
<img src="<c:url value="${urun.kitapresim}" /> " width="270" height="190"/>

URL...

View Replies View Related

Code Is Used To Find Coordinates Of Image

Jan 27, 2015

The code is used to find coordinates of an image and i cannot understand how it works.

for (int y = 0; y < height; y += 2) {
for (int x = 0; x < width; x += 2) {
int px1 = secureRandom.nextInt(4);
int px2 = secureRandom.nextInt(4);
while (px1 == px2)
px2 = secureRandom.nextInt(4);

int px1x = (px1 < 2) ? px1 : px1 - 2;
int px1y = (px1 < 2) ? 0 : 1;
int px2x = (px2 < 2) ? px2 : px2 - 2;
int px2y = (px2 < 2) ? 0 : 1;

View Replies View Related

Servlets :: File Is Located In Root Directory Of Project But System Cannot Find File Specified

Jan 10, 2015

I need to make some operations with a file. I struggle to understand why Apache is throwing this error:

(The system cannot find the file specified)

My file is located in the root directory of the project.

And here is how I indicate the path to it:

String filePath = "default.jpg";
InputStream inputStream = new FileInputStream(new File(filePath));

If I put the file in the Eclipse folder, it works... But I need it to work if I put it in my project's root folder.

View Replies View Related

File Not Found - Can't Find File Specified

Apr 17, 2014

I'm getting this -file not found- error despite the fact that I have saved the file with appropriate permissions in the src folder of the given application in netbeans. The program prompts for a listings.txt file to read and write data to a new file that counts and sums the info in a overview.txt report. Here is the stacktrace:

run:

Type in the name of the file: listings
There was a problem:java.io.FileNotFoundException: listings.txt (The system cannot find the file specified)
java.io.FileNotFoundException: listings.txt (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:131)
at java.io.FileInputStream.<init>(FileInputStream.java:87)
at java.io.FileReader.<init>(FileReader.java:58)
at kettask2a.KetTask2a.main(KetTask2a.java:48)

[code]....

View Replies View Related

Can't Find End Of File

Feb 21, 2014

I'm having issues with my bottom loop trying to read in a large *.txt* file but how can I do a check to see if its at the end of the document?

import java.io.File;
import java.util.Scanner;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.FileNotFoundException;

[code]...

View Replies View Related

Find The File And Zip It?

Feb 2, 2015

I'm trying to find a specific file that already exists on the computer. I want to find that file and zip it. don't get sidetracked with whether or not the file exists, because I'm sure it does on my local machine and TDD will address that what-if scenario later.

My code and JUnit is below. Since its not finding the file, I assume I must be formatting 'path' wrong. I wonder if I'm even on the right track logically.

private ZipParameters zp = new ZipParameters();
private ZipFile zipFile;
public ZipFile createZipFile(File f, String path) throws ZipException{
zipFile = new ZipFile(path);
zp.setCompressionLevel(Zip4jConstants.DEFLATE_LEVEL_NORMAL);
zp.setCompressionMethod(Zip4jConstants.COMP_DEFLATE);

[Code] ....

View Replies View Related

Renaming Scanned Image File

Feb 25, 2014

how can we rename the scanned image file from scanner which is by default scan_01is their any api which can rename the scanned o/p file

View Replies View Related

How To Change Jar File Icon With Image

Sep 8, 2014

how to change my jar file's icon with an image?

View Replies View Related

Image Path Java To Exe / Jar File

Sep 30, 2014

I already done my program with images on it but when i convert it to exe , the images is not appearing.

Usually my images are located at documents netbeansprojectprojectimage.jpg

When i run the code on netbeans the images are appearing but when i convert it to exe or jar file run on a computer without netbeans.. images is not appearing ...

import java.awt.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.ImageIcon;

class Phonebook extends JFrame {
private static final int WIDTH = 430;
private static final int HEIGHT = 200;
public Phonebook()

[Code] ....

View Replies View Related

Drawing Image - Specify File Path

Jul 3, 2014

Gyazo - e5663e8da42ac46a642895d72836b933.png

As you can see I have specified a file path, as it is needed to draw the image.

The image "sun" is in a certain folder inside the directory of my jar file.

But If I were to send the whole package to my teacher to review. The file path would still remain the same, local to my computer making the image, unloadable.?

View Replies View Related

Buffered Image Read File

Sep 8, 2014

I am trying to read an image I have in the location of my project, So I do this:

When I read it in the try/catch like: BufferedImage image = ImageIO.read(new file(""));

And try to access it after the try/catch, it does not know that image exists, so I need to declare it as a global variable for that class first, and then it works.

public class Gui extends JFrame
{
private BufferedImage image1;
public Gui() {
super("MyApp");
setDefaultCloseOperation(EXIT_ON_CLOSE);
setLocationRelativeTo(null);
setVisible(true);
initUI();
 
[Code] ....

View Replies View Related

Cannot Find File Apache POI

Sep 2, 2014

I'm trying to read a .xlsx file using Apache Poi on Eclipse and store the data into an ArrayList.

My code :

import org.apache.poi.ss.usermodel.*;
import java.io.*;
import java.util.*; 
public class parseReadFiles
{
public static void main(String[] args) {

[Code] ....

I keep getting a FileNotFoundException: Users/Divjot/Desktop/first.xlsx (No such file or directory). I've tried different combinations of file names and paths but can't get the program to find it. Should the file be stored in a special place or should the class path be different?

View Replies View Related

Cryptography - Converting A Text File Into Image?

Jul 26, 2014

I am stuck with converting a text file in to image ?

View Replies View Related

Carrying A File (image) With Application (Java SE)

Mar 21, 2015

I wanna make a simple Java SE application which is only one jar file, but unfortunately there is an image which I want my app access it, what I have in mind is carrying that file with the app, but I don't know how to do it and how to access it in run-time.

View Replies View Related

Changing Image Orientation While Saving To File

Jul 30, 2014

I get a Base64Encoded image string (GIF format) from an external system. While reading the byte array and saving the image to file, the image gets saved in landscape orientation. The code snippet is below.
 
String image = "R0lGODdhCAcgA=";
Base64Coder decoder = new Base64Coder();
byte [] decodeBytes = decoder.decode(image.getBytes());
ByteArrayInputStream stream = new ByteArrayInputStream(pngArray);
BufferedImage bImage = ImageIO.read(stream);
File label = new File("C:/labels/test.gif");
ImageIO.write(bImage, "gif", label);
 
I want to save the image in portrait orientation. Is there a way to do that?

View Replies View Related

How To Find The Current Path Of A File

Jun 24, 2014

First of all, i am using ubuntu and jdk8. My problem: displaying the current path of a file in my system Approach: I have a file called dummy.txt in a given directory which have enough permissions and i did the following:

File file=new File("dummy.txt");
System.out.println(file.getAbsolutePath().substring(0,file.getAbsolutePath().lastIndexOf("/")));

I expected to see displayed the current path of the file without the name of the file but it is showing a different path. I just want to display the current path of the file without the name.

View Replies View Related

Find High And Low Scores From File

Aug 28, 2014

I am trying to figure out how to report the high and low scores with names from a file. The format is like:

6352 J@me$$
663843 BOBBBB1
etc...

This is my code so far.

import java.io.*;
import java.util.*;
public class Assignment1
{
public static void main(String[] args)throws IOException

[code]....

View Replies View Related

Find Number Of Rows In CSV File

Feb 13, 2014

I am working through a text and I am supposed to complete the following tasks.

Your ReadFiles.java class requires the following methods:

Method: check to see if the file exists

Method: find number of rows in csv file

Method: Converts the csv file to a mutli-dimensional array

Method: PrintArray

Method: Return array using a get method

Create a file DataAnalyzer.java. This file will be used to call the methods in ReadFiles.java. Be sure to demonstrate that all of your methods work through DataAnalyzer.java.

The problem is that it does not really provide any information on how to go about reading a file into an array. I am stuck at the third task of converting the file to an array and I have tried several ways to do this unsuccessfully. I thought that I would at least try to get things to print out (line 87) to see if I could get that to work, but all that prints in null over and over again.

Java Code:

public class DataAnalyzer {
public static void main (String[] args) {
ReadFiles aReadFiles = new ReadFiles();
aReadFiles.fileCheck();
aReadFiles.findRows();
aReadFiles.convertFile();

[Code] .....

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved