从已知点对照片进行白平衡

2024-02-27

白平衡是一个相当广泛的主题,但我看到的大多数答案都涵盖了整个图像的自动白平衡技术,该技术没有已知的白色、灰色和黑色点。我似乎找不到很多从已知点涵盖白平衡的内容。我有一个脚本(如下),它拍摄色卡 (Spyder Checkr 48) 的图像并返回白色、20% 灰色和黑色色卡块:

Color       L      A     B     sR   sG   sB   aR   aG   aB
Card White  96.04  2.16  2.6   249  242  238  247  242  237
20% Gray    80.44  1.17  2.05  202  198  195  199  196  193
Card Black  16.91  1.43  -0.81 43   41   43   46   46   47

问题:由于我知道图像特定部分的真实 LAB、sRGB 和 Adob​​eRGB 值,那么对图像进行白平衡的最佳方法是什么?

这是我正在使用的图像的链接。 https://drive.google.com/drive/folders/1DVSPXk2Mbj8jpAU2EeZfK8d2HZM9taiH?usp=sharing这是提取色卡块的代码(我目前在 Windows、Python 3.7 上运行它):

from __future__ import print_function
import cv2
import imutils
import numpy as np
from matplotlib import pyplot as plt
import os
import sys

image = cv2.imread("PATH_TO_IMAGE")
template = cv2.imread("PATH_TO_TEMPLATE")
rtemplate = cv2.imread("PATH_TO_RIGHT_TEMPLATE")


def sift(image):
    sift = cv2.xfeatures2d.SIFT_create()
    kp, des = sift.detectAndCompute(image, None)
    return kp, des

def sift_match(im1, im2, vis=False, save=False):
    MIN_MATCH_COUNT = 10
    FLANN_INDEX_KDTREE = 0
    kp1, des1 = sift(im1)
    kp2, des2 = sift(im2)

    index_params = dict(algorithm=FLANN_INDEX_KDTREE, trees=7)

    search_params = dict(checks=100)

    flann = cv2.FlannBasedMatcher(index_params, search_params)

    matches = flann.knnMatch(des1, des2, k=2)

    # Need to draw only good matches, so create a mask
    matchesMask = [[0, 0] for i in range(len(matches))]

    if vis is True:
        draw_params = dict(matchColor=(0, 255, 0),
                           singlePointColor=(255, 0, 0),
                           matchesMask=matchesMask,
                           flags=0)

        im3 = cv2.drawMatchesKnn(im1, kp1, im2, kp2, matches, None, **draw_params)

        if save:
            cv2.imwrite("tempSIFT_Match.png", im3)

        plt.imshow(im3), plt.show()
    good = []
    for m, n in matches:
        if m.distance < 0.75 * n.distance:
            good.append(m)
    return kp1, des1, kp2, des2, good



def smartextractor(im1, im2, vis=False):

    # Detect features and compute descriptors.
    kp1, d1, kp2, d2, matches = sift_match(im1, im2, vis)
    kp1 = np.asarray(kp1)
    kp2 = np.asarray(kp2)

    # Extract location of good matches
    points1 = np.zeros((len(matches), 2), dtype=np.float32)
    points2 = np.zeros((len(matches), 2), dtype=np.float32)

    for i, match in enumerate(matches):
        points1[i, :] = kp1[match.queryIdx].pt
        points2[i, :] = kp2[match.trainIdx].pt

    # Find homography
    h, mask = cv2.findHomography(points1, points2, cv2.RANSAC)

    if h is None:
        print("could not find homography")
        return None, None

    # Use homography
    height, width, channels = im2.shape
    im1Reg = cv2.warpPerspective(im1, h, (width, height))

    return im1Reg, h


