JPG 이미지 자르기다음 스크립트를 사용하여 아래 웨이퍼맵 이미지 외부에서 밝은 회색 테두리를 자르려고 합니다. 전후 이미지 차이가 없어서 크롭 메시지가 어떻게 작동하는지 이해하지 못하는 것 같습니다.
내가 뭘 잘못하고 있는지 알겠어?
건배, 트로이
img = open("D:\wafer.jpg", jpg);
win1 = newWindow("Original", img);
img << crop(left(5),right(5),top(5),bottom(5));
win2 = newWindow("Cropped", img);
img << savePicture("D:\waferCropped.jpg", jpg);

스크립팅Re: JPG 이미지 자르기안녕하세요,
자른 이미지를 변수에 할당하는 것을 잊었다고 생각합니다.
img2 = img << crop(left(5),right(5),top(5),bottom(5));
win2 = newWindow("Cropped", img2);
최상의,
TS
Re: JPG 이미지 자르기Thierry님 답변 감사합니다.
나도 정확히 그것을 시도했지만 운이 없었습니다.
Re: JPG 이미지 자르기알겠습니다. 자르기 기능이 어떻게 작동하는지 이해하지 못한 것 같습니다. 기본적으로 자르려는 이미지의 높이와 너비를 알아야 하고 LHS 및 TOP 가장자리를 기준으로 자를 때 해당 값으로 작업해야 합니다.
왼쪽 = 왼쪽에서 제거할 픽셀 수
오른쪽 = 유지할 나머지 이미지의 '너비'(픽셀 단위)
상단 = 이미지 상단에서 제거할 픽셀 수
하단 = 유지할 나머지 이미지의 '높이'(픽셀 단위)
img = open("D:\WaferMaps\8PTPCVEB\wafer.jpg", jpg);
imgX = (img << GetSize)[1];
imgY = (img << GetSize)[2];
win1 = newWindow("Original", img);
myTrimBy = 5;
img << crop(left(myTrimBy),right(imgX - myTrimBy), top(myTrimBy), bottom(imgY - myTrimBy));
win2 = newWindow("Cropped", img);
img << savePicture("D:\WaferMaps\8PTPCVEB\waferCropped.jpg", jpg);
Re: JPG 이미지 자르기좋은 작업. 제공한 오른쪽 및 아래쪽 정의가 지정한 것과 정확히 일치하지 않습니다. 당신의 대본이 딱!
아래 스크립트를 참조하세요.
Names Default To Here( 1 );
img = Open( "$SAMPLE_IMAGES/tile.jpg", jpg );
s = {w,h} = img << get size();
show( s ); //{451, 451}
obj = New Window( "tile(40,40)", img );
Wait( 1 );
img << Crop( Left( 50 ), Right( 100 ), Top( 60 ), Bottom( 150 ) );
s = {w,h} = img << get size();
show( s ); //{50, 90}
//img is a matrix of pixels the initail size is 1 to 451 columns aka "w" width
//and "h" is height 1 to 451 rows
//Crop Left(x) is the starting column and Right(y) is the ending column
//Top() and Bottom() works the same, so after the crop the width is 100-50=50
//and the height is 150-60=90Re: JPG 이미지 자르기~에게 @티에리_S ,
나는 문서가 "새 이미지를 생성합니다 ..."라고 말하는 것처럼 같은 방식으로 생각했을 것입니다.이 동작은 이상합니다.
그러나 실제로 자르기는 현재 이미지를 변경하고 있으므로 내 눈에는 문서가 정확하지 않고 오해의 소지가 있습니다.
@tonya_mauldin , 이에 따라 문서를 변경해야 한다고 생각하십니까?
Names Default To Here( 1 );
img = Open( "$SAMPLE_IMAGES/tile.jpg", jpg );
Print( "Size before crop:", img << get size );
img << Crop(
Left( 50 ),
Right( 400 ),
Top( 50 ),
Bottom( 400 )
);
Print( "Size before crop:", img << get size );
print("So crop changes the image and does not create a new one as written in the documentation");이미지(jmp.com)
Re: JPG 이미지 자르기예, 명확하지 않은 인터페이스이며 더 나은 문서를 원합니다. @QianaEaglin
pixels = [
-11 -11 -11 -11 -11 -11 -11 -11 -11,
-11 -11 -91 -99 -99 -99 -99 -92 -11,
-11 -11 -99 -99 -99 -99 -99 -99 -11,
-11 -11 -99 -99 -99 -99 -99 -99 -11,
-11 -11 -99 -99 -99 -99 -99 -99 -11,
-11 -11 -93 -99 -99 -99 -99 -94 -11];
img = New Image( pixels );
{hSize, ySize} = img << size;
Show( img << getsize, img << getpixels );
// crop the -11 out of the image
img << crop( Left( 2 ), Right( 8 ), top( 1 ), bottom( 6 ) );
Show( img << getsize, img << getpixels );
//// img << getsize = {6, 5};
//// img << getpixels =
//// [ -91 -99 -99 -99 -99 -92,
//// -99 -99 -99 -99 -99 -99,
//// -99 -99 -99 -99 -99 -99,
//// -99 -99 -99 -99 -99 -99,
//// -93 -99 -99 -99 -99 -94];
0부터 시작하는 픽셀 인덱스는 픽셀 사이의 가는 선에 있습니다.