小编nba*_*nic的帖子

Retinex算法实现

我需要在C#中实现Single Scale retinex和多尺度retinex算法,
我搜索了一下但是找不到任何有用的练习项目和代码的艺术
我正确理解我应该:

  1. 将RGB转换为YUV
  2. 使用高斯模糊滤镜模糊图像
  3. 使用I'(x,y)= 255*log10(I(x,y)/ G(x,y))+ 127.5
    I - 是照明,G - 高斯核,I' - 结果图像
  4. Сonvert回YUV到RGB

此代码无法正常工作

 public static Image<Bgr, byte> SingleScaleRetinex(this Image<Bgr, byte> img, int gaussianKernelSize, double sigma)
            {
                var radius = gaussianKernelSize / 2;
                var kernelSize = 2 * radius + 1;

                var ycc = img.Convert<Ycc, byte>();

                var sum = 0f;
                var gaussKernel = new float[kernelSize * kernelSize];
                for (int i = -radius, k = 0; i <= radius; i++, k++)
                {
                    for …
Run Code Online (Sandbox Code Playgroud)

.net c# image image-processing image-enhancement

2
推荐指数
1
解决办法
3554
查看次数

我看不到log2 + log3 + log4 = log(n!)

我看不到log2 + log3 + log4 + ... + log n = log(n!)值如何计算出来,但我不明白为什么会这样。请帮帮我!

math big-o recurrence

2
推荐指数
1
解决办法
1691
查看次数

不希望形式最小化

是否可以禁止在Delphi中最小化表单\应用程序?

我找到了以下代码:

procedure TForm1.WMShowWindow(var Msg: TWMShowWindow);
begin
  if not Msg.Show then
    Msg.Result := 0
  else
    inherited;
end;
Run Code Online (Sandbox Code Playgroud)

但是,如果我按下Windows键+ M或WindowsKey + D,它仍然会被最小化.有办法防止这种情况吗?

delphi minimize

1
推荐指数
1
解决办法
2345
查看次数

使用jQuery的$ .get时出错我得不到.

这很简单:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title></title>

<script src="jquery.js" type="text/javascript"></script>

<script type="text/javascript">
$(document).ready(function() {
        $.get("http://twitter.com/statuses/user_timeline/19092829.rss");
    });
</script>
</head>
<body>

</body>
</html>
Run Code Online (Sandbox Code Playgroud)

在IE和Opera中,这非常有效,但在FF 3.5,Chrome和Safari中我得到了400 Bad Request.使用Fiddler2和FireBug查看请求,有些东西正在用OPTIONS替换GET.但在IE和Opera中,它仍然显示为GET.我不明白????

编辑:我觉得这样的白痴甚至没有考虑XSS政策.多谢你们.

javascript jquery

1
推荐指数
1
解决办法
572
查看次数

我在HTML文件中看不到错误

我试图验证我的HTML代码,但我收到此错误:

第157行,第22列:文档类型不允许元素"div"在这里; 缺少"object","applet","map","iframe","button","ins","del"start-tag<div class="details">

提到的元素不允许出现在您放置它的上下文中; 其他提到的元素是唯一允许存在的元素,并且可以包含所提到的元素.这可能意味着您需要一个包含元素,或者您可能忘记关闭前一个元素.

此消息的一个可能原因是您尝试将块级元素(例如" <p>"或" <table>")放在内联元素(例如" <a>"," <span>"或" <font>")中.

但我在代码中看不到任何错误,所以我在寻求帮助......

<!--Bar 3-->

<div class="mosaic-block bar3">

<a href="http://www.desktopped.com/featured/2010/09/multi-d isplay-setup-with-four-systems-and-a-whole-lot-of- screen-space/" target="_blank" class="mosaic-overlay">

<div class="details">

<h4>Multi-Display Setup With Four Systems, A Wall of Screens, And 64TB Of Storage</h4>

<p>via Desktopped</p>

</div>

</a>

<a href="http://www.nonsensesociety.com/2010/12/i-am-not-hu man-portraits/" target="_blank" class="mosaic-backdrop"><img src="http://buildinternet.s3.amazonaws.com/projects/mos aic/64tb.jpg" alt="fotka1"/></a>

</div>
Run Code Online (Sandbox Code Playgroud)

html

1
推荐指数
1
解决办法
215
查看次数

为什么我不能使用自定义选择的属性?

我试图在我的HTML中使用自定义"selected"属性,jQuery总是返回此属性的错误值.我知道,"selected"在options标签中使用,但为什么我不能在其他标签中使用它?只看例子:http://jsfiddle.net/SE7FB/8/

<div class="category" selected="false">First</div>
<div class="category" selected="false">Second</div>
<div id="tester" style="width: 100px; height: 100px; float: right; background-color: black;"></div>
Run Code Online (Sandbox Code Playgroud)

JavaScript的:

$(".category").click(function () {
    $("#tester").css("background-color", "rgb(" + Math.floor(Math.random() * 255) + "," + Math.floor(Math.random() * 255) + "," + Math.floor(Math.random() * 255) + ")");
    $("#tester").append("<p>" + $(this).attr("selected") + "</p>");
    if ($(this).attr("selected") == "true") {
        $(this).css("background-color", "transparent");
        $(this).attr("selected", "false");
    } else if ($(this).attr("selected") == "false") {
        $(this).css("background-color", "blue");
        $(this).attr("selected", "true");
    }
});
Run Code Online (Sandbox Code Playgroud)

html javascript jquery

1
推荐指数
1
解决办法
73
查看次数

区分HTTP请求和Ajax请求

我目前正在研究ASP.NET WebApi和Angularjs

WebApi有一个方法

 [System.Web.Http.AcceptVerbs("POST")]
        [System.Web.Http.HttpPost]
        public HttpResponseMessage SearchAddress(SearchDetails searchDetail)
        {
            //13.03993,80.231867
            try
            {
                if (!WebSecurity.IsAuthenticated)
                {
                    HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.NotAcceptable);
                    return response;
                }
                List<CollegeAddress> CollegeAddress = addressService.GetAddressFromDistance(17.380498, 78.4864948, 2000);
                HttpResponseMessage responseData = Request.CreateResponse(HttpStatusCode.Accepted, CollegeAddress);
                return responseData;
            }
            catch (Exception e)
            {
                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.NotFound);
                return response;
            }
        }
