/** Converts the current image from RGB to CIE L*a*b* and stores the results * in the same RGB image R=L*, G=a*, B=b*. Values are therfore offset and rescaled. */ public static void RGBtoLab() { ImagePlus imp = IJ.getImage(); if (imp.getBitDepth()==24) imp.setProcessor(RGBtoLab(imp.getProcessor())); }
/** Converts the current image from RGB to YUV and stores * the results in the same RGB image R=Y, G=U, B=V. * Author: Gabriel Landini, G.Landini@bham.ac.uk */ public static void RGBtoYUV() { ImagePlus imp = IJ.getImage(); if (imp.getBitDepth()==24) { RGBtoYUV(imp.getProcessor()); imp.updateAndDraw(); } }
public synchronized void adjustmentValueChanged(AdjustmentEvent e) { if (IJ.debugMode) IJ.log("ColorThresholder.adjustmentValueChanged "); if (!checkImage()) return; if (e.getSource() == minSlider) adjustMinHue((int) minSlider.getValue()); else if (e.getSource() == maxSlider) adjustMaxHue((int) maxSlider.getValue()); else if (e.getSource() == minSlider2) adjustMinSat((int) minSlider2.getValue()); else if (e.getSource() == maxSlider2) adjustMaxSat((int) maxSlider2.getValue()); else if (e.getSource() == minSlider3) adjustMinBri((int) minSlider3.getValue()); else if (e.getSource() == maxSlider3) adjustMaxBri((int) maxSlider3.getValue()); //originalB.setEnabled(true); updateLabels(); updatePlot(); notify(); }
if (imp==null || imp.getBitDepth()!=24) return; reset(imp); byte[] hsSource,ssSource,bsSource; cp2.getHSB(hsSource,ssSource,bsSource); else if(colorSpace==LAB) getLab(cp2, hsSource,ssSource,bsSource); else if(colorSpace==YUV) getYUV(cp2, hsSource,ssSource,bsSource); adjustMinHue(iminhue); minSlider.setValue(iminhue); adjustMaxHue(imaxhue); maxSlider.setValue(imaxhue); adjustMinSat(iminsat); minSlider2.setValue(iminsat); adjustMaxSat(imaxsat); maxSlider2.setValue(imaxsat); adjustMinBri(iminbri); minSlider3.setValue(iminbri); adjustMaxBri(imaxbri); maxSlider3.setValue(imaxbri);
GridBagLayout gridbag = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); setLayout(gridbag); c.insets = new Insets(5, 0, 0, 0); labelh = new Label("Hue", Label.CENTER); add(labelh, c); c.insets = new Insets(7, 0, 0, 0); labelf = new Label("", Label.RIGHT); add(labelf, c); c.anchor = c.CENTER; c.insets = new Insets(0, 5, 0, 0); add(plot, c); c.gridwidth = 2; c.insets = new Insets(5, 5, 0, 5); add(bandPassH, c); add(minSlider, c); minSlider.addAdjustmentListener(this); minSlider.setUnitIncrement(1); label1 = new Label(" ", Label.LEFT); label1.setFont(font); add(label1, c); c.weightx = 100;
if (imp==null || imp.getBitDepth()!=24) return; reset(imp); byte[] hsSource,ssSource,bsSource; cp2.getHSB(hsSource,ssSource,bsSource); else if(colorSpace==LAB) getLab(cp2, hsSource,ssSource,bsSource); else if(colorSpace==YUV) getYUV(cp2, hsSource,ssSource,bsSource); adjustMinHue(iminhue); minSlider.setValue(iminhue); adjustMaxHue(imaxhue); maxSlider.setValue(imaxhue); adjustMinSat(iminsat); minSlider2.setValue(iminsat); adjustMaxSat(imaxsat); maxSlider2.setValue(imaxsat); adjustMinBri(iminbri); minSlider3.setValue(iminbri); adjustMaxBri(imaxbri); maxSlider3.setValue(imaxbri);
GridBagLayout gridbag = new GridBagLayout(); GridBagConstraints c = new GridBagConstraints(); setLayout(gridbag); c.insets = new Insets(5, 0, 0, 0); labelh = new Label("Hue", Label.CENTER); add(labelh, c); c.insets = new Insets(7, 0, 0, 0); labelf = new Label("", Label.RIGHT); add(labelf, c); c.anchor = c.CENTER; c.insets = new Insets(0, 5, 0, 0); add(plot, c); c.gridwidth = 2; c.insets = new Insets(5, 5, 0, 5); add(bandPassH, c); add(minSlider, c); minSlider.addAdjustmentListener(this); minSlider.setUnitIncrement(1); label1 = new Label(" ", Label.LEFT); label1.setFont(font); add(label1, c); c.weightx = 100;
public synchronized void adjustmentValueChanged(AdjustmentEvent e) { if (IJ.debugMode) IJ.log("ColorThresholder.adjustmentValueChanged "); if (!checkImage()) return; if (e.getSource() == minSlider) adjustMinHue((int) minSlider.getValue()); else if (e.getSource() == maxSlider) adjustMaxHue((int) maxSlider.getValue()); else if (e.getSource() == minSlider2) adjustMinSat((int) minSlider2.getValue()); else if (e.getSource() == maxSlider2) adjustMaxSat((int) maxSlider2.getValue()); else if (e.getSource() == minSlider3) adjustMinBri((int) minSlider3.getValue()); else if (e.getSource() == maxSlider3) adjustMaxBri((int) maxSlider3.getValue()); //originalB.setEnabled(true); updateLabels(); updatePlot(); notify(); }
/** Converts the current image from RGB to YUV and stores * the results in the same RGB image R=Y, G=U, B=V. * Author: Gabriel Landini, G.Landini@bham.ac.uk */ public static void RGBtoYUV() { ImagePlus imp = IJ.getImage(); if (imp.getBitDepth()==24) { RGBtoYUV(imp.getProcessor()); imp.updateAndDraw(); } }
/** Converts the current image from RGB to CIE L*a*b* and stores the results * in the same RGB image R=L*, G=a*, B=b*. Values are therfore offset and rescaled. */ public static void RGBtoLab() { ImagePlus imp = IJ.getImage(); if (imp.getBitDepth()==24) imp.setProcessor(RGBtoLab(imp.getProcessor())); }