def show_images(images, cols=1, titles=None):
    """
    Display a list of images in a single figure with matplotlib.
    """
    assert ((titles is None) or (len(images) == len(titles)))
    n_images = len(images)
    if titles is None: titles = ['Image (%d)' % i for i in range(1, n_images + 1)]
    fig = plt.figure()
    for n, (image, title) in enumerate(zip(images, titles)):
        a = fig.add_subplot(cols, np.ceil(n_images / float(cols)), n + 1)
        if image.ndim == 2:
            plt.gray()
        plt.imshow(image)
        a.set_title(title)
    fig.set_size_inches(np.array(fig.get_size_inches()) * n_images)
    plt.show()


def Sobel(img, bilateralFilter=True):
    # timestart = time.clock()
    try:
        img = cv2.imread(img, 0)
    except TypeError:
        None
    try:
        rheight, rwidth, rdepth = img.shape
        img1 = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
    except ValueError:
        raise TypeError
    # cv2.imwrite('temp.png',img)
    _, s, v = cv2.split(img1)
    b, g, r = cv2.split(img)
    if bilateralFilter is True:
        s = cv2.bilateralFilter(s, 11, 17, 17)
        v = cv2.bilateralFilter(v, 11, 17, 17)
        b = cv2.bilateralFilter(b, 11, 17, 17)
        g = cv2.bilateralFilter(g, 11, 17, 17)
        r = cv2.bilateralFilter(r, 11, 17, 17)
    # calculate sobel in x,y,diagonal directions with the following kernels
    sobelx = np.array([[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]], dtype=np.float32)
    sobely = np.array([[-1, -2, -1], [0, 0, 0], [1, 2, 1]], dtype=np.float32)
    sobeldl = np.array([[0, 1, 2], [-1, 0, 1], [-2, -1, 0]], dtype=np.float32)
    sobeldr = np.array([[2, 1, 0], [1, 0, -1], [0, -1, -2]], dtype=np.float32)
    # calculate the sobel on value of hsv
    gx = cv2.filter2D(v, -1, sobelx)
    gy = cv2.filter2D(v, -1, sobely)
    gdl = cv2.filter2D(v, -1, sobeldl)
    gdr = cv2.filter2D(v, -1, sobeldr)
    # combine sobel on value of hsv
    xylrv = 0.25 * gx + 0.25 * gy + 0.25 * gdl + 0.25 * gdr

    # calculate the sobel on saturation of hsv
    sx = cv2.filter2D(s, -1, sobelx)
    sy = cv2.filter2D(s, -1, sobely)
    sdl = cv2.filter2D(s, -1, sobeldl)
    sdr = cv2.filter2D(s, -1, sobeldr)
    # combine sobel on value of hsv
    xylrs = 0.25 * sx + 0.25 * sy + 0.25 * sdl + 0.25 * sdr

    # combine value sobel and saturation sobel
    xylrc = 0.5 * xylrv + 0.5 * xylrs
    xylrc[xylrc < 6] = 0

    # calculate the sobel on value on green
    grx = cv2.filter2D(g, -1, sobelx)
    gry = cv2.filter2D(g, -1, sobely)
    grdl = cv2.filter2D(g, -1, sobeldl)
    grdr = cv2.filter2D(g, -1, sobeldr)
    # combine sobel on value on green
    xylrgr = 0.25 * grx + 0.25 * gry + 0.25 * grdl + 0.25 * grdr

    # calculate the sobel on blue
    bx = cv2.filter2D(b, -1, sobelx)
    by = cv2.filter2D(b, -1, sobely)
    bdl = cv2.filter2D(b, -1, sobeldl)
    bdr = cv2.filter2D(b, -1, sobeldr)
    # combine sobel on value on blue
    xylrb = 0.25 * bx + 0.25 * by + 0.25 * bdl + 0.25 * bdr

    # calculate the sobel on red
    rx = cv2.filter2D(r, -1, sobelx)
    ry = cv2.filter2D(r, -1, sobely)
    rdl = cv2.filter2D(r, -1, sobeldl)
    rdr = cv2.filter2D(r, -1, sobeldr)
    # combine sobel on value on red
    xylrr = 0.25 * rx + 0.25 * ry + 0.25 * rdl + 0.25 * rdr

    # combine value sobel and saturation sobel
    xylrrgb = 0.33 * xylrgr + 0.33 * xylrb + 0.33 * xylrr
    xylrrgb[xylrrgb < 6] = 0

    # combine HSV and RGB sobel outputs
    xylrc = 0.5 * xylrc + 0.5 * xylrrgb
    xylrc[xylrc < 6] = 0
    xylrc[xylrc > 25] = 255

    return xylrc

