• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java image processing

 
Greenhorn
Posts: 27
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how to form pixel pair of two images in java
 
ram mane
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is mean by pixel pairing of image
 
ram mane
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is mean by pixel pairing of image in java and how we will doen in java
please help
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pixel pairing? I searched the web for it and found nothing. So I suggest you go back to whoever asked (or suggested, or told) you to do that and find out what they were talking about.
 
ram mane
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i want to browse image through html page and passed to servlet .some processing in servlet and after pass to jsp page how do in java or example
 
ram mane
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
f(x+1)= f(x)in c language recursion function
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, but that doesn't make it any clearer. Can you point us to some resource where this concept is explained in more detail? Or what exactly it is that you're trying to accomplish? (Your 4th post seems to ask something rather different than the first three.)
 
ram mane
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:Sorry, but that doesn't make it any clearer. Can you point us to some resource where this concept is explained in more detail? Or what exactly it is that you're trying to accomplish? (Your 4th post seems to ask something rather different than the first three.)


1 Segment the RGB
Image into Color
Planes
2 Generate watermark
using green color
plane as seed in
messy system.
3 Form the pixel pair
from red and blue
color planes
in third step how we can forming pixel pair and what is mean by pixel pairing???
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, still not clear. Have you asked whoever gave you this task what "pixel pairing" is?
 
ram mane
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:Sorry, still not clear. Have you asked whoever gave you this task what "pixel pairing" is?




i am study ieee paper in that they give reference of pixel pairing and i will give link bellow please help me
link=http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=5739350&url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D5739350
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't access the full article, and the abstract only talks about watermarks.
 
ram mane
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:I can't access the full article, and the abstract only talks about watermarks.


