About

watashiはわたし それだけ

a.k.a. watashi | rejudge | whatasha

146 Responses to “About”
  1. think says:

    #!/usr/bin/perl -w

    use Image::Magick;
    use GD;

    my $image = Image::Magick->new;
    $image->Read(“cat.jpg”);
    my @pixel = $image->GetPixel(x=>0,y=>0,normalize=>0);
    print “@pixel”;

    print “\n”;

    $image = GD::Image->new(“cat.jpg”);
    my $index = $image->getPixel(0,0);
    my($r,$g,$b) = $image->rgb($index);
    print $r,” “,$g,” “,$b;

    print “\n”;

    使用Image::Magick怎样正确获得像素值?

    上面输出结果:
    30326 19275 17733 这个应该是错误的
    119 68 64

    • watashi says:

      [30326, 19275, 17733].map{|_| ‘%x’ % _}
      => ["7676", "4b4b", "4545"]

      你想要scale到0~255的话可以直接取低8位

      • think says:

        没看明白,怎样scale到0~255的话可以直接取低8位?

        我使用Image::Magick得到的值是30326, 19275, 17733,使用GD得到的值是119, 68, 64,能直接给出代码吗。

        非常感谢!

      • think says:

        请shi神帮帮忙,关于使用Image::Magick获得与GD、Imager等库相同的像素值的问题,实在进行不下去了。。。。。。

  2. think says:

    请问朋友试过imgseek-server没,我尝试在centos5上安装,总是通不过,希望能得到你的帮助,谢谢!

      • think says:

        Image::Imlib2能直接建立灰度图片吗?

        my $image = Image::Imlib2->load(“img/0.jpg”);
        my ($w,$h)=($image->get_width,$image->get_height);
        $image->crop(x=>$w-126-20, y=>$h-70-20, width=>126, height=>70);
        //$image->Quantize(colorspace => ‘gray’);
        //add_image(Image::Imlib2->load($tempfile), 0);
        //add_image($image, 0);//我希望在前面使用Image::Imlib2将图片处理成灰度图后,直接传递给add_imag方法使用,而不是使用别的方式(比如Image::Magick)处理图片后,再次用Image::Imlib2加载图片并传递给add_img,减少图片打开读取次数。

  3. beyondxgb says:

    shi神,codeforces Croc Champ 2012 — Qualification Round的E题,我用你的方法用c++写,但是TLE了,不知道为什么,是vector跟ArrayList的区别吗?求指教…谢谢!

  4. ZAKIR says:

    请问shi神是在EAGLE-Lab么?
    小弟今年考研失败,在考虑是调剂软院申请EAGLE-Lab还是直接去企鹅公司。
    想向shi神了解一下进了EAGLE-Lab项目组是不是就是进导师的公司干活?

    • watashi says:

      据我的了解差不多就是这样的
      做项目的话实验室接了什么你就做什么
      如果你一心想去产业界,对工作满意,对实验室又不满意,其实直接工作挺好的,个人感觉而已

  5. lmm333 says:

    shi神的博客可以ipv6访问,这是如何做到的呢?

  6. udonmai says:

    路过 わたし大神 膜拜 > <

  7. Thanks for the wondefull infomation. I may need to come back and see what others think about what you have said.

  8. winguse says:

    请问你的wp版本多少呢?那个代码高亮的,似乎不修改最新版本的还用不了~

  9. Lancelot says:

    弱问一下,据说大连赛区是ZJU出题,是真的吗?

  10. cloudfancy says:

    HI,能问一下你的vps服务商是啥么?

  11. daizhenyang says:

    shi哥不更新zoj报告了?

  12.  
Leave a Reply