print("extracting image")
extractedImage, _ = smartextractor(image, template)

print("extracting right image")
rextractedImage, _ = smartextractor(extractedImage, rtemplate, vis=False)
grextractedImage = cv2.cvtColor(rextractedImage, cv2.COLOR_BGR2GRAY)
bfsobelImg = Sobel(rextractedImage)
sobelImg = Sobel(rextractedImage, bilateralFilter=False)
csobelImg = cv2.add(bfsobelImg, sobelImg)
csobelImg[csobelImg < 6] = 0
csobelImg[csobelImg > 18] = 255

csobelImg = csobelImg.astype(np.uint8)
img2 = csobelImg.copy()
ret, thresh = cv2.threshold(img2, 18, 255, 0)
contours = cv2.findContours(thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)

contours = imutils.grab_contours(contours)
contours = sorted(contours, key=cv2.contourArea, reverse=True)



count = 0
trigger = False
for c in contours:
    # approximate the contour
    peri = cv2.arcLength(c, True)
    contours[count] = cv2.approxPolyDP(c, 0.05 * peri, True)

    if len(contours[count]) == 4:
        if trigger is False:
            screenCnt = contours[count]
            trigger = True

    count += 1

tl = screenCnt[0]
tr = screenCnt[1]
bl = screenCnt[3]
br = screenCnt[2]

tLy, tLx = tl[0]
tRy, tRx = tr[0]
bLy, bLx = bl[0]
bRy, bRx = br[0]

ratio = .15
realSpace = (3/16)
boxwidth = int(((tRx - tLx) + (bRx - bLx))*.5 - (tLx + bLx)*.5)
boxheight = int(((bRy - tRy) + (bLy - tLy))*.5 - (tRy + tLy)*.5)
spaceWidth = int((boxwidth + boxheight)*.5*realSpace)
boxcenter = [int(((bRy - tRy)*.5 + (bLy - tLy)*.5)*.5), int(((tRx - tLx)*.5 + (bRx - bLx)*.5)*.5)]
roitl = [boxcenter[0] - int(ratio*boxheight), boxcenter[1] - int(ratio*boxwidth)]
roitr = [boxcenter[0] - int(ratio*boxheight), boxcenter[1] + int(ratio*boxwidth)]
roibl = [boxcenter[0] + int(ratio*boxheight), boxcenter[1] - int(ratio*boxwidth)]
roibr = [boxcenter[0] + int(ratio*boxheight), boxcenter[1] + int(ratio*boxwidth)]

spacing = int((boxwidth + boxheight)*.5)+spaceWidth
roiWhite = np.array((roitl, roitr, roibr, roibl))


roiGray = np.array(([roitl[1], roitl[0]+spacing*1], [roitr[1], roitr[0]+spacing*1],
                    [roibr[1], roibr[0]+spacing*1], [roibl[1], roibl[0]+spacing*1]))

roiBlack = np.array(([roitl[1], roitl[0]+spacing*6], [roitr[1], roitr[0]+spacing*6],
                     [roibr[1], roibr[0]+spacing*6], [roibl[1], roibl[0]+spacing*6]))

whiteAvgb, whiteAvgg, whiteAvgr, _ = cv2.mean(rextractedImage[(roitl[0]+spacing*0):(roibr[0]+spacing*0),
                                              roitl[1]:roibr[1]])