i will upload all abstract please see.
Identification of Reference Color Plane
The pixels of fundus image in the proposed scheme are
given in 24-bits or 3 bytes of RGB color and represented in
TIF (Tagged Image File) format. The fundus camera uses
special green filter for photograph the fundus area. Thus, the
green channel of the fundus image will contain the important
details than other color channels. Hence, the green color plane
is chosen as reference color plane to generate the watermark.
It can also be done according to the color characteristics for
other medical imaging modalities such as X-Ray, CT, MRI,
SPECT and PET.
Messy system is a dynamical system whose behavior
changes with time. These changes are very sensitive to the
initial conditions. This sensitivity manifests changes as an
exponential growth of perturbations in the initial conditions.
Thus, the behavior of messy system appears to be random,
though they are deterministic. The dynamic changes of this
system are completely defined by their initial conditions
without any random elements. Therefore, the watermark is
generated through messy system using the reference color
plane as initial condition. Thereby, the watermark is generated
dynamically. A general messy system is defined by the
following equation
Xn+1=f(n)
Where f(*) refers the iterative, non linear function. It
iteratively produces the values for initial value. It is known as
messy sequence. The iteration will be stopped, when the
parameters in f(*) satisfy a certain requirements for messy
status. Once the sequence reached the messy status, it can be
used to generate the watermark.
In the proposed system, a hybrid optical bi stable messy
system [23] is used which is defined by
f(xn) = 4 sin 2 (Xn - 2.5) (2)
The watermark is generated through messy system by
using prominent pixel values of reference color plane of the
image as seed. The initial values to the messy system is
designed by
c sec/k,O)=a* jlo01(s(k)li)*i +b* pos+c*key (3)
Where, s(k) refers the pixel values of reference color
plane of the image. a, band c are predefined constants and I refers embedding depth. The position information (pas) and
secret key (key) is also used in the initial condition. The messy
sequence is generated by substituting c_seg (k, 0) value for Xn
in Eqn.2.For the kth pixel the sequence is referred as
c_seq (k, i), i=l, 2, 3 ... 1 The reasonable number of iteration
(I) is performed for the 􀀪 pixel to attain the messy status.
This sequence contains floating numbers that is converted in
to binary sequence in the proposed scheme. Hence, the
thresholding T is introduced here to convert the sequence
c_seq (k, i) from floating to binary sequence w (k, i). The
w (k, i) is obtained by
{1 c _seq(k,i) w(k,i ) = > T
0 Elsewhere

Embedding by Intra Plane Difference Expanding
The watermark generated in previous stage will be
embedded in this stage by using intra-plane difference
expanding as shown in fig .2. In the embedding stage, the
original image Img (L J, K) is divided into color planes. Here I
denote number of rows, J denotes number of columns and K
denotes number of planes. Since, the input image is in RGB
(Red, Green, Blue) mode, k=3in the proposed scheme. The
green color plane will be used as seed to generate the
watermark in messy system. Since, the watermark is generated
dynamically; it will be unique to the images. Then, pixel pair
is formed from the red and blue color planes of the images. By
checking overflow and underflow condition for pixel pair, the
watermark is embedded in the difference of the pixel pair by
expanding the difference. This is known as intra-plane
difference expanding.
Integer Transform: For a 8 bit gray scale pixel pair (x,
y), 0::; x,y ::; 255, the integer transform is given by the pair
(m, d).Where m refers integer average and drefers differenceWhere L J refers floor operation which rounds the value
to nearest integer. In the integer transform, the difference (d)
is modified based on the watermark bit (bit) to hide the bit into
the pixel pair. The modification of difference (d ') is given by
d'
= 2 * d + bit (9)
The modification process checks two conditions. They
are overflow and underflow. It is done to ensure that the
difference is expandable or not. The expandable difference
should satisfy the following condition.
Id' i 􀀰 2 * (255 - m) if128 􀀰 m 􀀰 255
(10)
Id' I􀀰2*m+l ifO􀀰m􀀰127
Only expandable difference can be used for embedding. If
all the expandable differences are used, the capacity will reach
its limit. Let N and Ne denote the number of differences and
the number of expandable differences, respectively. The
hiding capacity of an image is defined as:
Ne
C= - (11)
N
The difference can be expanded in multilayer also. It
means that the same pixel pairs are selected for further data
embedding. Here some of the differences may not be
expandable for longer time [24].
In the proposed scheme, the pixel pairs are formed from
red and blue color plane's pixel values. This is known as intra
plane difference expanding. Thus, the difference between the
pixels from different (Red and Blue) color planes is expanded
for embedding watermark in the proposed scheme. Thereby,
the watermarked image (Wjmg) is generated for the given
original image (Img).
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The language in that quote is a bit sloppy, but as far as I can see when they say "pixel pair" they are referring to a pair of pixels. You can implement that by anything which keeps two pixels together in a data structure. For example an array of two pixels.
 
ram mane
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:The language in that quote is a bit sloppy, but as far as I can see when they say "pixel pair" they are referring to a pair of pixels. You can implement that by anything which keeps two pixels together in a data structure. For example an array of two pixels.


in the above they can be mentioned if pixel pair is expandable then Embed watermark by expanding the differences in that what did they have? how do code in java?
 
ram mane
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you give me code in java for the bellow details
Messy system is a dynamical system whose behavior
changes with time. These changes are very sensitive to the
initial conditions. This sensitivity manifests changes as an
exponential growth of perturbations in the initial conditions.
Thus, the behavior of messy system appears to be random,
though they are deterministic. The dynamic changes of this
system are completely defined by their initial conditions
without any random elements. Therefore, the watermark is
generated through messy system using the reference color
plane as initial condition. Thereby, the watermark is generated
dynamically. A general messy system is defined by the
following equation
Xn+1=f(n)
Where f(*) refers the iterative, non linear function. It
iteratively produces the values for initial value. It is known as
messy sequence. The iteration will be stopped, when the
parameters in f(*) satisfy a certain requirements for messy
status. Once the sequence reached the messy status, it can be
used to generate the watermark.In the proposed system, a hybrid optical bi stable messy
system [23] is used which is defined by
f(xn) = 4 sin 2 (Xn - 2.5) (2)
The watermark is generated through messy system by
using prominent pixel values of reference color plane of the
image as seed. The initial values to the messy system is
designed by
c sec/k,O)=a* jlo01(s(k)li)*i +b* pos+c*key (3)
Where, s(k) refers the pixel values of reference color
plane of the image. a, band c are predefined constants and I refers embedding depth. The position information (pas) and
secret key (key) is also used in the initial condition. The messy
sequence is generated by substituting c_seg (k, 0) value for Xn
in Eqn.2.For the kth pixel the sequence is referred as
c_seq (k, i), i=l, 2, 3 ... 1 The reasonable number of iteration
(I) is performed for the 􀀪 pixel to attain the messy status.
This sequence contains floating numbers that is converted in
to binary sequence in the proposed scheme. Hence, the
thresholding T is introduced here to convert the sequence
c_seq (k, i) from floating to binary sequence w (k, i). The
w (k, i) is obtained by
{ 1 c _seq(k,i) w(k,i ) = > T
0 Elsewhere
(4)
Where, T is set to 8/3 by the number of test to bring equal
number of zeros and ones [24]. The length of sequence G is
combined to one bit w (.) by applying XOR operation. Thus,
the watermark is generated for the kth pixel. By repeating the
same procedure for remaining pixels of the reference color
plane of the image, the watermark
Embedding by Intra Plane Difference Expanding
The watermark generated in previous stage will be
embedded in this stage by using intra-plane difference
expanding as shown in fig .2. In the embedding stage, the
original image Img (L J, K) is divided into color planes. Here I
denote number of rows, J denotes number of columns and K
denotes number of planes. Since, the input image is in RGB
(Red, Green, Blue) mode, k=3in the proposed scheme. The
green color plane will be used as seed to generate the
watermark in messy system. Since, the watermark is generated
dynamically; it will be unique to the images. Then, pixel pair
is formed from the red and blue color planes of the images. By
checking overflow and underflow condition for pixel pair, thewatermark is embedded in the difference of the pixel pair by
expanding the difference. This is known as intra-plane
difference expanding.
Integer Transform: For a 8 bit gray scale pixel pair (x,
y), 0::; x,y ::; 255, the integer transform is given by the pair
(m, d).Where m refers integer average and drefers difference.
m=(x+y)/2
d=x-y
The inverse transform is given by
x=m+ (d+1)/2
y=m-(d/2)
Where L J refers floor operation which rounds the value
to nearest integer. In the integer transform, the difference (d)
is modified based on the watermark bit (bit) to hide the bit into
the pixel pair. The modification of difference (d ') is given by
d'
= 2 * d + bit (9)
The modification process checks two conditions. They
are overflow and underflow. It is done to ensure that the
difference is expandable or not. The expandable difference
should satisfy the following condition.
Id' i 􀀰 2 * (255 - m) if128 􀀰 m 􀀰 255
(10)
Id' I􀀰2*m+l ifO􀀰m􀀰127
Only expandable difference can be used for embedding. If
all the expandable differences are used, the capacity will reach
its limit. Let N and Ne denote the number of differences and
the number of expandable differences, respectively. The
hiding capacity of an image is defined as:
Ne
C= - (11)
N
The difference can be expanded in multilayer also. It
means that the same pixel pairs are selected for further data
embedding. Here some of the differences may not be
expandable for longer time [24].
In the proposed scheme, the pixel pairs are formed from
red and blue color plane's pixel values. This is known as intra
plane difference expanding. Thus, the difference between the
pixels from different (Red and Blue) color planes is expanded
for embedding watermark in the proposed scheme. Thereby,
the watermarked image (Wjmg) is generated for the given
original image (Img).
can you give me code for generating messy sequence in image or give me hint how i will doen this task in java
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, that's not how JavaRanch works. We'll help you write the code, but we won't do it for you.
 
ram mane
Greenhorn
Posts: 27
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
public class testing
{
static BufferedImage image;
public static void main(String[] args) throws IOException {

ArrayList<Integer> l1=new ArrayList<Integer>();
ArrayList<Integer> l2=new ArrayList<Integer>();
ArrayList<Integer> l3=new ArrayList<Integer>();

image = ImageIO.read(new File("nn33.png"));
int w = image.getWidth();
int h = image.getHeight();
for (int y = 0; y < h; y++)
{
for (int x = 0; x < w; x++)
{
Color c = new Color(image.getRGB(x, y));
int A=c.getRed()+3;
l1.add(A);
int B=c.getBlue()+2;
l2.add(B);
int C=c.getGreen();
l3.add(C);



}
}
i will write above code but i write image again by using different color values how can i write
 
ram mane
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
import javax.imageio.ImageIO;
import java.io.File;
import java.awt.Image;
import java.awt.image.BufferedImage;


class gtest
{
static BufferedImage image;
static BufferedImage redImage,greenImage,blueImage;
static final int TYPE=BufferedImage.TYPE_INT_ARGB;

public static void main(String[] args) throws Exception
{
// read image,
// change the file name as needed
image = ImageIO.read(new File("1.png"));


int w = image.getWidth();
int h = image.getHeight();

// create 3 images for each RGB plane
redImage = new BufferedImage(w,h,TYPE);
greenImage = new BufferedImage(w,h,TYPE);
blueImage = new BufferedImage(w,h,TYPE);


// split RGB plane
for (int y=0;y<h;y++)
for (int x=0;x<w;x++)
{
int pixel=image.getRGB(x,y);

int alpha_mask = pixel & 0xff000000;
int red = (pixel >> 16) & 0xff;
int green = (pixel >> 8) & 0xff;
int blue = (pixel) & 0xff;

redImage.setRGB(x,y, alpha_mask | (red << 16));
greenImage.setRGB(x,y, alpha_mask | (green << 8) );
blueImage.setRGB(x,y, alpha_mask | blue);
}


// write result to 3 image files
String format="png";
ImageIO.write(redImage,format, new File("image_red.png"));
ImageIO.write(greenImage,format, new File("image_green.png"));
ImageIO.write(blueImage,format, new File("image_blue.png"));




}
}
in this above code image can be segment into red,green, blue plane but when i am process green plane and again i form in original image but i can not gaining original image by using three plane give any hint
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'll move this thread to Java in General since you're not using any non-JSE APIs.

And can you please UseCodeTags next time?
 
ram mane
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Spoor wrote:I'll move this thread to Java in General since you're not using any non-JSE APIs.

And can you please UseCodeTags next time?


thanks for suggestion
 
ram mane
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
class mm
{
int width = gtest.greenImage.getWidth();
int height = gtest.greenImage.getHeight();
WritableRaster raster = gtest.greenImage.getRaster();
for (int xx = 0; xx < width; xx++) {
for (int yy = 0; yy < height; yy++) {
Color c = new Color(gtest.greenImage.getRGB(xx, yy));
int[] pixels = raster.getPixel(xx, yy, (int[]) null);
pixels[0] = c.getGreen() ;
l1.add(c.getGreen());
raster.setPixel(xx, yy, pixels); }}
int width1 = gtest.blueImage.getWidth();
int height1 = gtest.blueImage.getHeight();
WritableRaster raster1 = gtest.blueImage.getRaster();
for (int xx = 0; xx < width1; xx++) {
for (int yy = 0; yy < height1; yy++) {
Color c = new Color(gtest.blueImage.getRGB(xx, yy));
int[] pixels = raster.getPixel(xx, yy, (int[]) null);
pixels[1] = c.getBlue() ;
l2.add(c.getBlue());
raster1.setPixel(xx, yy, pixels);
}}
int width2 = gtest.redImage.getWidth();
int height2 = gtest.redImage.getHeight();
WritableRaster raster2 = gtest.redImage.getRaster();
for (int xx = 0; xx < width2; xx++) {
for (int yy = 0; yy < height2; yy++) {
Color c = new Color(gtest.redImage.getRGB(xx, yy));
int[] pixels = raster.getPixel(xx, yy, (int[]) null);
pixels[2] = c.getRed() ;
l3.add(c.getRed());
raster2.setPixel(xx, yy, pixels);}
}
}
}
in above code i am giving three different plane (red plane,green plane,blue plane)that each plane reading pixel by pixel .i am storing each pixel in array list according to that image color . i want retrieve original image by using three different plane .is it possible and in above code if i add three array list in one image is it found original image please help me how form by using three different plane into one image
 
Ranch Hand
Posts: 254
1
MySQL Database Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please UseCodeTags . It makes your code so much easier to read.
 
ram mane
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ahsan Bagwan wrote:Please UseCodeTags . It makes your code so much easier to read.


suggest me any hint about that above what i explain
 
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic