Character Rotation and Recognition
이전 댓글 표시
So, I have taken a screenshot of an enlarged letter from a UAV (no more than 30 meters up). The letter 'F' is white, and placed on a red background 'rectangle 2m by 2m' (the letter almost fills the rectangle without stretching it). I am trying to identify the letter through character recognition and i'm having a few problems with doing so.
Below lies the code I have so far, it currently highlights the letter clearly in Black, whilst the background is all white. My thoughts on how to counter this problem are to somehow crop the image so only the letter is chosen, then rotate and analyse simultaneously using character recognition (as the angle of the letter may change depending on the angle of entry towards the target) until the code recognizes the letter.
clear all; close all; clc tic iamge = imread('pro1.jpg'); red=iamge(:,:,1); blue=iamge(:,:,2); green=iamge(:,:,3); % matrix = impixel(x); bi = red>229 & blue<77 & green<88; imshow(bi);
[N J]=size(bi); image2=bi; for x=1:J for y=1:N if all(all(bi(y,x)==1)); image2(y,x)=255; end end end
img = im2double(imread('pro1.jpg')); % read image and convert it to double in range [0..1] b = sum( (1-img).^2, 3 ); % check how far each pixel from "white"
% display figure; imshow( b > .5 ); title('Letter Recognition (some error)');
Does anyone have an clues on how to go about solving this problem, i'm not sure where I would begin even with my idea seeming somewhat reasonable. Any help would be greatly appreciated,
Cheers!
댓글 수: 1
David Young
2015년 3월 2일
As you can see, your code is very hard to read. You can fix this with the"{} Code" button.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Semantic Segmentation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!