Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing ImageProcessor in ImageJ
    primarykey
    data
    text
    <p>I am new to java and imageJ. I already loaded one image and get an ImageProcessor which I called <strong>imgproc</strong>. And I found the boundary/box in the image which surround the features. Outside just background. I also found the pixels Matrix of this area. Now I am trying to only process this area in the image. And to do that with a previous existing code(method), my input parameter should be an ImageProcessor. So, my initial thought is to used the duplicate() method to make a copy of <strong>imgproc</strong>. And use the resize method to shrink it down to the size of the box I found before. But this did not work, as I tested with a show image method I have to display it. What I got is just a shrunk black picture. This initial thought is coded here:</p> <pre><code>ImageProcessor Whiteimproc=imgproc.duplicate(); ImageProcessor BWhiteimproc=Whiteimproc.resize(BWhiteMatrix.length,BWhiteMatrix[0].length); BWhiteimproc.setIntArray(BWhiteMatrix); //the next three lines are going to show the image Image ImagetoShow=BWhiteimproc.createImage(); Img ShowImg= new Img(); ShowImg.imgFrame(ImagetoShow,"BWhite");` </code></pre> <p>Then I tried to use ImagePlus and create an new ImageProcessor. And it worked. As shown below:</p> <pre><code>ImagePlus imgWhite=IJ.createImage("white","jpg",BWhiteMatrix.length,BWhiteMatrix[0].length,1); ImageProcessor BWhiteimproc=imgWhite.getProcessor(); BWhiteimproc.setIntArray(BWhiteMatrix); //the next three lines are going to show the image Image ImagetoShow=BWhiteimproc.createImage(); Img ShowImg= new Img(); ShowImg.imgFrame(ImagetoShow,"BWhite"); </code></pre> <p>Would anyone help me with why is that? And I do know why I could not use ImageProcessor to define an new object of ImageProcessor Class.</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload