我有一个名为C
在其索引中包含像素的二维数组。如何查看该像素值构成的图像,图像可以用数组来表示。没有尝试相反的过程,我只想看到灰度图像,因为名为的数组C
每个索引只有一个值。使用 python 进行编程
这是我的代码 http://pastebin.com/qmnKrtzu
在这一行中出现错误
ime = Image.fromarray(c)
ime.save("your_file.jpeg")
Run Code Online (Sandbox Code Playgroud)
ime = Image.fromarray(c_array)
arr = obj.__array_interface__
AttributeError: 'list' object has no attribute '__array_interface__'
任何人都可以请详细说明此代码中的引用行为,为什么它在第一行而不是11行打印12.
下面是代码
#include <cstdio>
using namespace std;
int &fun()
{
static int x = 10;
x++;
return x;
}
int main()
{
int *ptr=&fun();
int *ptr1=&fun();
printf("%p %p \t %d %d",(void*)ptr,(void*)ptr1,*ptr,*ptr1);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
代码的输出是
134519132 134519132 12 12
请解释为什么12在第一次通话时打印而不是11我知道在第二次通话时它应该打印12
我是新手,我正在尝试访问灰度图像的像素值
这是我的代码
im = cv.LoadImage("new.bmp")
# displaying the matrix form of image
for i in range(im.height):
for j in range(im.width):
print im[i,j],
print "\n",i
Run Code Online (Sandbox Code Playgroud)
我正在获取 RGB 每个像素值的输出,请参阅输出的快照
/* 我正在使用ajax动态创建表*/
$(".n").click(function(){
var id= $(this).closest('tr').find('td.ide2').html();
//for displaying the table
$.ajax({
type: 'POST',
url: '<?php echo base_url(); ?>Admin/show', //We are going to make the request to the method "list_dropdown" in the match controller
dataType:'json',
data: {'id':id}, //POST parameter to be sent with the tournament id
success: function(resp) {
for(var i=0;i<(resp.length);i++)
{
var row = $('<tr></tr>').appendTo($("#unique-list"));
$('<td />',{text:resp[i]}).appendTo(row);
$('<td class="off-del glyphicon glyphicon-minus"></td>').appendTo(row);
}//end for loop
} //end success
}); //end ajax
$(".off-del").click(function(){
alert('hello');
var id= $(this).closest('tr').find($(":first-child")).html();
console.log(id);
});
});
Run Code Online (Sandbox Code Playgroud)
单击的事件 …
我希望在关闭此模态时触发事件.当我们点击关闭按钮或关闭按钮外的任何地方时,模型会关闭
<a href='#part-3' data-toggle='modal' id='sss' style='float:right; color:black;' >view</a></center>
//code for modal
<div class="modal modal-wide fade" id="part-3" >
<div class="modal-dialog" style="min-width:60%">
<div class="modal-content" >
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" >×</button>
</div>
<div class="modal-body">
<div class="show">
//the html code of form which is popped up
</div>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我可以通过关闭按钮来关闭模式时轻松创建一个jquery事件,给它一个id,但是当用户点击模态外的任何地方时,如何触发/应该是该触发器的名称.