小编chA*_*Ami的帖子

如何在opencv java api中将MatOfPoint转换为MatOfPoint2f

我正在尝试 使用opencv java api 实现以下问题的示例代码 .要findContours(gray, contours, CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE);在java中实现,我使用了这种语法Imgproc.findContours(gray, contours, new Mat(), Imgproc.RETR_LIST, Imgproc.CHAIN_APPROX_SIMPLE);.

所以现在轮廓应该List<MatOfPoint> contours = new ArrayList<MatOfPoint>();而不是vector<vector<cv::Point> > contours;.

然后我需要实现这个approxPolyDP(Mat(contours[i]), approx, arcLength(Mat(contours[i]), true)*0.02, true);.在java api中,Imgproc.approxPolyDP接受参数为approxPolyDP(MatOfPoint2f curve, MatOfPoint2f approxCurve, double epsilon, boolean closed).我如何将MatOfPoint转换为MatOfPoint2f?

或者有没有办法使用与c ++接口相同的向量来实现它.任何建议或示例代码都非常感谢.

java android opencv image-processing

37
推荐指数
3
解决办法
2万
查看次数

JCombobox的圆形弹出窗口

我使用灵气作为L&F,但我真的很喜欢像seaglass L&F 那样的圆形组合框下拉.见下图.

雨云

在此输入图像描述

SEAGLASS

在此输入图像描述

我怎样才能达到这个效果?覆盖油漆在这里有用吗?方法是什么?

java swing popup rounded-corners jcombobox

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

在android中保存为png图像

我正在开发绘画应用程序,我将我的绘图保存为png图像.对于绘制,我使用了使用位图创建的画布.它工作但图像已损坏.谁能帮我.我没有用真正的手机检查它,但是在模拟器上.这是模拟器的问题.我认为它具有非常小的处理能力.我对吗?谢谢.

android canvas bitmap save android-emulator

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

在android中使用边缘检测选择区域后裁剪图像

我想自动选择要稍后裁剪的页面区域.我认为边缘检测可能是有用的,并使用canny边缘检测来查找图像的边缘.现在我有这个形象!但我不清楚选择页面区域为矩形.任何人都可以建议这个问题的方法或实现?我真正想要做的是选择页面区域如下. 有没有其他方法可以做到这一点?我还在使用matlab的数字图像处理介绍书中看到了边界检测.但我对此并不熟悉.我可以将它用于此目的吗?

java android opencv image-processing edge-detection

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

将文本视图添加到曲面视图

我在我的应用程序中使用它作为表面视图,现在我想以编程方式添加文本视图.我怎样才能做到这一点.

"<com.csfcse.udrawer.UdrawerDrawingSurface
  android:layout_width="fill_parent" 
  android:layout_height="fill_parent"
  android:id="@+id/drawingSurface" 
        android:layout_gravity="left" />"
Run Code Online (Sandbox Code Playgroud)

谢谢......

layout android textview surfaceview

3
推荐指数
2
解决办法
2万
查看次数

删除对可编辑jtable单元格的关注

双击jtable的可编辑单元格时,如此处显示.

跟随

我需要的是如果用户在输入值之前按下鼠标在按钮之外,则应自动输入现有值,输出应如下所示.

后

任何帮助或建议将不胜感激.

java user-interface swing jtable tablecelleditor

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

启动窗口在mac中不起作用

在显示JAVA 6 Splash屏幕时遇到问题我使用以下方法来显示启动窗口.

File splashImageFile = new File(Constants.PATH_IMAGE + "splash.png");
        final BufferedImage img = ImageIO.read(splashImageFile);
        final JWindow window = new JWindow() {
            private static final long serialVersionUID = -132452345234523523L;

            @Override
            public void paint(Graphics g) {
                Graphics2D g2 = (Graphics2D) g.create();
                g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
            RenderingHints.VALUE_ANTIALIAS_ON);
                Rectangle windowRect = getBounds();
                try {
                    Robot robot = new Robot(getGraphicsConfiguration().getDevice());                        
                    BufferedImage capture = robot.createScreenCapture(new Rectangle(windowRect.x, windowRect.y, windowRect.width, windowRect.height));
                    g2.drawImage(capture, null, 0, 0);
                } catch (IllegalArgumentException iae) {
                    System.out.println("Argumets mis matched.\n" + iae.getMessage());
                } catch(SecurityException se){
                    System.out.println("Security permission …
Run Code Online (Sandbox Code Playgroud)

java user-interface swing splash-screen

3
推荐指数
2
解决办法
551
查看次数