grayAvgb, grayAvgg, grayAvgr, _ = cv2.mean(rextractedImage[(roitl[0]+spacing*1):(roibr[0]+spacing*1),
                                           roitl[1]:roibr[1]])
blackAvgb, blackAvgg, blackAvgr, _ = cv2.mean(rextractedImage[(roitl[0]+spacing*6):(roibr[0]+spacing*6),
                                              roitl[1]:roibr[1]])

whiteROI = rextractedImage[(roitl[0]+spacing*0):(roibr[0]+spacing*0), roitl[1]:roibr[1]]
grayROI = rextractedImage[(roitl[0]+spacing*1):(roibr[0]+spacing*1), roitl[1]:roibr[1]]
blackROI = rextractedImage[(roitl[0]+spacing*6):(roibr[0]+spacing*6), roitl[1]:roibr[1]]
imageList = [whiteROI, grayROI, blackROI]
show_images(imageList, cols=1)

correctedImage = rextractedImage.copy()

whiteROI[:, :, 0] = whiteAvgb
whiteROI[:, :, 1] = whiteAvgg
whiteROI[:, :, 2] = whiteAvgr

grayROI[:, :, 0] = grayAvgb
grayROI[:, :, 1] = grayAvgg
grayROI[:, :, 2] = grayAvgr

blackROI[:, :, 0] = blackAvgb
blackROI[:, :, 1] = blackAvgg
blackROI[:, :, 2] = blackAvgr

imageList = [whiteROI, grayROI, blackROI]
show_images(imageList, cols=1)

# SPYDER COLOR CHECKR Values: http://www.bartneck.de/2017/10/24/patch-color-definitions-for-datacolor-spydercheckr-48/

blank = np.zeros_like(csobelImg)
maskedImg = blank.copy()
maskedImg = cv2.fillConvexPoly(maskedImg, roiWhite, 255)
maskedImg = cv2.fillConvexPoly(maskedImg, roiGray, 255)
maskedImg = cv2.fillConvexPoly(maskedImg, roiBlack, 255)

res = cv2.bitwise_and(rextractedImage, rextractedImage, mask=maskedImg)
# maskedImg = cv2.fillConvexPoly(maskedImg, roi2Black, 255)

cv2.drawContours(blank, contours, -1, 255, 3)

outputSquare = np.zeros_like(csobelImg)
cv2.drawContours(outputSquare, [screenCnt], -1, 255, 3)

imageList = [rextractedImage, grextractedImage, bfsobelImg, sobelImg, csobelImg, blank, outputSquare, maskedImg, res]
show_images(imageList, cols=3)

sys.exit() 

给定白色块的 RGB 值,可以通过除以该值来校正图像的白平衡。也就是说,应用线性变换,使白色斑块在三个通道中具有相同的级别:

lum = (whiteR + whiteG + whiteB)/3
imgR = imgR * lum / whiteR
imgG = imgG * lum / whiteG
imgB = imgB * lum / whiteB

乘以lum使得平均强度不会改变。

(计算lum如果使用适当的权重会更好:0.2126、0.7152、0.0722,但我想保持简单。如果输入的白色远远偏离目标,这只会产生很大的差异,在这种情况下,您还会遇到其他问题。)

Note这种变换最适合应用于线性 RGB 空间。如果图像以 sRGB 或类似格式存储(来自相机的原始图像将是线性 RGB,JPEG 将是 sRGB),则图像和白色的 RGB 值都应首先转换为线性 RGB。看here https://en.wikipedia.org/wiki/SRGB#The_reverse_transformation为相关方程。

为了获得更好的精度,您还可以使用灰色块的 RGB 值来应用上述内容。取平均乘法因子(whiteR/lum)从每个通道的白色和灰色补丁中导出,并将它们应用到图像。

在确定白色 RGB 值并校正白平衡之前,可以从图像中减去黑色电平。这将改善对比度和色彩感知,但不是白平衡的一部分。

全色彩校正要复杂得多,我不会详细讨论。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

