安卓手机APP 开发

article/2025/9/15 16:19:13

最近在准备开题报告,已经很久没再写博客了,明天要开题答辩了,十分紧张,写个博客,放松一下,祝自己明天顺利通过。哈哈!!!!!

前一阵子,学习了一下java安卓开发,做了一个小东西,就是自己用玩的。本来还要写一些关于智能算法和React的程序,但是时间恐怕不太够了,算了,等下次有时间再写吧,反正技多不压身。

程序的目录

在这里插入图片描述
在这里插入图片描述

ActivityCollector.java

package com.example.myhomework;import android.app.Activity;
import java.util.ArrayList;
import java.util.List;public class ActivityCollector {public static List<Activity> activities = new ArrayList<>();public static void addActivity(Activity activity) {activities.add(activity);}public static void removeActivity(Activity activity) {activities.remove(activity);}public static void finishAll() {for  (Activity activity : activities){if (!activity.isFinishing()){activity.finish();}}}
}

BaseActivity.java

package com.example.myhomework;import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;public class BaseActivity extends AppCompatActivity {private ForceOfflineReceiver receiver;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);Log.v("BaseActivity","广播接收器已创建");ActivityCollector.addActivity(this);}@Overrideprotected void onResume() {super.onResume();IntentFilter intentFilter = new IntentFilter();intentFilter.addAction("com.example.myhomework.FORCE_OFFLINE");receiver = new ForceOfflineReceiver();registerReceiver(receiver, intentFilter);Log.v("BaseActivity","广播接收器已接受");}@Overrideprotected void onPause() {super.onPause();if (receiver != null){unregisterReceiver(receiver);receiver = null;}}@Overrideprotected void onDestroy() {super.onDestroy();ActivityCollector.removeActivity(this);}private class ForceOfflineReceiver extends BroadcastReceiver {@Overridepublic void onReceive(final Context context, Intent intent) {AlertDialog.Builder builder = new AlertDialog.Builder(context);builder.setTitle("Waring");builder.setMessage("You are forced to be offline. Please try to login again.");builder.setCancelable(false);builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {@Overridepublic void onClick(DialogInterface dialog, int which) {ActivityCollector.finishAll();//销毁所有活动Intent intent = new Intent(context, LoginActivity.class);context.startActivity(intent);//重新启动LoginActivity}});builder.show();}}
}

LoginActivity.java

package com.example.myhomework;import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.Toast;public class LoginActivity extends BaseActivity {private SharedPreferences pref;private SharedPreferences.Editor editor;private EditText accountEdit;private EditText passwordEdit;private Button login;private Button register;private Button quertData;private CheckBox rememberPass;private MyDatabaseHelper dbHelper;@Overrideprotected void onCreate(@Nullable Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_login);
//        隐藏自带标题ActionBar actionBar = getSupportActionBar();if (actionBar != null){actionBar.hide();}pref = PreferenceManager.getDefaultSharedPreferences(this);accountEdit = (EditText) findViewById(R.id.account);passwordEdit = (EditText) findViewById(R.id.password);rememberPass = (CheckBox) findViewById(R.id.remember_pass);login = (Button) findViewById(R.id.login);register = (Button) findViewById(R.id.register);quertData = (Button) findViewById(R.id.query_data);dbHelper = new MyDatabaseHelper(this, "BookStore.db", null, 2);Button createDatabase = (Button) findViewById(R.id.create_database);createDatabase.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {dbHelper.getWritableDatabase();}});boolean isRemember = pref.getBoolean("remember_password", false);if (isRemember){
//            将账号和密码都设置到文本框中String account = pref.getString("account", "");String password = pref.getString("password", "");accountEdit.setText(account);passwordEdit.setText(password);rememberPass.setChecked(true);}login.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {String account = accountEdit.getText().toString();String password = passwordEdit.getText().toString();
//                如果账号是admin密码是123456,就认为登陆成功
//                account.equals("admin") && password.equals("123456")if(checkExist(account,password)){editor = pref.edit();if (rememberPass.isChecked()) { //检查复选框是否被选中editor.putBoolean("remember_password", true);editor.putString("account",account);editor.putString("password", password);}else{editor.clear();}editor.apply();Intent intent = new Intent(LoginActivity.this, MainActivity.class);startActivity(intent);finish();}else{Toast.makeText(LoginActivity.this, "account or wassspord is invalid", Toast.LENGTH_SHORT).show();}}});register.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {Intent intent = new Intent(LoginActivity.this,RegisterActivity.class);startActivity(intent);}});quertData.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {SQLiteDatabase db = dbHelper.getWritableDatabase();Log.d("LoginActivity", "开始遍历");
//                查询表中所有数据Cursor cursor = db.query("Book", null, null, null,null,null,null);if (cursor.moveToFirst()){do{//遍历Cursor对象,取出数据并打印String account = cursor.getString(cursor.getColumnIndex("account"));String password = cursor.getString(cursor.getColumnIndex("password"));Log.d("LoginActivity", "账号"+account+"\t"+"密码"+ password);} while (cursor.moveToNext());}cursor.close();}});}public Boolean checkExist(String a,String p){dbHelper = new MyDatabaseHelper(this, "BookStore.db", null, 2);SQLiteDatabase db = dbHelper.getWritableDatabase();Log.d("LoginActivity", "开始遍历");
//                查询表中所有数据Cursor cursor = db.query("Book", null, null, null,null,null,null);if (cursor.moveToFirst()){do{//遍历Cursor对象,取出数据并打印String account = cursor.getString(cursor.getColumnIndex("account"));String password = cursor.getString(cursor.getColumnIndex("password"));if(a.equals(account) && p.equals(password)){return true;}Log.d("LoginActivity", "账号"+account+"\t"+"密码"+ password);} while (cursor.moveToNext());}cursor.close();return false;}}

MainActivity.java

package com.example.myhomework;import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;public class MainActivity extends BaseActivity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);Button forceOffline = (Button) findViewById(R.id.force_offline);forceOffline.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {Intent intent = new Intent("com.example.myhomework.FORCE_OFFLINE");sendBroadcast(intent);Log.v("MainActivity","已发送广播信息");}});}
}

