小编Joh*_*n55的帖子

用UIBezierPath - Swift表示CIRectangleFeature

目前我正在使用CIDetector来检测UIImage中的矩形.我正在做的建议方法是将坐标传递给过滤器以获取CIImage以放置所采用的UIImage.它看起来像这样:

func performRectangleDetection(image: UIKit.CIImage) -> UIKit.CIImage? {
    var resultImage: UIKit.CIImage?
    let detector:CIDetector = CIDetector(ofType: CIDetectorTypeRectangle, context: nil, options: [CIDetectorAccuracy : CIDetectorAccuracyHigh])
        // Get the detections
        let features = detector.featuresInImage(image)
        for feature in features as! [CIRectangleFeature] {
            resultImage = self.drawHighlightOverlayForPoints(image, topLeft: feature.topLeft, topRight: feature.topRight,
                                                        bottomLeft: feature.bottomLeft, bottomRight: feature.bottomRight)
        }
    return resultImage

}


func drawHighlightOverlayForPoints(image: UIKit.CIImage, topLeft: CGPoint, topRight: CGPoint,
                                   bottomLeft: CGPoint, bottomRight: CGPoint) -> UIKit.CIImage {

    var overlay = UIKit.CIImage(color: CIColor(red: 1.0, green: 0.55, blue: 0.0, alpha: 0.45))
    overlay = overlay.imageByCroppingToRect(image.extent) …
Run Code Online (Sandbox Code Playgroud)

image-processing ios uibezierpath swift cidetector

21
推荐指数
2
解决办法
3320
查看次数

网址丢失加号

我意识到在URL中,+符号表示空格,但是我需要保留加号。我怎样才能做到这一点?我的网址和代码如下:

http://www.example.com/path/test.php?test=2+2

<?php
$test = $_GET['test'];

echo $test;
?>
Run Code Online (Sandbox Code Playgroud)

打印出2 2

php url

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

标签 统计

cidetector ×1

image-processing ×1

ios ×1

php ×1

swift ×1

uibezierpath ×1

url ×1