コード例 #1
0
 def calibrate(self, pixel_cm_ratio, tr):
     self.pixelcmratio = "{0:.2f}".format(pixel_cm_ratio)
     self.rgbtransform = ",".join(["{0:.2f}".format(x) for x in tr.flatten()])
     self.correctedlength = "{0:.2f}".format(self.length / pixel_cm_ratio)
     self.correctedwidth = "{0:.2f}".format(self.width / pixel_cm_ratio)
     correctedrgb = np.dot(tr, np.array(self.rgb))
     self.correctedrgb = triplet_to_rgb(correctedrgb)
     self.correctedcolorname = closest_color(correctedrgb)
     self.calibrated = True
コード例 #2
0
ファイル: grabseeds.py プロジェクト: arvin580/jcvi
 def calibrate(self, pixel_cm_ratio, tr):
     self.pixelcmratio = "{0:.2f}".format(pixel_cm_ratio)
     self.rgbtransform = ",".join(["{0:.2f}".format(x) for x in tr.flatten()])
     self.correctedlength = "{0:.2f}".format(self.length / pixel_cm_ratio)
     self.correctedwidth = "{0:.2f}".format(self.width / pixel_cm_ratio)
     correctedrgb = np.dot(tr, np.array(self.rgb))
     self.correctedrgb = triplet_to_rgb(correctedrgb)
     self.correctedcolorname = closest_color(correctedrgb)
     self.calibrated = True
コード例 #3
0
ファイル: grabseeds.py プロジェクト: arvin580/jcvi
 def __init__(self, imagename, accession, seedno, rgb, props, exif):
     self.imagename = imagename
     self.accession = accession
     self.seedno = seedno
     y, x = props.centroid
     self.x, self.y = int(round(x)), int(round(y))
     self.location = "{0}|{1}".format(self.x, self.y)
     self.area = int(round(props.area))
     self.length = int(round(props.major_axis_length))
     self.width = int(round(props.minor_axis_length))
     self.props = props
     self.circularity = 4 * pi * props.area / props.perimeter ** 2
     self.rgb = rgb
     self.colorname = closest_color(rgb)
     self.datetime = exif.get("exif:DateTimeOriginal", "none")
     self.rgbtag = triplet_to_rgb(rgb)
     self.pixeltag = "length={0} width={1} area={2}".format(self.length, self.width, self.area)
     self.hashtag = " ".join((self.rgbtag, self.colorname))
     self.calibrated = False
コード例 #4
0
ファイル: grabseeds.py プロジェクト: fossabot/jcvi
 def __init__(self, imagename, accession, seedno, rgb, props, exif):
     self.imagename = imagename
     self.accession = accession
     self.seedno = seedno
     y, x = props.centroid
     self.x, self.y = int(round(x)), int(round(y))
     self.location = "{0}|{1}".format(self.x, self.y)
     self.area = int(round(props.area))
     self.length = int(round(props.major_axis_length))
     self.width = int(round(props.minor_axis_length))
     self.props = props
     self.circularity = 4 * pi * props.area / props.perimeter**2
     self.rgb = rgb
     self.colorname = closest_color(rgb)
     self.datetime = exif.get("exif:DateTimeOriginal", "none")
     self.rgbtag = triplet_to_rgb(rgb)
     self.pixeltag = "length={0} width={1} area={2}".format(
         self.length, self.width, self.area)
     self.hashtag = " ".join((self.rgbtag, self.colorname))
     self.calibrated = False
コード例 #5
0
def test_closest_color(input, output):
    from jcvi.utils.webcolors import closest_color

    assert closest_color(input) == output