MyDatabaseHelper.java

package com.example.myhomework;import android.content.Context;
import android.database.DatabaseErrorHandler;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.widget.Toast;public class MyDatabaseHelper extends SQLiteOpenHelper {public static final String CREATE_TABLE = "create table Book ("+"id integer primary key autoincrement, "+"account text,"+"password text)";private Context mContext;public MyDatabaseHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {super(context, name, factory, version);mContext = context;}@Overridepublic void onCreate(SQLiteDatabase db) {db.execSQL(CREATE_TABLE);Toast.makeText(mContext, "Create successed", Toast.LENGTH_SHORT).show();}@Overridepublic void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {db.execSQL("drop table if exists Book");onCreate(db);}
}

RegisterActivity.java

package com.example.myhomework;import android.app.Activity;
import android.content.ContentValues;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;public class RegisterActivity extends BaseActivity {private MyDatabaseHelper dbHelper;private Button submit;private Button clear;private TextView account;private TextView password;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_register);dbHelper = new MyDatabaseHelper(this, "BookStore.db", null, 2);submit = (Button) findViewById(R.id.submit);clear = (Button) findViewById(R.id.clear);account = (TextView) findViewById(R.id.re_account);password = (TextView) findViewById(R.id.re_password);submit.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {SQLiteDatabase db = dbHelper.getWritableDatabase();ContentValues values = new ContentValues();
//              开始添加第一条数据String a =  account.getText().toString();String b = password.getText().toString();Log.d("RegisterActivity",a+"\t"+b);values.put("account",a);values.put("password",password.getText().toString());db.insert("Book", null, values);
//                Log.d("RegisterActivity",account.getText().toString()+"\t"+password.getText().toString());values.clear();Toast.makeText(RegisterActivity.this, "添加完成", Toast.LENGTH_SHORT).show();Intent intent  = new Intent(RegisterActivity.this,LoginActivity.class);startActivity(intent);}});clear.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {account.setText("");password.setText("");}});}
}