Run Code Online (Sandbox Code Playgroud)

我必须从客户端调用此方法.

当我使用调用此方法时Ajax,它不起作用,searchDetail如果我使用Ajax ,则method参数始终为null.

$.ajax({
            method: 'POST',
            url: rootUrl + '/api/Address/SearchAddress',
            async: false,
            data: searchDetail,
            type: "json",
            headers: {
                'Content-Type': "application/json; charset=utf-8"
            }
        }).success(function (response) …
Run Code Online (Sandbox Code Playgroud)

javascript ajax http asp.net-web-api angularjs

1
推荐指数
1
解决办法
4432
查看次数

带有单选按钮的jQuery

这段代码出了什么问题?为什么它不显示价值?

<script>
    $(document).ready(function()
    {
        $('#radio_div').change(function(event){
            var value = $("input[@name='rdio']:checked").val();
            $('#update_text').html('Radio value:' + value);
        });
    });
    </script>
    </head>                                                                 
    <body>  

    <div id="radio_div">
        <input type="radio" name="rdio" value="a" />
        <input type="radio" name="rdio" value="b" />
        <input type="radio" name="rdio" value="c" />
    </div>
    <div id="update_text">Please push radio button</div>
Run Code Online (Sandbox Code Playgroud)

jquery

0
推荐指数
1
解决办法
643
查看次数

php换行问题

我有这个代码

if($hgroup['groupid'] == $row_groups['groupid']){
  $problem++;
  $hostname=DBfetch($cursor_gethost_again);
  $replace_macro=array('/{HOSTNAME}/','/{HOST.NAME}/');
  $problem_text=$problem_text.$trigger['description'];
  $problem_text=preg_replace($replace_macro,$hostname['name'],$problem_text);
  $problem_text=$problem_text."\r\n";
}
Run Code Online (Sandbox Code Playgroud)

它是一个循环生成的代码.任何人都可以帮助我如何制作那个愚蠢的换行符吗?我必须这样做,因为我正在修改一个代码.所以我想保持这种布局.
它不起作用.它会用文字打印出来.我也尝试preg_replace <br />.

php newline

0
推荐指数
1
解决办法
492
查看次数

我无法改变静态void(String [] args)

我无法在控制台应用程序中更改static void Main(string [] args).任何人都可以告诉我如何将其改为其他任何东西?

c#

-4
推荐指数
1
解决办法
886
查看次数