从已知点对照片进行白平衡 的相关文章

  • 在 opencv 中一次性将旋转和平移结合起来

    我有一段用于旋转和平移图像的代码 Point2f pt 0 in rows double angle atan trans c trans b 180 M PI Mat r getRotationMatrix2D pt angle 1 0
  • 字符串中数字的连续相加

    我是一名正在学习 python 的新程序员 并且在如何完成此任务方面遇到了困难 所以本质上我有一个从文件导入的数字字符串需要读取 并且需要将第一个数字的总和添加到第二个数字并将其转换为正确的 ascii 字符 因此 例如 如果我正在读取字符
  • 使用unicode在hdf5中存储字符串数据集

    我试图从包含特殊字符的文件中存储变量字符串表达式 例如 and 这是我的代码 import h5py as h5 file h5 File deleteme hdf5 a dt h5 special dtype vlen str dset
  • 布尔 pandas 之间的操作对称性破缺。具有不等索引的系列

    隐式索引匹配pandas用于不同之间的操作DataFrame Series很棒 而且大多数时候 它都有效 但是 我偶然发现了一个无法按预期工作的示例 import pandas as pd 0 21 0 import numpy as np
  • Python替换多个字符串同时支持反向引用

    有一些好方法 https stackoverflow com questions 6116978 python replace multiple strings处理 python 中的同时多字符串替换 但是 我在创建一个高效的函数来实现这一
  • 如何获取 sklearn.metrics.classification_report 的输出作为字典?

    我一直在尝试以字典的形式获得分类报告 所以根据 scikit learn 0 20 文档 我这样做 from sklearn import metrics rep metrics classification report y true y
  • pyVISA:以编程方式将仪器返回到本地模式

    我正在使用 pyVISA 来控制 GPIB 网络中的一些仪器 当我创建资源管理器时 GPIB 网络中的所有仪器都会进入远程模式 因此前面板显示被锁定并且不会更新 当我关闭资源管理器时 仪器仍处于远程模式 import visa rm vis
  • 如何使用 pyinstaller 包含文件?

    我也使用 tkinter 使用 python 3 7 编写了一个程序 由于我使用的是外部图片 因此当我将所有内容编译为一个 exe 时 我需要包含它们 我试过做 add data bg png files 但我仍然收到此错误 tkinter
  • 如何在 Python 3 中循环遍历集合,同时从集合中删除项目

    这是我的情况 我有一个list set 哪个并不重要 movieplayer我想调用的对象 preload 功能开启 该预加载函数可以立即返回 但希望将来返回一点 我想存储这个电影播放器 集合 表明它们尚未预加载 然后循环它们 调用prel
  • PyMC3-自定义 theano Op 进行数值积分

    我使用 PyMC3 进行参数估计 使用必须定义的特定似然函数 我用谷歌搜索了一下 发现我应该使用densitydist实现用户定义的似然函数的方法 但它不起作用 如何在 PyMC3 中合并用户定义的似然函数并找出最大 aposteriori
  • 动态 __init_subclass__ 方法的参数绑定

    我正在尝试让类装饰器工作 装饰器会添加一个 init subclass 方法到它所应用的类 但是 当该方法动态添加到类中时 第一个参数不会绑定到子类对象 为什么会发生这种情况 举个例子 这是可行的 下面的静态代码是我试图最终得到的示例 cl
  • 如何循环遍历字典列表并打印特定键的值?

    我是 Python 新手 有一个问题 我知道这是一个非常简单的问题 运行Python 3 4 我有一个需要迭代并提取特定信息的列表 以下是列表 称为部分 的示例 已截断 数千个项目 state DEAD id phwl type name
  • 如何在Python 3中将文本流编码为字节流?

    将字节流解码为文本流很容易 import io f io TextIOWrapper io BytesIO b Test nTest n utf 8 f readline 在这个例子中 io BytesIO b Test nTest n 是
  • Windows 中的 Python 多处理池奇怪行为

    Python 多处理池在 Linux 和 Windows 之间有不同的行为 当按工作人员数量运行方法映射时 在 Linux 中 它会在您作为参数提供的特定函数的范围内运行该进程 但在 Windows 中 每个工作进程都在父进程的范围内运行
  • Python:处理图像并保存到文件流

    我需要使用 python 处理图像 应用过滤器和其他转换 然后使用 HTTP 将其提供给用户 现在 我正在使用 BaseHTTPServer 和 PIL 问题是 PIL 无法直接写入文件流 因此我必须写入临时文件 然后读取该文件 以便将其发
  • 如何将 Emgu.Cv.Image 转换为 System.Image

    我是 Emgu Cv 的新手 我想知道是否有人可以让我知道如何将 Emgu Cv Image 更改为 System Image 如果需要进一步解释 请告诉我 我会这样做 我的语言我使用的是C 你可以只使用ToImage 方法得到一个Syst
  • 在 SSLwrapp() 之前在原始套接字上接收/发送,Python

    我想知道在包装原始套接字之前是否可以在原始套接字上接收 发送数据 我已经查看了文档并搜索了它 但找不到任何具体内容 我基本上想做的事情 client addr listeningSocket accept client recv 32 cl
  • 在 pandas 中获取组名称的有效方法

    我有一个包含大约 300 000 行的 csv 文件 我将其设置为按特定列分组 每个组大约有 140 名成员 总共 2138 个组 我正在尝试生成组名称的 numpy 数组 到目前为止 我已经使用 for 循环来生成名称 但处理所有内容都需
  • 使用Python对图像进行反转和平移

    我编写了以下代码来循环遍历文件夹中的所有图像 创建其底片并将其保存在新的相似名称下 我怎样才能做同样的事情来将它们向右平移 5 个像素 Code from PIL import Image import PIL ImageOps impor
  • scrapy获取同一个类的第n个子文本

    我附上了一张照片 我面临的问题是获取同一类的第一个元素 我想得到 adxHeader gt adxExtraInfo 1st one gt adxExtraInfoPart 1st one gt a text 我编写了以下代码但不起作用 任