Titlelayout.java

package com.example.myhomework;import android.app.Activity;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.Toast;public class Titlelayout extends LinearLayout {public Titlelayout(Context context, AttributeSet attrs) {super(context, attrs);LayoutInflater.from(context).inflate(R.layout.title, this);Button titleback = (Button) findViewById(R.id.title_back);Button titleEdit = (Button) findViewById(R.id.title_edit);titleback.setOnClickListener(new OnClickListener() {@Overridepublic void onClick(View v) {((Activity) getContext() ).finish();}});titleEdit.setOnClickListener(new OnClickListener() {@Overridepublic void onClick(View v) {Toast.makeText(getContext(), "人间自有真情在,多给两分行不行?", Toast.LENGTH_LONG).show();}});}
}

布局的程序

activity_login.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:orientation="vertical"android:layout_width="match_parent"android:layout_height="match_parent"tools:context=".MainActivity"><com.example.myhomework.Titlelayoutandroid:layout_width="match_parent"android:layout_height="wrap_content" /><LinearLayoutandroid:layout_width="match_parent"android:layout_height="92dp"android:layout_marginTop="30dp"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_gravity="center_vertical"android:layout_marginLeft="100dp"android:text="学生登录界面"android:textSize="50sp" /></LinearLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="60dp"android:layout_marginTop="40dp"android:orientation="horizontal"><TextViewandroid:layout_width="90dp"android:layout_height="wrap_content"android:text="Account"android:textSize="18sp" /><EditTextandroid:id="@+id/account"android:layout_width="0dp"android:layout_height="wrap_content"android:layout_gravity="center_vertical"android:layout_weight="1" /></LinearLayout><LinearLayoutandroid:orientation="horizontal"android:layout_width="match_parent"android:layout_height="60dp"><TextViewandroid:layout_width="90dp"android:layout_height="wrap_content"android:layout_gravity="center_vertical"android:textSize="18sp"android:text="Password"/><EditTextandroid:id="@+id/password"android:layout_width="0dp"android:layout_height="wrap_content"android:layout_weight="1"android:layout_gravity="center_vertical"android:inputType="textPassword"/></LinearLayout><LinearLayoutandroid:orientation="horizontal"android:layout_marginTop="20dp"android:layout_marginLeft="50dp"android:layout_width="match_parent"android:layout_height="wrap_content"><CheckBoxandroid:id="@+id/remember_pass"android:layout_width="wrap_content"android:layout_height="match_parent" /><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:textSize="18sp"android:text="Remember password"/></LinearLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"><Buttonandroid:id="@+id/login"android:layout_width="167dp"android:layout_height="60dp"android:layout_marginLeft="30dp"android:layout_marginTop="20dp"android:layout_marginRight="10dp"android:text="Login" /><Buttonandroid:id="@+id/register"android:layout_width="167dp"android:layout_height="60dp"android:layout_marginLeft="10dp"android:layout_marginTop="20dp"android:layout_marginRight="10dp"android:text="Register" /></LinearLayout><Buttonandroid:id="@+id/create_database"android:layout_marginTop="40dp"android:layout_marginLeft="30dp"android:layout_marginRight="30dp"android:layout_width="match_parent"android:layout_height="wrap_content"android:text="Create Table" /><Buttonandroid:id="@+id/query_data"android:layout_marginTop="40dp"android:layout_marginLeft="30dp"android:layout_marginRight="30dp"android:layout_width="match_parent"android:layout_height="wrap_content"android:text="查询表中数据并打印" />
</LinearLayout>

activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"tools:context=".MainActivity"><Buttonandroid:id="@+id/force_offline"android:layout_width="match_parent"android:layout_height="wrap_content"android:text="Send force offline broadcast"/></LinearLayout>

