我正在使用Java支持编译OpenCV 3.0.0.我的剧本是:
mkdir /opt/opencv /opt/opencv/opencv-build
cd /opt/opencv
git clone https://github.com/Itseez/opencv.git
cd /opt/opencv/opencv-build
export OPENCV_INSTALL_PATH=/opt/opencv
export FFMPEG_PATH=/opt/ffmpeg/ffmpeg_build/lib
export LD_LIBRARY_PATH=$OPENCV_INSTALL_PATH/lib:$FFMPEG_PATH:/opt/opencv/opencv/3rdparty/lib:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=/opt/ffmpeg/ffmpeg_build/lib/pkgconfig
cmake28 -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX="/opt/opencv" \
-D OPENCV_EXTRA_C_FLAGS="-DHAVE_CAMV4L -DHAVE_CAMV4L2" \
-D WITH_OPENCL=OFF -D BUILD_SHARED_LIBS=OFF ../opencv
make
make install
Run Code Online (Sandbox Code Playgroud)
正如http://docs.opencv.org/doc/tutorials/introduction/desktop_java/java_dev_intro.html中所述-D BUILD_SHARED_LIBS=OFF.
当我想测试安装时,我发现没有Highgui类,也没有路径.这是我的opencv-300.jar org.opencv文件夹内容:
calib3d
core
features2d
imgcodecs
imgproc
ml
objdetect
photo
utils
video
videoio
Run Code Online (Sandbox Code Playgroud)
我在安装过程中遗漏了什么?
我在评估来自Java / Scala的OpenCV 4.1.0中的多个神经网络时遇到问题。网络会返回全零的鱼自行车图像以及其他图像。我在以下方面观察到这一点:
检测可与YOLOv3-spp和YOLOv3-tiny https://pjreddie.com/darknet/yolo/一起使用。
这个dnn烹饪有什么问题?
// The reproduce in Scala REPL you need a hack:
def loadLibraryScalaREPL(libraryName: String): Unit = {
val loadLibrary0 = Runtime.getRuntime.getClass.getDeclaredMethods()(4)
loadLibrary0.setAccessible(true)
loadLibrary0.invoke(Runtime.getRuntime, scala.tools.nsc.interpreter.IMain.getClass, libraryName)
}
loadLibraryScalaREPL(org.opencv.core.Core.NATIVE_LIBRARY_NAME)
// To load in Java/Scala application just use System.loadLibrary.
import org.opencv.core.{Scalar, Size}
import org.opencv.dnn.Dnn
import org.opencv.imgcodecs.Imgcodecs
val image = Imgcodecs.imread("/root/fish-bike.jpg")
val net = Dnn.readNetFromCaffe("/tmp/VGG_coco_SSD_512x512_iter_360000.prototxt", "/tmp/VGG_coco_SSD_512x512_iter_360000.caffemodel")
val blob = Dnn.blobFromImage(image, 1/125.0, new Size(512, 512), new Scalar(104,117,123), true)
net.setInput(blob)
val layer …Run Code Online (Sandbox Code Playgroud) 我正在使用windows下的emacs cider开发clojure项目.有时我有一个问题,即在意外忘记println功能或打印大文件内容后,Emacs停止响应(光标和所有组合键都不起作用)并退回到自己处理该信息以在repl中显示它.继续我知道的唯一方法是从头开始关闭程序和打开项目文件.进入这个陷阱是如此简单.
还有其他更好的解决方案或配置限制吗?
我有一个从网络获取的pdf文件,它的链接周围有红色框。
我怎样才能摆脱它们?如何在没有它们的情况下查看文档?
PS我发现的东西:
pdf可能是由乳胶生成的,
非商业软件仅限于修改文档。
更新:
事实不同意只有作者才能改变 pdf 外观的观点。以下是 google chrome 中相同文档的示例。
我在scala中有一种方法
counts.writeAsText(path_to_file)
当文件已经存在并建议指定时,它将引发异常
File or directory already exists. Existing files and directories are not overwritten in NO_OVERWRITE mode. Use OVERWRITE mode to overwrite existing files and directories.。但是我没有在DataStream类中找到可以接受的方法org.apache.flink.core.fs.FileSystem.WriteMode。只有一个签名可以接受Long毫秒。
尝试在scala 2.10.4中使用0.10.0 flink版本的流API.在尝试编译第一个版本时:
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
import org.apache.flink.streaming.api.scala.DataStream
import org.apache.flink.streaming.api.windowing.time._
object Main {
def main(args: Array[String]) {
val env = StreamExecutionEnvironment.getExecutionEnvironment
val text = env.socketTextStream("localhost", 9999)
val words : DataStream[String] = text.flatMap[String](
new Function[String,TraversableOnce[String]] {
def apply(line:String):TraversableOnce[String] = line.split(" ")
})
env.execute("Window Stream wordcount")
}
}
Run Code Online (Sandbox Code Playgroud)
我收到编译时错误:
[error] found : String => TraversableOnce[String]
[error] required: org.apache.flink.api.common.functions.FlatMapFunction[String,String]
[error] new Function[String,TraversableOnce[String]] { def apply(line:String):TraversableOnce[String] = line.split(" ")})
[error] ^
Run Code Online (Sandbox Code Playgroud)
在我已经包含在项目中的反编译版本的DataStream.class中,有接受这种类型的函数(最后一个):
public <R> DataStream<R> flatMap(FlatMapFunction<T, R> flatMapper, TypeInformation<R> evidence$12, ClassTag<R> evidence$13) {
if (flatMapper …Run Code Online (Sandbox Code Playgroud) 这段代码出了什么问题?
#include "stdio.h"
typedef int type1[10];
typedef type1 *type2;
typedef struct {
int field1;
type2 field2;
} type3;
typedef type3 type4[5];
int main() {
type4 a;
a[0].(*field2[3]) = 99; // Line 16
return 0;
}
Run Code Online (Sandbox Code Playgroud)
获取:main.c:16:10:错误:在<(>令牌之前)的预期标识符
Gcc版本:gcc(GCC)4.7.2
我想将二进制文件标记为在CentOS 7.2上不需要可执行堆栈execstack,但是没有这样的实用程序并且yum找不到包execstack。为什么会这样呢?现在不使用该实用程序吗?
[root@localhost bin]# execstack
-bash: execstack: command not found
Run Code Online (Sandbox Code Playgroud)