随机推荐

  • 将 HTML 转换为 Word 文件?

    如何将 ruby 文件转换为 word 文件 即 docx 文件 对于pdf 大家宝石大虾 但是有没有word文件的gem 我正在尝试将我的html文件转换为word文件 以便用户也可以编辑它 这种情况应该怎么办 我本来打算将该文件转换为w
  • 白线出现在特定浏览器宽度的渐变填充 div 的末尾

    我有一个带有 id 的 div gradient div with a background image set to linear gradient 我在线性渐变的末尾和 div 的末尾之间发现了间隙 gradient div仅在某些浏览
  • 如何动态访问 Django 模型字段详细名称?

    我想访问我的模型字段 verbose name 我可以通过这样的字段索引来获取它 model meta fields 2 verbose name 但我需要动态获取它 理想情况下应该是这样的 model meta fields locati
  • 使用 Spring Data 从 RDBMS 刷新 ElasticSearch 索引

    我有以下设置 Mysql RDBMS 服务器 弹性搜索服务器 我的要求是定期从 MYSQL RDBMS 复制数据并用它更新弹性服务器 目前我正在遵循以下方法 使用 Spring Data Jpa 从 MYSQL 读取所有数据的批处理作业 然
  • 如何在 Rust 中创建参数化测试?

    我想编写依赖于参数的测试用例 我的测试用例应该针对每个参数执行 我想看看每个参数是否成功或失败 我习惯用Java编写这样的东西 RunWith Parameterized class public class FibonacciTest P
  • STL容器的二进制兼容性

    假设我用 C 编写了一个 DLL 并且想要导出一个采用 std vector 参数的方法 我可以希望不同的 STL 版本之间有二进制兼容性吗 我不知道版本之间的兼容性有任何保证 甚至同一编译器上的发布和调试之间也没有保证 一种解决方案是为向
  • SQL:找出每个组每个 ID 的所有可能的年份组合

    我正在使用 Netezza SQL 我有以下关于学生 2010 2015 年 的数据集 my table 他们当前就读的学位专业 参加考试的日期以及考试结果 student id current major year exam result
  • Cakephp 导入控制器

    我是 cakephp 的新手 我想在我的控制器中导入控制器 所以我使用以下语法 这是我导入用户控制器的控制器 用户控制器 php function api work data this gt User gt find all this gt
  • 半角和全角字符的用途是什么?

    半角字符和全角字符的用途是什么 它们之间有什么区别 我很好奇是因为验证器 js https github com chriso validator js 一个开源字符串验证库 有几个函数可以评估form http en wikipedia
  • Pandas 用组值填充 NA [重复]

    这个问题在这里已经有答案了 给定以下数据框 import pandas as pd import numpy as np df pd DataFrame Site A A A B B B C C C Value np nan 1 np na
  • Magento 2 Rest Api 在产品更新时过于频繁地清除缓存

    我们对 Magento 2 的 Api 存在一个问题 涉及全页缓存以及来自 ERP 系统的其余 API 的更新 ERP 不断通过 API 推送库存 库存和产品更新 进而刷新每次产品更新的缓存 从而形成始终不缓存的网站 我们尝试包装 Flus
  • 以编程方式下载视频android的第一帧

    我想从我的 Android 应用程序的服务器下载视频文件的单帧 我不想下载前面的完整视频 使用该帧作为缩略图向用户显示 以便用户选择后可以下载 ffmpeg可以使用以下命令从视频流创建缩略图 ffmpeg itsoffset 4 i htt
  • MPI中如何获取物理机的数量

    我可以用MPI Comm size获取处理器总数 但是如何获取真实物理机的数量呢 If by 物理机你的意思是一组处理元素 共享公共内存地址空间 然后是 MPI 3 按类型分割操作MPI COMM SPLIT TYPE可用于便携式获取此类机
  • PHP和2多维数组基于两个键值进行比较

    我有两个像这样的多维数组 original Array 0 gt Array time gt 1364690340 memberid gt 90 type gt single 1 gt Array time gt 1364690341 me
  • 在不使用 CAP_FIRST 的情况下将列中多个单词的首字母大写

    我有一张如下表 Name firstname lastname FirstName Lastname firstName Lastname FirstName lastname 我正在尝试将每个字母大写firstname and lastn
  • 如何使用 Zend DB 执行 MySQL IN 子句?

    我正在尝试使用 Zend Framework 1 11 获取整数数组中的行 this gt dbSelect gt from table prefix product link gt joinLeft table prefix produc
  • Qt如何连接rubberBandChanged信号

    我尝试将 QChartView 类中的 ruby BandChanged 信号链接到 MainWindow 类中的特定函数 主窗口 h class MainWindow public QMainWindow Q OBJECT public
  • Python paramiko 线程安全吗?

    我想在并行执行某些命令时轮询系统状态 例如内存负载或 CPU 负载 我可以在多个 Python 线程中使用一个 Paramiko 客户端还是必须连接多个 Paramiko 客户端 我找不到任何有关 Paramiko 线程安全的文档 感谢您的
  • System.getProperty("os.arch") 在 M1 Mac 上的价值?

    有什么价值System getProperty os arch 返回运行的 Apple Silicon M1 Macaarch64JDK 的端口 例如Liberica https bell sw com端口 即not使用罗塞塔2 基于thi
  • 从已知点对照片进行白平衡

    白平衡是一个相当广泛的主题 但我看到的大多数答案都涵盖了整个图像的自动白平衡技术 该技术没有已知的白色 灰色和黑色点 我似乎找不到很多从已知点涵盖白平衡的内容 我有一个脚本 如下 它拍摄色卡 Spyder Checkr 48 的图像并返回白