activity_register.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:orientation="vertical"android:layout_width="match_parent"android:layout_height="match_parent"tools:context=".MainActivity"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="92dp"android:layout_marginTop="30dp"><TextViewandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_gravity="center_vertical"android:layout_marginLeft="50dp"android:text="学生注册界面"android:textSize="50sp" /></LinearLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="60dp"android:layout_marginTop="40dp"android:layout_marginLeft="30dp"android:layout_marginRight="30dp"android:orientation="horizontal"><TextViewandroid:layout_width="90dp"android:layout_height="wrap_content"android:text="姓名"android:textSize="18sp" /><EditTextandroid:id="@+id/re_account"android:layout_width="0dp"android:layout_height="wrap_content"android:layout_gravity="center_vertical"android:layout_weight="1" /></LinearLayout><LinearLayoutandroid:orientation="horizontal"android:layout_width="match_parent"android:layout_marginTop="10dp"android:layout_marginLeft="30dp"android:layout_marginRight="30dp"android:layout_height="60dp"><TextViewandroid:layout_width="90dp"android:layout_height="wrap_content"android:layout_gravity="center_vertical"android:textSize="18sp"android:text="学号"/><EditTextandroid:id="@+id/re_password"android:layout_width="0dp"android:layout_height="wrap_content"android:layout_weight="1"android:layout_gravity="center_vertical"android:inputType="textPassword"/></LinearLayout><LinearLayoutandroid:orientation="horizontal"android:layout_width="match_parent"android:layout_marginTop="10dp"android:layout_marginLeft="30dp"android:layout_marginRight="30dp"android:layout_height="60dp"><TextViewandroid:layout_width="90dp"android:layout_height="wrap_content"android:layout_gravity="center_vertical"android:textSize="18sp"android:text="手机号"/><EditTextandroid:id="@+id/re_phone"android:layout_width="0dp"android:layout_height="wrap_content"android:layout_weight="1"android:layout_gravity="center_vertical"/></LinearLayout><LinearLayoutandroid:orientation="horizontal"android:layout_width="match_parent"android:layout_marginTop="10dp"android:layout_marginLeft="30dp"android:layout_marginRight="30dp"android:layout_height="60dp"><TextViewandroid:layout_width="90dp"android:layout_height="wrap_content"android:layout_gravity="center_vertical"android:textSize="18sp"android:text="性别"/><EditTextandroid:id="@+id/re_xingbie"android:layout_width="0dp"android:layout_height="wrap_content"android:layout_weight="1"android:layout_gravity="center_vertical"/></LinearLayout><LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"><Buttonandroid:id="@+id/submit"android:layout_width="167dp"android:layout_height="60dp"android:layout_marginLeft="30dp"android:layout_marginTop="20dp"android:layout_marginRight="10dp"android:text="Submit" /><Buttonandroid:id="@+id/clear"android:layout_width="167dp"android:layout_height="60dp"android:layout_marginLeft="10dp"android:layout_marginTop="20dp"android:layout_marginRight="10dp"android:text="Clear" /></LinearLayout>
</LinearLayout>

titile.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="wrap_content"tools:context=".MainActivity"><Buttonandroid:id="@+id/title_back"android:layout_width="50dp"android:layout_height="65dp"android:layout_gravity="center"android:layout_margin="5dp"android:background="@drawable/back"android:textColor="#fff" /><TextViewandroid:id="@+id/title_text"android:layout_width="0dp"android:layout_height="42dp"android:layout_gravity="center"android:layout_weight="1"android:gravity="center"android:text="请点击右边的按钮-->"android:textColor="#000"android:textSize="24sp" /><Buttonandroid:id="@+id/title_edit"android:layout_width="53dp"android:layout_height="61dp"android:layout_gravity="center"android:layout_margin="5dp"android:background="@drawable/close"android:textColor="#fff" />
</LinearLayout>

结果

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

我现在还不会用GitHub托管自己的程序,等再过一阵子吧,好烦,好多事,哦,我前两天用springboot和python和浏览器用websocket建立了联系,浏览器发数据,Python接收数据。挺好玩的。继续努力,加油


