小编ChH*_*upt的帖子

HOG使用OpenCV,C++中的HOGDescriptor进行可视化

我使用OpenCV C++ Lib的HOGDescriptor来计算图像的特征向量.我想要想象源图像中的功能.谁能帮我?

c++ opencv feature-detection

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

在surfaceview和canvas上绘制Android

我有一个"简单"的问题.我试着在surfaceview上画画.布局XML:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:keepScreenOn="true"
    android:orientation="vertical" >

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/hello" />

    <SurfaceView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/imagesurface"
        android:layout_height="fill_parent"
        android:layout_width="fill_parent"
        android:background="#00ff00">
    </SurfaceView>

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

Activity是SurfaceHolder.Callback:

public class OpenCvonAndroidGTDforHOGActivity extends Activity implements SurfaceHolder.Callback{

    private SurfaceHolder _surfaceHolder;
    private SurfaceView _surfaceView;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        _surfaceView = (SurfaceView)findViewById(R.id.imagesurface);
        _surfaceHolder = _surfaceView.getHolder();
        _surfaceHolder.addCallback(this);
        _surfaceView.setWillNotDraw(false);

    }

    protected void onDraw(Canvas canvas) {
        canvas.drawRGB(255, 0, 255);            
    }

    public void surfaceCreated(SurfaceHolder holder) {
        Canvas canvas = null;
        try …
Run Code Online (Sandbox Code Playgroud)

android drawing

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

尝试使用Highgui.imread加载图像(OpenCV + Android)

我尝试加载图片:

    File root = Environment.getExternalStorageDirectory();
    File file = new File(root, "image.gif");
    Mat m = Highgui.imread(file.getAbsolutePath());
    if(file.exists()){
        showToast("Height: " + m.height() + " Width: " + m.width());
    }
Run Code Online (Sandbox Code Playgroud)

但是大小= 0(高度/宽度).

java android opencv image-processing

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