http://chatgpt.dhexx.cn/article/Olaxqlbw.shtml

相关文章

利用手机、平板开发安卓APP(入门篇)

在这之前&#xff0c;开发安卓APP的开发者们只能依赖PC端的eclipse或Android studio等IDE开发软件&#xff0c;至少在您打开这篇文章时就已经证明您从未使用手机开发过安卓APP。如果您继续往下读就会相信并且确信&#xff1a;单纯使用手机、平板也能构建一个十全十美的APP应用。…

Android开发入门

文章目录 基础认识 Android作业&#xff1a;利用百度LBS定位期末作业&#xff1a;Android&#xff08;仿QQ登入网易新闻&#xff09;其他自学 基础认识 Android 开发&#xff1a;用于安卓手机APP开发 PHP&#xff1a;动态网页 Android Android系统是由Andy Rubin创建的&…

【Android开发】

系列文章目录 软工课设学习记录贴 基于android原生Java&#xff08;后端&#xff09;pythondjango 文章目录 系列文章目录一、Android Studio布局2.Activity活动2.1 活动的生命周期 3、底部导航BottomNavigationViewFragment3.1 Fragment3.2 Frame Layout 4.Intent4.1 显示Int…

android软件开发

安卓开发笔记 第一课xmlmach_parent 文件夹组成新建导入程序页面 第一课xml Linear layout:线性布局 android:orientation“vertical”&#xff08;垂直布局&#xff09; 布局属性 background"#ff0000"(设置背景色) layout_width“200dp” (dp类似像素单位) 其中字…

Android手机端编程开发软件合集(一)

【2022-05-14链接已更新】在网上搜索了很久才找到的编程IDE高级解锁版&#xff0c; 在这里记录并分享一下吧&#xff01; 一、合集地址&#xff1a; 蓝奏云&#xff1a;https://huanxingke.lanzoux.com/b0203kqjg 密码&#xff1a;flyingdream 二、软件合集截图如下&#xff…

python实现Gabor滤波器

Gabor 函数表示 复数表示&#xff1a; 实数部分&#xff1a; 虚数部分&#xff1a; 其中&#xff1a; 代码中参数和Gabor函数参数对应关系 代码实现了Gabor滤波器的实数部分。代码中参数和Gabor函数实数部分参数对应如下&#xff1a; 对应 看上去是不是感觉很容易实现Gabor…

gabor特征 gabor滤波器

gabor特征 Gabor 特征是一种可以用来描述图像纹理信息的特征&#xff0c;Gabor 滤波器的频率和方向与人类的视觉系统类似&#xff0c;特别适合于纹理表示与判别。Gabor 特征主要依靠 Gabor 核在频率域上对信号进行加窗&#xff0c;从而能描述信号的局部频率信息。Gabor 核靠傅…

Log-Gabor Filters

原文转自&#xff1a;http://www.csse.uwa.edu.au/~pk/research/matlabfns/PhaseCongruency/Docs/convexpl.html What Are Log-Gabor Filters and Why Are They Good? Gabor filters are a traditional choice for obtaining localised frequency information. They offer the…

Gabor

出处&#xff1a;http://zhenyulu.cnblogs.com/articles/325968.html 二、Gabor函数 Gabor变换属于加窗傅立叶变换&#xff0c;Gabor函数可以在频域不同尺度、不同方向上提取相关的特征。另外Gabor函数与人眼的生物作用相仿&#xff0c;所以经常用作纹理识别上&#xff0c;并取…

Gabor滤波器与特征提取

一、Gabor滤波器 Gabor滤波器&#xff0c;最主要使用优势体现在对物体纹理特征的提取上。 二维Gabor基函数能够很好地描述哺乳动物初级视觉系统中一对简单视觉神经元的感受野特性。随着小波变换和神经生理学的发展&#xff0c;Gabor变换逐渐演变成二维Gabor小波的形式。Gabor…

【图像处理】Gabor滤波器

Gabor的核函数参考的wiki 使用实数Real的公式计算核函数代码&#xff1a; Mat getGaborFilter(float lambda, float theta, float sigma2,float gamma, float psi 0.0f){if(abs(lambda-0.0f)<1e-6){lambda 1.0f;} float sigma_x sigma2;float sigma_y sigma2/(gamma*gam…

生物特征识别中的Gabor滤波器

Daugman&#xff08;1980&#xff09;提出的2D Gabor滤波器&#xff08;以下简称Gabor滤波器&#xff09;&#xff0c;在纹理分类、纹理分割、生物特征识别中取得了广泛的应用。本文首先简要介绍Gabor滤波器&#xff0c;然后列举它在生物特征识别方面的代表性应用。 2D Gabor滤…

matlab的gabor类解读

为什么要进行解析&#xff0c;因为自带的gabor函数有个小坑&#xff0c; 转opencv的时候&#xff0c;因为没有完全理解自带的gabor源码被小小的坑了一下&#xff0c; 所以做一下记录&#xff0c; 以方便后人。‘ 版本是2016B 文章目录 Matlab gabor函数解析1 gabor基本公式2 m…

Gabor滤波 + 多尺度问题

Gabor函数 Gabor变换属于加窗傅立叶变换&#xff0c;Gabor函数可以在频域不同尺度、不同方向上提取相关的特征。另外Gabor函数与人眼的生物作用相仿&#xff0c;所以经常用作纹理识别上&#xff0c;并取得了较好的效果。二维Gabor函数可以表示为&#xff1a; 其中&#xff1a;…

Gabor算法

在数字图像处理领域&#xff0c;Gabor滤波器是以Dennis Gabor命名的&#xff0c;Gabor滤波器是用作边缘检测的线性滤波器。Gabor滤波器的频率和方向的表达与人类的视觉系统很相似。研究发现&#xff0c;Gabor滤波器非常适合纹理表达和分离。在空间域中&#xff0c;一个二维Gabo…

Log-Gabor滤波器

Log-Gabor滤波器 G ( f ) e l n 2 ( ω / ω 0 ) 2 l n 2 ( k / ω 0 ) G(f)e^{\frac {ln^2({\omega /\omega_0})}{2{ln}^2(k/\omega_0)}} G(f)e2ln2(k/ω0​)ln2(ω/ω0​)​ 式中&#xff1a; ω 0 \omega_0 ω0​为滤波器中心频率&#xff0c;通常将 k / ω 0 k/\omega_0 k…

Gabor滤波器原理

一、什么是Gabor函数&#xff08;以下内容含部分翻译自维基百科&#xff09; 在图像处理中&#xff0c;Gabor函数是一个用于边缘提取的线性滤波器。Gabor滤波器的频率和方向表达同人类视觉系统类似。研究发现&#xff0c;Gabor滤波器十分适合纹理表达和分离。在空间域中&#x…

Gabor的OpenCV代码

唯一持续维护地址&#xff1a;http://52coding.com/opencv-gabor 最近弄人脸识别&#xff0c;用到Gabor卷积核&#xff0c;但网上的代码似乎没有和我心意的&#xff0c;于是参考了自己写了下&#xff01;参考了Zhou Mian以及matlab的Gabor实现代码的代码。虽然OpenCV的imporc下…

2021-08-07 Gabor滤波器简介以及简单应用

Gabor滤波器&#xff08;Gabor Filter&#xff09; 文章目录 Gabor滤波器&#xff08;Gabor Filter&#xff09;简介Gabor滤波器的不同参数Gabor滤波器的简单应用&#xff08;python&#xff09; 简介 Gabor滤波器是一种线性滤波器&#xff0c;用于边缘检测、纹理分析、特征提…

Gabor Filters

Gabor Filters: Manjunath, B. S., & Ma, W. Y. (1996). Texture features for browsing and retrieval of image data. IEEE Transactions on Pattern Analysis and Machine Intelligence, 18(8), 837-842. Gabor滤波器是一种基于Gabor函数的特定频率和方向选择性滤波器。…